fortify: switch to static linking
All checks were successful
Build / Create distribution (push) Successful in 1m43s
Test / Run NixOS test (push) Successful in 4m32s

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-01-16 17:32:52 +09:00
parent 124743ffd3
commit b60c01f440
10 changed files with 196 additions and 166 deletions

View File

@@ -1,15 +1,11 @@
{
lib,
buildGoModule,
makeBinaryWrapper,
xdg-dbus-proxy,
bubblewrap,
pkgsStatic,
pkg-config,
acl,
wayland,
wayland-scanner,
wayland-protocols,
xorg,
}:
buildGoModule rec {
@@ -27,19 +23,13 @@ buildGoModule rec {
lib.attrsets.foldlAttrs
(
ldflags: name: value:
ldflags
++ [
"-X"
"git.gensokyo.uk/security/fortify/internal.${name}=${value}"
]
ldflags ++ [ "-X git.gensokyo.uk/security/fortify/internal.${name}=${value}" ]
)
[
"-s"
"-w"
"-X"
"main.Fmain=${placeholder "out"}/libexec/fortify"
"-X"
"main.Fshim=${placeholder "out"}/libexec/fshim"
"-s -w"
"-extldflags '-static'"
"-X main.Fmain=${placeholder "out"}/libexec/fortify"
"-X main.Fshim=${placeholder "out"}/libexec/fshim"
]
{
Version = "v${version}";
@@ -51,17 +41,26 @@ buildGoModule rec {
# nix build environment does not allow acls
GO_TEST_SKIP_ACL = 1;
buildInputs = [
acl
wayland
wayland-protocols
xorg.libxcb
];
buildInputs =
# cannot find a cleaner way to do this
with pkgsStatic;
[
musl
libffi
acl
wayland
wayland-protocols
]
++ (with xorg; [
libxcb
libXau
libXdmcp
]);
nativeBuildInputs = [
pkg-config
wayland-scanner
makeBinaryWrapper
pkgsStatic.makeBinaryWrapper
];
preConfigure = ''