1 # Maintainer: Vi0L0 <vi0l093@gmail.com>
2 # Great Contributor: Eduardo "kensai" Romero (previous maintainer)
3 # Contributor: Spasswolf
4 # Contributor: aidanlinz
11 pkgname=catalyst-${_kernver}
14 pkgdesc="AMD/ATI Catalyst drivers. fglrx kernel module for ${_kernver} kernel"
15 arch=('i686' 'x86_64')
16 url="http://www.ati.amd.com"
18 depends=('catalyst-generator')
19 install=catalyst.install
26 msg "Unpacking archive ..."
27 if [ "${CARCH}" = "x86_64" ]; then
30 if [ "${CARCH}" = "i686" ]; then
36 ln -s ../*.c . || return 1
37 ln -s ../*.h . || return 1
38 ln -s ../*.patch . || return 1
39 ln -s ../Makefile . || return 1
40 ln -s ../ati_make.sh . || return 1
41 ln -s ../libfglrx_ip.a . || return 1
44 msg "Applying patch(es) ..."
45 patch -Np7 -i makefile_compat.patch || return 1
47 if [[ ${_kernver:0:6} < "2.6.39" ]] && [[ `cat /lib/modules/${_kernver}/build/.config | grep -c CONFIG_BKL=y` = 0 ]]; then
48 patch -Np6 -i no_bkl.patch || return 1
51 if [[ ${_kernver:0:6} == "2.6.39" ]] || [[ ${_kernver:0:6} > "2.6.39" ]]; then
52 patch -Np6 -i 2.6.39_bkl.patch || return 1
53 patch -Np6 -i no_bkl.patch || return 1
57 msg "Setting compilation variables ..."
58 ## include ati_make.sh and use _ati_check function from it
63 msg "Compiling fglrx module ..."
64 ## Compile module using _ati_check variables
65 make -C /lib/modules/${_kernver}/build SUBDIRS="`pwd`" ARCH=${BUILDARCH} \
66 MODFLAGS="-DMODULE -DATI -DFGL -DPAGE_ATTR_FIX=$PAGE_ATTR_FIX -DCOMPAT_ALLOC_USER_SPACE=$COMPAT_ALLOC_USER_SPACE $def_smp $def_modversions" \
67 PAGE_ATTR_FIX=$PAGE_ATTR_FIX COMPAT_ALLOC_USER_SPACE=$COMPAT_ALLOC_USER_SPACE modules || return 1
71 install -m755 -d "${pkgdir}/lib/modules/${_kernver}/video/" || return 1
72 install -m644 fglrx.ko "${pkgdir}/lib/modules/${_kernver}/video/" || return 1
73 sed -i -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/" $startdir/catalyst.install