summary refs log tree commit diff
path: root/pkgs/os-specific/linux/nvidia-x11/default.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2010-05-30 21:56:56 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2010-05-30 21:56:56 +0000
commita6d63f4fabb90c5964618df6e1ce1e95c89bf499 (patch)
tree9adda9323bcc84459455d353aa6a9899d4332afc /pkgs/os-specific/linux/nvidia-x11/default.nix
parent76143618b6f3611d3955deaa2f221f3d63173498 (diff)
downloadnixpkgs-a6d63f4fabb90c5964618df6e1ce1e95c89bf499.tar
nixpkgs-a6d63f4fabb90c5964618df6e1ce1e95c89bf499.tar.gz
nixpkgs-a6d63f4fabb90c5964618df6e1ce1e95c89bf499.tar.bz2
nixpkgs-a6d63f4fabb90c5964618df6e1ce1e95c89bf499.tar.lz
nixpkgs-a6d63f4fabb90c5964618df6e1ce1e95c89bf499.tar.xz
nixpkgs-a6d63f4fabb90c5964618df6e1ce1e95c89bf499.tar.zst
nixpkgs-a6d63f4fabb90c5964618df6e1ce1e95c89bf499.zip
* nvidia_x11: added a flag to build only the libraries. This is
  useful on x86_64-linux to support i686 binaries: there we need the
  NVIDIA OpenGL libraries, but not the kernel module or the
  nvidia-settings program (which just cause a lot of unnecessary and
  large dependencies).

svn path=/nixpkgs/trunk/; revision=22061
Diffstat (limited to 'pkgs/os-specific/linux/nvidia-x11/default.nix')
-rw-r--r--pkgs/os-specific/linux/nvidia-x11/default.nix25
1 files changed, 14 insertions, 11 deletions
diff --git a/pkgs/os-specific/linux/nvidia-x11/default.nix b/pkgs/os-specific/linux/nvidia-x11/default.nix
index 68263c128af..bc88775b02f 100644
--- a/pkgs/os-specific/linux/nvidia-x11/default.nix
+++ b/pkgs/os-specific/linux/nvidia-x11/default.nix
@@ -1,13 +1,16 @@
-{stdenv, fetchurl, kernel, xlibs, gtkLibs, zlib, perl}:
+{ 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
+}:
 
-let 
+with stdenv.lib;
 
-  versionNumber = "195.36.24";
-
-in
+let versionNumber = "195.36.24"; in
 
 stdenv.mkDerivation {
-  name = "nvidia-x11-${versionNumber}-${kernel.version}";
+  name = "nvidia-x11-${versionNumber}${optionalString (!libsOnly) "-${kernel.version}"}";
   
   builder = ./builder.sh;
   
@@ -24,7 +27,9 @@ stdenv.mkDerivation {
       }
     else throw "nvidia-x11 does not support platform ${stdenv.system}";
 
-  inherit versionNumber kernel;
+  inherit versionNumber libsOnly;
+
+  kernel = if libsOnly then null else kernel;
 
   dontStrip = true;
 
@@ -32,10 +37,8 @@ stdenv.mkDerivation {
 
   cudaPath = stdenv.lib.makeLibraryPath [zlib stdenv.gcc.gcc];
 
-  programPath = stdenv.lib.makeLibraryPath [
-    gtkLibs.gtk gtkLibs.atk gtkLibs.pango gtkLibs.glib
-    xlibs.libXv
-  ];
+  programPath = optionalString (!libsOnly) (stdenv.lib.makeLibraryPath
+    [ gtkLibs.gtk gtkLibs.atk gtkLibs.pango gtkLibs.glib xlibs.libXv ] );
 
   buildInputs = [ perl ];