[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

AMD64 patch for flavio's fglrx debs



Here's a patch I've made against flavio's latest fglrx packages to generate amd64 debs. I *think* it does the right thing placing the 32bit drivers in /emul/ia32-linux/usr/X11R6/lib/ and the 64bit ones in /usr/X11R6/lib/, with the correct diversions. It works for me, but I don't have any real games to test the 32bit compatability with.

As a side note, module-assistant kicks ass.

-Peter
diff -ur old/fglrx-installer-8.8.25/debian/control fglrx-installer-8.8.25/debian/control
--- old/fglrx-installer-8.8.25/debian/control	2004-12-26 17:25:50.000000000 -0500
+++ fglrx-installer-8.8.25/debian/control	2005-01-19 18:01:41.000000000 -0500
@@ -6,7 +6,7 @@
 Standards-Version: 3.6.1
 
 Package: fglrx-driver
-Architecture: i386
+Architecture: amd64 i386
 Depends: ${shlibs:Depends}, xserver-xfree86 (>= ${XVERSION}), xserver-xfree86 (<< ${XVERSIONMAX})
 Recommends: fglrx-kernel
 Description: Video driver for the ATI graphics accelerators
@@ -28,7 +28,7 @@
 
 Package: fglrx-driver-dev
 Section: non-free/devel
-Architecture: i386
+Architecture: amd64 i386
 Depends: fglrx-driver
 Description: Video driver for the ATI graphics accelerators (devel files)
  Video driver for the ATI Radeon and FireGL graphics accelerators.
@@ -37,7 +37,7 @@
  and the FGLRXGAMMA extension interface library.
 
 Package: fglrx-kernel-src
-Architecture: i386
+Architecture: amd64 i386
 Depends: debconf, debhelper (>= 4), kernel-package, make
 Recommends: fglrx-driver
 Description: Kernel module source for the ATI graphics accelerators
@@ -46,7 +46,7 @@
  This package provides the kernel module build environment.
 
 Package: fglrx-control-qt3
-Architecture: i386
+Architecture: amd64 i386
 Depends: ${shlibs:Depends}, fglrx-driver
 Conflicts: fglrx-control-qt2
 Description: Control panel for the ATI graphics accelerators
@@ -55,7 +55,7 @@
  This package provides the control panel comnpiled for Qt3.
 
 Package: fglrx-sources
-Architecture: i386
+Architecture: amd64 i386
 Recommends: fglrx-driver, libqt3-mt-dev, xlibs-dev
 Description: Source code for the ATI graphics accelerators control panel
  Video driver for the ATI Radeon and FireGL graphics accelerators.
diff -ur old/fglrx-installer-8.8.25/debian/postrm fglrx-installer-8.8.25/debian/postrm
--- old/fglrx-installer-8.8.25/debian/postrm	2004-03-22 03:35:44.000000000 -0500
+++ fglrx-installer-8.8.25/debian/postrm	2005-01-19 20:51:23.000000000 -0500
@@ -15,6 +15,16 @@
 
 case "$1" in
     remove)
+	if [ `arch` = 'x86_64' ]; then
+		dpkg-divert --remove --package fglrx-driver \
+			--divert /usr/share/fglrx/diversions/emul/libGL.so.1.2 \
+			--rename /emul/ia32-linux/usr/X11R6/lib/libGL.so.1.2
+
+		if [  -d /usr/share/fglrx/diversions/emul ]; then
+			rmdir /usr/share/fglrx/diversions/emul || true
+		fi
+	fi
+
 	dpkg-divert --remove --package fglrx-driver \
 		--divert /usr/share/fglrx/diversions/libGL.so.1.2 \
 		--rename /usr/X11R6/lib/libGL.so.1.2
diff -ur old/fglrx-installer-8.8.25/debian/preinst fglrx-installer-8.8.25/debian/preinst
--- old/fglrx-installer-8.8.25/debian/preinst	2004-03-22 03:35:30.000000000 -0500
+++ fglrx-installer-8.8.25/debian/preinst	2005-01-19 20:51:38.000000000 -0500
@@ -20,6 +20,16 @@
 	dpkg-divert --add --package fglrx-driver \
 		--divert /usr/share/fglrx/diversions/libGL.so.1.2 \
 		--rename /usr/X11R6/lib/libGL.so.1.2
