forked from iina/homebrew-mpv-iina
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathffmpeg-iina.rb
90 lines (80 loc) · 2.35 KB
/
ffmpeg-iina.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Last check with upstream: 5ef3900b6178dee40629e3e058a587ef196b53b1
# https://github.com/Homebrew/homebrew-core/blob/master/Formula/ffmpeg.rb
class FfmpegIina < Formula
desc "Play, record, convert, and stream audio and video"
homepage "https://ffmpeg.org/"
url "https://ffmpeg.org/releases/ffmpeg-4.4.1.tar.xz"
sha256 "eadbad9e9ab30b25f5520fbfde99fae4a92a1ae3c0257a8d68569a4651e30e02"
head "https://github.com/FFmpeg/FFmpeg.git"
keg_only <<EOS
it is intended to only be used for building IINA.
This formula is not recommended for daily use and has no binaraies (ffmpeg, ffplay etc.)
EOS
depends_on "nasm" => :build
depends_on "pkg-config" => :build
depends_on "dav1d"
depends_on "fontconfig"
depends_on "freetype"
depends_on "frei0r"
depends_on "gnutls"
depends_on "libass"
depends_on "libbluray"
depends_on "libsoxr"
depends_on "libvidstab"
depends_on "rubberband"
depends_on "snappy"
depends_on "speex"
depends_on "tesseract"
depends_on "xz"
depends_on "zeromq"
depends_on "zimg"
uses_from_macos "bzip2"
uses_from_macos "libxml2"
uses_from_macos "zlib"
def install
args = %W[
--prefix=#{prefix}
--enable-shared
--enable-pthreads
--enable-version3
--cc=#{ENV.cc}
--host-cflags=#{ENV.cflags}
--host-ldflags=#{ENV.ldflags}
--enable-ffplay
--enable-gnutls
--enable-gpl
--enable-libbluray
--enable-libdav1d
--enable-librubberband
--enable-libsnappy
--enable-libtesseract
--enable-libvidstab
--enable-libxml2
--enable-libfontconfig
--enable-libfreetype
--enable-frei0r
--enable-libass
--enable-libspeex
--enable-libsoxr
--enable-videotoolbox
--enable-libzmq
--enable-libzimg
--disable-libjack
--disable-indev=jack
--disable-programs
]
system "./configure", *args
system "make", "install"
# Build and install additional FFmpeg tools
system "make", "alltools"
bin.install Dir["tools/*"].select { |f| File.executable? f }
# Fix for Non-executables that were installed to bin/
mv bin/"python", pkgshare/"python", force: true
end
test do
# Create an example mp4 file
mp4out = testpath/"video.mp4"
system bin/"ffmpeg", "-filter_complex", "testsrc=rate=1:duration=1", mp4out
assert_predicate mp4out, :exist?
end
end