FFmpeg: Add option to build ffplay

The ffplay binary is only built by default if SDL is present---which made
obtaining it a hit-and-miss operation for some users. A new option,
`--with-ffplay`, has been added that will cause ffplay to be built.

ffplay will be explicitly disabled if the option is not invoked.

Fixes Homebrew/homebrew#6880.
This commit is contained in:
Charlie Sharpsteen 2011-11-09 12:02:42 -08:00
parent 56897f4859
commit 124091a0c1

View file

@ -1,5 +1,9 @@
require 'formula'
def ffplay?
ARGV.include? '--with-ffplay'
end
class Ffmpeg < Formula
url 'http://ffmpeg.org/releases/ffmpeg-0.8.6.tar.bz2'
homepage 'http://ffmpeg.org/'
@ -9,6 +13,13 @@ class Ffmpeg < Formula
fails_with_llvm 'Dies during compilation of motionpixels_tablegen'
def options
[
["--with-tools", "Install additional FFmpeg tools."],
["--with-ffplay", "Build ffplay."]
]
end
depends_on 'yasm' => :build
depends_on 'x264' => :optional
depends_on 'faac' => :optional
@ -19,11 +30,7 @@ class Ffmpeg < Formula
depends_on 'libvpx' => :optional
depends_on 'xvid' => :optional
def options
[
["--with-tools", "Install additional FFmpeg tools."]
]
end
depends_on 'sdl' if ffplay?
def install
args = ["--prefix=#{prefix}",
@ -41,6 +48,7 @@ class Ffmpeg < Formula
args << "--enable-libvorbis" if Formula.factory('libvorbis').installed?
args << "--enable-libvpx" if Formula.factory('libvpx').installed?
args << "--enable-libxvid" if Formula.factory('xvid').installed?
args << "--disable-ffplay" unless ffplay?
# For 32-bit compilation under gcc 4.2, see:
# http://trac.macports.org/ticket/20938#comment:22