diff --git a/pkgs/development/libraries/s2geometry/default.nix b/pkgs/development/libraries/s2geometry/default.nix new file mode 100644 index 00000000000..afd5ffa0a0a --- /dev/null +++ b/pkgs/development/libraries/s2geometry/default.nix @@ -0,0 +1,32 @@ +{ stdenv, lib, fetchFromGitHub, fetchpatch, cmake, pkg-config, openssl, gtest }: + +stdenv.mkDerivation rec { + pname = "s2geometry"; + version = "0.9.0"; + + src = fetchFromGitHub { + owner = "google"; + repo = "s2geometry"; + rev = "v${version}"; + sha256 = "1mx61bnn2f6bd281qlhn667q6yfg1pxzd2js88l5wpkqlfzzhfaz"; + }; + + patches = [ + # Fix build https://github.com/google/s2geometry/issues/165 + (fetchpatch { + url = "https://github.com/google/s2geometry/commit/a4dddf40647c68cd0104eafc31e9c8fb247a6308.patch"; + sha256 = "0fp3w4bg7pgf5vv4vacp9g06rbqzhxc2fg6i5appp93q6phiinvi"; + }) + ]; + + nativeBuildInputs = [ cmake pkg-config ]; + buildInputs = [ openssl gtest ]; + + meta = with lib; { + description = "Computational geometry and spatial indexing on the sphere"; + homepage = "http://s2geometry.io/"; + license = licenses.asl20; + maintainers = [ maintainers.Thra11 ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d6327ed33d4..b97c08e3a87 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16657,6 +16657,8 @@ in rubberband = callPackage ../development/libraries/rubberband { }; + s2geometry = callPackage ../development/libraries/s2geometry { }; + /* This package references ghc844, which we no longer have. Unfortunately, I have been unable to mark it as "broken" in a way that the ofBorg bot recognizes. Since I don't want to merge code into master that generates