2014-09-06 06:17:00 +02:00
|
|
|
{ stdenv, fetchurl, kernel ? null, xlibs, which, imake
|
2010-05-18 21:36:55 +02:00
|
|
|
, mesa # for fgl_glxgears
|
|
|
|
, libXxf86vm, xf86vidmodeproto # for fglrx_gamma
|
|
|
|
, xorg, makeWrapper, glibc, patchelf
|
2012-10-07 18:03:06 +02:00
|
|
|
, unzip
|
2014-10-15 00:37:39 +02:00
|
|
|
, qt4 # for amdcccle
|
2014-09-06 06:17:00 +02:00
|
|
|
, # 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
|
2010-05-18 21:36:55 +02:00
|
|
|
}:
|
|
|
|
|
2014-09-06 06:17:00 +02:00
|
|
|
assert (!libsOnly) -> kernel != null;
|
|
|
|
|
2010-05-18 21:36:55 +02:00
|
|
|
# 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
|
|
|
|
# which is a problem because it doesn't contain the xorgserver patch supporting
|
|
|
|
# the XORG_DRI_DRIVER_PATH env var.
|
|
|
|
# See http://thread.gmane.org/gmane.linux.distributions.nixos/4145 for a
|
|
|
|
# workaround (TODO)
|
|
|
|
|
2014-01-22 10:57:43 +01:00
|
|
|
# The gentoo ebuild contains much more magic and is usually a great resource to
|
|
|
|
# find patches :)
|
2010-05-18 21:36:55 +02:00
|
|
|
|
|
|
|
# http://wiki.cchtml.com/index.php/Main_Page
|
|
|
|
|
2012-10-07 18:03:06 +02:00
|
|
|
# There is one issue left:
|
|
|
|
# /usr/lib/dri/fglrx_dri.so must point to /run/opengl-driver/lib/fglrx_dri.so
|
|
|
|
|
2014-09-06 06:17:00 +02:00
|
|
|
with stdenv.lib;
|
2014-01-05 02:57:21 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2014-12-10 21:12:54 +01:00
|
|
|
name = "ati-drivers-14.12" + (optionalString (!libsOnly) "-${kernel.version}");
|
2010-05-18 21:36:55 +02:00
|
|
|
|
|
|
|
builder = ./builder.sh;
|
|
|
|
|
|
|
|
inherit libXxf86vm xf86vidmodeproto;
|
2015-01-15 05:25:26 +01:00
|
|
|
gcc = stdenv.cc.cc;
|
2010-05-18 21:36:55 +02:00
|
|
|
|
2012-02-17 15:32:28 +01:00
|
|
|
src = fetchurl {
|
2014-12-10 21:12:54 +01:00
|
|
|
url = http://www2.ati.com/drivers/linux/amd-catalyst-omega-14.12-linux-run-installers.zip;
|
|
|
|
sha256 = "0jd2scrdlyapynxfjdrarnwcdzxjqrk5fg5i10g3bm0ay8v9hrk8";
|
2013-12-14 00:59:17 +01:00
|
|
|
curlOpts = "--referer http://support.amd.com/en-us/download/desktop?os=Linux%20x86_64";
|
2010-05-18 21:36:55 +02:00
|
|
|
};
|
|
|
|
|
2014-12-10 21:30:31 +01:00
|
|
|
patchPhase = "patch -p1 < ${./fglrx_3.17rc6-no_hotplug.patch}";
|
2014-01-22 10:57:43 +01:00
|
|
|
patchPhaseSamples = "patch -p2 < ${./patch-samples.patch}";
|
2013-08-22 12:00:23 +02:00
|
|
|
|
2012-02-17 15:32:28 +01:00
|
|
|
buildInputs =
|
2013-12-13 09:32:36 +01:00
|
|
|
[ xlibs.libXext xlibs.libX11 xlibs.libXinerama
|
2012-02-17 15:32:28 +01:00
|
|
|
xlibs.libXrandr which imake makeWrapper
|
|
|
|
patchelf
|
2012-10-07 18:03:06 +02:00
|
|
|
unzip
|
2013-08-22 12:00:23 +02:00
|
|
|
mesa
|
2014-10-15 00:37:39 +02:00
|
|
|
qt4
|
2012-02-17 15:32:28 +01:00
|
|
|
];
|
2013-01-17 22:05:59 +01:00
|
|
|
|
2014-09-06 06:17:00 +02:00
|
|
|
inherit libsOnly;
|
|
|
|
|
|
|
|
kernel = if libsOnly then null else kernel.dev;
|
2013-03-24 12:45:00 +01:00
|
|
|
|
|
|
|
inherit glibc /* glibc only used for setting interpreter */;
|
2013-01-17 22:05:59 +01:00
|
|
|
|
2012-02-17 15:32:28 +01:00
|
|
|
LD_LIBRARY_PATH = stdenv.lib.concatStringsSep ":"
|
2010-05-18 21:36:55 +02:00
|
|
|
[ "${xorg.libXrandr}/lib"
|
|
|
|
"${xorg.libXrender}/lib"
|
|
|
|
"${xorg.libXext}/lib"
|
|
|
|
"${xorg.libX11}/lib"
|
2013-12-13 09:32:36 +01:00
|
|
|
"${xorg.libXinerama}/lib"
|
2010-05-18 21:36:55 +02:00
|
|
|
];
|
|
|
|
|
2013-08-22 12:00:23 +02:00
|
|
|
# without this some applications like blender don't start, but they start
|
|
|
|
# with nvidia. This causes them to be symlinked to $out/lib so that they
|
|
|
|
# appear in /run/opengl-driver/lib which get's added to LD_LIBRARY_PATH
|
2014-01-22 10:57:43 +01:00
|
|
|
extraDRIlibs = [ xorg.libXext ];
|
2013-08-22 12:00:23 +02:00
|
|
|
|
2014-10-15 00:37:39 +02:00
|
|
|
inherit mesa qt4; # only required to build examples and amdcccle
|
2010-05-18 21:36:55 +02:00
|
|
|
|
2014-01-22 10:57:43 +01:00
|
|
|
meta = with stdenv.lib; {
|
2013-01-17 22:05:59 +01:00
|
|
|
description = "ATI drivers";
|
2010-05-18 21:36:55 +02:00
|
|
|
homepage = http://support.amd.com/us/gpudownload/Pages/index.aspx;
|
2014-01-22 10:57:43 +01:00
|
|
|
license = licenses.unfree;
|
2014-10-15 00:37:39 +02:00
|
|
|
maintainers = with maintainers; [ marcweber offline jgeerds ];
|
2014-09-06 06:17:00 +02:00
|
|
|
platforms = platforms.linux;
|
2013-11-05 00:04:36 +01:00
|
|
|
hydraPlatforms = [];
|
2010-05-18 21:36:55 +02:00
|
|
|
};
|
|
|
|
}
|