git.iko.soy/typeable/nixpkgs
on master help sign in
nvidia_x11: add 343 branch as the default (close #5070)

It's just a plain copy of the 340 expressions (only hash and version changed).

commitfd9d8edc51258a59a9444f7cd32f6ec7b8a8f2a9 authorVladimír Čunát <vcunat@gmail.com> dateWed 24 Dec 2014, 00:01 (12 years ago) parentd5ab3fb
3 files changed+172−2
pkgs/os-specific/linux/nvidia-x11/builder.sh+107 pkgs/os-specific/linux/nvidia-x11/default.nix+64 pkgs/top-level/all-packages.nix+1−2
pkgs/os-specific/linux/nvidia-x11/builder.shnew file+107
@@ -0,0 +1,107 @@
1+source $stdenv/setup
2+
3+dontPatchELF=1 # must keep libXv, $out in RPATH
4+
5+
6+unpackFile() {
7+ skip=$(sed 's/^skip=//; t; d' $src)
8+ tail -n +$skip $src | xz -d | tar xvf -
9+ sourceRoot=.
10+}
11+
12+
13+buildPhase() {
14+ if test -z "$libsOnly"; then
15+ # Create the module.
16+ echo "Building linux driver against kernel: $kernel";
17+ cd kernel
18+ kernelVersion=$(cd $kernel/lib/modules && ls)
19+ sysSrc=$(echo $kernel/lib/modules/$kernelVersion/source)
20+ sysOut=$(echo $kernel/lib/modules/$kernelVersion/build)
21+ unset src # used by the nv makefile
22+ make SYSSRC=$sysSrc SYSOUT=$sysOut module
23+ cd uvm
24+ make SYSSRC=$sysSrc SYSOUT=$sysOut module
25+ cd ..
26+ cd ..
27+ fi
28+}
29+
30+
31+installPhase() {
32+
33+ if test -z "$libsOnly"; then
34+ # Install the kernel module.
35+ mkdir -p $out/lib/modules/$kernelVersion/misc
36+ cp kernel/nvidia.ko $out/lib/modules/$kernelVersion/misc
37+ cp kernel/uvm/nvidia-uvm.ko $out/lib/modules/$kernelVersion/misc
38+
39+ # Install the X driver.
40+ mkdir -p $out/lib/xorg/modules
41+ cp -p libnvidia-wfb.* $out/lib/xorg/modules/
42+ mkdir -p $out/lib/xorg/modules/drivers
43+ cp -p nvidia_drv.so $out/lib/xorg/modules/drivers
44+ mkdir -p $out/lib/xorg/modules/extensions
45+ cp -p libglx.so.* $out/lib/xorg/modules/extensions
46+
47+ #patchelf --set-rpath $out/lib $out/lib/xorg/modules/extensions/libglx.so.*.*
48+
49+ # Install the programs.
50+ mkdir -p $out/bin
51+
52+ for i in nvidia-settings nvidia-smi; do
53+ cp $i $out/bin/$i
54+ patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
55+ --set-rpath $out/lib:$programPath:$glPath $out/bin/$i
56+ done
57+
58+ # Header files etc.
59+ mkdir -p $out/include/nvidia
60+ cp -p *.h $out/include/nvidia
61+
62+ mkdir -p $out/share/man/man1
63+ cp -p *.1.gz $out/share/man/man1
64+ rm $out/share/man/man1/nvidia-xconfig.1.gz
65+
66+ mkdir -p $out/share/applications
67+ cp -p *.desktop $out/share/applications
68+
69+ mkdir -p $out/share/pixmaps
70+ cp -p nvidia-settings.png $out/share/pixmaps
71+
72+ # Patch the `nvidia-settings.desktop' file.
73+ substituteInPlace $out/share/applications/nvidia-settings.desktop \
74+ --replace '__UTILS_PATH__' $out/bin \
75+ --replace '__PIXMAP_PATH__' $out/share/pixmaps
76+
77+ # Test a bit.
78+ $out/bin/nvidia-settings --version
79+ 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.*.*
104+}
105+
106+
107+genericBuild
pkgs/os-specific/linux/nvidia-x11/default.nixnew file+64
@@ -0,0 +1,64 @@
1+{ stdenv, fetchurl, kernel ? null, xlibs, zlib, perl
2+, gtk, atk, pango, glib, gdk_pixbuf
3+, # Whether to build the libraries only (i.e. not the kernel module or
4+ # nvidia-settings). Used to support 32-bit binaries on 64-bit
5+ # Linux.
6+ libsOnly ? false
7+}:
8+
9+with stdenv.lib;
10+
11+assert (!libsOnly) -> kernel != null;
12+
13+let
14+
15+ versionNumber = "343.36";
16+ /* This branch is needed for G8x, G9x, and GT2xx GPUs, and motherboard chipsets based on them.
17+ Ongoing support for new Linux kernels and X servers, as well as fixes for critical bugs,
18+ will be included in 340.* legacy releases through the end of 2019.
19+ */
20+ inherit (stdenv.lib) makeLibraryPath;
21+in
22+
23+stdenv.mkDerivation {
24+ name = "nvidia-x11-${versionNumber}${optionalString (!libsOnly) "-${kernel.version}"}";
25+
26+ builder = ./builder.sh;
27+
28+ src =
29+ if stdenv.system == "i686-linux" then
30+ fetchurl {
31+ url = "http://us.download.nvidia.com/XFree86/Linux-x86/${versionNumber}/NVIDIA-Linux-x86-${versionNumber}.run";
32+ sha256 = "17l23dp725883xcyy1n178pcl6lj27psrgbxymc356x2pngwkhcc";
33+ }
34+ else if stdenv.system == "x86_64-linux" then
35+ fetchurl {
36+ url = "http://us.download.nvidia.com/XFree86/Linux-x86_64/${versionNumber}/NVIDIA-Linux-x86_64-${versionNumber}-no-compat32.run";
37+ sha256 = "0djvh9wmazrfvpgyiqrz81kjk2war20xyjjr2kncxyplzk28mw97";
38+ }
39+ else throw "nvidia-x11 does not support platform ${stdenv.system}";
40+
41+ inherit versionNumber libsOnly;
42+
43+ kernel = if libsOnly then null else kernel.dev;
44+
45+ dontStrip = true;
46+
47+ glPath = makeLibraryPath [xlibs.libXext xlibs.libX11 xlibs.libXrandr];
48+ cudaPath = makeLibraryPath [zlib stdenv.gcc.gcc];
49+ openclPath = makeLibraryPath [zlib];
50+ allLibPath = makeLibraryPath [xlibs.libXext xlibs.libX11 xlibs.libXrandr zlib stdenv.gcc.gcc];
51+
52+ programPath = optionalString (!libsOnly) (makeLibraryPath
53+ [ gtk atk pango glib gdk_pixbuf xlibs.libXv ] );
54+
55+ buildInputs = [ perl ];
56+
57+ meta = with stdenv.lib.meta; {
58+ homepage = http://www.nvidia.com/object/unix.html;
59+ description = "X.org driver and kernel module for NVIDIA graphics cards";
60+ license = licenses.unfreeRedistributable;
61+ platforms = platforms.linux;
62+ maintainers = [ maintainers.vcunat ];
63+ };
64+}
pkgs/top-level/all-packages.nix+1−2
@@ -8363,11 +8363,10 @@ let
83638363
83648364 nvidiabl = callPackage ../os-specific/linux/nvidiabl { };
83658365
8366− nvidia_x11 = self.nvidia_x11_legacy340;
8367−
83688366 nvidia_x11_legacy173 = callPackage ../os-specific/linux/nvidia-x11/legacy173.nix { };
83698367 nvidia_x11_legacy304 = callPackage ../os-specific/linux/nvidia-x11/legacy304.nix { };
83708368 nvidia_x11_legacy340 = callPackage ../os-specific/linux/nvidia-x11/legacy340.nix { };
8369+ nvidia_x11 = callPackage ../os-specific/linux/nvidia-x11 { };
83718370
83728371 openafsClient = callPackage ../servers/openafs-client { };
83738372