Skip to content

Instantly share code, notes, and snippets.

@dbackeus
Created April 7, 2010 12:11
Show Gist options
  • Save dbackeus/358796 to your computer and use it in GitHub Desktop.
Save dbackeus/358796 to your computer and use it in GitHub Desktop.
require 'formula'
class Ffmpeg <Formula
head 'svn://svn.ffmpeg.org/ffmpeg/trunk', :revision => 22811
homepage 'http://ffmpeg.org/'
depends_on 'x264' => :optional
depends_on 'faac' => :optional
depends_on 'faad2' => :optional
depends_on 'lame' => :optional
depends_on 'libvorbis' => :optional
depends_on 'theora' => :optional
depends_on 'opencore-amr' => :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?
configure_flags << "--enable-libvorbis" if Formula.factory('libvorbis').installed?
configure_flags << "--enable-libtheora" if Formula.factory('theora').installed?
if Formula.factory('opencore-amr').installed?
configure_flags << "--enable-version3"
configure_flags << "--enable-libopencore-amrnb"
configure_flags << "--enable-libopencore-amrwb"
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment