2010-05-30 22:56:56 +01:00
|
|
|
{ stdenv, fetchurl, kernel ? null, xlibs, gtkLibs, zlib, perl
|
|
|
|
, # 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 15:10:46 +01:00
|
|
|
|
2010-05-30 22:56:56 +01:00
|
|
|
with stdenv.lib;
|
2007-07-12 12:52:34 +01:00
|
|
|
|
2010-05-30 22:56:56 +01:00
|
|
|
let versionNumber = "195.36.24"; in
|
2008-01-07 22:54:30 +00:00
|
|
|
|
2007-05-28 15:10:46 +01:00
|
|
|
stdenv.mkDerivation {
|
2010-05-30 22:56:56 +01:00
|
|
|
name = "nvidia-x11-${versionNumber}${optionalString (!libsOnly) "-${kernel.version}"}";
|
2008-06-12 15:04:06 +01:00
|
|
|
|
2007-05-28 15:10:46 +01:00
|
|
|
builder = ./builder.sh;
|
|
|
|
|
2008-06-12 15:04:06 +01:00
|
|
|
src =
|
|
|
|
if stdenv.system == "i686-linux" then
|
|
|
|
fetchurl {
|
2009-03-30 15:50:00 +01:00
|
|
|
url = "http://us.download.nvidia.com/XFree86/Linux-x86/${versionNumber}/NVIDIA-Linux-x86-${versionNumber}-pkg0.run";
|
2010-05-19 11:35:44 +01:00
|
|
|
sha256 = "0h96356jmmk283ijq30zimp3wxldsaddrk03gy3jifj1v29iklcg";
|
2008-06-12 15:04:06 +01:00
|
|
|
}
|
|
|
|
else if stdenv.system == "x86_64-linux" then
|
|
|
|
fetchurl {
|
2009-03-30 15:50:00 +01:00
|
|
|
url = "http://us.download.nvidia.com/XFree86/Linux-x86_64/${versionNumber}/NVIDIA-Linux-x86_64-${versionNumber}-pkg0.run";
|
2010-05-19 11:35:44 +01:00
|
|
|
sha256 = "1car62fgzy4gvgmqjywbdpascrasqwv3knlyw6zzr7r84qabzc1a";
|
2008-06-12 15:04:06 +01:00
|
|
|
}
|
|
|
|
else throw "nvidia-x11 does not support platform ${stdenv.system}";
|
2008-05-29 14:22:12 +01:00
|
|
|
|
2010-05-30 22:56:56 +01:00
|
|
|
inherit versionNumber libsOnly;
|
|
|
|
|
|
|
|
kernel = if libsOnly then null else kernel;
|
2007-05-28 15:10:46 +01:00
|
|
|
|
2008-03-04 10:06:21 +00:00
|
|
|
dontStrip = true;
|
|
|
|
|
2009-06-16 13:51:35 +01:00
|
|
|
glPath = stdenv.lib.makeLibraryPath [xlibs.libXext xlibs.libX11 xlibs.libXrandr];
|
2008-06-04 10:59:33 +01:00
|
|
|
|
|
|
|
cudaPath = stdenv.lib.makeLibraryPath [zlib stdenv.gcc.gcc];
|
|
|
|
|
2010-05-30 22:56:56 +01:00
|
|
|
programPath = optionalString (!libsOnly) (stdenv.lib.makeLibraryPath
|
|
|
|
[ gtkLibs.gtk gtkLibs.atk gtkLibs.pango gtkLibs.glib xlibs.libXv ] );
|
2008-08-07 17:47:08 +01:00
|
|
|
|
2009-12-18 11:36:36 +00:00
|
|
|
buildInputs = [ perl ];
|
|
|
|
|
2008-08-07 17:47:08 +01:00
|
|
|
meta = {
|
|
|
|
homepage = http://www.nvidia.com/object/unix.html;
|
|
|
|
description = "X.org driver and kernel module for NVIDIA graphics cards";
|
2009-03-03 13:27:40 +00:00
|
|
|
license = "unfree";
|
2008-08-07 17:47:08 +01:00
|
|
|
};
|
2007-05-28 15:10:46 +01:00
|
|
|
}
|