diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-01-16 17:32:52 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-01-16 17:32:52 +0900 |
| commit | b60c01f4405ec3b5cc4a740fe994c3b9f39cf01f (patch) | |
| tree | 3d43cd726a26bba2336d2373a6dfe65a567a35a8 /package.nix | |
| parent | 124743ffd3da7c31ef9c562593e15d88bb19008e (diff) | |
fortify: switch to static linking
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'package.nix')
| -rw-r--r-- | package.nix | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/package.nix b/package.nix index 51e29c6f..85a3859d 100644 --- a/package.nix +++ b/package.nix @@ -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 = '' |
