libglvnd, ocl-icd, vulkan-loader: Add /run/opengl-driver(-32) to RUNPATH. (#60985)

libglvnd, ocl-icd, vulkan-loader: Add /run/opengl-driver(-32) to RUNPATH.
This commit is contained in:
Florian Klink
2019-05-22 23:36:01 +02:00
committed by GitHub
10 changed files with 110 additions and 19 deletions

View File

@@ -1,6 +1,7 @@
{ lib, stdenv, makeWrapper, fetchurl, requireFile, perl, ncurses5, expat, python27, zlib
, gcc48, gcc49, gcc5, gcc6, gcc7
, xorg, gtk2, gdk_pixbuf, glib, fontconfig, freetype, unixODBC, alsaLib, glibc
, addOpenGLRunpath
}:
let
@@ -39,7 +40,7 @@ let
outputs = [ "out" "lib" "doc" ];
nativeBuildInputs = [ perl makeWrapper ];
nativeBuildInputs = [ perl makeWrapper addOpenGLRunpath ];
buildInputs = [ gdk_pixbuf ]; # To get $GDK_PIXBUF_MODULE_FILE via setup-hook
runtimeDependencies = [
ncurses5 expat python zlib glibc
@@ -143,10 +144,19 @@ let
else
rpath2=$rpath:$lib/lib:$out/jre/lib/amd64/jli:$out/lib:$out/lib64:$out/nvvm/lib:$out/nvvm/lib64
fi
patchelf --set-rpath $rpath2 --force-rpath $i
patchelf --set-rpath "$rpath2" --force-rpath $i
done < <(find $out $lib $doc -type f -print0)
'';
# Set RPATH so that libcuda and other libraries in
# /run/opengl-driver(-32)/lib can be found. See the explanation in
# addOpenGLRunpath. Don't try to figure out which libraries really need
# it, just patch all (but not the stubs libraries). Note that
# --force-rpath prevents changing RPATH (set above) to RUNPATH.
postFixup = ''
addOpenGLRunpath --force-rpath {$out,$lib}/lib/lib*.so
'';
# cuda-gdb doesn't run correctly when not using sandboxing, so
# temporarily disabling the install check. This should be set to true
# when we figure out how to get `cuda-gdb --version` to run correctly