Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
c-blosc2: update build Signed-off-by: Rui Chen <rui@chenrui.dev>
- Loading branch information
1 parent
dfe89fe
commit 9d57ae1
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 |