2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-09-10 00:06:52 +00:00
|
|
|
|
|
|
|
class Ffmpeg <Formula
|
2010-03-17 22:06:10 +00:00
|
|
|
head 'svn://svn.ffmpeg.org/ffmpeg/trunk', :revision => 22585
|
2009-10-06 03:49:48 +00:00
|
|
|
homepage 'http://ffmpeg.org/'
|
|
|
|
|
2010-01-14 20:56:04 +00:00
|
|
|
depends_on 'x264' => :optional
|
|
|
|
depends_on 'faac' => :optional
|
|
|
|
depends_on 'faad2' => :optional
|
|
|
|
depends_on 'lame' => :optional
|
2009-09-10 00:06:52 +00:00
|
|
|
|
|
|
|
def install
|
2010-01-14 20:56:04 +00:00
|
|
|
configure_flags = [
|
|
|
|
"--prefix=#{prefix}",
|
|
|
|
"--disable-debug",
|
|
|
|
"--enable-shared",
|
|
|
|
"--enable-pthreads",
|
|
|
|
"--enable-nonfree",
|
|
|
|
"--enable-gpl"
|
|
|
|
]
|
|
|
|
|
|
|
|
configure_flags << "--enable-libx264" if Formula.factory('x264').installed?
|
|
|
|
configure_flags << "--enable-libfaac" if Formula.factory('faac').installed?
|
|
|
|
configure_flags << "--enable-libfaad" if Formula.factory('faad2').installed?
|
|
|
|
configure_flags << "--enable-libmp3lame" if Formula.factory('lame').installed?
|
|
|
|
|
2009-09-27 23:50:59 +00:00
|
|
|
system "./configure", *configure_flags
|
2010-01-14 20:56:04 +00:00
|
|
|
|
|
|
|
inreplace 'config.mak' do |s|
|
|
|
|
if MACOS_VERSION >= 10.6 and Hardware.is_64_bit?
|
|
|
|
shflags = s.get_make_var 'SHFLAGS'
|
|
|
|
s.change_make_var! 'SHFLAGS', shflags.gsub!(' -Wl,-read_only_relocs,suppress', '')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2009-09-10 00:06:52 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
end
|