Advertisement
Guest User

Nvidia-340xx-dkms

a guest
Oct 30th, 2022
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.93 KB | Software | 0 0
  1. # Maintainer: graysky <graysky AT archlinux DOT us>
  2. # Maintainer: Jerry Xiao <aur@mail.jerryxiao.cc>
  3. # Contributor: Giancarlo Razzolini <grazzolini@archlinux.org>
  4. # Contributor: Eric Bélanger <eric@archlinux.org>
  5.  
  6. pkgbase=nvidia-340xx
  7. pkgname=(nvidia-340xx nvidia-340xx-dkms); [ -n "$NVIDIA_340XX_DKMS_ONLY" ] && pkgname=(nvidia-340xx-dkms)
  8. pkgver=340.108
  9. pkgrel=31
  10. pkgdesc="NVIDIA drivers for linux, 340xx legacy branch"
  11. arch=('x86_64')
  12. url="https://www.nvidia.com/"
  13. makedepends=("nvidia-340xx-utils=${pkgver}" 'linux>=5.5' 'linux-headers>=5.5')
  14. conflicts=('nvidia')
  15. license=('custom')
  16. options=(!strip)
  17. _pkg="NVIDIA-Linux-x86_64-${pkgver}-no-compat32"
  18. # https://github.com/warpme/minimyth2/tree/master/script/nvidia/nvidia-340.108/files
  19. source=("https://download.nvidia.com/XFree86/Linux-x86_64/${pkgver}/${_pkg}.run"
  20.   20-nvidia.conf
  21.   0001-kernel-5.7.patch
  22.   0002-kernel-5.8.patch
  23.   0003-kernel-5.9.patch
  24.   0004-kernel-5.10.patch
  25.   0005-kernel-5.11.patch
  26.   0006-kernel-5.14.patch
  27.   0007-kernel-5.15.patch
  28.   0008-kernel-5.16.patch
  29.   0009-kernel-5.17.patch
  30.   0010-kernel-5.18.patch
  31.   0011-kernel-6.0.patch
  32. )
  33. b2sums=('6538bbec53b10f8d20977f9b462052625742e9709ef06e24cf2e55de5d0c55f1620a4bb21396cfd89ebc54c32f921ea17e3e47eaa95abcbc24ecbd144fb89028'
  34.         '91dd76b932ca70594f83086be06ea836e05bb740d48596e95b198ff8ffffe9960d6d21d2f7643bb674d2235e4c4ad5d9f32d9cae9a865d1e44ffca13d3c8924d'
  35.         '105c4f124f8e2ea04442492753837500dfcfd565423ea34d4917a5890d32cf3f85e850dd1ec9bf5092a6046b7cbce2c99ea0cad867bce28aab041c34d7eb2e93'
  36.         '73976fe107570af2dd564cd62077d72934cb22412a6e6bb2f0f8897b97946cd1a245700da8fab1cec44449a947a604b9d9dfeed0020e100b25dccd13c8112405'
  37.         'f1cce5188a0be405ec386198fc0c134710346b2aaab16b4d3078ca78c0e5bc5100125743f6cbaf5f226910eabd6dd14b45159b1a48c586178bfddaf06be7a581'
  38.         'd6d08db1e56a655ccc79edb28a28d7296d7c134c8070f5618b0545ffc0fd1ea7066754f1442ec4bf4f14a6c2c1f34895fe6f0d64c03d22d7591bd3f221781006'
  39.         '344cd3a9888a9a61941906c198d3a480ce230119c96c72c72a74b711d23face2a7b1e53b9b4639465809b84762cdc53f38210e740318866705241bc4216e4f35'
  40.         '420b3c026c9b41090ba6b67aeeceeea77f2b69eba7e4b5b3ccc58e3d7a602824f8b34982590648826f9d8a2e033e73ea6e8c6bdfa895e80f106e1fca02ef1807'
  41.         '08c6f5d840523ab1d047eee279e93ea04b4e006bc8aa92bfa90246a71f6632f7565700af09de32383f1f0df8c662569d54f0f34d171781b9eca97f2d2a126c92'
  42.         '0154514431eb26a587875db865597f195f6ceb46e52063ca2a3a3bc34c8128fe9cf8adad33f90602f634014130c502d9e54c8a67e6852bf64d859205d22a8412'
  43.         '0266e1baaac9ffbb94d9e916a693b1663d8686b15e970bfc30f7c51f051a0af9267aa5f6a12b68586c69d2e9796a1124488b3997ba4b26db1a5ac10a892f0df2'
  44.         'd69c9acbe550d5fccca68ca6a0d5095cbcaf887d2bc43704a8eb85533896692f16701eef07ead297881f596f5502c3105bb5bea77b2dcaf6c4dc2b49941f9f19'
  45.         'eb0f8321a43a952e000feee1a96820f0a011ce17481d1658ced2eaaf15c36880f54d6bdb4fbe35e9cd39e7bf0bfe9b55adf2e009f599d4cee259bab6212c0860')
  46.  
  47.     rm -rf src pkg
  48. # default is 'linux' substitute custom name here
  49. _kernelname=linux
  50. _kernver="$(</usr/src/$_kernelname/version)"
  51. _extradir="/usr/lib/modules/$_kernver/extramodules"
  52.  
  53. prepare() {
  54.     sh "${_pkg}.run" --extract-only
  55.     cd "${_pkg}"
  56.  
  57.     local src
  58.         for src in "${source[@]}"; do
  59.             src="${src%%::*}"
  60.             src="${src##*/}"
  61.             [[ $src = 0*.patch ]] || continue
  62.             echo "Applying patch $src..."
  63.             patch -Np1 < "../$src"
  64.         done
  65.  
  66.     cp -a kernel kernel-dkms
  67. }
  68.  
  69. build() {
  70.     [ -n "$NVIDIA_340XX_DKMS_ONLY" ] && return 0
  71.     cd "${_pkg}/kernel"
  72.     make SYSSRC="/usr/src/$_kernelname" module
  73.  
  74.     cd uvm
  75.     make SYSSRC="/usr/src/$_kernelname" module
  76. }
  77.  
  78. package_nvidia-340xx() {
  79.     pkgdesc="NVIDIA drivers for linux, 340xx legacy branch"
  80.     depends=('linux>=5.3.6' "nvidia-340xx-utils=$pkgver" 'libgl')
  81.  
  82.     install -Dt "${pkgdir}${_extradir}" -m644 \
  83.     "${srcdir}/${_pkg}/kernel"/{nvidia,uvm/nvidia-uvm}.ko
  84.     find "${pkgdir}" -name '*.ko' -exec gzip -n {} +
  85.  
  86.     echo "blacklist nouveau" |
  87.     install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modprobe.d/nvidia-340xx.conf"
  88. #   install -Dm644 "$srcdir/20-nvidia.conf" "$pkgdir/usr/share/nvidia-340xx/20-nvidia.conf"
  89.     install -Dm644 "$srcdir/20-nvidia.conf" "$pkgdir/etc/X11/xorg.conf.d/20-nvidia.conf"
  90. }
  91.  
  92. package_nvidia-340xx-dkms() {
  93.     pkgdesc="NVIDIA driver sources for linux, 340xx legacy branch"
  94.     depends=('dkms' "nvidia-340xx-utils=$pkgver" 'libgl')
  95.     optdepends=('linux-headers: Build the module for Arch kernel')
  96.     provides=("nvidia-340xx=$pkgver")
  97.     conflicts+=('nvidia-340xx')
  98.  
  99.     cd "${_pkg}"
  100.  
  101.     install -dm 755 "${pkgdir}"/usr/src
  102.     cp -dr --no-preserve='ownership' kernel-dkms "${pkgdir}/usr/src/nvidia-${pkgver}"
  103.     cat "${pkgdir}"/usr/src/nvidia-${pkgver}/uvm/dkms.conf.fragment >> "${pkgdir}"/usr/src/nvidia-${pkgver}/dkms.conf
  104.  
  105.     echo "blacklist nouveau" |
  106.     install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modprobe.d/${pkgname}.conf"
  107. #   install -Dm644 "$srcdir/20-nvidia.conf" "$pkgdir/usr/share/nvidia-340xx/20-nvidia.conf"
  108.     install -Dm644 "$srcdir/20-nvidia.conf" "$pkgdir/etc/X11/xorg.conf.d/20-nvidia.conf"
  109. }
  110.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement