From 124091a0c140db0b657fa091ce2d66a0ff4da22a Mon Sep 17 00:00:00 2001 From: Charlie Sharpsteen Date: Wed, 9 Nov 2011 12:02:42 -0800 Subject: [PATCH] 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. --- Formula/ffmpeg.rb | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Formula/ffmpeg.rb b/Formula/ffmpeg.rb index 728057b7cc..6ffe651d17 100644 --- a/Formula/ffmpeg.rb +++ b/Formula/ffmpeg.rb @@ -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