@@ -29,6 +29,29 @@ buildPhase() {
2929
3030
3131installPhase() {
32+ # Install libGL and friends.
33+ mkdir -p "$out/lib/vendors"
34+ cp -p nvidia.icd $out/lib/vendors/
35+
36+ cp -prd *.so.* tls "$out/lib/"
37+ rm "$out"/lib/lib{glx,nvidia-wfb}.so.* # handled separately
38+
39+ for libname in `find "$out/lib/" -name '*.so.*'`
40+ do
41+ # I'm lazy to differentiate needed libs per-library, as the closure is the same.
42+ # Unfortunately --shrink-rpath would strip too much.
43+ patchelf --set-rpath "$out/lib:$allLibPath" "$libname"
44+
45+ libname_short=`echo -n "$libname" | sed 's/so\..*/so/'`
46+ ln -srnf "$libname" "$libname_short"
47+ ln -srnf "$libname" "$libname_short.1"
48+ done
49+
50+ #patchelf --set-rpath $out/lib:$glPath $out/lib/libGL.so.*.*
51+ #patchelf --set-rpath $out/lib:$glPath $out/lib/libvdpau_nvidia.so.*.*
52+ #patchelf --set-rpath $cudaPath $out/lib/libcuda.so.*.*
53+ #patchelf --set-rpath $openclPath $out/lib/libnvidia-opencl.so.*.*
54+
3255
3356 if test -z "$libsOnly"; then
3457 # Install the kernel module.
@@ -52,9 +75,11 @@ installPhase() {
5275 for i in nvidia-settings nvidia-smi; do
5376 cp $i $out/bin/$i
5477 patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
55− --set-rpath $out/lib:$programPath:$glPath $out/bin/$i
78+ --set-rpath $out/lib:$glPath $out/bin/$i
5679 done
5780
81+ patchelf --set-rpath $glPath:$gtk3Path $out/lib/libnvidia-gtk3.so.*.*
82+
5883 # Header files etc.
5984 mkdir -p $out/include/nvidia
6085 cp -p *.h $out/include/nvidia
@@ -76,31 +101,11 @@ installPhase() {
76101
77102 # Test a bit.
78103 $out/bin/nvidia-settings --version
104+ else
105+ rm $out/lib/libnvidia-gtk3.*
79106 fi
80−
81−
82− # Install libGL and friends.
83− mkdir -p "$out/lib/vendors"
84− cp -p nvidia.icd $out/lib/vendors/
85−
86− cp -prd *.so.* tls "$out/lib/"
87− rm "$out"/lib/lib{glx,nvidia-wfb}.so.* # handled separately
88−
89− for libname in `find "$out/lib/" -name '*.so.*'`
90− do
91− # I'm lazy to differentiate needed libs per-library, as the closure is the same.
92− # Unfortunately --shrink-rpath would strip too much.
93− patchelf --set-rpath "$out/lib:$allLibPath" "$libname"
94−
95− libname_short=`echo -n "$libname" | sed 's/so\..*/so/'`
96− ln -srnf "$libname" "$libname_short"
97− ln -srnf "$libname" "$libname_short.1"
98− done
99−
100− #patchelf --set-rpath $out/lib:$glPath $out/lib/libGL.so.*.*
101− #patchelf --set-rpath $out/lib:$glPath $out/lib/libvdpau_nvidia.so.*.*
102− #patchelf --set-rpath $cudaPath $out/lib/libcuda.so.*.*
103− #patchelf --set-rpath $openclPath $out/lib/libnvidia-opencl.so.*.*
107+ # for simplicity and dependency reduction, don't support the gtk2 interface
108+ rm $out/lib/libnvidia-gtk2.*
104109}
105110
106111