homebrew-core/Formula/ffmpeg@2.8.rb

116 lines
3.3 KiB
Ruby

class FfmpegAT28 < Formula
desc "Play, record, convert, and stream audio and video"
homepage "https://ffmpeg.org/"
url "https://ffmpeg.org/releases/ffmpeg-2.8.18.tar.xz"
sha256 "96ef935af1d0adfd9e1a6823b55307dd0cc671192138660b6d5bde8cd6c1cd4c"
# None of these parts are used by default, you have to explicitly pass `--enable-gpl`
# to configure to activate them. In this case, FFmpeg's license changes to GPL v2+.
license "GPL-2.0-or-later"
livecheck do
url "https://ffmpeg.org/download.html"
regex(/href=.*?ffmpeg[._-]v?(2\.8(?:\.\d+)*)\.t/i)
end
bottle do
sha256 arm64_monterey: "c9062aaa537c8d0dea31ecf713f3d193a1c716207ad93b680d7cf690f0e3fa65"
sha256 arm64_big_sur: "46dcab918292c83b05fe0a66b5093494a91cb4de3862137d5584941692f68557"
sha256 monterey: "84fbb1fe0f5c5aa78cd61fbaa46cf4e3dc6ecf12c2d5abbf5531a288838c57cb"
sha256 big_sur: "bab81dd752fec0d0945c4683863d6fb89176e8d8213e227f67414d43a9305b94"
sha256 catalina: "edea22eff2016286a9da86bbc0e7ec16508d57744fe023bf3621e97827745956"
end
keg_only :versioned_formula
depends_on "pkg-config" => :build
depends_on "texi2html" => :build
depends_on "yasm" => :build
depends_on "fontconfig"
depends_on "freetype"
depends_on "frei0r"
depends_on "lame"
depends_on "libass"
depends_on "libvo-aacenc"
depends_on "libvorbis"
depends_on "libvpx"
depends_on "opencore-amr"
depends_on "opus"
depends_on "rtmpdump"
depends_on "sdl"
depends_on "snappy"
depends_on "speex"
depends_on "theora"
depends_on "x264"
depends_on "x265"
depends_on "xvid"
def install
args = %W[
--prefix=#{prefix}
--enable-shared
--enable-pthreads
--enable-gpl
--enable-version3
--enable-hardcoded-tables
--enable-avresample
--cc=#{ENV.cc}
--host-cflags=#{ENV.cflags}
--host-ldflags=#{ENV.ldflags}
--enable-ffplay
--enable-libmp3lame
--enable-libopus
--enable-libsnappy
--enable-libtheora
--enable-libvo-aacenc
--enable-libvorbis
--enable-libvpx
--enable-libx264
--enable-libx265
--enable-libxvid
--enable-libfontconfig
--enable-libfreetype
--enable-frei0r
--enable-libass
--enable-libopencore-amrnb
--enable-libopencore-amrwb
--enable-librtmp
--enable-libspeex
--enable-opencl
--disable-indev=jack
--disable-libxcb
--disable-xlib
]
# A bug in a dispatch header on 10.10, included via CoreFoundation,
# prevents GCC from building VDA support. GCC has no problems on
# 10.9 and earlier.
# See: https://github.com/Homebrew/homebrew/issues/33741
args << if ENV.compiler == :clang
"--enable-vda"
else
"--disable-vda"
end
system "./configure", *args
inreplace "config.mak" do |s|
shflags = s.get_make_var "SHFLAGS"
s.change_make_var! "SHFLAGS", shflags if shflags.gsub!(" -Wl,-read_only_relocs,suppress", "")
end
system "make", "install"
# Build and install additional FFmpeg tools
system "make", "alltools"
bin.install Dir["tools/*"].select { |f| File.executable? f }
end
test do
# Create an example mp4 file
mp4out = testpath/"video.mp4"
system bin/"ffmpeg", "-y", "-filter_complex", "testsrc=rate=1:duration=1", mp4out
assert_predicate mp4out, :exist?
end
end