updated on Thu Jan 19 04:14:35 UTC 2012
[aur-mirror.git] / nvidia-mainline / PKGBUILD
blobc46994cbb0d25d2ab68a197db5035a1385f1c6f6
1 # Maintainer: Mikael Eriksson <mikael_eriksson@miffe.org>
2 # Original arch package by:
3 # Thomas Baechler <thomas@archlinux.org>
5 pkgname=nvidia-mainline
6 pkgver=285.05.09
7 pkgver=290.10
8 pkgrel=1
9 pkgdesc="NVIDIA drivers for linux-mainline."
10 read _ _kernver < <(file -b "/boot/vmlinuz-linux-mainline" | grep -o 'version [^ ]\+')
11 _kernpkgver=$(pacman -Q linux-mainline|cut -d' ' -f 2)
12 _extramodules=$_kernver/extramodules
13 arch=('i686' 'x86_64')
14 url="http://www.nvidia.com/"
15 depends=('linux-mainline' "nvidia-utils=${pkgver}")
16 conflicts=('nvidia-96xx' 'nvidia-173xx')
17 license=('custom')
18 install=nvidia.install
19 options=(!strip)
21 if [ "$CARCH" = "i686" ]; then
22     _arch='x86'
23     _pkg="NVIDIA-Linux-${_arch}-${pkgver}"
24     source=("ftp://download.nvidia.com/XFree86/Linux-${_arch}/${pkgver}/${_pkg}.run")
25     md5sums=('50319a4b3818c12c9c7243525e0e6316')
26 elif [ "$CARCH" = "x86_64" ]; then
27     _arch='x86_64'
28     _pkg="NVIDIA-Linux-${_arch}-${pkgver}-no-compat32"
29     source=("ftp://download.nvidia.com/XFree86/Linux-${_arch}/${pkgver}/${_pkg}.run")
30     md5sums=('cebfba9a7e91716a06c66bb5b38d9661')
33 build() {
34         msg "Building for kernel version $_kernver"
35     cd "${srcdir}"
36     sh "${_pkg}.run" --extract-only
37     cd "${_pkg}/kernel"
38     make SYSSRC=/lib/modules/"${_kernver}/build" module
41 package() {
42     install -D -m644 "${srcdir}/${_pkg}/kernel/nvidia.ko" \
43         "${pkgdir}/lib/modules/${_extramodules}/nvidia.ko"
44     install -d -m755 "${pkgdir}/etc/modprobe.d"
45     #echo "blacklist nouveau" >> "${pkgdir}/etc/modprobe.d/nouveau_blacklist.conf"
46     sed -i -e "s,EXTRAMODULES='.*',EXTRAMODULES='${_extramodules}'," "${startdir}/nvidia.install"
47     gzip "${pkgdir}/lib/modules/${_extramodules}/nvidia.ko"
48         eval pkgrel="${pkgrel}_${_kernpkgver/-/_}"