homebrew-core/Formula/x265.rb

43 lines
1.2 KiB
Ruby
Raw Normal View History

require 'formula'
class X265 < Formula
homepage "http://x265.org"
url "https://bitbucket.org/multicoreware/x265/get/1.3.tar.bz2"
sha1 "b24fc768c61bab3dc4442dc65649fa74d16318a2"
bottle do
cellar :any
2014-07-10 09:29:53 +00:00
sha1 "fc59dbc0ec41212e6385d5a0a6bb441b3b580387" => :mavericks
sha1 "9620f7cb983531a3ff5a7cbbb27b96d8ede82b4f" => :mountain_lion
sha1 "3930317031d2e7c6825c089ca9d3050e239cba07" => :lion
end
head 'https://bitbucket.org/multicoreware/x265', :using => :hg
depends_on 'yasm' => :build
depends_on 'cmake' => :build
depends_on :macos => :lion
option '16-bit', 'Build a 16-bit x265 (default: 8-bit)'
def install
args = std_cmake_args
args.delete '-DCMAKE_BUILD_TYPE=None'
args << '-DCMAKE_BUILD_TYPE=Release'
args << '-DHIGH_BIT_DEPTH=ON' if build.include? '16-bit'
system "cmake", "source", *args
system "make", "install"
end
test do
yuv_path = testpath/"raw.yuv"
x265_path = testpath/"x265.265"
2014-07-31 02:04:17 +00:00
yuv_path.binwrite "\xCO\xFF\xEE" * 3200
system "#{bin}/x265 --input-res 80x80 --fps 1 #{yuv_path} #{x265_path}"
header = 'AAAAAUABDAH//w=='
assert_equal header.unpack("m"), [x265_path.read(10)]
2014-07-31 02:04:17 +00:00
end
end