homebrew-core/Formula/ffmpeg.rb
Adam Vandenberg 3458e88d45 Subversion now supports revisions on externals.
A formula using svn can now provide a spec:
    :revisions => {...revision numbers...}
that contains a mapping of revision numbers to use
for externals.

The name of the external is keyed to the revision to
use for that external.

The symbol :trunk should be used to specify the reivsion
of the main repo.

An example from the Ffmpeg formula:
    head 'svn://svn.ffmpeg.org/ffmpeg/trunk',
        :revisions => { :trunk => 22916, 'libswscale' => 31045 }

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2010-06-08 12:36:03 -07:00

45 lines
1.3 KiB
Ruby

require 'formula'
class Ffmpeg <Formula
head 'svn://svn.ffmpeg.org/ffmpeg/trunk',
:revisions => { :trunk => 22916, 'libswscale' => 31045 }
homepage 'http://ffmpeg.org/'
depends_on 'x264' => :optional
depends_on 'faac' => :optional
depends_on 'faad2' => :optional
depends_on 'lame' => :optional
def install
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?
# For 32-bit compilation under gcc 4.2, see:
# http://trac.macports.org/ticket/20938#comment:22
if MACOS_VERSION >= 10.6 and not Hardware.is_64_bit?
ENV.append_to_cflags "-mdynamic-no-pic"
end
system "./configure", *configure_flags
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
system "make install"
end
end