···1314eval "$patchPhase"
1500000000000000016kernelVersion=$(cd ${kernel}/lib/modules && ls)
17kernelBuild=$(echo ${kernel}/lib/modules/$kernelVersion/build)
18linuxsources=$(echo ${kernel}/lib/modules/$kernelVersion/source)
···105setModVersions
106CC=gcc
107MODULE=fglrx
108-case "$system" in
109- x86_64-linux)
110- arch=x86_64
111- lib_arch=lib64
112- ;;
113- i686-linux)
114- arch=x86
115- lib_arch=lib
116- ;;
117- *) exit 1;;
118-esac
119LIBIP_PREFIX=$TMP/arch/$arch/lib/modules/fglrx/build_mod
120[ -d $LIBIP_PREFIX ]
121GCC_MAJOR="`gcc --version | grep -o -e ") ." | head -1 | cut -d " " -f 2`"
···138 cd $TMP
139}
14000141{ # install
142143 mkdir -p $out/lib/xorg
···152 # what are those files used for?
153 cp -r common/etc $out
154155- DIR_DEPENDING_ON_XORG_VERSION=xpic_64a
156 cp -r $DIR_DEPENDING_ON_XORG_VERSION/usr/X11R6/$lib_arch/* $out/lib/xorg
15700158 t=$out/lib/modules/${kernelVersion}/kernel/drivers/misc
159 mkdir -p $t
160161 cp ./common/lib/modules/fglrx/build_mod/2.6.x/fglrx.ko $t
0162163 # should this be installed at all?
164 # its used by the example fglrx_gamma only
···185 patchelf --set-rpath $gcc/$lib_arch $out/lib/libatiadlxx.so
186}
18700188{ # build samples
189 mkdir -p $out/bin
190···228 rm -fr $out/lib/modules/fglrx # don't think those .a files are needed. They cause failure of the mod
229230}
00231232for p in $extraDRIlibs; do
233 for lib in $p/lib/*.so*; do
···1314eval "$patchPhase"
1516+case "$system" in
17+ x86_64-linux)
18+ arch=x86_64
19+ lib_arch=lib64
20+ DIR_DEPENDING_ON_XORG_VERSION=xpic_64a
21+ ;;
22+ i686-linux)
23+ arch=x86
24+ lib_arch=lib
25+ DIR_DEPENDING_ON_XORG_VERSION=xpic
26+ ;;
27+ *) exit 1;;
28+esac
29+30+if test -z "$libsOnly"; then
31kernelVersion=$(cd ${kernel}/lib/modules && ls)
32kernelBuild=$(echo ${kernel}/lib/modules/$kernelVersion/build)
33linuxsources=$(echo ${kernel}/lib/modules/$kernelVersion/source)
···120setModVersions
121CC=gcc
122MODULE=fglrx
00000000000123LIBIP_PREFIX=$TMP/arch/$arch/lib/modules/fglrx/build_mod
124[ -d $LIBIP_PREFIX ]
125GCC_MAJOR="`gcc --version | grep -o -e ") ." | head -1 | cut -d " " -f 2`"
···142 cd $TMP
143}
144145+fi
146+147{ # install
148149 mkdir -p $out/lib/xorg
···158 # what are those files used for?
159 cp -r common/etc $out
1600161 cp -r $DIR_DEPENDING_ON_XORG_VERSION/usr/X11R6/$lib_arch/* $out/lib/xorg
162163+ # install kernel module
164+ if test -z "$libsOnly"; then
165 t=$out/lib/modules/${kernelVersion}/kernel/drivers/misc
166 mkdir -p $t
167168 cp ./common/lib/modules/fglrx/build_mod/2.6.x/fglrx.ko $t
169+ fi
170171 # should this be installed at all?
172 # its used by the example fglrx_gamma only
···193 patchelf --set-rpath $gcc/$lib_arch $out/lib/libatiadlxx.so
194}
195196+if test -z "$libsOnly"; then
197+198{ # build samples
199 mkdir -p $out/bin
200···238 rm -fr $out/lib/modules/fglrx # don't think those .a files are needed. They cause failure of the mod
239240}
241+242+fi
243244for p in $extraDRIlibs; do
245 for lib in $p/lib/*.so*; do
+13-13
pkgs/os-specific/linux/ati-drivers/default.nix
···1-{ stdenv, fetchurl, kernel, xlibs, which, imake
2, mesa # for fgl_glxgears
3, libXxf86vm, xf86vidmodeproto # for fglrx_gamma
4, xorg, makeWrapper, glibc, patchelf
5, unzip
00006}:
7008# If you want to use a different Xorg version probably
9# DIR_DEPENDING_ON_XORG_VERSION in builder.sh has to be adopted (?)
10# make sure libglx.so of ati is used. xorg.xorgserver does provide it as well
···21# There is one issue left:
22# /usr/lib/dri/fglrx_dri.so must point to /run/opengl-driver/lib/fglrx_dri.so
2324-assert stdenv.system == "x86_64-linux";
2526stdenv.mkDerivation {
27- name = "ati-drivers-14.4-${kernel.version}";
2829 builder = ./builder.sh;
30···49 mesa
50 ];
5152- kernel = kernel.dev;
005354 inherit glibc /* glibc only used for setting interpreter */;
55···73 homepage = http://support.amd.com/us/gpudownload/Pages/index.aspx;
74 license = licenses.unfree;
75 maintainers = with maintainers; [marcweber offline];
76- platforms = [ "x86_64-linux" ];
77 hydraPlatforms = [];
78 };
79-80- # moved assertions here because the name is evaluated when the NixOS manual is generated
81- # Don't make that fail - fail lazily when a users tries to build this derivation only
82- dummy =
83- # assert xorg.xorgserver.name == "xorg-server-1.7.5";
84- assert stdenv.system == "x86_64-linux"; # i686-linux should work as well - however I didn't test it.
85- null;
86-87}
···1+{ stdenv, fetchurl, kernel ? null, xlibs, which, imake
2, mesa # for fgl_glxgears
3, libXxf86vm, xf86vidmodeproto # for fglrx_gamma
4, xorg, makeWrapper, glibc, patchelf
5, unzip
6+, # Whether to build the libraries only (i.e. not the kernel module or
7+ # driver utils). Used to support 32-bit binaries on 64-bit
8+ # Linux.
9+ libsOnly ? false
10}:
1112+assert (!libsOnly) -> kernel != null;
13+14# If you want to use a different Xorg version probably
15# DIR_DEPENDING_ON_XORG_VERSION in builder.sh has to be adopted (?)
16# make sure libglx.so of ati is used. xorg.xorgserver does provide it as well
···27# There is one issue left:
28# /usr/lib/dri/fglrx_dri.so must point to /run/opengl-driver/lib/fglrx_dri.so
2930+with stdenv.lib;
3132stdenv.mkDerivation {
33+ name = "ati-drivers-14.4" + (optionalString (!libsOnly) "-${kernel.version}");
3435 builder = ./builder.sh;
36···55 mesa
56 ];
5758+ inherit libsOnly;
59+60+ kernel = if libsOnly then null else kernel.dev;
6162 inherit glibc /* glibc only used for setting interpreter */;
63···81 homepage = http://support.amd.com/us/gpudownload/Pages/index.aspx;
82 license = licenses.unfree;
83 maintainers = with maintainers; [marcweber offline];
84+ platforms = platforms.linux;
85 hydraPlatforms = [];
86 };
0000000087}