5
5
, postgresql
6
6
, geos
7
7
, proj
8
- , gdal
8
+ , gdalMinimal
9
9
, json_c
10
10
, pkg-config
11
11
, file
12
12
, protobufc
13
13
, libiconv
14
+ , pcre2
14
15
, nixosTests
15
16
} :
17
+
18
+ let
19
+ gdal = gdalMinimal ;
20
+ in
16
21
stdenv . mkDerivation rec {
17
22
pname = "postgis" ;
18
23
version = "3.3.2" ;
19
24
20
25
outputs = [ "out" "doc" ] ;
21
26
22
- src = fetchurl {
27
+ src = fetchurl {
23
28
url = "https://download.osgeo.org/postgis/source/postgis-${ version } .tar.gz" ;
24
29
sha256 = "sha256-miohnaAFoXMKOdGVmhx87GGbHvsAm2W+gP/CW60pkGg=" ;
25
30
} ;
26
31
27
- buildInputs = [ libxml2 postgresql geos proj gdal json_c protobufc ]
32
+ buildInputs = [ libxml2 postgresql geos proj gdal json_c protobufc pcre2 . dev ]
28
33
++ lib . optional stdenv . isDarwin libiconv ;
29
- nativeBuildInputs = [ perl pkg-config ] ++ lib . optional postgresql . jitSupport postgresql . llvm ;
34
+ nativeBuildInputs = [ perl pkg-config ] ;
30
35
dontDisableStatic = true ;
31
36
32
37
# postgis config directory assumes /include /lib from the same root for json-c library
33
- NIX_LDFLAGS = "-L${ lib . getLib json_c } /lib" ;
38
+ env . NIX_LDFLAGS = "-L${ lib . getLib json_c } /lib" ;
39
+
34
40
35
41
preConfigure = ''
36
42
sed -i 's@/usr/bin/file@${ file } /bin/file@' configure
37
- configureFlags="--datadir=$out/share/postgresql --datarootdir=$out/share/postgresql --bindir=$out/bin --with-gdalconfig=${ gdal } /bin/gdal-config --with-jsondir=${ json_c . dev } "
43
+ configureFlags="--datadir=$out/share/postgresql --datarootdir=$out/share/postgresql --bindir=$out/bin --docdir=$doc/share/doc/ ${ pname } -- with-gdalconfig=${ gdal } /bin/gdal-config --with-jsondir=${ json_c . dev } --disable-extension-upgrades-install "
38
44
39
- makeFlags="PERL=${ perl } /bin/perl datadir=$out/share/postgresql pkglibdir=$out/lib bindir=$out/bin"
45
+ makeFlags="PERL=${ perl } /bin/perl datadir=$out/share/postgresql pkglibdir=$out/lib bindir=$out/bin docdir=$doc/share/doc/ ${ pname } "
40
46
'' ;
41
47
postConfigure = ''
42
48
sed -i "s|@mkdir -p \$(DESTDIR)\$(PGSQL_BINDIR)||g ;
@@ -50,7 +56,7 @@ stdenv.mkDerivation rec {
50
56
51
57
# postgis' build system assumes it is being installed to the same place as postgresql, and looks
52
58
# for the postgres binary relative to $PREFIX. We gently support this system using an illusion.
53
- ln -s ${ postgresql_15 } /bin/postgres $out/bin/postgres
59
+ ln -s ${ postgresql } /bin/postgres $out/bin/postgres
54
60
'' ;
55
61
56
62
# create aliases for all commands adding version information
@@ -73,7 +79,7 @@ stdenv.mkDerivation rec {
73
79
homepage = "https://postgis.net/" ;
74
80
changelog = "https://git.osgeo.org/gitea/postgis/postgis/raw/tag/${ version } /NEWS" ;
75
81
license = licenses . gpl2 ;
76
- maintainers = [ samrose ] ;
82
+ maintainers = with maintainers ; teams . geospatial . members ++ [ marcweber wolfgangwalther ] ;
77
83
inherit ( postgresql . meta ) platforms ;
78
84
} ;
79
85
}
0 commit comments