postgresql: Respect dontDisableStatic

This commit is contained in:
Shea Levy 2018-01-11 09:19:46 -05:00
parent 1276a3b12a
commit 0578f07b91
No known key found for this signature in database
GPG key ID: 5C0BD6957D86FE27

View file

@ -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)