diff options
author | Shea Levy <shea@shealevy.com> | 2018-01-11 09:19:46 -0500 |
---|---|---|
committer | Shea Levy <shea@shealevy.com> | 2018-01-11 09:19:46 -0500 |
commit | 0578f07b91f8761baec98a7920928da062c1f4a7 (patch) | |
tree | 04a68de6d4ebe4c1bbc1e1a7cc59b42ed53d88c6 | |
parent | 1276a3b12aa0fa3ad5e52cce2dafe75ac5599a92 (diff) | |
download | nixlib-0578f07b91f8761baec98a7920928da062c1f4a7.tar nixlib-0578f07b91f8761baec98a7920928da062c1f4a7.tar.gz nixlib-0578f07b91f8761baec98a7920928da062c1f4a7.tar.bz2 nixlib-0578f07b91f8761baec98a7920928da062c1f4a7.tar.lz nixlib-0578f07b91f8761baec98a7920928da062c1f4a7.tar.xz nixlib-0578f07b91f8761baec98a7920928da062c1f4a7.tar.zst nixlib-0578f07b91f8761baec98a7920928da062c1f4a7.zip |
postgresql: Respect dontDisableStatic
-rw-r--r-- | pkgs/servers/sql/postgresql/default.nix | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/pkgs/servers/sql/postgresql/default.nix b/pkgs/servers/sql/postgresql/default.nix index cffdbb969280..1a721e90a8df 100644 --- a/pkgs/servers/sql/postgresql/default.nix +++ b/pkgs/servers/sql/postgresql/default.nix @@ -58,13 +58,15 @@ let # Prevent a retained dependency on gcc-wrapper. substituteInPlace "$out/lib/pgxs/src/Makefile.global" --replace ${stdenv.cc}/bin/ld ld - # Remove static libraries in case dynamic are available. - for i in $out/lib/*.a; do - name="$(basename "$i")" - if [ -e "$lib/lib/''${name%.a}.so" ] || [ -e "''${i%.a}.so" ]; then - rm "$i" - fi - done + if [ -z "''${dontDisableStatic:-}" ]; then + # Remove static libraries in case dynamic are available. + for i in $out/lib/*.a; do + name="$(basename "$i")" + if [ -e "$lib/lib/''${name%.a}.so" ] || [ -e "''${i%.a}.so" ]; then + rm "$i" + fi + done + fi ''; postFixup = lib.optionalString (!stdenv.isDarwin) |