about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorMario Rodas <marsam@users.noreply.github.com>2023-03-30 18:48:07 -0500
committerGitHub <noreply@github.com>2023-03-30 18:48:07 -0500
commit04b40d660ac1721a735f288353ef91f8df1f9e22 (patch)
tree1998e57664a7fc01d5045f7c7fc6d85850b5d03e /pkgs
parent06c40b74980d67309330a04442ae7498857aa682 (diff)
parent908a8f3e4ef0dd9a5905bca06c3e6b3fd2b61757 (diff)
Merge pull request #219620 from marsam/update-h3
h3_4: init at 4.1.0
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/misc/h3/default.nix62
-rw-r--r--pkgs/top-level/all-packages.nix4
2 files changed, 44 insertions, 22 deletions
diff --git a/pkgs/development/misc/h3/default.nix b/pkgs/development/misc/h3/default.nix
index 99b7f8fdc325e..13c8f8d0424ed 100644
--- a/pkgs/development/misc/h3/default.nix
+++ b/pkgs/development/misc/h3/default.nix
@@ -2,32 +2,52 @@
 , stdenv
 , cmake
 , fetchFromGitHub
+, static ? stdenv.hostPlatform.isStatic
 }:
 
-stdenv.mkDerivation rec {
-  pname = "h3";
-  version = "3.7.2";
+let
+  generic = { version, hash }:
+    stdenv.mkDerivation rec {
+      inherit version;
+      pname = "h3";
 
-  src = fetchFromGitHub {
-    owner = "uber";
-    repo = "h3";
-    rev = "v${version}";
-    sha256 = "sha256-MvWqQraTnab6EuDx4V0v8EvrFWHT95f2EHTL2p2kei8=";
-  };
+      src = fetchFromGitHub {
+        owner = "uber";
+        repo = "h3";
+        rev = "v${version}";
+        inherit hash;
+      };
+
+      nativeBuildInputs = [ cmake ];
 
-  nativeBuildInputs = [ cmake ];
+      cmakeFlags = [
+        "-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}"
+        "-DBUILD_BENCHMARKS=OFF"
+        "-DBUILD_FUZZERS=OFF"
+        "-DBUILD_GENERATORS=OFF"
+        "-DENABLE_COVERAGE=OFF"
+        "-DENABLE_FORMAT=OFF"
+        "-DENABLE_LINTING=OFF"
+      ];
 
-  cmakeFlags = [
-    "-DBUILD_SHARED_LIBS=ON"
-    "-DENABLE_LINTING=OFF"
-  ];
+      meta = with lib; {
+        homepage = "https://h3geo.org/";
+        description = "Hexagonal hierarchical geospatial indexing system";
+        license = licenses.asl20;
+        changelog = "https://github.com/uber/h3/raw/v${version}/CHANGELOG.md";
+        platforms = platforms.all;
+        maintainers = with maintainers; [ kalbasit marsam ];
+      };
+    };
+in
+{
+  h3_3 = generic {
+    version = "3.7.2";
+    hash = "sha256-MvWqQraTnab6EuDx4V0v8EvrFWHT95f2EHTL2p2kei8=";
+  };
 
-  meta = with lib; {
-    homepage = "https://h3geo.org/";
-    description = "Hexagonal hierarchical geospatial indexing system";
-    license = licenses.asl20;
-    changelog = "https://github.com/uber/h3/raw/v${version}/CHANGELOG.md";
-    platforms = platforms.all;
-    maintainers = [ maintainers.kalbasit ];
+  h3_4 = generic {
+    version = "4.1.0";
+    hash = "sha256-7qyN73T8XDwZLgMZld7wwShUwoLEi/2gN2oiZX8n5nQ=";
   };
 }
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 679c5ff1ec788..f4319da14e88f 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -17081,7 +17081,9 @@ with pkgs;
 
   ### DEVELOPMENT / MISC
 
-  h3 = callPackage ../development/misc/h3 { };
+  inherit (callPackage ../development/misc/h3 { }) h3_3 h3_4;
+
+  h3 = h3_3;
 
   amtk = callPackage ../development/libraries/amtk { };