summary refs log tree commit diff
path: root/pkgs/os-specific/linux/ati-drivers/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/os-specific/linux/ati-drivers/default.nix')
-rw-r--r--pkgs/os-specific/linux/ati-drivers/default.nix26
1 files changed, 13 insertions, 13 deletions
diff --git a/pkgs/os-specific/linux/ati-drivers/default.nix b/pkgs/os-specific/linux/ati-drivers/default.nix
index 10aeea18ceb4..45452c1ea6d2 100644
--- a/pkgs/os-specific/linux/ati-drivers/default.nix
+++ b/pkgs/os-specific/linux/ati-drivers/default.nix
@@ -1,10 +1,16 @@
-{ stdenv, fetchurl, kernel, xlibs, which, imake
+{ stdenv, fetchurl, kernel ? null, xlibs, which, imake
 , mesa # for fgl_glxgears
 , libXxf86vm, xf86vidmodeproto # for fglrx_gamma
 , xorg, makeWrapper, glibc, patchelf
 , unzip
+, # Whether to build the libraries only (i.e. not the kernel module or
+  # driver utils). Used to support 32-bit binaries on 64-bit
+  # Linux.
+  libsOnly ? false
 }:
 
+assert (!libsOnly) -> kernel != null;
+
 # If you want to use a different Xorg version probably
 # DIR_DEPENDING_ON_XORG_VERSION in builder.sh has to be adopted (?)
 # make sure libglx.so of ati is used. xorg.xorgserver does provide it as well
@@ -21,10 +27,10 @@
 # There is one issue left:
 # /usr/lib/dri/fglrx_dri.so must point to /run/opengl-driver/lib/fglrx_dri.so
 
-assert stdenv.system == "x86_64-linux";
+with stdenv.lib;
 
 stdenv.mkDerivation {
-  name = "ati-drivers-14.4-${kernel.version}";
+  name = "ati-drivers-14.4" + (optionalString (!libsOnly) "-${kernel.version}");
 
   builder = ./builder.sh;
 
@@ -49,7 +55,9 @@ stdenv.mkDerivation {
       mesa
     ];
 
-  kernel = kernel.dev;
+  inherit libsOnly;
+
+  kernel = if libsOnly then null else kernel.dev;
 
   inherit glibc /* glibc only used for setting interpreter */;
 
@@ -73,15 +81,7 @@ stdenv.mkDerivation {
     homepage = http://support.amd.com/us/gpudownload/Pages/index.aspx;
     license = licenses.unfree;
     maintainers = with maintainers; [marcweber offline];
-    platforms = [ "x86_64-linux" ];
+    platforms = platforms.linux;
     hydraPlatforms = [];
   };
-
-  # moved assertions here because the name is evaluated when the NixOS manual is generated
-  # Don't make that fail - fail lazily when a users tries to build this derivation only
-  dummy =
-    # assert xorg.xorgserver.name == "xorg-server-1.7.5";
-    assert stdenv.system == "x86_64-linux"; # i686-linux should work as well - however I didn't test it.
-    null;
-
 }