1{ lib
2, stdenv
3, callPackage
4, fetchurl
5, testers
6
7, cmake
8}:
9
10stdenv.mkDerivation (finalAttrs: {
11 pname = "geos";
12 version = "3.12.1";
13
14 src = fetchurl {
15 url = "https://download.osgeo.org/geos/${finalAttrs.pname}-${finalAttrs.version}.tar.bz2";
16 hash = "sha256-1up+SSIktRGT6CRP4+wXxNRNB3fzwyyk+xcRQFSaDQM=";
17 };
18
19 nativeBuildInputs = [ cmake ];
20
21 # https://github.com/libgeos/geos/issues/930
22 cmakeFlags = lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [
23 "-DCMAKE_CTEST_ARGUMENTS=--exclude-regex;unit-geom-Envelope"
24 ];
25
26 doCheck = true;
27
28 passthru.tests = {
29 pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
30 geos = callPackage ./tests.nix { geos = finalAttrs.finalPackage; };
31 };
32
33 meta = with lib; {
34 description = "C/C++ library for computational geometry with a focus on algorithms used in geographic information systems (GIS) software";
35 homepage = "https://libgeos.org";
36 license = licenses.lgpl21Only;
37 mainProgram = "geosop";
38 maintainers = teams.geospatial.members;
39 pkgConfigModules = [ "geos" ];
40 changelog = "https://github.com/libgeos/geos/releases/tag/${finalAttrs.finalPackage.version}";
41 };
42})