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.

+17 -1
+7 -1
pkgs/servers/sql/postgresql/generic.nix
··· 366 367 postPatch = '' 368 substituteInPlace "src/Makefile.global.in" --subst-var out 369 cat ${./pg_config.env.mk} >> src/common/Makefile 370 ''; 371 ··· 373 '' 374 moveToOutput "bin/ecpg" "$dev" 375 moveToOutput "lib/pgxs" "$dev" 376 - 377 rm "$out/bin/pg_config" 378 make -C src/common pg_config.env 379 install -D src/common/pg_config.env "$dev/nix-support/pg_config.env"
··· 366 367 postPatch = '' 368 substituteInPlace "src/Makefile.global.in" --subst-var out 369 + substituteInPlace "src/common/config_info.c" --subst-var dev 370 cat ${./pg_config.env.mk} >> src/common/Makefile 371 ''; 372 ··· 374 '' 375 moveToOutput "bin/ecpg" "$dev" 376 moveToOutput "lib/pgxs" "$dev" 377 + '' 378 + + lib.optionalString (stdenv'.buildPlatform.canExecute stdenv'.hostPlatform) '' 379 + mkdir -p "$dev/nix-support" 380 + "$out/bin/pg_config" > "$dev/nix-support/pg_config.expected" 381 + '' 382 + + '' 383 rm "$out/bin/pg_config" 384 make -C src/common pg_config.env 385 install -D src/common/pg_config.env "$dev/nix-support/pg_config.env"
+10
pkgs/servers/sql/postgresql/pg_config.nix
··· 1 { 2 lib, 3 replaceVarsWith, 4 runtimeShell, 5 # PostgreSQL package 6 finalPackage, 7 }: ··· 15 inherit runtimeShell; 16 postgresql-dev = lib.getDev finalPackage; 17 }; 18 }
··· 1 { 2 + diffutils, 3 lib, 4 replaceVarsWith, 5 runtimeShell, 6 + stdenv, 7 # PostgreSQL package 8 finalPackage, 9 }: ··· 17 inherit runtimeShell; 18 postgresql-dev = lib.getDev finalPackage; 19 }; 20 + nativeCheckInputs = [ 21 + diffutils 22 + ]; 23 + postCheck = '' 24 + if [ -e ${lib.getDev finalPackage}/nix-support/pg_config.expected ]; then 25 + diff ${lib.getDev finalPackage}/nix-support/pg_config.expected <($out/bin/pg_config) 26 + fi 27 + ''; 28 }