+
+	if [ `arch` = 'x86_64' ]; then
+		if [ ! -d /usr/share/fglrx/diversions/emul ]; then
+			mkdir -p /usr/share/fglrx/diversions/emul || true
+		fi
+
+		dpkg-divert --add --package fglrx-driver \
+			--divert /usr/share/fglrx/diversions/emul/libGL.so.1.2 \
+			--rename /emul/ia32-linux/usr/X11R6/lib/libGL.so.1.2
+	fi
     ;;
 
     upgrade)
diff -ur old/fglrx-installer-8.8.25/debian/rules fglrx-installer-8.8.25/debian/rules
--- old/fglrx-installer-8.8.25/debian/rules	2005-01-18 15:50:14.000000000 -0500
+++ fglrx-installer-8.8.25/debian/rules	2005-01-19 20:42:38.000000000 -0500
@@ -46,7 +46,12 @@
 
 # These file names don't always match XVERSION+PVERSION:
 # look on the driver info page and update accordingly.
-RPMNAME := fglrx_$(subst .,_,$(XVERSION))-$(PVERSION)-1.i386.rpm
+ifeq ($(shell arch),x86_64)
+	RPMNAME := fglrx64_$(subst .,_,$(XVERSION))-$(PVERSION)-1.x86_64.rpm
+else
+	RPMNAME := fglrx_$(subst .,_,$(XVERSION))-$(PVERSION)-1.i386.rpm
+endif
+
 PATCHDIR := debian/patches-$(PVERSION)
 
 # Package names
@@ -107,11 +112,23 @@
 	dh_installdirs
 
 	# Create the directories to install into
+	# the amd64 package includes 32bit compatability libraries
+ifeq ($(shell arch),x86_64)
 	dh_installdirs -p$(PKG_driver) \
+		emul/ia32-linux/usr/X11R6/lib \
+		emul/ia32-linux/usr/X11R6/lib/modules \
 		usr/X11R6 \
 		usr/X11R6/bin \
 		usr/X11R6/lib \
 		usr/X11R6/lib/modules
+else
+	dh_installdirs -p$(PKG_driver) \
+		usr/X11R6 \
+		usr/X11R6/bin \
+		usr/X11R6/lib \
+		usr/X11R6/lib/modules
+endif
+
 	dh_installdirs -p$(PKG_driver_dev) \
 		usr/X11R6 \
 		usr/X11R6/include \
@@ -134,8 +151,16 @@
 	dh_install
 
 	dh_install -p$(PKG_driver) "usr/X11R6/bin/fgl*"      "usr/X11R6/bin"
+	# amd64 needs some library redirection
+ifeq ($(shell arch),x86_64)
+	dh_install -p$(PKG_driver) "usr/X11R6/lib64/*.so*"     "usr/X11R6/lib"
+	dh_install -p$(PKG_driver) "usr/X11R6/lib64/modules/*" "usr/X11R6/lib/modules"
+	dh_install -p$(PKG_driver) "usr/X11R6/lib/*.so*"       "emul/ia32-linux/usr/X11R6/lib"
+	dh_install -p$(PKG_driver) "usr/X11R6/lib/modules/*"   "emul/ia32-linux/usr/X11R6/lib/modules"
+else
 	dh_install -p$(PKG_driver) "usr/X11R6/lib/*.so*"     "usr/X11R6/lib"
 	dh_install -p$(PKG_driver) "usr/X11R6/lib/modules/*" "usr/X11R6/lib/modules"
+endif
 
 	dh_install -p$(PKG_driver_dev) "usr/X11R6/lib/*.a"   "usr/X11R6/lib"
 	dh_install -p$(PKG_driver_dev) "usr/X11R6/include/*" "usr/X11R6/include"
Only in fglrx-installer-8.8.25/debian: substvars
diff -ur old/fglrx-installer-8.8.25/module/control.template fglrx-installer-8.8.25/module/control.template
--- old/fglrx-installer-8.8.25/module/control.template	2004-12-25 13:16:15.000000000 -0500
+++ fglrx-installer-8.8.25/module/control.template	2005-01-19 18:03:44.000000000 -0500
@@ -5,7 +5,7 @@
 Build-Depends: debhelper (>= 4.2.11), kernel-package
 
 Package: fglrx-kernel-#KVERS#
-Architecture: i386
+Architecture: amd64 i386
 Provides: fglrx-kernel
 Recommends: fglrx-driver (= #VERSION#), kernel-image-#KVERS#
 Description: ATI binary kernel module for Linux #KVERS#

Reply to: