PageRenderTime 57ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/Library/Formula/x265.rb

https://bitbucket.org/JoshHagins/homebrew
Ruby | 42 lines | 33 code | 9 blank | 0 comment | 1 complexity | 7a8580c8b4aecde51f0301ede6cfe83a MD5 | raw file
  1. require 'formula'
  2. class X265 < Formula
  3. homepage "http://x265.org"
  4. url "https://bitbucket.org/multicoreware/x265/get/1.4.tar.bz2"
  5. sha1 "95b4481d61d1766fce4b7120d4b49d08e39d922b"
  6. bottle do
  7. cellar :any
  8. sha1 "e01e498d5bcd69391d2ac68ce0f507c1aec71b4f" => :yosemite
  9. sha1 "b25757d40934c1d49d183f71dde41ade71563ea0" => :mavericks
  10. sha1 "41905d7b570e7e2be6d4fd99f641b5549a8e7719" => :mountain_lion
  11. end
  12. head 'https://bitbucket.org/multicoreware/x265', :using => :hg
  13. depends_on 'yasm' => :build
  14. depends_on 'cmake' => :build
  15. depends_on :macos => :lion
  16. option '16-bit', 'Build a 16-bit x265 (default: 8-bit)'
  17. def install
  18. args = std_cmake_args
  19. args.delete '-DCMAKE_BUILD_TYPE=None'
  20. args << '-DCMAKE_BUILD_TYPE=Release'
  21. args << '-DHIGH_BIT_DEPTH=ON' if build.include? '16-bit'
  22. system "cmake", "source", *args
  23. system "make", "install"
  24. end
  25. test do
  26. yuv_path = testpath/"raw.yuv"
  27. x265_path = testpath/"x265.265"
  28. yuv_path.binwrite "\xCO\xFF\xEE" * 3200
  29. system "#{bin}/x265 --input-res 80x80 --fps 1 #{yuv_path} #{x265_path}"
  30. header = 'AAAAAUABDAH//w=='
  31. assert_equal header.unpack("m"), [x265_path.read(10)]
  32. end
  33. end