Merge: postgresql: fix pgxs Makefile for darwin (#358566)

This commit is contained in:
Maximilian Bosch
2024-11-24 12:59:47 +01:00
committed by GitHub
2 changed files with 6 additions and 11 deletions
@@ -89,14 +89,6 @@ buildPostgresqlExtension (finalAttrs: {
"--disable-extension-upgrades-install"
];
postConfigure = ''
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
'';
makeFlags = [
"PERL=${perl}/bin/perl"
];
@@ -111,9 +103,6 @@ buildPostgresqlExtension (finalAttrs: {
# 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-${finalAttrs.version}
done
+6
View File
@@ -284,6 +284,12 @@ let
# Stop lib depending on the -dev output of llvm
remove-references-to -t ${llvmPackages.llvm.dev} "$out/lib/llvmjit${dlSuffix}"
'' + lib.optionalString stdenv'.hostPlatform.isDarwin ''
# The darwin specific Makefile for PGXS contains a reference to the postgres
# binary. Some extensions (here: postgis), which are able to set bindir correctly
# to their own output for installation, will then fail to find "postgres" during linking.
substituteInPlace "$dev/lib/pgxs/src/Makefile.port" \
--replace-fail '-bundle_loader $(bindir)/postgres' "-bundle_loader $out/bin/postgres"
'';
postFixup = lib.optionalString stdenv'.hostPlatform.isGnu