2019-10-15 04:08:54 +08:00
|
|
|
# Maintainer: Jerry Xiao <aur@mail.jerryxiao.cc>
|
|
|
|
# Maintainer: graysky <graysky AT archlinux DOT us>
|
|
|
|
# Contributor: Giancarlo Razzolini <grazzolini@archlinux.org>
|
2019-06-07 18:25:13 +08:00
|
|
|
# Contributor: Eric Bélanger <eric@archlinux.org>
|
|
|
|
|
2019-10-15 04:08:54 +08:00
|
|
|
pkgbase=nvidia-340xx-lts
|
|
|
|
pkgname=(nvidia-340xx-lts nvidia-340xx-lts-dkms)
|
2019-12-25 19:29:47 +08:00
|
|
|
pkgver=340.108
|
2020-01-11 04:04:07 +08:00
|
|
|
pkgrel=2
|
2019-10-23 05:07:22 +08:00
|
|
|
pkgdesc="NVIDIA drivers for linux-lts, 340xx legacy branch"
|
2019-06-07 18:25:13 +08:00
|
|
|
arch=('x86_64')
|
|
|
|
url="https://www.nvidia.com/"
|
2019-10-15 04:08:54 +08:00
|
|
|
makedepends=("nvidia-340xx-utils=${pkgver}" 'linux-lts>=4.19.79' 'linux-lts-headers>=4.19.79')
|
2019-06-07 18:25:13 +08:00
|
|
|
conflicts=('nvidia-lts')
|
|
|
|
license=('custom')
|
|
|
|
options=(!strip)
|
|
|
|
source=("https://us.download.nvidia.com/XFree86/Linux-x86_64/${pkgver}/NVIDIA-Linux-x86_64-${pkgver}-no-compat32.run"
|
2019-12-25 19:29:47 +08:00
|
|
|
unfuck-340.108-build-fix.patch
|
2020-01-11 04:04:07 +08:00
|
|
|
fix_multi_core_build.patch
|
2019-10-15 04:08:54 +08:00
|
|
|
)
|
2019-12-25 19:29:47 +08:00
|
|
|
sha256sums=('995d44fef587ff5284497a47a95d71adbee0c13020d615e940ac928f180f5b77'
|
2020-01-11 04:04:07 +08:00
|
|
|
'2b7e3ef24846a40f4492e749be946e4f7f70ebed054bc2c9079f6cbdcbfabe57'
|
|
|
|
'82d14e9e6ec47c345d225d9f398238b7254cd5ae581c70e8521b9157ec747890')
|
2019-10-15 04:08:54 +08:00
|
|
|
_pkg="NVIDIA-Linux-x86_64-${pkgver}-no-compat32"
|
2019-06-07 18:25:13 +08:00
|
|
|
|
2019-10-15 04:08:54 +08:00
|
|
|
# default is 'linux' substitute custom name here
|
|
|
|
_kernelname=linux-lts
|
|
|
|
_kernver="$(</usr/src/$_kernelname/version)"
|
|
|
|
_extradir="/usr/lib/modules/$_kernver/extramodules"
|
2019-06-07 18:25:13 +08:00
|
|
|
|
|
|
|
prepare() {
|
2019-10-15 04:08:54 +08:00
|
|
|
sh "${_pkg}.run" --extract-only
|
|
|
|
cd "${_pkg}"
|
|
|
|
|
|
|
|
# patches here
|
2019-12-25 19:29:47 +08:00
|
|
|
local src
|
|
|
|
for src in "${source[@]}"; do
|
|
|
|
src="${src%%::*}"
|
|
|
|
src="${src##*/}"
|
|
|
|
[[ $src = *.patch ]] || continue
|
|
|
|
(cd kernel ; patch -p1 --no-backup-if-mismatch -i "../../$src")
|
|
|
|
done
|
2019-10-15 04:08:54 +08:00
|
|
|
|
|
|
|
cp -a kernel kernel-dkms
|
2019-06-07 18:25:13 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
cd "${_pkg}/kernel"
|
2019-10-15 04:08:54 +08:00
|
|
|
make SYSSRC="/usr/src/$_kernelname" module
|
2019-06-07 18:25:13 +08:00
|
|
|
|
|
|
|
cd uvm
|
2019-10-15 04:08:54 +08:00
|
|
|
make SYSSRC="/usr/src/$_kernelname" module
|
2019-06-07 18:25:13 +08:00
|
|
|
}
|
|
|
|
|
2019-10-15 04:08:54 +08:00
|
|
|
package_nvidia-340xx-lts() {
|
|
|
|
pkgdesc="NVIDIA drivers for linux-lts, 340xx legacy branch."
|
|
|
|
depends=('linux-lts>=4.19.72' "nvidia-340xx-utils=$pkgver" 'libgl')
|
|
|
|
|
|
|
|
install -Dt "${pkgdir}${_extradir}" -m644 \
|
|
|
|
"${srcdir}/${_pkg}/kernel"/{nvidia,uvm/nvidia-uvm}.ko
|
|
|
|
|
|
|
|
find "${pkgdir}" -name '*.ko' -exec gzip -n {} +
|
|
|
|
|
|
|
|
echo "blacklist nouveau" |
|
2019-10-23 05:07:22 +08:00
|
|
|
install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modprobe.d/nvidia-340xx-lts.conf"
|
2019-06-07 18:25:13 +08:00
|
|
|
}
|
2019-10-15 04:08:54 +08:00
|
|
|
|
|
|
|
package_nvidia-340xx-lts-dkms() {
|
|
|
|
pkgdesc="NVIDIA driver sources for linux-lts, 340xx legacy branch"
|
|
|
|
depends=('dkms' "nvidia-340xx-utils=$pkgver" 'libgl')
|
|
|
|
optdepends=('linux-lts-headers: Build the module for lts kernel')
|
|
|
|
provides=("nvidia-340xx=$pkgver")
|
|
|
|
conflicts+=('nvidia-340xx')
|
|
|
|
|
|
|
|
cd "${_pkg}"
|
|
|
|
|
|
|
|
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"
|
|
|
|
}
|
|
|
|
|
|
|
|
# vim:set ts=2 sw=2 et:
|