nix: Move postgrest-check-static inside derivation of static package
This will make the static build fail if we're not producing a static binary.
This commit is contained in:
committed by
Wolfgang Walther
parent
411cf430ad
commit
c43696c9a6
+15
-3
@@ -46,9 +46,21 @@ let
|
||||
});
|
||||
});
|
||||
|
||||
makeExecutableStatic = drv:
|
||||
lib.justStaticExecutables
|
||||
(lib.appendConfigureFlag drv "--enable-executable-static");
|
||||
makeExecutableStatic = drv: pkgs.lib.pipe drv [
|
||||
(lib.compose.appendConfigureFlags [ "--enable-executable-static" ])
|
||||
lib.compose.justStaticExecutables
|
||||
(lib.compose.overrideCabal (drv: {
|
||||
postInstall = ''
|
||||
exe="$out/bin/postgrest"
|
||||
if ! (file "$exe" | grep 'statically linked') then
|
||||
echo "not a static executable, ldd output:"
|
||||
ldd "$exe"
|
||||
exit 1
|
||||
fi
|
||||
"$exe" --help
|
||||
'';
|
||||
}))
|
||||
];
|
||||
|
||||
in
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user