niri: force linking with linker args instead of patchelf

We don't need to be patching an already built binary here
This commit is contained in:
seth
2024-10-08 01:35:08 -04:00
parent d9aecbc3e0
commit f1cf61e2bf
+15 -7
View File
@@ -1,6 +1,5 @@
{
lib,
autoPatchelfHook,
clang,
dbus,
fetchFromGitHub,
@@ -41,7 +40,6 @@ rustPlatform.buildRustPackage rec {
strictDeps = true;
nativeBuildInputs = [
autoPatchelfHook
clang
pkg-config
rustPlatform.bindgenHook
@@ -50,6 +48,7 @@ rustPlatform.buildRustPackage rec {
buildInputs = [
dbus
libdisplay-info
libglvnd # For libEGL
libinput
libxkbcommon
mesa # For libgbm
@@ -57,11 +56,7 @@ rustPlatform.buildRustPackage rec {
pipewire
seatd
systemd # Also includes libudev
];
runtimeDependencies = [
wayland
libglvnd # For libEGL
wayland # For libwayland-client
];
passthru.providedSessions = [ "niri" ];
@@ -79,6 +74,19 @@ rustPlatform.buildRustPackage rec {
install -Dm0644 resources/niri{-shutdown.target,.service} -t $out/share/systemd/user
'';
env = {
# Force linking with libEGL and libwayland-client
# so they can be discovered by `dlopen()`
RUSTFLAGS = toString (
map (arg: "-C link-arg=" + arg) [
"-Wl,--push-state,--no-as-needed"
"-lEGL"
"-lwayland-client"
"-Wl,--pop-state"
]
);
};
passthru.updateScript = nix-update-script { };
meta = with lib; {