|
| 1 | +class Libbsc < Formula |
| 2 | + desc "High performance block-sorting data compression library" |
| 3 | + homepage "http://libbsc.com" |
| 4 | + url "https://github.com/IlyaGrebnov/libbsc/archive/refs/tags/v3.3.9.tar.gz" |
| 5 | + sha256 "d287535feaf18a05c3ffc9ccba3ee4eacd7604224b4648121d7388727160f107" |
| 6 | + license "Apache-2.0" |
| 7 | + |
| 8 | + bottle do |
| 9 | + sha256 cellar: :any, arm64_sequoia: "c7ed848197e074d4ffbf597c051dcc37399d2d589c6ada3a15f90fd049859470" |
| 10 | + sha256 cellar: :any, arm64_sonoma: "e9f13fa761075788e61ac51a14ab27649231f3355f7f7fe3d56d848c74714e96" |
| 11 | + sha256 cellar: :any, arm64_ventura: "5d49a44a479d5de112bc9bd95c88ab7b14fcd9e86f099e5c335c912df1610a90" |
| 12 | + sha256 cellar: :any, sonoma: "d901c26e237fd703be8440ff7f5e3004309d876be6beeb6dec4360f33af8c399" |
| 13 | + sha256 cellar: :any, ventura: "b3aecda9cb9b4592b4b92191c99d14532127ad1af91874aa1c6963a1c010e4ca" |
| 14 | + sha256 cellar: :any_skip_relocation, x86_64_linux: "95b7b546d36cecdefc38a60d52c6360e704c60877584786623f2fc7e841909b8" |
| 15 | + end |
| 16 | + |
| 17 | + depends_on "cmake" => :build |
| 18 | + |
| 19 | + on_macos do |
| 20 | + depends_on "libomp" |
| 21 | + end |
| 22 | + |
| 23 | + def install |
| 24 | + args = %W[ |
| 25 | + -DBSC_ENABLE_NATIVE_COMPILATION=OFF |
| 26 | + -DBSC_BUILD_SHARED_LIB=ON |
| 27 | + -DCMAKE_INSTALL_RPATH=#{rpath} |
| 28 | + ] |
| 29 | + system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args |
| 30 | + system "cmake", "--build", "build" |
| 31 | + system "cmake", "--install", "build" |
| 32 | + end |
| 33 | + |
| 34 | + test do |
| 35 | + system bin/"bsc", "e", test_fixtures("test.tiff"), "test.tiff.bsc" |
| 36 | + system bin/"bsc", "d", "test.tiff.bsc", "test.tiff" |
| 37 | + assert_equal Digest::SHA256.hexdigest(test_fixtures("test.tiff").read), |
| 38 | + Digest::SHA256.hexdigest((testpath/"test.tiff").read) |
| 39 | + end |
| 40 | +end |
0 commit comments