summary refs log tree commit diff
path: root/pkgs/os-specific/linux/ati-drivers/builder.sh
diff options
context:
space:
mode:
authorMarc Weber <marco-oweber@gmx.de>2012-10-07 18:03:06 +0200
committerMarc Weber <marco-oweber@gmx.de>2012-10-07 18:03:06 +0200
commit2e7847cd12cbaf8abc32e1d53683700a8e97de22 (patch)
treec8f95b43e0ab2062db99f0406e789df500c5aeaa /pkgs/os-specific/linux/ati-drivers/builder.sh
parent4454e45955e665f955e1176541bb8d195dfcb40c (diff)
downloadnixpkgs-2e7847cd12cbaf8abc32e1d53683700a8e97de22.tar
nixpkgs-2e7847cd12cbaf8abc32e1d53683700a8e97de22.tar.gz
nixpkgs-2e7847cd12cbaf8abc32e1d53683700a8e97de22.tar.bz2
nixpkgs-2e7847cd12cbaf8abc32e1d53683700a8e97de22.tar.lz
nixpkgs-2e7847cd12cbaf8abc32e1d53683700a8e97de22.tar.xz
nixpkgs-2e7847cd12cbaf8abc32e1d53683700a8e97de22.tar.zst
nixpkgs-2e7847cd12cbaf8abc32e1d53683700a8e97de22.zip
making ati dirvers compile again
See comments on the nixos patch
Diffstat (limited to 'pkgs/os-specific/linux/ati-drivers/builder.sh')
-rw-r--r--pkgs/os-specific/linux/ati-drivers/builder.sh23
1 files changed, 16 insertions, 7 deletions
diff --git a/pkgs/os-specific/linux/ati-drivers/builder.sh b/pkgs/os-specific/linux/ati-drivers/builder.sh
index b05093d8915..abb78549cee 100644
--- a/pkgs/os-specific/linux/ati-drivers/builder.sh
+++ b/pkgs/os-specific/linux/ati-drivers/builder.sh
@@ -2,13 +2,14 @@
 # TODO gentoo removes some tools because there are xorg sources (?)
 
 source $stdenv/setup
+set -x
 
 die(){ echo $@; exit 1; }
 
-
 # custom unpack:
-cp $src archive
-sh archive --extract .
+unzip $src
+run_file=$(echo amd-driver-installer-*)
+sh $run_file --extract .
 
 
 kernelVersion=$(cd ${kernel}/lib/modules && ls)
@@ -68,7 +69,7 @@ setModVersions(){
 # On kernels with the fix, use arch_compat_alloc_user_space instead
 # of compat_alloc_user_space since the latter is GPL-only
 
-COMPAT_ALLOC_USER_SPACE=compat_alloc_user_space
+COMPAT_ALLOC_USER_SPACE=arch_compat_alloc_user_space
 
 for src_file in \
     $kernelBuild/arch/x86/include/asm/compat.h \
@@ -123,6 +124,8 @@ GCC_MAJOR="`gcc --version | grep -o -e ") ." | head -1 | cut -d " " -f 2`"
   echo .lib${MODULE}_ip.a.GCC${GCC_MAJOR}.cmd
   echo 'This is a dummy file created to suppress this warning: could not find /lib/modules/fglrx/build_mod/2.6.x/.libfglrx_ip.a.GCC4.cmd for /lib/modules/fglrx/build_mod/2.6.x/libfglrx_ip.a.GCC4' > lib${MODULE}_ip.a.GCC${GCC_MAJOR}.cmd
 
+  sed -i -e "s@COMPAT_ALLOC_USER_SPACE@$COMPAT_ALLOC_USER_SPACE@" ../kcl_ioctl.c
+
   make CC=${CC} \
       LIBIP_PREFIX=$(echo "$LIBIP_PREFIX" | sed -e 's|^\([^/]\)|../\1|') \
       MODFLAGS="-DMODULE -DATI -DFGL -DPAGE_ATTR_FIX=$PAGE_ATTR_FIX -DCOMPAT_ALLOC_USER_SPACE=$COMPAT_ALLOC_USER_SPACE $def_smp $def_modversions" \
@@ -143,12 +146,12 @@ GCC_MAJOR="`gcc --version | grep -o -e ") ." | head -1 | cut -d " " -f 2`"
   cp -r common/usr/share $out
   cp -r common/usr/X11R6 $out
 
-  cp -r arch/$arch/lib $out/lib
+  # cp -r arch/$arch/lib $out/lib
 
   # what are those files used for?
   cp -r common/etc $out
 
-  DIR_DEPENDING_ON_XORG_VERSION=x750_64a
+  DIR_DEPENDING_ON_XORG_VERSION=xpic_64a
   cp -r $DIR_DEPENDING_ON_XORG_VERSION/usr/X11R6/$lib_arch/* $out/lib/xorg
 
   t=$out/lib/modules/${kernelVersion}/kernel/drivers/misc
@@ -164,12 +167,18 @@ GCC_MAJOR="`gcc --version | grep -o -e ") ." | head -1 | cut -d " " -f 2`"
   cp -r $TMP/arch/$arch/usr/X11R6/$lib_arch/modules/dri $out/lib
   cp -r $TMP/arch/$arch/usr/X11R6/$lib_arch/modules/dri/* $out/lib
   cp -r $TMP/arch/$arch/usr/X11R6/$lib_arch/*.so.* $out/lib
+  cp -r $TMP/arch/$arch/usr/X11R6/$lib_arch/fglrx/fglrx-libGL.so.1.2 $out/lib/fglrx-libGL.so.1.2
+
   cp -r $TMP/arch/$arch/usr/$lib_arch/* $out/lib
 
   # cp -r $TMP/arch/$arch/usr/$lib_arch/* $out/lib
   ln -s libatiuki.so.1.0 $out/lib/libatiuki.so.1
-  ln -s libGL.so.1.2 $out/lib/libGL.so.1
+  ln -s fglrx-libGL.so.1.2 $out/lib/libGL.so.1
+  ln -s fglrx-libGL.so.1.2 $out/lib/libGL.so
+
   ln -s libfglrx_gamma.so.1.0 $out/lib/libfglrx_gamma.so.1
+  # make xorg use the ati version
+  ln -s $out/lib/xorg/modules/extensions/{fglrx/fglrx-libglx.so,libglx.so}
 
 }