summary refs log tree commit diff
path: root/pkgs/os-specific
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
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')
-rw-r--r--pkgs/os-specific/linux/ati-drivers/builder.sh23
-rw-r--r--pkgs/os-specific/linux/ati-drivers/default.nix13
2 files changed, 27 insertions, 9 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}
 
 }
 
diff --git a/pkgs/os-specific/linux/ati-drivers/default.nix b/pkgs/os-specific/linux/ati-drivers/default.nix
index a53058de6a0..49efcc1e76e 100644
--- a/pkgs/os-specific/linux/ati-drivers/default.nix
+++ b/pkgs/os-specific/linux/ati-drivers/default.nix
@@ -2,6 +2,7 @@
 , mesa # for fgl_glxgears
 , libXxf86vm, xf86vidmodeproto # for fglrx_gamma
 , xorg, makeWrapper, glibc, patchelf
+, unzip
 }:
 
 # If you want to use a different Xorg version probably
@@ -16,6 +17,9 @@
 
 # http://wiki.cchtml.com/index.php/Main_Page
 
+# There is one issue left:
+# /usr/lib/dri/fglrx_dri.so must point to /run/opengl-driver/lib/fglrx_dri.so
+
 assert stdenv.system == "x86_64-linux";
 
 stdenv.mkDerivation rec {
@@ -27,14 +31,19 @@ stdenv.mkDerivation rec {
   inherit libXxf86vm xf86vidmodeproto;
 
   src = fetchurl {
-    url = https://www2.ati.com/drivers/linux/ati-driver-installer-10-11-x86.x86_64.run;
-    sha256 = "1z33w831ayx1j5lm9d1xv6whkmzsz9v8li3s8c96hwnwki6zpimr";
+    url = http://www2.ati.com/drivers/linux/amd-driver-installer-12-8-x86.x86_64.zip;
+    sha256 = "0hdv89vdap6v0dnwhddizfmlkwyh0j910sp4wyj2lq5pn9rm2lk2";
+
+    # beta
+    # url = "http://www2.ati.com/drivers/beta/amd-driver-installer-12-9-beta-x86.x86_64.zip";
+    # sha256 = "02dmflzfrgr07fa1hv34m7ad8pra21xv7qbk500gqm6v8s9vbplk";
   };
 
   buildInputs =
     [ xlibs.libXext xlibs.libX11
       xlibs.libXrandr which imake makeWrapper
       patchelf
+      unzip
     ];
     
   inherit kernel glibc /* glibc only used for setting interpreter */;