ati_unfree: Towards using ati unfree 32bit binary libs

+38 -26
+1 -1
nixos/modules/hardware/video/ati.nix
··· 22 { name = "fglrx"; modules = [ ati_x11 ]; libPath = [ "${ati_x11}/lib" ]; }; 23 24 hardware.opengl.package = ati_x11; 25 - #hardware.opengl.package32 = pkgs_i686.linuxPackages.ati_x11.override { libsOnly = true; kernel = null; }; 26 27 environment.systemPackages = [ ati_x11 ]; 28
··· 22 { name = "fglrx"; modules = [ ati_x11 ]; libPath = [ "${ati_x11}/lib" ]; }; 23 24 hardware.opengl.package = ati_x11; 25 + hardware.opengl.package32 = pkgs_i686.linuxPackages.ati_drivers_x11.override { libsOnly = true; kernel = null; }; 26 27 environment.systemPackages = [ ati_x11 ]; 28
+24 -12
pkgs/os-specific/linux/ati-drivers/builder.sh
··· 13 14 eval "$patchPhase" 15 16 kernelVersion=$(cd ${kernel}/lib/modules && ls) 17 kernelBuild=$(echo ${kernel}/lib/modules/$kernelVersion/build) 18 linuxsources=$(echo ${kernel}/lib/modules/$kernelVersion/source) ··· 105 setModVersions 106 CC=gcc 107 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 LIBIP_PREFIX=$TMP/arch/$arch/lib/modules/fglrx/build_mod 120 [ -d $LIBIP_PREFIX ] 121 GCC_MAJOR="`gcc --version | grep -o -e ") ." | head -1 | cut -d " " -f 2`" ··· 138 cd $TMP 139 } 140 141 { # install 142 143 mkdir -p $out/lib/xorg ··· 152 # what are those files used for? 153 cp -r common/etc $out 154 155 - DIR_DEPENDING_ON_XORG_VERSION=xpic_64a 156 cp -r $DIR_DEPENDING_ON_XORG_VERSION/usr/X11R6/$lib_arch/* $out/lib/xorg 157 158 t=$out/lib/modules/${kernelVersion}/kernel/drivers/misc 159 mkdir -p $t 160 161 cp ./common/lib/modules/fglrx/build_mod/2.6.x/fglrx.ko $t 162 163 # 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 } 187 188 { # 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 229 230 } 231 232 for p in $extraDRIlibs; do 233 for lib in $p/lib/*.so*; do
··· 13 14 eval "$patchPhase" 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 31 kernelVersion=$(cd ${kernel}/lib/modules && ls) 32 kernelBuild=$(echo ${kernel}/lib/modules/$kernelVersion/build) 33 linuxsources=$(echo ${kernel}/lib/modules/$kernelVersion/source) ··· 120 setModVersions 121 CC=gcc 122 MODULE=fglrx 123 LIBIP_PREFIX=$TMP/arch/$arch/lib/modules/fglrx/build_mod 124 [ -d $LIBIP_PREFIX ] 125 GCC_MAJOR="`gcc --version | grep -o -e ") ." | head -1 | cut -d " " -f 2`" ··· 142 cd $TMP 143 } 144 145 + fi 146 + 147 { # install 148 149 mkdir -p $out/lib/xorg ··· 158 # what are those files used for? 159 cp -r common/etc $out 160 161 cp -r $DIR_DEPENDING_ON_XORG_VERSION/usr/X11R6/$lib_arch/* $out/lib/xorg 162 163 + # install kernel module 164 + if test -z "$libsOnly"; then 165 t=$out/lib/modules/${kernelVersion}/kernel/drivers/misc 166 mkdir -p $t 167 168 cp ./common/lib/modules/fglrx/build_mod/2.6.x/fglrx.ko $t 169 + fi 170 171 # 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 } 195 196 + 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 239 240 } 241 + 242 + fi 243 244 for 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 6 }: 7 8 # 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 23 24 - assert stdenv.system == "x86_64-linux"; 25 26 stdenv.mkDerivation { 27 - name = "ati-drivers-14.4-${kernel.version}"; 28 29 builder = ./builder.sh; 30 ··· 49 mesa 50 ]; 51 52 - kernel = kernel.dev; 53 54 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 }: 11 12 + 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 29 30 + with stdenv.lib; 31 32 stdenv.mkDerivation { 33 + name = "ati-drivers-14.4" + (optionalString (!libsOnly) "-${kernel.version}"); 34 35 builder = ./builder.sh; 36 ··· 55 mesa 56 ]; 57 58 + inherit libsOnly; 59 + 60 + kernel = if libsOnly then null else kernel.dev; 61 62 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 }; 87 }