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

Felix Yan fyan at archlinux.org
Fri Sep 4 09:27:38 UTC 2015


    Date: Friday, September 4, 2015 @ 11:27:38
  Author: fyan
Revision: 245270

upgpkg: nvidia 355.11-1

- upstream new release
- add a DKMS package

Added:
  nvidia/trunk/nvidia-dkms.install
Modified:
  nvidia/trunk/PKGBUILD

---------------------+
 PKGBUILD            |   55 +++++++++++++++++++++++++++++++++++---------------
 nvidia-dkms.install |   30 +++++++++++++++++++++++++++
 2 files changed, 69 insertions(+), 16 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2015-09-04 09:27:01 UTC (rev 245269)
+++ PKGBUILD	2015-09-04 09:27:38 UTC (rev 245270)
@@ -2,30 +2,40 @@
 # Maintainer: Sven-Hendrik Haase <sh at lutzhaase.com>
 # Maintainer: Thomas Baechler <thomas at archlinux.org>
 
-pkgname=nvidia
-pkgver=352.41
+pkgbase=nvidia
+pkgname=(nvidia nvidia-dkms)
+pkgver=355.11
 _extramodules=extramodules-4.2-ARCH
-pkgrel=2
+pkgrel=1
 pkgdesc="NVIDIA drivers for linux"
 arch=('i686' 'x86_64')
 url="http://www.nvidia.com/"
-depends=('linux>=4.2' 'linux<4.3' "nvidia-utils=${pkgver}" 'libgl')
-makedepends=('linux-headers>=4.2' 'linux-headers<4.3' 'nvidia-libgl')
+makedepends=('libgl' "nvidia-utils=${pkgver}" 'linux' 'linux-headers>=4.2' 'linux-headers<4.3')
 license=('custom')
-install=nvidia.install
 options=(!strip)
 source=("ftp://download.nvidia.com/XFree86/Linux-x86/${pkgver}/NVIDIA-Linux-x86-${pkgver}.run"
         "ftp://download.nvidia.com/XFree86/Linux-x86_64/${pkgver}/NVIDIA-Linux-x86_64-${pkgver}-no-compat32.run")
-md5sums=('3f9c9fed035fa845e3f6a1ea5f5732f7'
-         'd41d1a358edbade36cfd97cdcc9a80b9')
+md5sums=('16d143ccafe99328a2ca8e5a396fd4bc'
+         '30133d89690f4683c4e289ec6c0247dc')
 
 [[ "$CARCH" = "i686" ]] && _pkg="NVIDIA-Linux-x86-${pkgver}"
 [[ "$CARCH" = "x86_64" ]] && _pkg="NVIDIA-Linux-x86_64-${pkgver}-no-compat32"
 
-prepare() {
+prepare() { 
     sh "${_pkg}.run" --extract-only
     cd "${_pkg}"
     # patches here
+
+    cp -a kernel kernel-dkms
+    cd kernel-dkms
+    eval "sed -i 's/__VERSION_STRING/${pkgver}/' dkms.conf"
+    sed -i 's/__JOBS/${&}/' dkms.conf
+    sed -i '4iBUILT_MODULE_NAME[0]="nvidia"\
+DEST_MODULE_LOCATION[0]="/kernel/drivers/video"\
+BUILT_MODULE_NAME[1]="nvidia-uvm"\
+DEST_MODULE_LOCATION[1]="/kernel/drivers/video"\
+__JOBS=`nproc`' dkms.conf
+    sed -i 's/__DKMS_MODULES//' dkms.conf
 }
 
 build() {
@@ -32,19 +42,18 @@
     _kernver="$(cat /usr/lib/modules/${_extramodules}/version)"
     cd "${_pkg}"/kernel
     make SYSSRC=/usr/lib/modules/"${_kernver}/build" module
-
-    if [[ "$CARCH" = "x86_64" ]]; then
-        cd uvm
-        make SYSSRC=/usr/lib/modules/"${_kernver}/build" module
-    fi
 }
 
-package() {
+package_nvidia() {
+    pkgdesc="NVIDIA drivers for linux"
+    depends=('linux>=4.2' 'linux<4.3' "nvidia-utils=${pkgver}" 'libgl')
+    install=nvidia.install
+
     install -D -m644 "${srcdir}/${_pkg}/kernel/nvidia.ko" \
         "${pkgdir}/usr/lib/modules/${_extramodules}/nvidia.ko"
 
     if [[ "$CARCH" = "x86_64" ]]; then
-        install -D -m644 "${srcdir}/${_pkg}/kernel/uvm/nvidia-uvm.ko" \
+        install -D -m644 "${srcdir}/${_pkg}/kernel/nvidia-uvm.ko" \
             "${pkgdir}/usr/lib/modules/${_extramodules}/nvidia-uvm.ko"
     fi
 
@@ -53,3 +62,17 @@
 
     echo "blacklist nouveau" >> "${pkgdir}/usr/lib/modprobe.d/nvidia.conf"
 }
+
+package_nvidia-dkms() {
+    pkgdesc="NVIDIA driver sources for linux"
+    depends=('dkms' "nvidia-utils=$pkgver")
+    optdepends=('linux-headers: Build the module for Arch kernel'
+                'linux-lts-headers: Build the module for LTS Arch kernel')
+    conflict+=('nvidia')
+    install=nvidia-dkms.install
+
+    cd ${_pkg}
+    install -dm 755 "${pkgdir}"/usr/{lib/modprobe.d,src}
+    cp -dr --no-preserve='ownership' kernel-dkms "${pkgdir}/usr/src/nvidia-${pkgver}"
+    echo 'blacklist nouveau' > "${pkgdir}/usr/lib/modprobe.d/nvidia.conf"
+}

Added: nvidia-dkms.install
===================================================================
--- nvidia-dkms.install	                        (rev 0)
+++ nvidia-dkms.install	2015-09-04 09:27:38 UTC (rev 245270)
@@ -0,0 +1,30 @@
+#/bin/sh
+
+# arg 1:  the new package version
+post_install() {
+  dkms add nvidia/${1%-*}
+  cat << EOF
+==> To build and install your modules run: dkms install nvidia/${1%-*}
+==> To do this automatically at startup run: systemctl enable dkms.service
+EOF
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+pre_upgrade() {
+  pre_remove "$2"
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+post_upgrade() {
+  post_install "$1"
+}
+
+# arg 1:  the old package version
+pre_remove() {
+  # Remove modules using dkms
+  [ -n "${1%-*}" ] && dkms remove nvidia/${1%-*} --all &>/dev/null || true
+}
+
+# vim:set ts=2 sw=2 ft=sh et:
\ No newline at end of file



More information about the arch-commits mailing list