postgresql: remove redundant static libraries

This commit is contained in:
Nikolay Amiantov 2017-02-11 02:40:13 +03:00
parent 9a2b23427f
commit 5e074f10e1

View file

@ -56,6 +56,14 @@ 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
'';
postFixup = lib.optionalString (!stdenv.isDarwin)