2013-03-24 11:45:00 +00:00
|
|
|
{ stdenv, fetchurl, kernelDev, xlibs, which, imake
|
2010-05-18 20:36:55 +01:00
|
|
|
, mesa # for fgl_glxgears
|
|
|
|
, libXxf86vm, xf86vidmodeproto # for fglrx_gamma
|
|
|
|
, xorg, makeWrapper, glibc, patchelf
|
2012-10-07 17:03:06 +01:00
|
|
|
, unzip
|
2010-05-18 20:36:55 +01: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)
|
|
|
|
|
|
|
|
# The gentoo ebuild contains much more magic..
|
|
|
|
|
|
|
|
# http://wiki.cchtml.com/index.php/Main_Page
|
|
|
|
|
2012-10-07 17:03:06 +01:00
|
|
|
# There is one issue left:
|
|
|
|
# /usr/lib/dri/fglrx_dri.so must point to /run/opengl-driver/lib/fglrx_dri.so
|
|
|
|
|
2012-02-17 14:32:28 +00:00
|
|
|
assert stdenv.system == "x86_64-linux";
|
|
|
|
|
2010-10-26 01:35:38 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2013-08-22 11:00:23 +01:00
|
|
|
name = "ati-drivers-${version}-${kernel.version}";
|
|
|
|
version = "13.4";
|
2010-05-18 20:36:55 +01:00
|
|
|
|
|
|
|
builder = ./builder.sh;
|
|
|
|
|
|
|
|
inherit libXxf86vm xf86vidmodeproto;
|
|
|
|
|
2012-02-17 14:32:28 +00:00
|
|
|
src = fetchurl {
|
2013-08-22 11:00:23 +01:00
|
|
|
url = http://www2.ati.com/drivers/linux/amd-driver-installer-catalyst-13-4-linux-x86.x86_64.zip;
|
|
|
|
sha256 = "1914ikdich0kg047bqh89ai5z4dyryj5mlw5i46n90fsfiaxa532";
|
2010-05-18 20:36:55 +01:00
|
|
|
};
|
|
|
|
|
2013-08-22 11:00:23 +01:00
|
|
|
patchPhase = "patch -p0 < ${./gentoo-patches.patch}";
|
|
|
|
|
2012-02-17 14:32:28 +00:00
|
|
|
buildInputs =
|
|
|
|
[ xlibs.libXext xlibs.libX11
|
|
|
|
xlibs.libXrandr which imake makeWrapper
|
|
|
|
patchelf
|
2012-10-07 17:03:06 +01:00
|
|
|
unzip
|
2013-08-22 11:00:23 +01:00
|
|
|
mesa
|
2012-02-17 14:32:28 +00:00
|
|
|
];
|
2013-01-17 21:05:59 +00:00
|
|
|
|
2013-03-24 11:45:00 +00:00
|
|
|
kernel = kernelDev;
|
|
|
|
|
|
|
|
inherit glibc /* glibc only used for setting interpreter */;
|
2013-01-17 21:05:59 +00:00
|
|
|
|
2012-02-17 14:32:28 +00:00
|
|
|
LD_LIBRARY_PATH = stdenv.lib.concatStringsSep ":"
|
2010-05-18 20:36:55 +01:00
|
|
|
[ "${xorg.libXrandr}/lib"
|
|
|
|
"${xorg.libXrender}/lib"
|
|
|
|
"${xorg.libXext}/lib"
|
|
|
|
"${xorg.libX11}/lib"
|
|
|
|
];
|
|
|
|
|
2013-08-22 11:00:23 +01: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
|
|
|
|
extraDRIlibs = [ xorg.libXext ];
|
|
|
|
|
2010-05-18 20:36:55 +01:00
|
|
|
inherit mesa; # only required to build examples
|
|
|
|
|
|
|
|
meta = {
|
2013-01-17 21:05:59 +00:00
|
|
|
description = "ATI drivers";
|
2010-05-18 20:36:55 +01:00
|
|
|
homepage = http://support.amd.com/us/gpudownload/Pages/index.aspx;
|
|
|
|
license = "unfree";
|
|
|
|
maintainers = [stdenv.lib.maintainers.marcweber];
|
2013-11-04 23:04:36 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
hydraPlatforms = [];
|
2010-05-18 20:36:55 +01:00
|
|
|
};
|
2010-05-19 11:01:07 +01:00
|
|
|
|
|
|
|
# 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 =
|
2010-08-18 15:45:13 +01:00
|
|
|
# assert xorg.xorgserver.name == "xorg-server-1.7.5";
|
2010-05-19 11:01:07 +01:00
|
|
|
assert stdenv.system == "x86_64-linux"; # i686-linux should work as well - however I didn't test it.
|
|
|
|
null;
|
|
|
|
|
2010-05-18 20:36:55 +01:00
|
|
|
}
|