2013-06-26 19:58:18 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Libav < Formula
|
|
|
|
homepage 'https://libav.org/'
|
2014-04-12 14:47:14 +00:00
|
|
|
url 'http://libav.org/releases/libav-10.tar.xz'
|
|
|
|
sha1 '74effded58ec3c63de6c8c20b5a382dc3a864d5b'
|
2013-10-29 01:51:59 +00:00
|
|
|
head 'git://git.libav.org/libav.git'
|
2013-06-26 19:58:18 +00:00
|
|
|
|
2014-03-02 10:32:55 +00:00
|
|
|
bottle do
|
2014-04-12 14:55:54 +00:00
|
|
|
sha1 "f1e817f3e59111eabe18e54a43c4ee0cf38d651f" => :mavericks
|
|
|
|
sha1 "7da7ccfb7a07d8e3b47145183cdd50f6861d91a1" => :mountain_lion
|
|
|
|
sha1 "06c8d73e1afd93f7487ff1da6a82bbbf1e4330a3" => :lion
|
2014-03-02 10:32:55 +00:00
|
|
|
end
|
|
|
|
|
2013-06-26 19:58:18 +00:00
|
|
|
option "without-faac", "Disable AAC encoder via faac"
|
|
|
|
option "without-lame", "Disable MP3 encoder via libmp3lame"
|
|
|
|
option "without-x264", "Disable H.264 encoder via x264"
|
|
|
|
option "without-xvid", "Disable Xvid MPEG-4 video encoder via xvid"
|
|
|
|
|
|
|
|
option "with-opencore-amr", "Enable AMR-NB de/encoding and AMR-WB decoding " +
|
|
|
|
"via libopencore-amrnb and libopencore-amrwb"
|
|
|
|
option "with-openjpeg", "Enable JPEG 2000 de/encoding via OpenJPEG"
|
2013-10-29 01:51:59 +00:00
|
|
|
option "with-openssl", "Enable SSL support"
|
|
|
|
option "with-rtmpdump", "Enable RTMP protocol support"
|
|
|
|
option "with-schroedinger", 'Enable Dirac video format'
|
|
|
|
option "with-sdl", "Enable avplay"
|
2013-06-26 19:58:18 +00:00
|
|
|
option "with-speex", "Enable Speex de/encoding via libspeex"
|
|
|
|
option "with-theora", "Enable Theora encoding via libtheora"
|
|
|
|
option "with-libvorbis", "Enable Vorbis encoding via libvorbis"
|
2013-10-29 01:51:59 +00:00
|
|
|
option "with-libvo-aacenc", "Enable VisualOn AAC encoder"
|
2013-06-26 19:58:18 +00:00
|
|
|
option "with-libvpx", "Enable VP8 de/encoding via libvpx"
|
|
|
|
|
|
|
|
depends_on 'pkg-config' => :build
|
|
|
|
depends_on 'yasm' => :build
|
|
|
|
|
|
|
|
# manpages won't be built without texi2html
|
|
|
|
depends_on 'texi2html' => :build if MacOS.version >= :mountain_lion
|
|
|
|
|
|
|
|
depends_on 'faac' => :recommended
|
|
|
|
depends_on 'lame' => :recommended
|
|
|
|
depends_on 'x264' => :recommended
|
|
|
|
depends_on 'xvid' => :recommended
|
|
|
|
|
|
|
|
depends_on :freetype => :optional
|
2013-10-29 01:51:59 +00:00
|
|
|
depends_on 'fdk-aac' => :optional
|
|
|
|
depends_on 'frei0r' => :optional
|
2013-06-26 19:58:18 +00:00
|
|
|
depends_on 'gnutls' => :optional
|
2013-10-29 01:51:59 +00:00
|
|
|
depends_on 'libvo-aacenc' => :optional
|
2013-06-26 19:58:18 +00:00
|
|
|
depends_on 'libvorbis' => :optional
|
|
|
|
depends_on 'libvpx' => :optional
|
|
|
|
depends_on 'opencore-amr' => :optional
|
|
|
|
depends_on 'openjpeg' => :optional
|
2013-10-29 01:51:59 +00:00
|
|
|
depends_on 'opus' => :optional
|
|
|
|
depends_on 'rtmpdump' => :optional
|
|
|
|
depends_on 'schroedinger' => :optional
|
|
|
|
depends_on 'sdl' => :optional
|
2013-06-26 19:58:18 +00:00
|
|
|
depends_on 'speex' => :optional
|
|
|
|
depends_on 'theora' => :optional
|
|
|
|
|
|
|
|
def install
|
|
|
|
args = [
|
|
|
|
"--disable-debug",
|
|
|
|
"--disable-shared",
|
|
|
|
"--prefix=#{prefix}",
|
|
|
|
"--enable-doc",
|
|
|
|
"--enable-gpl",
|
|
|
|
"--enable-nonfree",
|
|
|
|
"--enable-version3",
|
2013-10-29 01:51:59 +00:00
|
|
|
"--enable-zlib",
|
2013-06-26 19:58:18 +00:00
|
|
|
"--cc=#{ENV.cc}",
|
|
|
|
"--host-cflags=#{ENV.cflags}",
|
|
|
|
"--host-ldflags=#{ENV.ldflags}"
|
|
|
|
]
|
|
|
|
|
2013-10-29 01:51:59 +00:00
|
|
|
args << "--enable-frei0r" if build.with? 'frei0r'
|
|
|
|
args << "--enable-gnutls" if build.with? 'gnutls'
|
2013-06-26 19:58:18 +00:00
|
|
|
args << "--enable-libfaac" if build.with? 'faac'
|
2013-10-29 01:51:59 +00:00
|
|
|
args << "--enable-libfdk-aac" if build.with? 'fdk-aac'
|
|
|
|
args << "--enable-libfreetype" if build.with? 'freetype'
|
2013-06-26 19:58:18 +00:00
|
|
|
args << "--enable-libmp3lame" if build.with? 'lame'
|
2013-10-29 01:51:59 +00:00
|
|
|
args << "--enable-libopencore-amrnb" if build.with? 'opencore-amr'
|
|
|
|
args << "--enable-libopencore-amrwb" if build.with? 'opencore-amr'
|
2013-06-26 19:58:18 +00:00
|
|
|
args << "--enable-libopenjpeg" if build.with? 'openjpeg'
|
2013-10-29 01:51:59 +00:00
|
|
|
args << "--enable-libopus" if build.with? 'opus'
|
|
|
|
args << "--enable-librtmp" if build.with? 'rtmpdump'
|
|
|
|
args << "--enable-libschroedinger" if build.with? 'schroedinger'
|
2013-06-26 19:58:18 +00:00
|
|
|
args << "--enable-libspeex" if build.with? 'speex'
|
|
|
|
args << "--enable-libtheora" if build.with? 'theora'
|
2013-10-29 01:51:59 +00:00
|
|
|
args << "--enable-libvo-aacenc" if build.with? 'libvo-aacenc'
|
|
|
|
args << "--enable-libvorbis" if build.with? 'libvorbis'
|
|
|
|
args << "--enable-libvpx" if build.with? 'libvpx'
|
|
|
|
args << "--enable-libx264" if build.with? 'x264'
|
|
|
|
args << "--enable-libxvid" if build.with? 'xvid'
|
|
|
|
args << "--enable-openssl" if build.with? 'openssl'
|
2013-06-26 19:58:18 +00:00
|
|
|
|
|
|
|
system "./configure", *args
|
|
|
|
|
|
|
|
system "make"
|
|
|
|
|
2013-10-29 01:51:59 +00:00
|
|
|
bin.install 'avconv', 'avprobe', 'avserver'
|
|
|
|
man1.install 'doc/avconv.1', 'doc/avprobe.1', 'doc/avserver.1'
|
|
|
|
if build.with? 'sdl'
|
|
|
|
bin.install 'avplay'
|
|
|
|
man1.install 'doc/avplay.1'
|
|
|
|
end
|
2013-06-26 19:58:18 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
system "#{bin}/avconv -h"
|
|
|
|
end
|
|
|
|
end
|