git.iko.soy/typeable/nixpkgs
on master help sign in
nvidia_x11: fix nvidia-settings after the major update

The GUI would no longer find libs it needed. Now it's gtk3 by default, so we don't support gtk2 version for simplicity. ldd finds no missing libs after this commit.

commit77986803a63a95505658e942d5e59d78279f1818 authorVladimír Čunát <vcunat@gmail.com> dateSat 21 Feb 2015, 16:05 (12 years ago) parent18ec13d
2 files changed+34−28
pkgs/os-specific/linux/nvidia-x11/builder.sh+30−25 pkgs/os-specific/linux/nvidia-x11/default.nix+4−3
pkgs/os-specific/linux/nvidia-x11/builder.sh+30−25
@@ -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
pkgs/os-specific/linux/nvidia-x11/default.nix+4−3
@@ -1,5 +1,5 @@
11{ stdenv, fetchurl, kernel ? null, xlibs, zlib, perl
2−, gtk, atk, pango, glib, gdk_pixbuf
2+, gtk3, atk, pango, glib, gdk_pixbuf, cairo
33, # Whether to build the libraries only (i.e. not the kernel module or
44 # nvidia-settings). Used to support 32-bit binaries on 64-bit
55 # Linux.
@@ -46,8 +46,9 @@ stdenv.mkDerivation {
4646 openclPath = makeLibraryPath [zlib];
4747 allLibPath = makeLibraryPath [xlibs.libXext xlibs.libX11 xlibs.libXrandr zlib stdenv.cc.cc];
4848
49− programPath = optionalString (!libsOnly) (makeLibraryPath
50− [ gtk atk pango glib gdk_pixbuf xlibs.libXv ] );
49+ # we don't support the gtk2 version
50+ gtk3Path = optionalString (!libsOnly) (makeLibraryPath
51+ [ gtk3 atk pango glib gdk_pixbuf cairo ] );
5152
5253 buildInputs = [ perl ];
5354