-
-
Notifications
You must be signed in to change notification settings - Fork 12.1k
/
c-blosc2.rb
39 lines (31 loc) 路 1.13 KB
/
c-blosc2.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
class CBlosc2 < Formula
desc "Fast, compressed, persistent binary data store library for C"
homepage "https://www.blosc.org"
url "https://github.com/Blosc/c-blosc2/archive/refs/tags/v2.13.2.tar.gz"
sha256 "f2adcd9615f138d1bb16dc27feadab1bb1eab01d77e5e2323d14ad4ca8c3ca21"
license "BSD-3-Clause"
head "https://github.com/Blosc/c-blosc2.git", branch: "main"
depends_on "cmake" => :build
depends_on "lz4"
depends_on "zstd"
uses_from_macos "zlib"
on_macos do
depends_on "llvm" => :build if DevelopmentTools.clang_build_version <= 1400
end
def install
ENV.llvm_clang if OS.mac? && DevelopmentTools.clang_build_version <= 1400
args = %w[
-DPREFER_EXTERNAL_LZ4=ON
-DPREFER_EXTERNAL_ZLIB=ON
-DPREFER_EXTERNAL_ZSTD=ON
]
system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args
system "cmake", "--build", "build"
system "cmake", "--install", "build"
pkgshare.install "examples/simple.c"
end
test do
system ENV.cc, pkgshare/"simple.c", "-I#{include}", "-L#{lib}", "-lblosc2", "-o", "test"
assert_match "Successful roundtrip!", shell_output(testpath/"test")
end
end