2019-10-15 04:08:30 +08:00
|
|
|
# Maintainer: Jerry Xiao <aur@mail.jerryxiao.cc>
|
|
|
|
# Maintainer: graysky <graysky AT archlinux DOT us>
|
|
|
|
# Contributor: Giancarlo Razzolini <grazzolini@archlinux.org>
|
|
|
|
# Contributor: Eric Bélanger <eric@archlinux.org>
|
2019-06-07 18:24:37 +08:00
|
|
|
|
|
|
|
pkgbase=nvidia-340xx
|
|
|
|
pkgname=(nvidia-340xx nvidia-340xx-dkms)
|
2019-12-25 19:29:12 +08:00
|
|
|
pkgver=340.108
|
2020-10-22 19:05:19 +08:00
|
|
|
pkgrel=12
|
2019-06-07 18:24:37 +08:00
|
|
|
pkgdesc="NVIDIA drivers for linux, 340xx legacy branch"
|
|
|
|
arch=('x86_64')
|
2019-10-15 04:08:30 +08:00
|
|
|
url="https://www.nvidia.com/"
|
2020-02-05 05:36:55 +08:00
|
|
|
makedepends=("nvidia-340xx-utils=${pkgver}" 'linux>=5.5' 'linux-headers>=5.5')
|
2019-06-07 18:24:37 +08:00
|
|
|
conflicts=('nvidia')
|
|
|
|
license=('custom')
|
2019-10-15 04:08:30 +08:00
|
|
|
options=(!strip)
|
|
|
|
source=("https://us.download.nvidia.com/XFree86/Linux-x86_64/${pkgver}/NVIDIA-Linux-x86_64-${pkgver}-no-compat32.run"
|
2020-10-22 19:05:19 +08:00
|
|
|
0001-kernel-5.7.patch
|
|
|
|
0002-kernel-5.8.patch
|
|
|
|
0003-kernel-5.9.patch
|
2019-10-15 04:08:30 +08:00
|
|
|
)
|
2020-08-15 17:37:50 +08:00
|
|
|
b2sums=('6538bbec53b10f8d20977f9b462052625742e9709ef06e24cf2e55de5d0c55f1620a4bb21396cfd89ebc54c32f921ea17e3e47eaa95abcbc24ecbd144fb89028'
|
2020-10-22 19:05:19 +08:00
|
|
|
'7150233df867a55f57aa5e798b9c7618329d98459fecc35c4acfad2e9772236cb229703c4fa072381c509279d0588173d65f46297231f4d3bfc65a1ef52e65b1'
|
|
|
|
'b436095b89d6e294995651a3680ff18b5af5e91582c3f1ec9b7b63be9282497f54f9bf9be3997a5af30eec9b8548f25ec5235d969ac00a667a9cddece63d8896'
|
|
|
|
'947cb1f149b2db9c3c4f973f285d389790f73fc8c8a6865fc5b78d6a782f49513aa565de5c82a81c07515f1164e0e222d26c8212a14cf016e387bcc523e3fcb1')
|
2019-06-07 18:24:37 +08:00
|
|
|
_pkg="NVIDIA-Linux-x86_64-${pkgver}-no-compat32"
|
|
|
|
|
2019-10-15 04:08:30 +08:00
|
|
|
# default is 'linux' substitute custom name here
|
|
|
|
_kernelname=linux
|
|
|
|
_kernver="$(</usr/src/$_kernelname/version)"
|
|
|
|
_extradir="/usr/lib/modules/$_kernver/extramodules"
|
|
|
|
|
2019-06-07 18:24:37 +08:00
|
|
|
prepare() {
|
2019-10-15 04:08:30 +08:00
|
|
|
sh "${_pkg}.run" --extract-only
|
2019-06-07 18:24:37 +08:00
|
|
|
|
2020-10-22 19:05:19 +08:00
|
|
|
cd "${_pkg}"
|
|
|
|
patch -Np1 -i ../0001-kernel-5.7.patch
|
|
|
|
patch -Np1 -i ../0002-kernel-5.8.patch
|
|
|
|
patch -Np1 -i ../0003-kernel-5.9.patch
|
2020-08-15 17:37:50 +08:00
|
|
|
|
2019-10-15 04:08:30 +08:00
|
|
|
cp -a kernel kernel-dkms
|
2019-06-07 18:24:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
2019-10-15 04:08:30 +08:00
|
|
|
cd "${_pkg}/kernel"
|
|
|
|
make SYSSRC="/usr/src/$_kernelname" module
|
2019-06-07 18:24:37 +08:00
|
|
|
|
2019-10-15 04:08:30 +08:00
|
|
|
cd uvm
|
|
|
|
make SYSSRC="/usr/src/$_kernelname" module
|
2019-06-07 18:24:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
package_nvidia-340xx() {
|
2019-10-15 04:08:30 +08:00
|
|
|
pkgdesc="NVIDIA drivers for linux, 340xx legacy branch"
|
2019-10-23 05:07:39 +08:00
|
|
|
depends=('linux>=5.3.6' "nvidia-340xx-utils=$pkgver" 'libgl')
|
2019-06-07 18:24:37 +08:00
|
|
|
|
2019-10-15 04:08:30 +08:00
|
|
|
install -Dt "${pkgdir}${_extradir}" -m644 \
|
|
|
|
"${srcdir}/${_pkg}/kernel"/{nvidia,uvm/nvidia-uvm}.ko
|
2019-06-07 18:24:37 +08:00
|
|
|
|
2019-10-15 04:08:30 +08:00
|
|
|
find "${pkgdir}" -name '*.ko' -exec gzip -n {} +
|
2019-06-07 18:24:37 +08:00
|
|
|
|
2019-10-15 04:08:30 +08:00
|
|
|
echo "blacklist nouveau" |
|
2019-10-23 05:07:39 +08:00
|
|
|
install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modprobe.d/nvidia-340xx.conf"
|
2019-06-07 18:24:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
package_nvidia-340xx-dkms() {
|
|
|
|
pkgdesc="NVIDIA driver sources for linux, 340xx legacy branch"
|
|
|
|
depends=('dkms' "nvidia-340xx-utils=$pkgver" 'libgl')
|
2019-10-15 04:08:30 +08:00
|
|
|
optdepends=('linux-headers: Build the module for Arch kernel')
|
2019-06-07 18:24:37 +08:00
|
|
|
provides=("nvidia-340xx=$pkgver")
|
|
|
|
conflicts+=('nvidia-340xx')
|
|
|
|
|
2019-10-15 04:08:30 +08:00
|
|
|
cd "${_pkg}"
|
2019-06-07 18:24:37 +08:00
|
|
|
|
|
|
|
install -dm 755 "${pkgdir}"/usr/src
|
|
|
|
cp -dr --no-preserve='ownership' kernel-dkms "${pkgdir}/usr/src/nvidia-${pkgver}"
|
|
|
|
cat "${pkgdir}"/usr/src/nvidia-${pkgver}/uvm/dkms.conf.fragment >> "${pkgdir}"/usr/src/nvidia-${pkgver}/dkms.conf
|
|
|
|
|
|
|
|
echo "blacklist nouveau" |
|
|
|
|
install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modprobe.d/${pkgname}.conf"
|
|
|
|
}
|
2019-10-15 04:08:30 +08:00
|
|
|
|
|
|
|
# vim:set ts=2 sw=2 et:
|