2013-09-20 15:00:53 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class X265 < Formula
|
2014-08-22 16:36:38 +00:00
|
|
|
homepage "http://x265.org"
|
2014-11-03 20:23:27 +00:00
|
|
|
url "https://bitbucket.org/multicoreware/x265/get/1.4.tar.bz2"
|
|
|
|
sha1 "95b4481d61d1766fce4b7120d4b49d08e39d922b"
|
2013-09-20 15:00:53 +00:00
|
|
|
|
2014-03-05 03:32:21 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2014-11-03 20:36:03 +00:00
|
|
|
sha1 "e01e498d5bcd69391d2ac68ce0f507c1aec71b4f" => :yosemite
|
|
|
|
sha1 "b25757d40934c1d49d183f71dde41ade71563ea0" => :mavericks
|
|
|
|
sha1 "41905d7b570e7e2be6d4fd99f641b5549a8e7719" => :mountain_lion
|
2014-03-05 03:32:21 +00:00
|
|
|
end
|
|
|
|
|
2013-09-20 15:00:53 +00:00
|
|
|
head 'https://bitbucket.org/multicoreware/x265', :using => :hg
|
|
|
|
|
|
|
|
depends_on 'yasm' => :build
|
|
|
|
depends_on 'cmake' => :build
|
|
|
|
depends_on :macos => :lion
|
|
|
|
|
2014-03-05 01:08:18 +00:00
|
|
|
option '16-bit', 'Build a 16-bit x265 (default: 8-bit)'
|
|
|
|
|
2013-09-20 15:00:53 +00:00
|
|
|
def install
|
|
|
|
|
|
|
|
args = std_cmake_args
|
|
|
|
args.delete '-DCMAKE_BUILD_TYPE=None'
|
|
|
|
args << '-DCMAKE_BUILD_TYPE=Release'
|
2014-03-05 01:08:18 +00:00
|
|
|
args << '-DHIGH_BIT_DEPTH=ON' if build.include? '16-bit'
|
2013-09-20 15:00:53 +00:00
|
|
|
|
|
|
|
system "cmake", "source", *args
|
2013-10-30 00:36:54 +00:00
|
|
|
system "make", "install"
|
2013-09-20 15:00:53 +00:00
|
|
|
end
|
2014-03-05 01:08:18 +00:00
|
|
|
|
|
|
|
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
|
2014-03-05 01:08:18 +00:00
|
|
|
system "#{bin}/x265 --input-res 80x80 --fps 1 #{yuv_path} #{x265_path}"
|
2014-04-04 10:22:23 +00:00
|
|
|
header = 'AAAAAUABDAH//w=='
|
|
|
|
assert_equal header.unpack("m"), [x265_path.read(10)]
|
2014-07-31 02:04:17 +00:00
|
|
|
end
|
2013-09-20 15:00:53 +00:00
|
|
|
end
|