about summary refs log tree commit diff
path: root/pkgs/development/libraries/croaring
diff options
context:
space:
mode:
authorAxel Forsman <axel@axelf.se>2023-09-20 15:32:31 +0200
committerAxel Forsman <axel@axelf.se>2023-10-10 16:08:28 +0200
commit912071c4cafcf09ca99b7865f82ba3152648960f (patch)
tree7331535e7414fb55f6709ed1415f47614591146d /pkgs/development/libraries/croaring
parentdcdf6002357418ff1341ca5886cbfdcc65e6e2cf (diff)
croaring: 0.2.61 -> 2.0.3
Diffstat (limited to 'pkgs/development/libraries/croaring')
-rw-r--r--pkgs/development/libraries/croaring/default.nix32
-rw-r--r--pkgs/development/libraries/croaring/fix-pkg-config.patch14
2 files changed, 36 insertions, 10 deletions
diff --git a/pkgs/development/libraries/croaring/default.nix b/pkgs/development/libraries/croaring/default.nix
index 5c1afcbf13658..88643c00195ae 100644
--- a/pkgs/development/libraries/croaring/default.nix
+++ b/pkgs/development/libraries/croaring/default.nix
@@ -1,28 +1,40 @@
-{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "croaring";
-  version = "0.2.61";
+  version = "2.0.3";
 
   src = fetchFromGitHub {
     owner = "RoaringBitmap";
     repo = "CRoaring";
     rev = "v${version}";
-    sha256 = "14y8iwv6b6gg7hgs00yqg8rwx4vwbb1zs2s99lxa51zx9vp1alcn";
+    hash = "sha256-WaFyJ/6zstJ05e3vfrwhaZKQsjRAEvVTs688Hw0fr94=";
   };
 
-  patches = fetchpatch {
-    url = "https://github.com/RoaringBitmap/CRoaring/commit/8d8c60736f506b2b8f1c365148a8a541b26a55f2.patch";
-    sha256 = "1y2mbn4i8lj3lkn5s8zziyr9pl1fq9hndzz9c01dkv3s8sn7f55s";
-  };
+  # roaring.pc.in cannot handle absolute CMAKE_INSTALL_*DIRs, nor
+  # overridden CMAKE_INSTALL_FULL_*DIRs. With Nix, they are guaranteed
+  # to be absolute so the following patch suffices (see #144170).
+  patches = [ ./fix-pkg-config.patch ];
 
   nativeBuildInputs = [ cmake ];
 
+  doCheck = true;
+
+  preConfigure = ''
+    mkdir -p dependencies/.cache
+    ln -s ${fetchFromGitHub {
+      owner = "clibs";
+      repo = "cmocka";
+      rev = "f5e2cd7";
+      hash = "sha256-Oq0nFsZhl8IF7kQN/LgUq8VBy+P7gO98ep/siy5A7Js=";
+    }} dependencies/.cache/cmocka
+  '';
+
   meta = with lib; {
     description = "Compressed bitset library for C and C++";
-    homepage = "http://roaringbitmap.org/";
-    license = licenses.asl20;
-    maintainers = with maintainers; [ orivej ];
+    homepage = "https://roaringbitmap.org/";
+    license = with licenses; [ asl20 mit ];
+    maintainers = [ maintainers.orivej ];
     platforms = platforms.all;
   };
 }
diff --git a/pkgs/development/libraries/croaring/fix-pkg-config.patch b/pkgs/development/libraries/croaring/fix-pkg-config.patch
new file mode 100644
index 0000000000000..f5cfcf308cf8b
--- /dev/null
+++ b/pkgs/development/libraries/croaring/fix-pkg-config.patch
@@ -0,0 +1,14 @@
+diff --git a/roaring.pc.in b/roaring.pc.in
+index e3b2391..c29adc3 100644
+--- a/roaring.pc.in
++++ b/roaring.pc.in
+@@ -1,7 +1,7 @@
+ prefix=@CMAKE_INSTALL_PREFIX@
+ exec_prefix=${prefix}
+-libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
+-includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
++libdir=@CMAKE_INSTALL_FULL_LIBDIR@
++includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
+ 
+ Name: roaring
+ Description: Roaring bitmap implementation in C