summary refs log tree commit diff
path: root/pkgs/development/libraries/libspatialindex
diff options
context:
space:
mode:
authorNikolay Korotkiy <sikmir@disroot.org>2022-09-02 10:18:02 +0300
committerNikolay Korotkiy <sikmir@disroot.org>2022-09-04 14:01:39 +0300
commit2dd6b94234392d685c5d66b9ed13e51c235654e6 (patch)
treeb0c2b3af39d262def53e1eac5dbd5d3c8a0e3e79 /pkgs/development/libraries/libspatialindex
parent937266ba5515b96e1731ef3846af358b2cd8d5a5 (diff)
libspatialindex: 1.8.5 → 1.9.3
Diffstat (limited to 'pkgs/development/libraries/libspatialindex')
-rw-r--r--pkgs/development/libraries/libspatialindex/default.nix41
1 files changed, 29 insertions, 12 deletions
diff --git a/pkgs/development/libraries/libspatialindex/default.nix b/pkgs/development/libraries/libspatialindex/default.nix
index 2081650f90a92..455d42c3bb45c 100644
--- a/pkgs/development/libraries/libspatialindex/default.nix
+++ b/pkgs/development/libraries/libspatialindex/default.nix
@@ -1,20 +1,37 @@
-{ lib, stdenv, fetchurl }:
+{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake }:
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: {
   pname = "libspatialindex";
-  version = "1.8.5";
+  version = "1.9.3";
 
-  src = fetchurl {
-    url = "https://download.osgeo.org/libspatialindex/spatialindex-src-${version}.tar.gz";
-    sha256 = "1vxzm7kczwnb6qdmc0hb00z8ykx11zk3sb68gc7rch4vrfi4dakw";
+  src = fetchFromGitHub {
+    owner = "libspatialindex";
+    repo = "libspatialindex";
+    rev = finalAttrs.version;
+    hash = "sha256-zsvS0IkCXyuNLCQpccKdAsFKoq0l+y66ifXlTHLNTkc=";
   };
 
-  enableParallelBuilding = true;
+  patches = [
+    # Allow building static libs
+    (fetchpatch {
+      name = "fix-static-lib-build.patch";
+      url = "https://github.com/libspatialindex/libspatialindex/commit/caee28d84685071da3ff3a4ea57ff0b6ae64fc87.patch";
+      hash = "sha256-nvTW/t9tw1ZLeycJY8nj7rQgZogxQb765Ca2b9NDvRo=";
+    })
+  ];
 
-  meta = {
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = [
+    "-DSIDX_BUILD_TESTS=${if finalAttrs.doCheck then "ON" else "OFF"}"
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
     description = "Extensible spatial index library in C++";
-    homepage = "http://libspatialindex.github.io/";
-    license = lib.licenses.mit;
-    platforms = lib.platforms.unix;
+    homepage = "https://libspatialindex.org";
+    license = licenses.mit;
+    platforms = platforms.unix;
   };
-}
+})