Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Maintainer: graysky <graysky AT archlinux DOT us>
- # Maintainer: Jerry Xiao <aur@mail.jerryxiao.cc>
- # Contributor: Giancarlo Razzolini <grazzolini@archlinux.org>
- # Contributor: Eric BĂ©langer <eric@archlinux.org>
- pkgname=(nvidia-340xx nvidia-340xx-dkms); [ -n "$NVIDIA_340XX_DKMS_ONLY" ] && pkgname=(nvidia-340xx-dkms)
- pkgver=340.108
- pkgrel=33
- pkgdesc="NVIDIA drivers for linux, 340xx legacy branch"
- arch=('x86_64')
- url="https://www.nvidia.com/"
- makedepends=("nvidia-340xx-utils=${pkgver}" 'linux>=5.5' 'linux-headers>=5.5')
- conflicts=('nvidia')
- license=('custom')
- options=(!strip)
- _pkg="NVIDIA-Linux-x86_64-${pkgver}-no-compat32"
- # https://github.com/warpme/minimyth2/tree/master/script/nvidia/nvidia-340.108/files
- source=("https://download.nvidia.com/XFree86/Linux-x86_64/${pkgver}/${_pkg}.run"
- 20-nvidia.conf
- 0001-kernel-5.7.patch
- 0002-kernel-5.8.patch
- 0003-kernel-5.9.patch
- 0004-kernel-5.10.patch
- 0005-kernel-5.11.patch
- 0006-kernel-5.14.patch
- 0007-kernel-5.15.patch
- 0008-kernel-5.16.patch
- 0009-kernel-5.17.patch
- 0010-kernel-5.18.patch
- 0011-kernel-6.0.patch
- 0012-kernel-6.2.patch
- 0013-kernel-6.3.patch
- )
- b2sums=('6538bbec53b10f8d20977f9b462052625742e9709ef06e24cf2e55de5d0c55f1620a4bb21396cfd89ebc54c32f921ea17e3e47eaa95abcbc24ecbd144fb89028'
- '91dd76b932ca70594f83086be06ea836e05bb740d48596e95b198ff8ffffe9960d6d21d2f7643bb674d2235e4c4ad5d9f32d9cae9a865d1e44ffca13d3c8924d'
- '105c4f124f8e2ea04442492753837500dfcfd565423ea34d4917a5890d32cf3f85e850dd1ec9bf5092a6046b7cbce2c99ea0cad867bce28aab041c34d7eb2e93'
- '73976fe107570af2dd564cd62077d72934cb22412a6e6bb2f0f8897b97946cd1a245700da8fab1cec44449a947a604b9d9dfeed0020e100b25dccd13c8112405'
- 'f1cce5188a0be405ec386198fc0c134710346b2aaab16b4d3078ca78c0e5bc5100125743f6cbaf5f226910eabd6dd14b45159b1a48c586178bfddaf06be7a581'
- 'd6d08db1e56a655ccc79edb28a28d7296d7c134c8070f5618b0545ffc0fd1ea7066754f1442ec4bf4f14a6c2c1f34895fe6f0d64c03d22d7591bd3f221781006'
- '344cd3a9888a9a61941906c198d3a480ce230119c96c72c72a74b711d23face2a7b1e53b9b4639465809b84762cdc53f38210e740318866705241bc4216e4f35'
- '420b3c026c9b41090ba6b67aeeceeea77f2b69eba7e4b5b3ccc58e3d7a602824f8b34982590648826f9d8a2e033e73ea6e8c6bdfa895e80f106e1fca02ef1807'
- '08c6f5d840523ab1d047eee279e93ea04b4e006bc8aa92bfa90246a71f6632f7565700af09de32383f1f0df8c662569d54f0f34d171781b9eca97f2d2a126c92'
- '0154514431eb26a587875db865597f195f6ceb46e52063ca2a3a3bc34c8128fe9cf8adad33f90602f634014130c502d9e54c8a67e6852bf64d859205d22a8412'
- '0266e1baaac9ffbb94d9e916a693b1663d8686b15e970bfc30f7c51f051a0af9267aa5f6a12b68586c69d2e9796a1124488b3997ba4b26db1a5ac10a892f0df2'
- 'd69c9acbe550d5fccca68ca6a0d5095cbcaf887d2bc43704a8eb85533896692f16701eef07ead297881f596f5502c3105bb5bea77b2dcaf6c4dc2b49941f9f19'
- 'eb0f8321a43a952e000feee1a96820f0a011ce17481d1658ced2eaaf15c36880f54d6bdb4fbe35e9cd39e7bf0bfe9b55adf2e009f599d4cee259bab6212c0860'
- '1638bf75a802927783a0ed7cd2415e0fe51b654485742098402a0bcdbda6a6428ad0848982b64b4bd4760558f8cc60f3d6c83645e73dc0bd6f93c14eeb03874f'
- '31c8c480a830aa16c5e4c9d2183d1963553d805b2a4534a24a6b78c51862d9172eb9de555aaeae12c4558bea8f01d095f48f09272ae87610eacbdf1b908596ab')
- # default is 'linux' substitute custom name here
- _kernelname=linux
- _kernver="$(</usr/src/$_kernelname/version)"
- _extradir="/usr/lib/modules/$_kernver/extramodules"
- prepare() {
- sh "${_pkg}.run" --extract-only
- cd "${_pkg}"
- local src
- for src in "${source[@]}"; do
- src="${src%%::*}"
- src="${src##*/}"
- [[ $src = 0*.patch ]] || continue
- echo "Applying patch $src..."
- patch -Np1 < "../$src"
- done
- cp -a kernel kernel-dkms
- }
- build() {
- [ -n "$NVIDIA_340XX_DKMS_ONLY" ] && return 0
- cd "${_pkg}/kernel"
- make SYSSRC="/usr/src/$_kernelname" module
- cd uvm
- make SYSSRC="/usr/src/$_kernelname" module
- }
- package_nvidia-340xx() {
- pkgdesc="NVIDIA drivers for linux, 340xx legacy branch"
- depends=('linux>=5.3.6' "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" |
- install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modprobe.d/nvidia-340xx.conf"
- # install -Dm644 "$srcdir/20-nvidia.conf" "$pkgdir/usr/share/nvidia-340xx/20-nvidia.conf"
- install -Dm644 "$srcdir/20-nvidia.conf" "$pkgdir/etc/X11/xorg.conf.d/20-nvidia.conf"
- }
- package_nvidia-340xx-dkms() {
- pkgdesc="NVIDIA driver sources for linux, 340xx legacy branch"
- depends=('dkms' "nvidia-340xx-utils=$pkgver" 'libgl')
- optdepends=('linux-headers: Build the module for Arch 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"
- # install -Dm644 "$srcdir/20-nvidia.conf" "$pkgdir/usr/share/nvidia-340xx/20-nvidia.conf"
- install -Dm644 "$srcdir/20-nvidia.conf" "$pkgdir/etc/X11/xorg.conf.d/20-nvidia.conf"
- }
Add Comment
Please, Sign In to add comment