From 19be5ac0119740b050ddcfd8608691ebf65abf9e Mon Sep 17 00:00:00 2001 From: Mia Kanashi Date: Wed, 5 Apr 2023 21:57:42 +0300 Subject: [PATCH] mesa: fix zink by patching RPATH so it finds libvulkan.so Currently zink can't find libvulkan.so, so it won't work when you try to use it, you can verify that using strace, patching RPATH fixes this. closes #187791 --- pkgs/development/libraries/mesa/generic.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/libraries/mesa/generic.nix b/pkgs/development/libraries/mesa/generic.nix index b60533ca39a8..0217391fe023 100644 --- a/pkgs/development/libraries/mesa/generic.nix +++ b/pkgs/development/libraries/mesa/generic.nix @@ -322,6 +322,10 @@ self = stdenv.mkDerivation { patchelf --set-rpath "$(patchelf --print-rpath $lib):$drivers/lib" "$lib" fi done + # add RPATH here so Zink can find libvulkan.so + ${lib.optionalString haveZink '' + patchelf --add-rpath ${vulkan-loader}/lib $drivers/lib/dri/zink_dri.so + ''} ''; env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.isDarwin [ "-fno-common" ] ++ lib.optionals enableOpenCL [