From a6d63f4fabb90c5964618df6e1ce1e95c89bf499 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 30 May 2010 21:56:56 +0000 Subject: * 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 --- pkgs/os-specific/linux/nvidia-x11/default.nix | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'pkgs/os-specific/linux/nvidia-x11/default.nix') 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 ]; -- cgit 1.4.1