ati_unfree: Towards using ati unfree 32bit binary libs

+38 -26
+1 -1
nixos/modules/hardware/video/ati.nix
··· 22 22 { name = "fglrx"; modules = [ ati_x11 ]; libPath = [ "${ati_x11}/lib" ]; }; 23 23 24 24 hardware.opengl.package = ati_x11; 25 - #hardware.opengl.package32 = pkgs_i686.linuxPackages.ati_x11.override { libsOnly = true; kernel = null; }; 25 + hardware.opengl.package32 = pkgs_i686.linuxPackages.ati_drivers_x11.override { libsOnly = true; kernel = null; }; 26 26 27 27 environment.systemPackages = [ ati_x11 ]; 28 28
+24 -12
pkgs/os-specific/linux/ati-drivers/builder.sh
··· 13 13 14 14 eval "$patchPhase" 15 15 16 + 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 16 31 kernelVersion=$(cd ${kernel}/lib/modules && ls) 17 32 kernelBuild=$(echo ${kernel}/lib/modules/$kernelVersion/build) 18 33 linuxsources=$(echo ${kernel}/lib/modules/$kernelVersion/source) ··· 105 120 setModVersions 106 121 CC=gcc 107 122 MODULE=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 119 123 LIBIP_PREFIX=$TMP/arch/$arch/lib/modules/fglrx/build_mod 120 124 [ -d $LIBIP_PREFIX ] 121 125 GCC_MAJOR="`gcc --version | grep -o -e ") ." | head -1 | cut -d " " -f 2`" ··· 138 142 cd $TMP 139 143 } 140 144 145 + fi 146 + 141 147 { # install 142 148 143 149 mkdir -p $out/lib/xorg ··· 152 158 # what are those files used for? 153 159 cp -r common/etc $out 154 160 155 - DIR_DEPENDING_ON_XORG_VERSION=xpic_64a 156 161 cp -r $DIR_DEPENDING_ON_XORG_VERSION/usr/X11R6/$lib_arch/* $out/lib/xorg 157 162 163 + # install kernel module 164 + if test -z "$libsOnly"; then 158 165 t=$out/lib/modules/${kernelVersion}/kernel/drivers/misc 159 166 mkdir -p $t 160 167 161 168 cp ./common/lib/modules/fglrx/build_mod/2.6.x/fglrx.ko $t 169 + fi 162 170 163 171 # should this be installed at all? 164 172 # its used by the example fglrx_gamma only ··· 185 193 patchelf --set-rpath $gcc/$lib_arch $out/lib/libatiadlxx.so 186 194 } 187 195 196 + if test -z "$libsOnly"; then 197 + 188 198 { # build samples 189 199 mkdir -p $out/bin 190 200 ··· 228 238 rm -fr $out/lib/modules/fglrx # don't think those .a files are needed. They cause failure of the mod 229 239 230 240 } 241 + 242 + fi 231 243 232 244 for p in $extraDRIlibs; do 233 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 1 + { stdenv, fetchurl, kernel ? null, xlibs, which, imake 2 2 , mesa # for fgl_glxgears 3 3 , libXxf86vm, xf86vidmodeproto # for fglrx_gamma 4 4 , xorg, makeWrapper, glibc, patchelf 5 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 6 10 }: 7 11 12 + assert (!libsOnly) -> kernel != null; 13 + 8 14 # If you want to use a different Xorg version probably 9 15 # DIR_DEPENDING_ON_XORG_VERSION in builder.sh has to be adopted (?) 10 16 # make sure libglx.so of ati is used. xorg.xorgserver does provide it as well ··· 21 27 # There is one issue left: 22 28 # /usr/lib/dri/fglrx_dri.so must point to /run/opengl-driver/lib/fglrx_dri.so 23 29 24 - assert stdenv.system == "x86_64-linux"; 30 + with stdenv.lib; 25 31 26 32 stdenv.mkDerivation { 27 - name = "ati-drivers-14.4-${kernel.version}"; 33 + name = "ati-drivers-14.4" + (optionalString (!libsOnly) "-${kernel.version}"); 28 34 29 35 builder = ./builder.sh; 30 36 ··· 49 55 mesa 50 56 ]; 51 57 52 - kernel = kernel.dev; 58 + inherit libsOnly; 59 + 60 + kernel = if libsOnly then null else kernel.dev; 53 61 54 62 inherit glibc /* glibc only used for setting interpreter */; 55 63 ··· 73 81 homepage = http://support.amd.com/us/gpudownload/Pages/index.aspx; 74 82 license = licenses.unfree; 75 83 maintainers = with maintainers; [marcweber offline]; 76 - platforms = [ "x86_64-linux" ]; 84 + platforms = platforms.linux; 77 85 hydraPlatforms = []; 78 86 }; 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 87 }