From 122a628deebf2b7a8e9ce89b3cbb84a3c287fd6d Mon Sep 17 00:00:00 2001 From: Sapphire Date: Sun, 9 Aug 2026 21:41:24 -0500 Subject: [PATCH] wayvr: patch uidev rpath so dlopen'd dependencies are found (cherry picked from commit 01dc282204efbfb4ba7c53aacada0576a183b534) --- pkgs/by-name/wa/wayvr/package.nix | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/pkgs/by-name/wa/wayvr/package.nix b/pkgs/by-name/wa/wayvr/package.nix index 4264bf2cd5aa..2e8abe1213b1 100644 --- a/pkgs/by-name/wa/wayvr/package.nix +++ b/pkgs/by-name/wa/wayvr/package.nix @@ -1,14 +1,17 @@ { alsa-lib, + autoPatchelfHook, dav1d, dbus, fetchFromGitHub, lib, libinput, libx11, + libxcursor, libxext, libxrandr, libxcb, + libxi, libxkbcommon, nix-update-script, openssl, @@ -23,6 +26,8 @@ shaderc, stdenv, testers, + vulkan-loader, + wayland, wayvr, xwayland-satellite, withOpenVR ? !stdenv.hostPlatform.isAarch64, @@ -49,6 +54,7 @@ rustPlatform.buildRustPackage (finalAttrs: { nativeBuildInputs = [ pkg-config rustPlatform.bindgenHook + autoPatchelfHook ]; buildInputs = [ @@ -56,6 +62,7 @@ rustPlatform.buildRustPackage (finalAttrs: { dav1d dbus libinput + # X dependencies are dlopen'd at runtime by uidev libx11 libxext libxrandr @@ -64,6 +71,12 @@ rustPlatform.buildRustPackage (finalAttrs: { openssl openxr-loader pipewire + + # only dlopen'd at runtime by uidev + libxcursor + libxi + wayland + vulkan-loader ] ++ lib.optionals withOpenVR [ openvr ]; @@ -94,6 +107,20 @@ rustPlatform.buildRustPackage (finalAttrs: { rm $out/bin/prost_build ''; + preFixup = '' + patchelf \ + --add-needed libwayland-client.so.0 \ + --add-needed libwayland-cursor.so.0 \ + --add-needed libwayland-egl.so.1 \ + --add-needed libX11.so.6 \ + --add-needed libxcb.so.1 \ + --add-needed libXcursor.so.1 \ + --add-needed libXi.so.6 \ + --add-needed libvulkan.so.1 \ + --add-needed libxkbcommon.so.0 \ + $out/bin/uidev + ''; + passthru = { tests.testVersion = testers.testVersion { package = wayvr; };