From 1bba961e2a1b143faa5589047f07df559178d4a8 Mon Sep 17 00:00:00 2001 From: Ambroz Bizjak Date: Sat, 8 Jun 2019 20:56:13 +0200 Subject: [PATCH] libglvnd, ocl-icd, vulkan-loader: Remove addOpenGLRunpath where not needed. For APIs that use driver config files, the config files should point to libraries using absolute paths, so `RUNPATH` should be unnecessary. It is still needed for `libGLX` because that does not use config files but the dispatch library receives just a vendor name from the X server. --- pkgs/development/libraries/libglvnd/default.nix | 7 ++++--- pkgs/development/libraries/ocl-icd/default.nix | 8 +------- pkgs/development/libraries/vulkan-loader/default.nix | 8 +------- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/pkgs/development/libraries/libglvnd/default.nix b/pkgs/development/libraries/libglvnd/default.nix index ed6139d48f6..2b64d5b7220 100644 --- a/pkgs/development/libraries/libglvnd/default.nix +++ b/pkgs/development/libraries/libglvnd/default.nix @@ -43,10 +43,11 @@ stdenv.mkDerivation rec { }); outputs = [ "out" "dev" ]; - # Set RUNPATH so that driver libraries in /run/opengl-driver(-32)/lib can be found. - # See the explanation in addOpenGLRunpath. + # Set RUNPATH so that libGLX can find driver libraries in /run/opengl-driver(-32)/lib. + # Note that libEGL does not need it because it uses driver config files which should + # contain absolute paths to libraries. postFixup = '' - addOpenGLRunpath $out/lib/libGLX.so $out/lib/libEGL.so + addOpenGLRunpath $out/lib/libGLX.so ''; passthru = { inherit (addOpenGLRunpath) driverLink; }; diff --git a/pkgs/development/libraries/ocl-icd/default.nix b/pkgs/development/libraries/ocl-icd/default.nix index 6cab843a22b..84205253554 100644 --- a/pkgs/development/libraries/ocl-icd/default.nix +++ b/pkgs/development/libraries/ocl-icd/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { sha256 = "0f14gpa13sdm0kzqv5yycp4pschbmi6n5fj7wl4ilspzsrqcgqr2"; }; - nativeBuildInputs = [ ruby addOpenGLRunpath ]; + nativeBuildInputs = [ ruby ]; buildInputs = [ opencl-headers ]; @@ -17,12 +17,6 @@ stdenv.mkDerivation rec { sed -i 's,"/etc/OpenCL/vendors","${addOpenGLRunpath.driverLink}/etc/OpenCL/vendors",g' ocl_icd_loader.c ''; - # Set RUNPATH so that driver libraries in /run/opengl-driver(-32)/lib can be found. - # See the explanation in addOpenGLRunpath. - postFixup = '' - addOpenGLRunpath $out/lib/libOpenCL.so - ''; - meta = with stdenv.lib; { description = "OpenCL ICD Loader for ${opencl-headers.name}"; homepage = https://forge.imag.fr/projects/ocl-icd/; diff --git a/pkgs/development/libraries/vulkan-loader/default.nix b/pkgs/development/libraries/vulkan-loader/default.nix index d8b94c40c7e..95d420627c7 100644 --- a/pkgs/development/libraries/vulkan-loader/default.nix +++ b/pkgs/development/libraries/vulkan-loader/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { sha256 = "0zhrwj1gi90x2w8gaaaw5h4b969a8gfy244kn0drrplhhb1nqz3b"; }; - nativeBuildInputs = [ pkgconfig addOpenGLRunpath ]; + nativeBuildInputs = [ pkgconfig ]; buildInputs = [ cmake python3 xlibsWrapper libxcb libXrandr libXext wayland ]; enableParallelBuilding = true; @@ -30,12 +30,6 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" ]; - # Set RUNPATH so that driver libraries in /run/opengl-driver(-32)/lib can be found. - # See the explanation in addOpenGLRunpath. - postFixup = '' - addOpenGLRunpath $out/lib/libvulkan.so - ''; - meta = with stdenv.lib; { description = "LunarG Vulkan loader"; homepage = https://www.lunarg.com;