require 'formula' class X264 < Formula homepage "http://www.videolan.org/developers/x264.html" # the latest commit on the stable branch url "http://git.videolan.org/git/x264.git", :revision => "e260ea549226ae29832d8bc0dcfd20cffc8cf248" version "r2412" head "http://git.videolan.org/git/x264.git" devel do # the latest commit on the master branch url "http://git.videolan.org/git/x264.git", :revision => "ac7644073ac28d19c9cf048849bbcd515713e426" version "r2431" end bottle do cellar :any sha1 "28d8418f2a774f057106ba67076060a45bfead9a" => :mavericks sha1 "001bb62c41554f3a6479ffc6dcd6625da17f2ea4" => :mountain_lion sha1 "326cb8fc003ed0c17f07e2f5a31d2a72f1d399cf" => :lion end depends_on 'yasm' => :build option '10-bit', 'Build a 10-bit x264 (default: 8-bit)' option "with-mp4=", "Select mp4 output: none (default), l-smash or gpac" case ARGV.value "with-mp4" when "l-smash" then depends_on "l-smash" when "gpac" then depends_on "gpac" end def install args = %W[ --prefix=#{prefix} --enable-shared --enable-static --enable-strip ] if Formula["l-smash"].installed? args << "--disable-gpac" elsif Formula["gpac"].installed? args << "--disable-lsmash" end args << "--bit-depth=10" if build.include? '10-bit' # For running version.sh correctly buildpath.install_symlink cached_download/".git" system "./configure", *args system "make", "install" end end