[arch-commits] Commit in nvidia/trunk (PKGBUILD)

Jan Steffens heftig at archlinux.org
Sun Apr 5 02:18:27 UTC 2020


    Date: Sunday, April 5, 2020 @ 02:18:26
  Author: heftig
Revision: 379525

440.64-10: build from nvidia-dkms

Modified:
  nvidia/trunk/PKGBUILD

----------+
 PKGBUILD |   69 +++++++++++++------------------------------------------------
 1 file changed, 15 insertions(+), 54 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2020-04-05 02:18:23 UTC (rev 379524)
+++ PKGBUILD	2020-04-05 02:18:26 UTC (rev 379525)
@@ -2,76 +2,37 @@
 # Maintainer: Felix Yan <felixonmars at archlinux.org>
 # Contributor: Thomas Baechler <thomas at archlinux.org>
 
-pkgbase=nvidia
-pkgname=(nvidia nvidia-dkms)
+pkgname=nvidia
 pkgver=440.64
-pkgrel=9
+pkgrel=10
 pkgdesc="NVIDIA drivers for linux"
 arch=('x86_64')
 url="https://www.nvidia.com/"
-makedepends=("nvidia-utils=${pkgver}" 'libglvnd' 'linux-headers')
+makedepends=('linux-headers' "nvidia-dkms=$pkgver")
+provides=('NVIDIA-MODULE')
 license=('custom')
 options=('!strip')
-_pkg="NVIDIA-Linux-x86_64-${pkgver}"
-source=("https://us.download.nvidia.com/XFree86/Linux-x86_64/${pkgver}/${_pkg}.run")
-sha512sums=('26156974d9a18456ada329f19e93c2f2abb1c5b12fec47df870a0e5b7788204cf0a745ebfefad6ab50d8f659127722905d5156462d4ce794cc52d796b762bf43')
 
-prepare() {
-    sh "${_pkg}.run" --extract-only
-    cd "${_pkg}"
+build() {
+    _kernver=$(</usr/src/linux/version)
 
-    cp -a kernel kernel-dkms
-    cd kernel-dkms
-    sed -i "s/__VERSION_STRING/${pkgver}/" dkms.conf
-    sed -i 's/__JOBS/`nproc`/' dkms.conf
-    sed -i 's/__DKMS_MODULES//' dkms.conf
-    sed -i '$iBUILT_MODULE_NAME[0]="nvidia"\
-DEST_MODULE_LOCATION[0]="/kernel/drivers/video"\
-BUILT_MODULE_NAME[1]="nvidia-uvm"\
-DEST_MODULE_LOCATION[1]="/kernel/drivers/video"\
-BUILT_MODULE_NAME[2]="nvidia-modeset"\
-DEST_MODULE_LOCATION[2]="/kernel/drivers/video"\
-BUILT_MODULE_NAME[3]="nvidia-drm"\
-DEST_MODULE_LOCATION[3]="/kernel/drivers/video"' dkms.conf
-
-    # Gift for linux-rt guys
-    sed -i 's/NV_EXCLUDE_BUILD_MODULES/IGNORE_PREEMPT_RT_PRESENCE=1 NV_EXCLUDE_BUILD_MODULES/' dkms.conf
+    dkms build --dkmstree "${srcdir}" -m nvidia/${pkgver} -k ${_kernver}
 }
 
-build() {
-    cd "${_pkg}"/kernel
-    make SYSSRC=/usr/src/linux module
-}
-
-package_nvidia() {
-    pkgdesc="NVIDIA drivers for linux"
+package() {
     depends=('linux' "nvidia-utils=${pkgver}" 'libglvnd')
 
-    _extradir="/usr/lib/modules/$(</usr/src/linux/version)/extramodules"
-    install -Dt "${pkgdir}${_extradir}" -m644 \
-      "${srcdir}/${_pkg}/kernel"/nvidia{,-modeset,-drm,-uvm}.ko
+    _kernver="$(</usr/src/linux/version)"
 
-    find "${pkgdir}" -name '*.ko' -exec gzip -n {} +
+    install -Dt "${pkgdir}/usr/lib/modules/${_kernver}/extramodules" -m644 \
+        nvidia/${pkgver}/${_kernver}/${CARCH}/module/*
 
-    echo "blacklist nouveau" |
-        install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modprobe.d/${pkgname}.conf"
+    # compress each module individually
+    find "$pkgdir" -name '*.ko' -exec xz -T1 {} +
 
-    install -Dt "${pkgdir}/usr/share/licenses/${pkgname}" -m644 "${srcdir}/${_pkg}/LICENSE"
-}
-
-package_nvidia-dkms() {
-    pkgdesc="NVIDIA driver sources for linux"
-    depends=('dkms' "nvidia-utils=$pkgver" 'libglvnd')
-    provides=("nvidia=$pkgver")
-    conflicts+=('nvidia')
-
-    cd ${_pkg}
-
-    install -dm 755 "${pkgdir}"/usr/src
-    cp -dr --no-preserve='ownership' kernel-dkms "${pkgdir}/usr/src/nvidia-${pkgver}"
-
     echo "blacklist nouveau" |
         install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modprobe.d/${pkgname}.conf"
 
-    install -Dt "${pkgdir}/usr/share/licenses/${pkgname}" -m644 "${srcdir}/${_pkg}/LICENSE"
+    install -Dt "${pkgdir}/usr/share/licenses/${pkgname}" -m644 \
+        /usr/share/licenses/nvidia-dkms/LICENSE
 }



More information about the arch-commits mailing list