ati-drivers: 15.7 -> 15.12

Also addresses breakage due to the multiple-outputs merge.
This commit is contained in:
Edward Tjörnhammar 2016-05-03 10:54:49 +02:00
parent 1ac8374e95
commit 046ee5ac3f
No known key found for this signature in database
GPG Key ID: 7B82CE4A866B6845
2 changed files with 34 additions and 42 deletions

View File

@ -1,4 +1,3 @@
# What is LIBGL_DRIVERS_PATH used for?
# TODO gentoo removes some tools because there are xorg sources (?) # TODO gentoo removes some tools because there are xorg sources (?)
source $stdenv/setup source $stdenv/setup
@ -6,15 +5,10 @@ set -x
die(){ echo $@; exit 1; } die(){ echo $@; exit 1; }
mkdir fglrx # custom unpack:
cd fglrx
unzip $src unzip $src
cd .. run_file=fglrx-$build/amd-driver-installer-$build-x86.x86_64.run
run_file=$(echo fglrx/amd-driver-installer-*)
sh $run_file --extract . sh $run_file --extract .
eval "$patchPhase1"
case "$system" in case "$system" in
x86_64-linux) x86_64-linux)
arch=x86_64 arch=x86_64
@ -33,9 +27,9 @@ esac
if test -z "$libsOnly"; then if test -z "$libsOnly"; then
kernelVersion=$(cd ${kernel}/lib/modules && ls) kernelVersion=$(cd ${kernelDir}/lib/modules && ls)
kernelBuild=$(echo ${kernel}/lib/modules/$kernelVersion/build) kernelBuild=$(echo ${kernelDir}/lib/modules/$kernelVersion/build)
linuxsources=$(echo ${kernel}/lib/modules/$kernelVersion/source) linuxsources=$(echo ${kernelDir}/lib/modules/$kernelVersion/source)
# note: maybe the .config file should be used to determine this ? # note: maybe the .config file should be used to determine this ?
# current kbuild infrastructure allows using CONFIG_* defines # current kbuild infrastructure allows using CONFIG_* defines
@ -231,7 +225,7 @@ fi
fglrx_dri.so \ fglrx_dri.so \
libaticaldd.so libaticaldd.so
do do
patchelf --set-rpath $gcc/$lib_arch/ $out/lib/$pelib2 patchelf --set-rpath $glibcDir/lib/:$libStdCxx/lib/ $out/lib/$pelib2
done done
} }
@ -272,7 +266,7 @@ if test -z "$libsOnly"; then
{ {
# patch and copy statically linked qt libs used by amdcccle # patch and copy statically linked qt libs used by amdcccle
patchelf --set-interpreter $(echo $glibc/lib/ld-linux*.so.2) $TMP/arch/$arch/usr/share/ati/$lib_arch/libQtCore.so.4 && patchelf --set-interpreter $(echo $glibcDir/lib/ld-linux*.so.2) $TMP/arch/$arch/usr/share/ati/$lib_arch/libQtCore.so.4 &&
patchelf --set-rpath $gcc/$lib_arch/ $TMP/arch/$arch/usr/share/ati/$lib_arch/libQtCore.so.4 && patchelf --set-rpath $gcc/$lib_arch/ $TMP/arch/$arch/usr/share/ati/$lib_arch/libQtCore.so.4 &&
patchelf --set-rpath $gcc/$lib_arch/:$out/share/ati/:$libXrender/lib/:$libSM/lib/:$libICE/lib/:$libfontconfig/lib/:$libfreetype/lib/ $TMP/arch/$arch/usr/share/ati/$lib_arch/libQtGui.so.4 && patchelf --set-rpath $gcc/$lib_arch/:$out/share/ati/:$libXrender/lib/:$libSM/lib/:$libICE/lib/:$libfontconfig/lib/:$libfreetype/lib/ $TMP/arch/$arch/usr/share/ati/$lib_arch/libQtGui.so.4 &&
mkdir -p $out/share/ati mkdir -p $out/share/ati
@ -285,7 +279,7 @@ if test -z "$libsOnly"; then
patchelf --shrink-rpath $BIN/amdcccle patchelf --shrink-rpath $BIN/amdcccle
for prog in $BIN/*; do for prog in $BIN/*; do
cp -f $prog $out/bin && cp -f $prog $out/bin &&
patchelf --set-interpreter $(echo $glibc/lib/ld-linux*.so.2) $out/bin/$(basename $prog) && patchelf --set-interpreter $(echo $glibcDir/lib/ld-linux*.so.2) $out/bin/$(basename $prog) &&
wrapProgram $out/bin/$(basename $prog) --prefix LD_LIBRARY_PATH : $out/lib/:$gcc/lib/:$out/share/ati/:$libXinerama/lib/:$libXrandr/lib/:$libfontconfig/lib/:$libfreetype/lib/:$LD_LIBRARY_PATH wrapProgram $out/bin/$(basename $prog) --prefix LD_LIBRARY_PATH : $out/lib/:$gcc/lib/:$out/share/ati/:$libXinerama/lib/:$libXrandr/lib/:$libfontconfig/lib/:$libfreetype/lib/:$LD_LIBRARY_PATH
done done
} }

View File

@ -11,10 +11,6 @@ assert (!libsOnly) -> kernel != null;
with stdenv.lib; with stdenv.lib;
let
version = "15.7";
in
# This derivation requires a maximum of gcc49, Linux kernel 4.1 and xorg.xserver 1.17 # This derivation requires a maximum of gcc49, Linux kernel 4.1 and xorg.xserver 1.17
# and will not build or run using versions newer # and will not build or run using versions newer
@ -31,11 +27,14 @@ in
# http://wiki.cchtml.com/index.php/Main_Page # http://wiki.cchtml.com/index.php/Main_Page
#
# /usr/lib/dri/fglrx_dri.so must point to /run/opengl-driver/lib/fglrx_dri.so # /usr/lib/dri/fglrx_dri.so must point to /run/opengl-driver/lib/fglrx_dri.so
# This is done in the builder script. # This is done in the builder script.
stdenv.mkDerivation { stdenv.mkDerivation rec {
version = "15.12";
pname = "ati-drivers";
build = "15.302";
linuxonly = linuxonly =
if stdenv.system == "i686-linux" then if stdenv.system == "i686-linux" then
@ -44,7 +43,7 @@ stdenv.mkDerivation {
true true
else throw "ati-drivers are Linux only. Sorry. The build was stopped."; else throw "ati-drivers are Linux only. Sorry. The build was stopped.";
name = "ati-drivers-${version}" + (optionalString (!libsOnly) "-${kernel.version}"); name = pname + "-" + version + (optionalString (!libsOnly) "-${kernelDir.version}");
builder = ./builder.sh; builder = ./builder.sh;
gcc = stdenv.cc.cc; gcc = stdenv.cc.cc;
@ -57,15 +56,16 @@ stdenv.mkDerivation {
libICE = xorg.libICE; libICE = xorg.libICE;
libfreetype = freetype; libfreetype = freetype;
libfontconfig = fontconfig; libfontconfig = fontconfig;
libStdCxx = stdenv.cc.cc.lib;
src = fetchurl { src = fetchurl {
url = "http://www2.ati.com/drivers/linux/amd-driver-installer-15.20.1046-x86.x86_64.zip"; url =
sha256 = "ffde64203f49d9288eaa25f4d744187b6f4f14a87a444bab6a001d822b327a9d"; "https://www2.ati.com/drivers/linux/radeon-crimson-15.12-15.302-151217a-297685e.zip";
curlOpts = "--referer http://support.amd.com/en-us/download/desktop?os=Linux%20x86_64"; sha256 = "0n0ynqmjkjp5dl5q07as7ps3rlyyn63hq4mlwgd7c7v82ky2skvh";
curlOpts = "--referer http://support.amd.com/en-us/download/desktop?os=Linux+x86_64";
}; };
patchPhaseSamples = "patch -p2 < ${./patch-samples.patch}"; patchPhaseSamples = "patch -p2 < ${./patch-samples.patch}";
patchPhase1 = "patch -p1 < ${./kernel-api-fixes.patch}";
buildInputs = buildInputs =
[ xorg.libXrender xorg.libXext xorg.libX11 xorg.libXinerama xorg.libSM [ xorg.libXrender xorg.libXext xorg.libX11 xorg.libXinerama xorg.libSM
@ -81,28 +81,28 @@ stdenv.mkDerivation {
inherit libsOnly; inherit libsOnly;
kernel = if libsOnly then null else kernel.dev; kernelDir = if libsOnly then null else kernel.dev;
inherit glibc /* glibc only used for setting interpreter */; # glibc only used for setting the binaries interpreter
glibcDir = glibc.out;
# outputs TODO: probably many fixes are needed; # outputs TODO: probably many fixes are needed;
# this in particular would be much better by lib.makeLibraryPath LD_LIBRARY_PATH = makeLibraryPath
LD_LIBRARY_PATH = stdenv.lib.concatStringsSep ":" [ xorg.libXrender xorg.libXext xorg.libX11 xorg.libXinerama xorg.libSM
[ "${xorg.libXrandr.out}/lib/" xorg.libXrandr xorg.libXxf86vm xorg.xf86vidmodeproto xorg.imake xorg.libICE
"${xorg.libXrender.out}/lib/" mesa
"${xorg.libXext.out}/lib/" fontconfig
"${xorg.libX11.out}/lib/" freetype
"${xorg.libXinerama.out}/lib/" stdenv.cc.cc
"${xorg.libSM.out}/lib/"
"${xorg.libICE.out}/lib/"
"${stdenv.cc.cc.out}/lib/"
]; ];
# without this some applications like blender don't start, but they start # 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 # 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 # appear in /run/opengl-driver/lib which get's added to LD_LIBRARY_PATH
extraDRIlibs = [ xorg.libXrandr xorg.libXrender xorg.libXext xorg.libX11 xorg.libXinerama xorg.libSM xorg.libICE ]; extraDRIlibs = [ xorg.libXrandr.out xorg.libXrender.out xorg.libXext.out
xorg.libX11.out xorg.libXinerama.out xorg.libSM.out
xorg.libICE.out ];
inherit mesa; # only required to build the examples inherit mesa; # only required to build the examples
@ -119,6 +119,4 @@ stdenv.mkDerivation {
priority = 4; priority = 4;
}; };
} }