2015-09-15 02:26:18 -07:00
|
|
|
{ stdenv, fetchurl, kernel ? null, xorg, zlib, perl
|
2016-09-11 14:24:51 -07:00
|
|
|
, gtk2, atk, pango, glib, gdk_pixbuf
|
2010-05-30 14:56:56 -07: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 07:10:46 -07:00
|
|
|
|
2010-05-30 14:56:56 -07:00
|
|
|
with stdenv.lib;
|
2007-07-12 04:52:34 -07:00
|
|
|
|
2014-02-16 00:53:15 -08:00
|
|
|
assert (!libsOnly) -> kernel != null;
|
|
|
|
|
2013-07-17 02:10:21 -07:00
|
|
|
let
|
2008-01-07 14:54:30 -08:00
|
|
|
|
2016-03-03 13:38:53 -08:00
|
|
|
versionNumber = "340.96";
|
2014-11-24 13:34:00 -08: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 14:27:37 -07:00
|
|
|
inherit (stdenv.lib) makeLibraryPath;
|
2013-07-17 02:10:21 -07:00
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2014-01-04 17:57:21 -08:00
|
|
|
name = "nvidia-x11-${versionNumber}${optionalString (!libsOnly) "-${kernel.version}"}";
|
2012-09-13 07:23:34 -07:00
|
|
|
|
2014-11-24 13:34:00 -08:00
|
|
|
builder = ./builder-legacy340.sh;
|
2012-09-13 07:23:34 -07:00
|
|
|
|
2008-06-12 07:04:06 -07:00
|
|
|
src =
|
|
|
|
if stdenv.system == "i686-linux" then
|
|
|
|
fetchurl {
|
2016-03-03 13:38:53 -08:00
|
|
|
url = "http://download.nvidia.com/XFree86/Linux-x86/${versionNumber}/NVIDIA-Linux-x86-${versionNumber}.run";
|
|
|
|
sha256 = "13j739gg1igll88xpfsx46m7pan4fwpzx5hqdskkdc0srmw2f3n4";
|
2008-06-12 07:04:06 -07:00
|
|
|
}
|
|
|
|
else if stdenv.system == "x86_64-linux" then
|
|
|
|
fetchurl {
|
2016-03-03 13:38:53 -08:00
|
|
|
url = "http://download.nvidia.com/XFree86/Linux-x86_64/${versionNumber}/NVIDIA-Linux-x86_64-${versionNumber}-no-compat32.run";
|
|
|
|
sha256 = "1i0lri76ghhr4c6fdlv5gwzd99n70hv3kw21w51anb55msr9s3r8";
|
2008-06-12 07:04:06 -07:00
|
|
|
}
|
|
|
|
else throw "nvidia-x11 does not support platform ${stdenv.system}";
|
2008-05-29 06:22:12 -07:00
|
|
|
|
2010-05-30 14:56:56 -07:00
|
|
|
inherit versionNumber libsOnly;
|
|
|
|
|
2014-01-04 17:57:21 -08:00
|
|
|
kernel = if libsOnly then null else kernel.dev;
|
2007-05-28 07:10:46 -07:00
|
|
|
|
2016-08-13 07:49:42 -07:00
|
|
|
hardeningDisable = [ "pic" "format" ];
|
|
|
|
|
2008-03-04 02:06:21 -08:00
|
|
|
dontStrip = true;
|
|
|
|
|
2015-09-15 02:26:18 -07:00
|
|
|
glPath = makeLibraryPath [xorg.libXext xorg.libX11 xorg.libXrandr];
|
2015-01-14 20:25:26 -08:00
|
|
|
cudaPath = makeLibraryPath [zlib stdenv.cc.cc];
|
2014-08-20 14:27:37 -07:00
|
|
|
openclPath = makeLibraryPath [zlib];
|
2015-09-15 02:26:18 -07:00
|
|
|
allLibPath = makeLibraryPath [xorg.libXext xorg.libX11 xorg.libXrandr zlib stdenv.cc.cc];
|
2008-06-04 02:59:33 -07:00
|
|
|
|
2014-08-20 14:27:37 -07:00
|
|
|
programPath = optionalString (!libsOnly) (makeLibraryPath
|
2016-09-11 14:24:51 -07:00
|
|
|
[ gtk2 atk pango glib gdk_pixbuf xorg.libXv ] );
|
2008-08-07 09:47:08 -07:00
|
|
|
|
2009-12-18 03:36:36 -08:00
|
|
|
buildInputs = [ perl ];
|
|
|
|
|
2014-02-16 01:00:56 -08:00
|
|
|
meta = with stdenv.lib.meta; {
|
2008-08-07 09:47:08 -07:00
|
|
|
homepage = http://www.nvidia.com/object/unix.html;
|
|
|
|
description = "X.org driver and kernel module for NVIDIA graphics cards";
|
2014-02-16 01:00:56 -08:00
|
|
|
license = licenses.unfreeRedistributable;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.vcunat ];
|
2016-03-03 13:38:53 -08:00
|
|
|
priority = 4; # resolves collision with xorg-server's "lib/xorg/modules/extensions/libglx.so"
|
2008-08-07 09:47:08 -07:00
|
|
|
};
|
2007-05-28 07:10:46 -07:00
|
|
|
}
|