diff --git a/pkgs/servers/sql/postgresql/ext/postgis.nix b/pkgs/servers/sql/postgresql/ext/postgis.nix index 673ddf4b9eac..1611fe05600e 100644 --- a/pkgs/servers/sql/postgresql/ext/postgis.nix +++ b/pkgs/servers/sql/postgresql/ext/postgis.nix @@ -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 diff --git a/pkgs/servers/sql/postgresql/generic.nix b/pkgs/servers/sql/postgresql/generic.nix index 0d21f2742c41..79111b589938 100644 --- a/pkgs/servers/sql/postgresql/generic.nix +++ b/pkgs/servers/sql/postgresql/generic.nix @@ -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