2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-09-27 23:48:11 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class X264 < Formula
|
2010-04-04 00:53:53 +00:00
|
|
|
homepage 'http://www.videolan.org/developers/x264.html'
|
2012-08-13 15:17:05 +00:00
|
|
|
url 'http://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20120812-2245-stable.tar.bz2'
|
|
|
|
sha1 '4be913fb12cd5b3628edc68dedb4b6e664eeda0a'
|
|
|
|
version 'r2197.4' # brew install -v --HEAD x264 will display the version.
|
2010-09-08 16:39:33 +00:00
|
|
|
|
2012-04-27 07:58:59 +00:00
|
|
|
head 'http://git.videolan.org/git/x264.git', :branch => 'stable'
|
2010-04-04 00:53:53 +00:00
|
|
|
|
2011-03-26 19:33:49 +00:00
|
|
|
depends_on 'yasm' => :build
|
2009-09-27 23:48:11 +00:00
|
|
|
|
2012-08-13 14:35:38 +00:00
|
|
|
option '10-bit', 'Build a 10-bit x264 (default: 8-bit)'
|
2011-11-16 17:31:17 +00:00
|
|
|
|
2009-09-27 23:48:11 +00:00
|
|
|
def install
|
2012-08-13 14:35:38 +00:00
|
|
|
if build.head?
|
2012-06-10 07:25:15 +00:00
|
|
|
ENV['GIT_DIR'] = cached_download/'.git'
|
|
|
|
system './version.sh'
|
|
|
|
end
|
2011-11-16 17:31:17 +00:00
|
|
|
args = ["--prefix=#{prefix}", "--enable-shared"]
|
2012-08-13 14:35:38 +00:00
|
|
|
args << "--bit-depth=10" if build.include? '10-bit'
|
2011-11-16 17:31:17 +00:00
|
|
|
|
|
|
|
system "./configure", *args
|
2010-04-04 00:53:53 +00:00
|
|
|
|
2011-09-12 21:51:47 +00:00
|
|
|
if MacOS.prefer_64_bit?
|
|
|
|
inreplace 'config.mak' do |s|
|
2010-04-04 00:53:53 +00:00
|
|
|
soflags = s.get_make_var 'SOFLAGS'
|
2011-09-12 21:51:47 +00:00
|
|
|
s.change_make_var! 'SOFLAGS', soflags.gsub(' -Wl,-read_only_relocs,suppress', '')
|
2010-04-04 00:53:53 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2009-09-27 23:48:11 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
2012-06-10 07:25:15 +00:00
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
Because x264 installs its library with a version number that changes,
|
|
|
|
any of these that you have installed should be reinstalled each time you
|
|
|
|
upgrade x264.
|
|
|
|
avidemux, ffmbc, ffmpeg, gst-plugins-ugly
|
|
|
|
EOS
|
|
|
|
end
|
2009-09-27 23:48:11 +00:00
|
|
|
end
|