# $Id$ # Maintainer: Sven-Hendrik Haase # Maintainer: Felix Yan # Contributor: Thomas Baechler pkgbase=nvidia pkgname=(nvidia) pkgver=396.24 _extramodules=extramodules-4.17-ARCH pkgrel=99 pkgdesc="NVIDIA drivers for linux" arch=('x86_64') url="http://www.nvidia.com/" makedepends=("nvidia-utils=${pkgver}" 'linux' 'linux-headers>=4.16' 'linux-headers<4.17') license=('custom') options=('!strip') _pkg="NVIDIA-Linux-x86_64-${pkgver}" source=("http://us.download.nvidia.com/XFree86/Linux-x86_64/${pkgver}/${_pkg}.run" kernel-4.16.patch) sha256sums=('59bb112b17ca72cd15fed4e521d4b52b0e9f5b8b13a95b36521f8eda978b568e' '622ac792ec200b2239cb663c0010392118b78c9904973d82cd261165c16d6385') prepare() { sh "${_pkg}.run" --extract-only cd "${_pkg}" # Restore phys_to_dma support (still needed for 396.18) # https://bugs.archlinux.org/task/58074 patch -Np1 -i ../kernel-4.16.patch # Change to GPL license find . -name '*.c' -type f -print0 | xargs -0 sed -i -E 's/MODULE_LICENSE\("(.*)"\)/MODULE_LICENSE\("GPL"\)/g' } build() { _kernver="$(cat /usr/lib/modules/${_extramodules}/version)" cd "${_pkg}"/kernel make SYSSRC=/usr/lib/modules/"${_kernver}/build" module } package_nvidia() { pkgdesc="NVIDIA drivers for linux" depends=('linux>=4.16' 'linux<4.17' "nvidia-utils=${pkgver}" 'libgl') install -Dt "${pkgdir}/usr/lib/modules/${_extramodules}" -m644 \ "${srcdir}/${_pkg}/kernel"/nvidia{,-modeset,-drm,-uvm}.ko find "${pkgdir}" -name '*.ko' -exec gzip -n {} + echo "blacklist nouveau" | install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modprobe.d/${pkgname}.conf" install -Dt "${pkgdir}/usr/share/licenses/${pkgname}" -m644 "${srcdir}/${_pkg}/LICENSE" }