Skip to content

Commit

Permalink
libglvnd, ocl-icd, vulkan-loader: Remove addOpenGLRunpath where not n…
Browse files Browse the repository at this point in the history
…eeded.

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.
  • Loading branch information
ambrop72 authored and abbradar committed Aug 18, 2019
1 parent ebe711a commit 1bba961
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
7 changes: 4 additions & 3 deletions pkgs/development/libraries/libglvnd/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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; };
Expand Down
8 changes: 1 addition & 7 deletions pkgs/development/libraries/ocl-icd/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,14 @@ stdenv.mkDerivation rec {
sha256 = "0f14gpa13sdm0kzqv5yycp4pschbmi6n5fj7wl4ilspzsrqcgqr2";
};

nativeBuildInputs = [ ruby addOpenGLRunpath ];
nativeBuildInputs = [ ruby ];

buildInputs = [ opencl-headers ];

postPatch = ''
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/;
Expand Down
8 changes: 1 addition & 7 deletions pkgs/development/libraries/vulkan-loader/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
sha256 = "0zhrwj1gi90x2w8gaaaw5h4b969a8gfy244kn0drrplhhb1nqz3b";
};

nativeBuildInputs = [ pkgconfig addOpenGLRunpath ];
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ cmake python3 xlibsWrapper libxcb libXrandr libXext wayland ];
enableParallelBuilding = true;

Expand All @@ -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;
Expand Down

0 comments on commit 1bba961

Please sign in to comment.