Guest User

Nvidia-340xx-dkms

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