1 # Maintainer : Ng Oon-Ee <ngoonee.talk@gmail.com>
2 # Based on nvidia-beta by Dan Vratil <vratil@progdansoft.com>
4 pkgname=nvidia-beta-all
7 pkgdesc="NVIDIA beta drivers for linux."
9 [ "$CARCH" = x86_64 ] && ARCH=x86_64 &&_srcname=NVIDIA-Linux-x86_64-${pkgver}-no-compat32 && md5sums=('d3746ccbfdffed6dc984703c5163a0e9')
10 [ "$CARCH" = "i686" ] && ARCH=x86 && _srcname=NVIDIA-Linux-x86-${pkgver} && md5sums=('cd0a20afd4d891adb884b9ad054fa2b6')
11 provides=("nvidia=${pkgver}")
12 url="http://www.nvidia.com/"
13 depends=("nvidia-utils-beta=${pkgver}")
14 makedepends=('linux-headers')
15 conflicts=('nvidia-96xx' 'nvidia-71xx' 'nvidia-legacy' 'nvidia')
17 install=nvidia.install
18 source=("ftp://download.nvidia.com/XFree86/Linux-$ARCH/${pkgver}/${_srcname}.run"
19 '2.6.33-rt-ice-nvidia-beta.patch')
21 ### Enable using of version numbers from pacman. This should only be used if you have kernels with
22 ### long version numbers (for example if compiled with git-suffixes). This will not work with kernels
23 ### compiled outside pacman's management, and takes much longer than the canonical method, due to
24 ### needing to search the local repository. Set to '1' to enable.
27 md5sums=(${md5sums[@]}
28 'bedb3e2022c9d1780b2a859e4ac21619')
32 # Extract the nvidia drivers
34 if [ -d ${_srcname} ]; then
37 sh ${_srcname}.run --extract-only
40 if [ "$USE_PACMAN_VERSION" = "0" ]; then
41 _KERNELS=`file /boot/* | grep 'Linux kernel.*boot executable' | sed 's/.*version \([^ ]\+\).*/\1/'`
43 _PACKAGES=`pacman -Qsq linux`
44 _KERNELS=`pacman -Ql $PACKAGES | grep /modules.alias.bin | sed 's/.*\/lib\/modules\/\(.*\)\/modules.alias.bin/\1/g'`
47 # Loop through all detected kernels
48 for _kernver in $_KERNELS;
50 cd ${srcdir}/${_srcname}
51 cp -R kernel kernel-${_kernver}
53 echo Building module for $_kernver
55 # If this kernel has a specific patch for nvidia-beta, apply it
56 # Patches should be named as the example, replacing the correct kernver
57 if [[ -f $startdir/$_kernver-nvidia-beta.patch ]]; then
58 echo Found patch for nvidia-beta for kernel $_kernver
59 patch -p1 < $startdir/$_kernver-nvidia-beta.patch
62 make SYSSRC=/usr/src/linux-${_kernver} module
65 # Modify .INSTALL (nvidia.install) file if needed
66 if [ "$USE_PACMAN_VERSION" = "0" ]; then
67 sed 's/USE_PACMAN_VERSION=1/USE_PACMAN_VERSION=0/g' $startdir/nvidia.install > $startdir/nvidia.installtemp
68 mv $startdir/nvidia.installtemp $startdir/nvidia.install
70 sed 's/USE_PACMAN_VERSION=0/USE_PACMAN_VERSION=1/g' $startdir/nvidia.install > $startdir/nvidia.installtemp
71 mv $startdir/nvidia.installtemp $startdir/nvidia.install
76 if [ "$USE_PACMAN_VERSION" = "0" ]; then
77 _KERNELS=`file /boot/* | grep 'Linux kernel.*boot executable' | sed 's/.*version \([^ ]\+\).*/\1/'`
79 _PACKAGES=`pacman -Qsq linux`
80 _KERNELS=`pacman -Ql $PACKAGES | grep /modules.alias.bin | sed 's/.*\/lib\/modules\/\(.*\)\/modules.alias.bin/\1/g'`
83 # Find all extramodules directories
84 _EXTRAMODULES=`find /lib/modules -name version | sed 's|\/lib\/modules\/||; s|\/version||'`
86 # Loop through all detected kernels
87 for _kernver in $_KERNELS;
89 cd "${srcdir}/${_srcname}/kernel-${_kernver}"
90 # Loop through all detected extramodules directories
91 for _moduledirs in $_EXTRAMODULES
93 # Check which extramodules directory corresponds with the built module
94 if [ `cat "/lib/modules/${_moduledirs}/version"` = $_kernver ]; then
95 # Install kernel module
96 #mkdir -p "${pkgdir}/lib/modules/${_kernver}/kernel/drivers/video/"
97 #install -m644 nvidia.ko "${pkgdir}/lib/modules/${_kernver}/kernel/drivers/video/"
98 #gzip "${pkgdir}/lib/modules/${_kernver}/kernel/drivers/video/nvidia.ko"
99 mkdir -p "${pkgdir}/lib/modules/${_moduledirs}/"
100 install -m644 nvidia.ko "${pkgdir}/lib/modules/${_moduledirs}/"
101 gzip "${pkgdir}/lib/modules/${_moduledirs}/nvidia.ko"
105 # Blacklist nouveau since 2.6.34
106 mkdir -p "${pkgdir}/etc/modprobe.d/"
107 echo "blacklist nouveau" >> "${pkgdir}/etc/modprobe.d/nouveau_blacklist.conf"