Wolfgang Walther 6db5dcc013
postgresql.pg_config: add check to confirm output is correct
This is only tested on native builds against the output of the original
pg_config, which should be enough.
2025-03-23 20:40:37 +01:00

29 lines
554 B
Nix

{
diffutils,
lib,
replaceVarsWith,
runtimeShell,
stdenv,
# PostgreSQL package
finalPackage,
}:
replaceVarsWith {
name = "pg_config";
src = ./pg_config.sh;
dir = "bin";
isExecutable = true;
replacements = {
inherit runtimeShell;
postgresql-dev = lib.getDev finalPackage;
};
nativeCheckInputs = [
diffutils
];
postCheck = ''
if [ -e ${lib.getDev finalPackage}/nix-support/pg_config.expected ]; then
diff ${lib.getDev finalPackage}/nix-support/pg_config.expected <($out/bin/pg_config)
fi
'';
}