Commit f88960c7 authored by Kira Bruneau's avatar Kira Bruneau
Browse files

ukmm: fix running on x11

Also switches from using LD_LIBRARY_PATH to RUSTFLAGS to include
required runtime libraries.
parent c0a7daff
Loading
Loading
Loading
Loading
+16 −3
Original line number Diff line number Diff line
@@ -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"