pkgbuilds/nvidia-drd/PKGBUILD

52 lines
1.9 KiB
Bash

# $Id: PKGBUILD 209728 2014-04-01 21:47:44Z thomas $
# Maintainer : Thomas Baechler <thomas@archlinux.org>
pkgname=nvidia-drd
pkgver=334.21
_extramodules=extramodules-3.14-drd
pkgrel=4
pkgdesc="NVIDIA drivers for linux"
arch=('i686' 'x86_64')
url="http://www.nvidia.com/"
depends=('linux-drd>=3.14' 'linux-drd<3.15' "nvidia-libgl" "nvidia-utils=${pkgver}")
makedepends=('linux-drd-headers>=3.14' 'linux-drd-headers<3.15')
conflicts=('nvidia-96xx' 'nvidia-173xx')
license=('custom')
install=nvidia.install
options=(!strip)
source=("ftp://download.nvidia.com/XFree86/Linux-x86/${pkgver}/NVIDIA-Linux-x86-${pkgver}.run"
"ftp://download.nvidia.com/XFree86/Linux-x86_64/${pkgver}/NVIDIA-Linux-x86_64-${pkgver}-no-compat32.run"
'nvidia-3.14.patch')
md5sums=('3b2736dd6ed7e24f71004bad0e55e32e'
'f96b6708702830fe647a7d11832c514e'
'08810729376eb0f829dedaf00d1c5915')
[[ "$CARCH" = "i686" ]] && _pkg="NVIDIA-Linux-x86-${pkgver}"
[[ "$CARCH" = "x86_64" ]] && _pkg="NVIDIA-Linux-x86_64-${pkgver}-no-compat32"
prepare() {
sh "${_pkg}.run" --extract-only
cd "${_pkg}"
# patches here
patch -p1 -i "${srcdir}/nvidia-3.14.patch"
}
build() {
_kernver="$(cat /usr/lib/modules/${_extramodules}/version)"
cd "${_pkg}"/kernel
make SYSSRC=/usr/lib/modules/"${_kernver}/build" module
cd uvm
make SYSSRC=/usr/lib/modules/"${_kernver}/build" module
}
package() {
install -D -m644 "${srcdir}/${_pkg}/kernel/nvidia.ko" \
"${pkgdir}/usr/lib/modules/${_extramodules}/nvidia.ko"
install -D -m644 "${srcdir}/${_pkg}/kernel/uvm/nvidia-uvm.ko" \
"${pkgdir}/usr/lib/modules/${_extramodules}/nvidia-uvm.ko"
gzip "${pkgdir}/usr/lib/modules/${_extramodules}/"*.ko
install -d -m755 "${pkgdir}/usr/lib/modprobe.d"
echo "blacklist nouveau" >> "${pkgdir}/usr/lib/modprobe.d/nvidia-drd.conf"
sed -i -e "s/EXTRAMODULES='.*'/EXTRAMODULES='${_extramodules}'/" "${startdir}/nvidia.install"
}