Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

c-blosc2 2.13.2 (new formula) #166914

Merged
merged 2 commits into from Mar 24, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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