diff options
author | Vladimír Čunát <vcunat@gmail.com> | 2015-02-21 16:05:09 +0100 |
---|---|---|
committer | Vladimír Čunát <vcunat@gmail.com> | 2015-02-21 16:07:53 +0100 |
commit | 77986803a63a95505658e942d5e59d78279f1818 (patch) | |
tree | f01a163e453f17f080ba480b8821d0b0288b330e /pkgs/os-specific/linux/nvidia-x11 | |
parent | 18ec13d9d2c9c10f9fc9370cb384d5750f8ccf8b (diff) | |
download | nixlib-77986803a63a95505658e942d5e59d78279f1818.tar nixlib-77986803a63a95505658e942d5e59d78279f1818.tar.gz nixlib-77986803a63a95505658e942d5e59d78279f1818.tar.bz2 nixlib-77986803a63a95505658e942d5e59d78279f1818.tar.lz nixlib-77986803a63a95505658e942d5e59d78279f1818.tar.xz nixlib-77986803a63a95505658e942d5e59d78279f1818.tar.zst nixlib-77986803a63a95505658e942d5e59d78279f1818.zip |
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.
Diffstat (limited to 'pkgs/os-specific/linux/nvidia-x11')
-rwxr-xr-x | pkgs/os-specific/linux/nvidia-x11/builder.sh | 55 | ||||
-rw-r--r-- | pkgs/os-specific/linux/nvidia-x11/default.nix | 7 |
2 files changed, 34 insertions, 28 deletions
diff --git a/pkgs/os-specific/linux/nvidia-x11/builder.sh b/pkgs/os-specific/linux/nvidia-x11/builder.sh index 5d6647d1ee08..314b1082dfc2 100755 --- a/pkgs/os-specific/linux/nvidia-x11/builder.sh +++ b/pkgs/os-specific/linux/nvidia-x11/builder.sh @@ -29,6 +29,29 @@ buildPhase() { installPhase() { + # Install libGL and friends. + mkdir -p "$out/lib/vendors" + cp -p nvidia.icd $out/lib/vendors/ + + cp -prd *.so.* tls "$out/lib/" + rm "$out"/lib/lib{glx,nvidia-wfb}.so.* # handled separately + + for libname in `find "$out/lib/" -name '*.so.*'` + do + # I'm lazy to differentiate needed libs per-library, as the closure is the same. + # Unfortunately --shrink-rpath would strip too much. + patchelf --set-rpath "$out/lib:$allLibPath" "$libname" + + libname_short=`echo -n "$libname" | sed 's/so\..*/so/'` + ln -srnf "$libname" "$libname_short" + ln -srnf "$libname" "$libname_short.1" + done + + #patchelf --set-rpath $out/lib:$glPath $out/lib/libGL.so.*.* + #patchelf --set-rpath $out/lib:$glPath $out/lib/libvdpau_nvidia.so.*.* + #patchelf --set-rpath $cudaPath $out/lib/libcuda.so.*.* + #patchelf --set-rpath $openclPath $out/lib/libnvidia-opencl.so.*.* + if test -z "$libsOnly"; then # Install the kernel module. @@ -52,9 +75,11 @@ installPhase() { for i in nvidia-settings nvidia-smi; do cp $i $out/bin/$i patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ - --set-rpath $out/lib:$programPath:$glPath $out/bin/$i + --set-rpath $out/lib:$glPath $out/bin/$i done + patchelf --set-rpath $glPath:$gtk3Path $out/lib/libnvidia-gtk3.so.*.* + # Header files etc. mkdir -p $out/include/nvidia cp -p *.h $out/include/nvidia @@ -76,31 +101,11 @@ installPhase() { # Test a bit. $out/bin/nvidia-settings --version + else + rm $out/lib/libnvidia-gtk3.* fi - - - # Install libGL and friends. - mkdir -p "$out/lib/vendors" - cp -p nvidia.icd $out/lib/vendors/ - - cp -prd *.so.* tls "$out/lib/" - rm "$out"/lib/lib{glx,nvidia-wfb}.so.* # handled separately - - for libname in `find "$out/lib/" -name '*.so.*'` - do - # I'm lazy to differentiate needed libs per-library, as the closure is the same. - # Unfortunately --shrink-rpath would strip too much. - patchelf --set-rpath "$out/lib:$allLibPath" "$libname" - - libname_short=`echo -n "$libname" | sed 's/so\..*/so/'` - ln -srnf "$libname" "$libname_short" - ln -srnf "$libname" "$libname_short.1" - done - - #patchelf --set-rpath $out/lib:$glPath $out/lib/libGL.so.*.* - #patchelf --set-rpath $out/lib:$glPath $out/lib/libvdpau_nvidia.so.*.* - #patchelf --set-rpath $cudaPath $out/lib/libcuda.so.*.* - #patchelf --set-rpath $openclPath $out/lib/libnvidia-opencl.so.*.* + # for simplicity and dependency reduction, don't support the gtk2 interface + rm $out/lib/libnvidia-gtk2.* } diff --git a/pkgs/os-specific/linux/nvidia-x11/default.nix b/pkgs/os-specific/linux/nvidia-x11/default.nix index f8b6327a6545..5dd8eb5450cf 100644 --- a/pkgs/os-specific/linux/nvidia-x11/default.nix +++ b/pkgs/os-specific/linux/nvidia-x11/default.nix @@ -1,5 +1,5 @@ { stdenv, fetchurl, kernel ? null, xlibs, zlib, perl -, gtk, atk, pango, glib, gdk_pixbuf +, gtk3, atk, pango, glib, gdk_pixbuf, cairo , # Whether to build the libraries only (i.e. not the kernel module or # nvidia-settings). Used to support 32-bit binaries on 64-bit # Linux. @@ -46,8 +46,9 @@ stdenv.mkDerivation { openclPath = makeLibraryPath [zlib]; allLibPath = makeLibraryPath [xlibs.libXext xlibs.libX11 xlibs.libXrandr zlib stdenv.cc.cc]; - programPath = optionalString (!libsOnly) (makeLibraryPath - [ gtk atk pango glib gdk_pixbuf xlibs.libXv ] ); + # we don't support the gtk2 version + gtk3Path = optionalString (!libsOnly) (makeLibraryPath + [ gtk3 atk pango glib gdk_pixbuf cairo ] ); buildInputs = [ perl ]; |