Skip to content

Commit 050f7a4

Browse files
committed
libbsc 3.3.9 (new formula)
1 parent a98ce0e commit 050f7a4

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

Formula/lib/libbsc.rb

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
depends_on "cmake" => :build
9+
10+
on_macos do
11+
depends_on "libomp"
12+
end
13+
14+
def install
15+
args = %W[
16+
-DBSC_ENABLE_NATIVE_COMPILATION=OFF
17+
-DBSC_BUILD_SHARED_LIB=ON
18+
-DCMAKE_INSTALL_RPATH=#{rpath}
19+
]
20+
system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args
21+
system "cmake", "--build", "build"
22+
system "cmake", "--install", "build"
23+
end
24+
25+
test do
26+
system bin/"bsc", "e", test_fixtures("test.tiff"), "test.tiff.bsc"
27+
system bin/"bsc", "d", "test.tiff.bsc", "test.tiff"
28+
assert_equal Digest::SHA256.hexdigest(test_fixtures("test.tiff").read),
29+
Digest::SHA256.hexdigest((testpath/"test.tiff").read)
30+
end
31+
end

0 commit comments

Comments
 (0)