2012-03-14 22:57:32 +01:00
|
|
|
{ stdenv, fetchurl, kernel ? null, xlibs, zlib, perl
|
|
|
|
, 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
|
|
|
|
2013-02-01 13:57:59 +01:00
|
|
|
let versionNumber = "310.32"; in
|
2008-01-07 23:54:30 +01:00
|
|
|
|
2007-05-28 16:10:46 +02:00
|
|
|
stdenv.mkDerivation {
|
2010-05-30 23:56:56 +02:00
|
|
|
name = "nvidia-x11-${versionNumber}${optionalString (!libsOnly) "-${kernel.version}"}";
|
2012-09-13 16:23:34 +02:00
|
|
|
|
2007-05-28 16:10:46 +02:00
|
|
|
builder = ./builder.sh;
|
2012-09-13 16:23:34 +02:00
|
|
|
|
2013-02-06 10:46:25 +01:00
|
|
|
patches = [ ./version-test.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";
|
2013-02-01 13:57:59 +01:00
|
|
|
sha256 = "13dc2s312h4k4bp7qb2ymdafr739jxbh0f3h1ilrkyjkd945cgnl";
|
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";
|
2013-02-01 13:57:59 +01:00
|
|
|
sha256 = "1wk0lcm712glffdmwpk4drrwb0fjva7qhpxylnqs7fl7d3acnsvq";
|
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;
|
|
|
|
|
|
|
|
kernel = if libsOnly then null else kernel;
|
2007-05-28 16:10:46 +02:00
|
|
|
|
2008-03-04 11:06:21 +01:00
|
|
|
dontStrip = true;
|
|
|
|
|
2009-06-16 14:51:35 +02:00
|
|
|
glPath = stdenv.lib.makeLibraryPath [xlibs.libXext xlibs.libX11 xlibs.libXrandr];
|
2008-06-04 11:59:33 +02:00
|
|
|
|
|
|
|
cudaPath = stdenv.lib.makeLibraryPath [zlib stdenv.gcc.gcc];
|
|
|
|
|
2013-02-01 13:57:59 +01:00
|
|
|
openclPath = stdenv.lib.makeLibraryPath [zlib];
|
|
|
|
|
2010-05-30 23:56:56 +02:00
|
|
|
programPath = optionalString (!libsOnly) (stdenv.lib.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 ];
|
|
|
|
|
2008-08-07 18:47:08 +02:00
|
|
|
meta = {
|
|
|
|
homepage = http://www.nvidia.com/object/unix.html;
|
|
|
|
description = "X.org driver and kernel module for NVIDIA graphics cards";
|
2009-03-03 14:27:40 +01:00
|
|
|
license = "unfree";
|
2008-08-07 18:47:08 +02:00
|
|
|
};
|
2007-05-28 16:10:46 +02:00
|
|
|
}
|