forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / development / libraries / c-blosc / 2.nix
blobc8bc3ec34eea6f6d5f10905b4bc57e8da9e5dde9
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , cmake
5 , testers
7 , static ? stdenv.hostPlatform.isStatic
9 , lz4
10 , zlib-ng
11 , zstd
14 stdenv.mkDerivation (finalAttrs: {
15   pname = "c-blosc2";
16   version = "2.15.1";
18   src = fetchFromGitHub {
19     owner = "Blosc";
20     repo = "c-blosc2";
21     rev = "v${finalAttrs.version}";
22     sha256 = "sha256-g/MUgVWeVVREiHX59XYbhXjtigJesyooxjnEdKA844M=";
23   };
25   # https://github.com/NixOS/nixpkgs/issues/144170
26   postPatch = ''
27     sed -i -E \
28       -e '/^libdir[=]/clibdir=@CMAKE_INSTALL_FULL_LIBDIR@' \
29       -e '/^includedir[=]/cincludedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@' \
30       blosc2.pc.in
31   '';
33   nativeBuildInputs = [ cmake ];
35   buildInputs = [
36     lz4
37     zlib-ng
38     zstd
39   ];
41   cmakeFlags = [
42     "-DBUILD_STATIC=${if static then "ON" else "OFF"}"
43     "-DBUILD_SHARED=${if static then "OFF" else "ON"}"
45     "-DPREFER_EXTERNAL_LZ4=ON"
46     "-DPREFER_EXTERNAL_ZLIB=ON"
47     "-DPREFER_EXTERNAL_ZSTD=ON"
49     "-DBUILD_EXAMPLES=OFF"
50     "-DBUILD_BENCHMARKS=OFF"
51     "-DBUILD_TESTS=${if finalAttrs.finalPackage.doCheck then "ON" else "OFF"}"
52   ];
54   doCheck = !static;
55   # possibly https://github.com/Blosc/c-blosc2/issues/432
56   enableParallelChecking = false;
58   passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
60   meta = with lib; {
61     description = "Fast, compressed, persistent binary data store library for C";
62     homepage = "https://www.blosc.org";
63     changelog = "https://github.com/Blosc/c-blosc2/releases/tag/v${finalAttrs.version}";
64     pkgConfigModules = [
65       "blosc2"
66     ];
67     license = licenses.bsd3;
68     platforms = platforms.all;
69     maintainers = with maintainers; [ ris ];
70   };