ati_unfree: Towards using ati unfree 32bit binary libs
This commit is contained in:
parent
c16874c4c0
commit
45f4b8b3ad
@ -22,7 +22,7 @@ in
|
|||||||
{ name = "fglrx"; modules = [ ati_x11 ]; libPath = [ "${ati_x11}/lib" ]; };
|
{ name = "fglrx"; modules = [ ati_x11 ]; libPath = [ "${ati_x11}/lib" ]; };
|
||||||
|
|
||||||
hardware.opengl.package = ati_x11;
|
hardware.opengl.package = ati_x11;
|
||||||
#hardware.opengl.package32 = pkgs_i686.linuxPackages.ati_x11.override { libsOnly = true; kernel = null; };
|
hardware.opengl.package32 = pkgs_i686.linuxPackages.ati_drivers_x11.override { libsOnly = true; kernel = null; };
|
||||||
|
|
||||||
environment.systemPackages = [ ati_x11 ];
|
environment.systemPackages = [ ati_x11 ];
|
||||||
|
|
||||||
|
@ -13,6 +13,21 @@ sh $run_file --extract .
|
|||||||
|
|
||||||
eval "$patchPhase"
|
eval "$patchPhase"
|
||||||
|
|
||||||
|
case "$system" in
|
||||||
|
x86_64-linux)
|
||||||
|
arch=x86_64
|
||||||
|
lib_arch=lib64
|
||||||
|
DIR_DEPENDING_ON_XORG_VERSION=xpic_64a
|
||||||
|
;;
|
||||||
|
i686-linux)
|
||||||
|
arch=x86
|
||||||
|
lib_arch=lib
|
||||||
|
DIR_DEPENDING_ON_XORG_VERSION=xpic
|
||||||
|
;;
|
||||||
|
*) exit 1;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if test -z "$libsOnly"; then
|
||||||
kernelVersion=$(cd ${kernel}/lib/modules && ls)
|
kernelVersion=$(cd ${kernel}/lib/modules && ls)
|
||||||
kernelBuild=$(echo ${kernel}/lib/modules/$kernelVersion/build)
|
kernelBuild=$(echo ${kernel}/lib/modules/$kernelVersion/build)
|
||||||
linuxsources=$(echo ${kernel}/lib/modules/$kernelVersion/source)
|
linuxsources=$(echo ${kernel}/lib/modules/$kernelVersion/source)
|
||||||
@ -105,17 +120,6 @@ setSMP
|
|||||||
setModVersions
|
setModVersions
|
||||||
CC=gcc
|
CC=gcc
|
||||||
MODULE=fglrx
|
MODULE=fglrx
|
||||||
case "$system" in
|
|
||||||
x86_64-linux)
|
|
||||||
arch=x86_64
|
|
||||||
lib_arch=lib64
|
|
||||||
;;
|
|
||||||
i686-linux)
|
|
||||||
arch=x86
|
|
||||||
lib_arch=lib
|
|
||||||
;;
|
|
||||||
*) exit 1;;
|
|
||||||
esac
|
|
||||||
LIBIP_PREFIX=$TMP/arch/$arch/lib/modules/fglrx/build_mod
|
LIBIP_PREFIX=$TMP/arch/$arch/lib/modules/fglrx/build_mod
|
||||||
[ -d $LIBIP_PREFIX ]
|
[ -d $LIBIP_PREFIX ]
|
||||||
GCC_MAJOR="`gcc --version | grep -o -e ") ." | head -1 | cut -d " " -f 2`"
|
GCC_MAJOR="`gcc --version | grep -o -e ") ." | head -1 | cut -d " " -f 2`"
|
||||||
@ -138,6 +142,8 @@ GCC_MAJOR="`gcc --version | grep -o -e ") ." | head -1 | cut -d " " -f 2`"
|
|||||||
cd $TMP
|
cd $TMP
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
{ # install
|
{ # install
|
||||||
|
|
||||||
mkdir -p $out/lib/xorg
|
mkdir -p $out/lib/xorg
|
||||||
@ -152,13 +158,15 @@ GCC_MAJOR="`gcc --version | grep -o -e ") ." | head -1 | cut -d " " -f 2`"
|
|||||||
# what are those files used for?
|
# what are those files used for?
|
||||||
cp -r common/etc $out
|
cp -r common/etc $out
|
||||||
|
|
||||||
DIR_DEPENDING_ON_XORG_VERSION=xpic_64a
|
|
||||||
cp -r $DIR_DEPENDING_ON_XORG_VERSION/usr/X11R6/$lib_arch/* $out/lib/xorg
|
cp -r $DIR_DEPENDING_ON_XORG_VERSION/usr/X11R6/$lib_arch/* $out/lib/xorg
|
||||||
|
|
||||||
|
# install kernel module
|
||||||
|
if test -z "$libsOnly"; then
|
||||||
t=$out/lib/modules/${kernelVersion}/kernel/drivers/misc
|
t=$out/lib/modules/${kernelVersion}/kernel/drivers/misc
|
||||||
mkdir -p $t
|
mkdir -p $t
|
||||||
|
|
||||||
cp ./common/lib/modules/fglrx/build_mod/2.6.x/fglrx.ko $t
|
cp ./common/lib/modules/fglrx/build_mod/2.6.x/fglrx.ko $t
|
||||||
|
fi
|
||||||
|
|
||||||
# should this be installed at all?
|
# should this be installed at all?
|
||||||
# its used by the example fglrx_gamma only
|
# its used by the example fglrx_gamma only
|
||||||
@ -185,6 +193,8 @@ GCC_MAJOR="`gcc --version | grep -o -e ") ." | head -1 | cut -d " " -f 2`"
|
|||||||
patchelf --set-rpath $gcc/$lib_arch $out/lib/libatiadlxx.so
|
patchelf --set-rpath $gcc/$lib_arch $out/lib/libatiadlxx.so
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if test -z "$libsOnly"; then
|
||||||
|
|
||||||
{ # build samples
|
{ # build samples
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
|
|
||||||
@ -229,6 +239,8 @@ GCC_MAJOR="`gcc --version | grep -o -e ") ." | head -1 | cut -d " " -f 2`"
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
for p in $extraDRIlibs; do
|
for p in $extraDRIlibs; do
|
||||||
for lib in $p/lib/*.so*; do
|
for lib in $p/lib/*.so*; do
|
||||||
ln -s $lib $out/lib/
|
ln -s $lib $out/lib/
|
||||||
|
@ -1,10 +1,16 @@
|
|||||||
{ stdenv, fetchurl, kernel, xlibs, which, imake
|
{ stdenv, fetchurl, kernel ? null, xlibs, which, imake
|
||||||
, mesa # for fgl_glxgears
|
, mesa # for fgl_glxgears
|
||||||
, libXxf86vm, xf86vidmodeproto # for fglrx_gamma
|
, libXxf86vm, xf86vidmodeproto # for fglrx_gamma
|
||||||
, xorg, makeWrapper, glibc, patchelf
|
, xorg, makeWrapper, glibc, patchelf
|
||||||
, unzip
|
, 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
|
# If you want to use a different Xorg version probably
|
||||||
# DIR_DEPENDING_ON_XORG_VERSION in builder.sh has to be adopted (?)
|
# 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
|
# make sure libglx.so of ati is used. xorg.xorgserver does provide it as well
|
||||||
@ -21,10 +27,10 @@
|
|||||||
# There is one issue left:
|
# There is one issue left:
|
||||||
# /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
|
||||||
|
|
||||||
assert stdenv.system == "x86_64-linux";
|
with stdenv.lib;
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "ati-drivers-14.4-${kernel.version}";
|
name = "ati-drivers-14.4" + (optionalString (!libsOnly) "-${kernel.version}");
|
||||||
|
|
||||||
builder = ./builder.sh;
|
builder = ./builder.sh;
|
||||||
|
|
||||||
@ -49,7 +55,9 @@ stdenv.mkDerivation {
|
|||||||
mesa
|
mesa
|
||||||
];
|
];
|
||||||
|
|
||||||
kernel = kernel.dev;
|
inherit libsOnly;
|
||||||
|
|
||||||
|
kernel = if libsOnly then null else kernel.dev;
|
||||||
|
|
||||||
inherit glibc /* glibc only used for setting interpreter */;
|
inherit glibc /* glibc only used for setting interpreter */;
|
||||||
|
|
||||||
@ -73,15 +81,7 @@ stdenv.mkDerivation {
|
|||||||
homepage = http://support.amd.com/us/gpudownload/Pages/index.aspx;
|
homepage = http://support.amd.com/us/gpudownload/Pages/index.aspx;
|
||||||
license = licenses.unfree;
|
license = licenses.unfree;
|
||||||
maintainers = with maintainers; [marcweber offline];
|
maintainers = with maintainers; [marcweber offline];
|
||||||
platforms = [ "x86_64-linux" ];
|
platforms = platforms.linux;
|
||||||
hydraPlatforms = [];
|
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;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user