From fe077c69e140fc4ea387423eb32a89b48dc98c0a Mon Sep 17 00:00:00 2001 From: Marco Allegretti Date: Thu, 12 Mar 2026 22:04:43 +0100 Subject: [PATCH] build(nix): fix compositor link: append gbm/libinput paths to NIX_LDFLAGS via preBuild hook --- infra/nixos/weft-packages.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/infra/nixos/weft-packages.nix b/infra/nixos/weft-packages.nix index 315b3e9..8f84fe3 100644 --- a/infra/nixos/weft-packages.nix +++ b/infra/nixos/weft-packages.nix @@ -22,8 +22,8 @@ let nativeBuildInputs = with pkgs; [ pkg-config ]; }; - mkWeftPkg = { pname, extraBuildInputs ? [], extraNativeBuildInputs ? [], cargoFlags ? [], extraEnv ? {} }: rustPlatform.buildRustPackage (commonArgs // { - inherit pname; + mkWeftPkg = { pname, extraBuildInputs ? [], extraNativeBuildInputs ? [], cargoFlags ? [], extraEnv ? {}, preBuild ? "" }: rustPlatform.buildRustPackage (commonArgs // { + inherit pname preBuild; cargoBuildFlags = [ "--package" pname ] ++ cargoFlags; cargoTestFlags = [ "--package" pname ]; buildInputs = extraBuildInputs; @@ -39,9 +39,9 @@ in { libdrm mesa wayland libxkbcommon seatd udev dbus libGL libdisplay-info libinput ]; extraNativeBuildInputs = with pkgs; [ wayland-scanner ]; - extraEnv = { - NIX_LDFLAGS = "-L${pkgs.mesa}/lib -L${pkgs.libinput}/lib"; - }; + preBuild = '' + export NIX_LDFLAGS="$NIX_LDFLAGS $(pkg-config --libs-only-L gbm 2>/dev/null || echo) $(pkg-config --libs-only-L libinput 2>/dev/null || echo)" + ''; }; weft-servo-shell = mkWeftPkg {