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.
This commit is contained in:
parent
5449a0ea74
commit
6db5dcc013
@ -366,6 +366,7 @@ let
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace "src/Makefile.global.in" --subst-var out
|
||||
substituteInPlace "src/common/config_info.c" --subst-var dev
|
||||
cat ${./pg_config.env.mk} >> src/common/Makefile
|
||||
'';
|
||||
|
||||
@ -373,7 +374,12 @@ let
|
||||
''
|
||||
moveToOutput "bin/ecpg" "$dev"
|
||||
moveToOutput "lib/pgxs" "$dev"
|
||||
|
||||
''
|
||||
+ lib.optionalString (stdenv'.buildPlatform.canExecute stdenv'.hostPlatform) ''
|
||||
mkdir -p "$dev/nix-support"
|
||||
"$out/bin/pg_config" > "$dev/nix-support/pg_config.expected"
|
||||
''
|
||||
+ ''
|
||||
rm "$out/bin/pg_config"
|
||||
make -C src/common pg_config.env
|
||||
install -D src/common/pg_config.env "$dev/nix-support/pg_config.env"
|
||||
|
@ -1,7 +1,9 @@
|
||||
{
|
||||
diffutils,
|
||||
lib,
|
||||
replaceVarsWith,
|
||||
runtimeShell,
|
||||
stdenv,
|
||||
# PostgreSQL package
|
||||
finalPackage,
|
||||
}:
|
||||
@ -15,4 +17,12 @@ replaceVarsWith {
|
||||
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
|
||||
'';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user