nix: wrap program from libexec
test / test (push) Successful in 24s Details

This avoids renaming the fortify binary.

Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
This commit is contained in:
Ophestra Umiker 2024-11-18 12:58:47 +09:00
parent 8f3f0c7bbf
commit 748a0ae2c8
Signed by: cat
SSH Key Fingerprint: SHA256:gQ67O0enBZ7UdZypgtspB2FDM1g3GVw8nX0XSdcFw8Q
1 changed files with 10 additions and 9 deletions

View File

@ -29,7 +29,7 @@ buildGoModule rec {
"-s" "-s"
"-w" "-w"
"-X" "-X"
"main.Fmain=${placeholder "out"}/bin/.fortify-wrapped" "main.Fmain=${placeholder "out"}/libexec/fortify"
"-X" "-X"
"main.Fshim=${placeholder "out"}/libexec/fshim" "main.Fshim=${placeholder "out"}/libexec/fshim"
] ]
@ -47,14 +47,15 @@ buildGoModule rec {
nativeBuildInputs = [ makeBinaryWrapper ]; nativeBuildInputs = [ makeBinaryWrapper ];
postInstall = '' postInstall = ''
wrapProgram $out/bin/${pname} --prefix PATH : ${ mkdir "$out/libexec"
lib.makeBinPath [ mv "$out"/bin/* "$out/libexec/"
bubblewrap
xdg-dbus-proxy
]
}
mkdir $out/libexec makeBinaryWrapper "$out/libexec/fortify" "$out/bin/fortify" \
(cd $out/bin && mv fsu fshim finit fuserdb ../libexec/) --inherit-argv0 --prefix PATH : ${
lib.makeBinPath [
bubblewrap
xdg-dbus-proxy
]
}
''; '';
} }