about summary refs log tree commit diff
path: root/pkgs/development/misc/h3/default.nix
blob: d30bdbc3e637f6158753878f1c0f045b9ca1f6cd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{ lib
, stdenv
, cmake
, fetchFromGitHub
, withFilters ? false
}:

let
  generic = { version, hash }:
    stdenv.mkDerivation rec {
      inherit version;
      pname = "h3";

      src = fetchFromGitHub {
        owner = "uber";
        repo = "h3";
        rev = "v${version}";
        inherit hash;
      };

      outputs = [ "out" "dev" ];

      nativeBuildInputs = [ cmake ];

      cmakeFlags = [
        "-DBUILD_SHARED_LIBS=ON"
        "-DBUILD_BENCHMARKS=OFF"
        "-DBUILD_FUZZERS=OFF"
        "-DBUILD_GENERATORS=OFF"
        "-DENABLE_COVERAGE=OFF"
        "-DENABLE_FORMAT=OFF"
        "-DENABLE_LINTING=OFF"
        (lib.cmakeBool "BUILD_FILTERS" withFilters)
      ];

      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 ];
      };
    };
in
{
  h3_3 = generic {
    version = "3.7.2";
    hash = "sha256-MvWqQraTnab6EuDx4V0v8EvrFWHT95f2EHTL2p2kei8=";
  };

  h3_4 = generic {
    version = "4.1.0";
    hash = "sha256-7qyN73T8XDwZLgMZld7wwShUwoLEi/2gN2oiZX8n5nQ=";
  };
}