From 15d2f6c28eb6ebf37eb13ab67cc63f9a76fd5a50 Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Fri, 27 Jun 2025 20:00:00 -0400 Subject: [PATCH] dwm: fix static build --- pkgs/applications/window-managers/dwm/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/applications/window-managers/dwm/default.nix b/pkgs/applications/window-managers/dwm/default.nix index 4204fb9590e0..efb5f34363ce 100644 --- a/pkgs/applications/window-managers/dwm/default.nix +++ b/pkgs/applications/window-managers/dwm/default.nix @@ -6,6 +6,7 @@ libXinerama, libXft, writeText, + pkg-config, patches ? [ ], conf ? null, # update script dependencies @@ -21,6 +22,8 @@ stdenv.mkDerivation rec { sha256 = "sha256-Ideev6ny+5MUGDbCZmy4H0eExp1k5/GyNS+blwuglyk="; }; + nativeBuildInputs = lib.optional stdenv.hostPlatform.isStatic pkg-config; + buildInputs = [ libX11 libXinerama @@ -31,6 +34,10 @@ stdenv.mkDerivation rec { sed -i "s@/usr/local@$out@" config.mk ''; + preBuild = lib.optional stdenv.hostPlatform.isStatic '' + makeFlagsArray+=(LDFLAGS="$(${stdenv.cc.targetPrefix}pkg-config --static --libs x11 xinerama xft)") + ''; + # Allow users set their own list of patches inherit patches;