ukmm: fix running on x11

Also switches from using LD_LIBRARY_PATH to RUSTFLAGS to include
required runtime libraries.
This commit is contained in:
Kira Bruneau 2024-07-13 11:56:37 -04:00
parent c0a7daff96
commit f88960c7b6

View File

@ -5,6 +5,7 @@
, pkg-config
, wrapGAppsHook3
, libglvnd
, libxkbcommon
, nix-update-script
}:
@ -35,9 +36,21 @@ rustPlatform.buildRustPackage rec {
wrapGAppsHook3
];
preFixup = ''
gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libglvnd ]})
'';
buildInputs = [
libglvnd
libxkbcommon
];
# Force linking to libEGL, which is always dlopen()ed, and to
# libwayland-client & libxkbcommon, which is dlopen()ed based on the
# winit backend.
RUSTFLAGS = map (a: "-C link-arg=${a}") [
"-Wl,--push-state,--no-as-needed"
"-lEGL"
"-lwayland-client"
"-lxkbcommon"
"-Wl,--pop-state"
];
cargoTestFlags = [
"--all"