Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ansible/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ postgres_major:

# Full version strings for each major version
postgres_release:
postgresorioledb-17: "17.0.1.020-orioledb"
postgres15: "15.8.1.030"
postgresorioledb-17: "17.0.1.019-orioledb-staging-2"
postgres15: "15.8.1.029-staging-2"

# Non Postgres Extensions
pgbouncer_release: "1.19.0"
Expand Down
38 changes: 17 additions & 21 deletions nix/ext/postgis.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,15 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ perl pkg-config ];
dontDisableStatic = true;

# postgis config directory assumes /include /lib from the same root for json-c library
env.NIX_LDFLAGS = "-L${lib.getLib json_c}/lib";


preConfigure = ''
sed -i 's@/usr/bin/file@${file}/bin/file@' configure
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 --with-sfcgal"

makeFlags="PERL=${perl}/bin/perl datadir=$out/share/postgresql pkglibdir=$out/lib bindir=$out/bin docdir=$doc/share/doc/${pname}"
'';

postConfigure = ''
sed -i "s|@mkdir -p \$(DESTDIR)\$(PGSQL_BINDIR)||g ;
s|\$(DESTDIR)\$(PGSQL_BINDIR)|$prefix/bin|g
Expand All @@ -54,28 +53,25 @@ stdenv.mkDerivation rec {
" \
"raster/scripts/python/Makefile";
mkdir -p $out/bin

# postgis' build system assumes it is being installed to the same place as postgresql, and looks
# for the postgres binary relative to $PREFIX. We gently support this system using an illusion.
ln -s ${postgresql}/bin/postgres $out/bin/postgres
'';

# create aliases for all commands adding version information
postInstall = ''
# Teardown the illusory postgres used for building; see postConfigure.
rm $out/bin/postgres

for prog in $out/bin/*; do # */
ln -s $prog $prog-${version}
done

for file in $out/share/postgresql/extension/postgis_topology*--${version}.sql; do
sed -i "/SELECT topology.AddToSearchPath('topology');/i SELECT topology.AddToSearchPath('extensions');" "$file"
done

mkdir -p $doc/share/doc/postgis
mv doc/* $doc/share/doc/postgis/
'';
postInstall = ''
rm $out/bin/postgres
for prog in $out/bin/*; do # */
ln -s $prog $prog-${version}
done
# Add function definition and usage to tiger geocoder files
for file in $out/share/postgresql/extension/postgis_tiger_geocoder*--${version}.sql; do
sed -i '/SELECT postgis_extension_AddToSearchPath('tiger');/a SELECT postgis_extension_AddToSearchPath('extensions');' "$file"
done
# Original topology patching
for file in $out/share/postgresql/extension/postgis_topology*--${version}.sql; do
sed -i "/SELECT topology.AddToSearchPath('topology');/i SELECT topology.AddToSearchPath('extensions');" "$file"
done
mkdir -p $doc/share/doc/postgis
mv doc/* $doc/share/doc/postgis/
'';

passthru.tests.postgis = nixosTests.postgis;

Expand Down
Loading