1{ lib
2, stdenv
3, cmake
4, fetchFromGitHub
5, withFilters ? false
6}:
7
8let
9 generic = { version, hash }:
10 stdenv.mkDerivation rec {
11 inherit version;
12 pname = "h3";
13
14 src = fetchFromGitHub {
15 owner = "uber";
16 repo = "h3";
17 rev = "v${version}";
18 inherit hash;
19 };
20
21 outputs = [ "out" "dev" ];
22
23 nativeBuildInputs = [ cmake ];
24
25 cmakeFlags = [
26 "-DBUILD_SHARED_LIBS=ON"
27 "-DBUILD_BENCHMARKS=OFF"
28 "-DBUILD_FUZZERS=OFF"
29 "-DBUILD_GENERATORS=OFF"
30 "-DENABLE_COVERAGE=OFF"
31 "-DENABLE_FORMAT=OFF"
32 "-DENABLE_LINTING=OFF"
33 (lib.cmakeBool "BUILD_FILTERS" withFilters)
34 ];
35
36 meta = with lib; {
37 homepage = "https://h3geo.org/";
38 description = "Hexagonal hierarchical geospatial indexing system";
39 license = licenses.asl20;
40 changelog = "https://github.com/uber/h3/raw/v${version}/CHANGELOG.md";
41 platforms = platforms.all;
42 maintainers = with maintainers; [ kalbasit ];
43 };
44 };
45in
46{
47 h3_3 = generic {
48 version = "3.7.2";
49 hash = "sha256-MvWqQraTnab6EuDx4V0v8EvrFWHT95f2EHTL2p2kei8=";
50 };
51
52 h3_4 = generic {
53 version = "4.1.0";
54 hash = "sha256-7qyN73T8XDwZLgMZld7wwShUwoLEi/2gN2oiZX8n5nQ=";
55 };
56}