Skip to content

Commit

Permalink
c-blosc2 2.13.2 (new formula)
Browse files Browse the repository at this point in the history
c-blosc2: update build

Signed-off-by: Rui Chen <rui@chenrui.dev>
  • Loading branch information
alebcay authored and chenrui333 committed Mar 24, 2024
1 parent dfe89fe commit 9d57ae1
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions Formula/c/c-blosc2.rb
@@ -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

0 comments on commit 9d57ae1

Please sign in to comment.