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.nix43
1 files changed, 21 insertions, 22 deletions
diff --git a/pkgs/os-specific/linux/ati-drivers/default.nix b/pkgs/os-specific/linux/ati-drivers/default.nix
index 0aa67dba237..179166bbc79 100644
--- a/pkgs/os-specific/linux/ati-drivers/default.nix
+++ b/pkgs/os-specific/linux/ati-drivers/default.nix
@@ -1,10 +1,17 @@
-{ 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
+, qt4 # for amdcccle
+, # 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,26 +28,23 @@
 # There is one issue left:
 # /usr/lib/dri/fglrx_dri.so must point to /run/opengl-driver/lib/fglrx_dri.so
 
-# You eventually have to blacklist radeon module (?)
-
-assert stdenv.system == "x86_64-linux";
+with stdenv.lib;
 
 stdenv.mkDerivation {
-  name = "ati-drivers-13.12-${kernel.version}";
+  name = "ati-drivers-14.12" + (optionalString (!libsOnly) "-${kernel.version}");
 
   builder = ./builder.sh;
 
   inherit libXxf86vm xf86vidmodeproto;
-  gcc = stdenv.gcc.gcc;
+  gcc = stdenv.cc.cc;
 
   src = fetchurl {
-    url = http://www2.ati.com/drivers/linux/amd-catalyst-13.12-linux-x86.x86_64.zip;
-    sha256 = "1c3fn328340by4qn99dgfj8c2q34fxdb2alcak0vnyc6bw7l5sms";
+    url = http://www2.ati.com/drivers/linux/amd-catalyst-omega-14.12-linux-run-installers.zip;
+    sha256 = "0jd2scrdlyapynxfjdrarnwcdzxjqrk5fg5i10g3bm0ay8v9hrk8";
     curlOpts = "--referer http://support.amd.com/en-us/download/desktop?os=Linux%20x86_64";
   };
 
-  # most patches are taken from gentoo
-  patchPhase = "patch -p1 < ${./gentoo-patches.patch}";
+  patchPhase = "patch -p1 < ${./fglrx_3.17rc6-no_hotplug.patch}";
   patchPhaseSamples = "patch -p2 < ${./patch-samples.patch}";
 
   buildInputs =
@@ -49,9 +53,12 @@ stdenv.mkDerivation {
       patchelf
       unzip
       mesa
+      qt4
     ];
 
-  kernel = kernel.dev;
+  inherit libsOnly;
+
+  kernel = if libsOnly then null else kernel.dev;
 
   inherit glibc /* glibc only used for setting interpreter */;
 
@@ -68,22 +75,14 @@ stdenv.mkDerivation {
   # appear in /run/opengl-driver/lib which get's added to LD_LIBRARY_PATH
   extraDRIlibs = [ xorg.libXext ];
 
-  inherit mesa; # only required to build examples
+  inherit mesa qt4; # only required to build examples and amdcccle
 
   meta = with stdenv.lib; {
     description = "ATI drivers";
     homepage = http://support.amd.com/us/gpudownload/Pages/index.aspx;
     license = licenses.unfree;
-    maintainers = with maintainers; [marcweber offline];
-    platforms = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ marcweber offline jgeerds ];
+    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;
-
 }