libpq: support dontDisableStatic (#519070)

This commit is contained in:
Wolfgang Walther
2026-05-13 21:16:43 +00:00
committed by GitHub
+7 -1
View File
@@ -163,7 +163,13 @@ stdenv.mkDerivation (finalAttrs: {
'';
# PostgreSQL always builds both shared and static libs, so we delete those we don't want.
postInstall = if stdenv.hostPlatform.isStatic then "touch $out/empty" else "rm -rfv $dev/lib/*.a";
# Honour the `dontDisableStatic` convention (see `generic.nix`) so consumers can keep
# the static archives in `$dev/lib` alongside the shared libraries in `$out/lib`.
postInstall =
if stdenv.hostPlatform.isStatic then
"touch $out/empty"
else
lib.optionalString (!(finalAttrs.dontDisableStatic or false)) "rm -rfv $dev/lib/*.a";
doCheck = false;