Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib
2, stdenv
3, fetchurl
4, pkg-config
5, geos
6, librttopo
7, libxml2
8, minizip
9, proj
10, sqlite
11, libiconv
12}:
13
14stdenv.mkDerivation rec {
15 pname = "libspatialite";
16 version = "5.0.1";
17
18 outputs = [ "out" "dev" ];
19
20 src = fetchurl {
21 url = "https://www.gaia-gis.it/gaia-sins/libspatialite-sources/${pname}-${version}.tar.gz";
22 sha256 = "sha256-7svJQxHHgBLQWevA+uhupe9u7LEzA+boKzdTwbNAnpg=";
23 };
24
25 nativeBuildInputs = [ pkg-config ];
26
27 buildInputs = [
28 geos
29 librttopo
30 libxml2
31 minizip
32 proj
33 sqlite
34 ] ++ lib.optionals stdenv.isDarwin [
35 libiconv
36 ];
37
38 configureFlags = [ "--disable-freexl" ];
39
40 enableParallelBuilding = true;
41
42 postInstall = lib.optionalString stdenv.isDarwin ''
43 ln -s $out/lib/mod_spatialite.{so,dylib}
44 '';
45
46 meta = with lib; {
47 description = "Extensible spatial index library in C++";
48 homepage = "https://www.gaia-gis.it/fossil/libspatialite";
49 # They allow any of these
50 license = with licenses; [ gpl2Plus lgpl21Plus mpl11 ];
51 platforms = platforms.unix;
52 maintainers = with maintainers; [ dotlambda ];
53 };
54}