2014-01-05 02:57:21 +01:00
|
|
|
{ stdenv, fetchurl, kernel ? null, xlibs, zlib, perl
|
2012-03-14 22:57:32 +01:00
|
|
|
, gtk, atk, pango, glib, gdk_pixbuf
|
2010-05-30 23:56:56 +02:00
|
|
|
, # 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.
|
|
|
|
libsOnly ? false
|
|
|
|
}:
|
2007-05-28 16:10:46 +02:00
|
|
|
|
2010-05-30 23:56:56 +02:00
|
|
|
with stdenv.lib;
|
2007-07-12 13:52:34 +02:00
|
|
|
|
2014-02-16 09:53:15 +01:00
|
|
|
assert (!libsOnly) -> kernel != null;
|
|
|
|
|
2013-07-17 11:10:21 +02:00
|
|
|
let
|
2008-01-07 23:54:30 +01:00
|
|
|
|
2015-02-16 11:48:19 +01:00
|
|
|
versionNumber = "340.76";
|
2014-11-24 22:34:00 +01:00
|
|
|
/* This branch is needed for G8x, G9x, and GT2xx GPUs, and motherboard chipsets based on them.
|
|
|
|
Ongoing support for new Linux kernels and X servers, as well as fixes for critical bugs,
|
|
|
|
will be included in 340.* legacy releases through the end of 2019.
|
|
|
|
*/
|
2014-08-20 23:27:37 +02:00
|
|
|
inherit (stdenv.lib) makeLibraryPath;
|
2013-07-17 11:10:21 +02:00
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2014-01-05 02:57:21 +01:00
|
|
|
name = "nvidia-x11-${versionNumber}${optionalString (!libsOnly) "-${kernel.version}"}";
|
2012-09-13 16:23:34 +02:00
|
|
|
|
2014-11-24 22:34:00 +01:00
|
|
|
builder = ./builder-legacy340.sh;
|
2012-09-13 16:23:34 +02:00
|
|
|
|
2015-07-03 09:28:07 +02:00
|
|
|
patches = [ ./nvidia-340.76-kernel-4.0.patch ];
|
|
|
|
|
2008-06-12 16:04:06 +02:00
|
|
|
src =
|
|
|
|
if stdenv.system == "i686-linux" then
|
|
|
|
fetchurl {
|
2010-07-18 22:21:18 +02:00
|
|
|
url = "http://us.download.nvidia.com/XFree86/Linux-x86/${versionNumber}/NVIDIA-Linux-x86-${versionNumber}.run";
|
2015-02-16 11:48:19 +01:00
|
|
|
sha256 = "1l1nn340hc8iwlzb16gcm2xvnvkw7rf84ll89bcax70094xxjacv";
|
2008-06-12 16:04:06 +02:00
|
|
|
}
|
|
|
|
else if stdenv.system == "x86_64-linux" then
|
|
|
|
fetchurl {
|
2010-07-18 22:21:18 +02:00
|
|
|
url = "http://us.download.nvidia.com/XFree86/Linux-x86_64/${versionNumber}/NVIDIA-Linux-x86_64-${versionNumber}-no-compat32.run";
|
2015-02-16 11:48:19 +01:00
|
|
|
sha256 = "016hnsgrcm4ly0mnkcd6c1qkciy3qmbwdwy4rlwq3m6dh4ixw7jc";
|
2008-06-12 16:04:06 +02:00
|
|
|
}
|
|
|
|
else throw "nvidia-x11 does not support platform ${stdenv.system}";
|
2008-05-29 15:22:12 +02:00
|
|
|
|
2010-05-30 23:56:56 +02:00
|
|
|
inherit versionNumber libsOnly;
|
|
|
|
|
2014-01-05 02:57:21 +01:00
|
|
|
kernel = if libsOnly then null else kernel.dev;
|
2007-05-28 16:10:46 +02:00
|
|
|
|
2008-03-04 11:06:21 +01:00
|
|
|
dontStrip = true;
|
|
|
|
|
2014-08-20 23:27:37 +02:00
|
|
|
glPath = makeLibraryPath [xlibs.libXext xlibs.libX11 xlibs.libXrandr];
|
2015-01-15 05:25:26 +01:00
|
|
|
cudaPath = makeLibraryPath [zlib stdenv.cc.cc];
|
2014-08-20 23:27:37 +02:00
|
|
|
openclPath = makeLibraryPath [zlib];
|
2015-01-15 05:25:26 +01:00
|
|
|
allLibPath = makeLibraryPath [xlibs.libXext xlibs.libX11 xlibs.libXrandr zlib stdenv.cc.cc];
|
2008-06-04 11:59:33 +02:00
|
|
|
|
2014-08-20 23:27:37 +02:00
|
|
|
programPath = optionalString (!libsOnly) (makeLibraryPath
|
2012-03-14 22:57:32 +01:00
|
|
|
[ gtk atk pango glib gdk_pixbuf xlibs.libXv ] );
|
2008-08-07 18:47:08 +02:00
|
|
|
|
2009-12-18 12:36:36 +01:00
|
|
|
buildInputs = [ perl ];
|
|
|
|
|
2014-02-16 10:00:56 +01:00
|
|
|
meta = with stdenv.lib.meta; {
|
2008-08-07 18:47:08 +02:00
|
|
|
homepage = http://www.nvidia.com/object/unix.html;
|
|
|
|
description = "X.org driver and kernel module for NVIDIA graphics cards";
|
2014-02-16 10:00:56 +01:00
|
|
|
license = licenses.unfreeRedistributable;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.vcunat ];
|
2008-08-07 18:47:08 +02:00
|
|
|
};
|
2007-05-28 16:10:46 +02:00
|
|
|
}
|