summaryrefslogtreecommitdiff
path: root/pkgs/development/misc/h3/default.nix
blob: a18ab9a553f7957c1a297dba6be2825c56ae6965 (plain)
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
57
58
59
60
61
62
{
  lib,
  stdenv,
  cmake,
  fetchFromGitHub,
  withFilters ? false,
}:

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

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

      outputs = [
        "out"
        "dev"
      ];

      nativeBuildInputs = [ cmake ];

      cmakeFlags = [
        (lib.cmakeBool "BUILD_SHARED_LIBS" true)
        (lib.cmakeBool "BUILD_BENCHMARKS" false)
        (lib.cmakeBool "BUILD_FUZZERS" false)
        (lib.cmakeBool "BUILD_GENERATORS" false)
        (lib.cmakeBool "ENABLE_COVERAGE" false)
        (lib.cmakeBool "ENABLE_FORMAT" false)
        (lib.cmakeBool "ENABLE_LINTING" false)
        (lib.cmakeBool "BUILD_FILTERS" withFilters)
      ]
      ++ (lib.optionals (lib.versionOlder version "4.0.0") [ "-DCMAKE_POLICY_VERSION_MINIMUM=3.5" ]);

      meta = {
        homepage = "https://h3geo.org/";
        description = "Hexagonal hierarchical geospatial indexing system";
        license = lib.licenses.asl20;
        changelog = "https://github.com/uber/h3/raw/v${version}/CHANGELOG.md";
        platforms = lib.platforms.all;
        maintainers = with lib.maintainers; [ kalbasit ];
      };
    };
in
{
  h3_3 = generic {
    version = "3.7.2";
    hash = "sha256-MvWqQraTnab6EuDx4V0v8EvrFWHT95f2EHTL2p2kei8=";
  };

  h3_4 = generic {
    version = "4.4.1";
    hash = "sha256-tKonXauTJiOb5DV56tOmnvba7eNYcWTnOvCSokheVsY=";
  };
}