[arch-commits] Commit in nvidia-304xx/trunk (PKGBUILD nvidia-304xx-dkms.install)
Sébastien Luttringer
seblu at archlinux.org
Sat Jul 25 00:21:09 UTC 2015
Date: Saturday, July 25, 2015 @ 02:21:09
Author: seblu
Revision: 242482
upgpkg: nvidia-304xx 304.125-20
- Add a DKMS version
Added:
nvidia-304xx/trunk/nvidia-304xx-dkms.install
Modified:
nvidia-304xx/trunk/PKGBUILD
---------------------------+
PKGBUILD | 32 +++++++++++++++++++++++++-------
nvidia-304xx-dkms.install | 30 ++++++++++++++++++++++++++++++
2 files changed, 55 insertions(+), 7 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2015-07-24 23:22:15 UTC (rev 242481)
+++ PKGBUILD 2015-07-25 00:21:09 UTC (rev 242482)
@@ -2,18 +2,16 @@
# Maintainer: Felix Yan <felixonmars at archlinux.org>
# Contributor: Thomas Baechler <thomas at archlinux.org>
-pkgname=nvidia-304xx
+pkgbase=nvidia-304xx
+pkgname=(nvidia-304xx nvidia-304xx-dkms)
pkgver=304.125
_extramodules=extramodules-4.1-ARCH
-pkgrel=19
-pkgdesc="NVIDIA drivers for linux, 304xx legacy branch"
+pkgrel=20
arch=('i686' 'x86_64')
url="http://www.nvidia.com/"
-depends=('linux>=4.1' 'linux<4.2' 'libgl' "nvidia-304xx-utils=${pkgver}")
-makedepends=('linux-headers>=4.1' 'linux-headers<4.2')
+makedepends=('libgl' "nvidia-304xx-utils=${pkgver}" 'linux' 'linux-headers>=4.1' 'linux-headers<4.2')
conflicts=('nvidia')
license=('custom')
-install=${pkgname}.install
options=(!strip)
source=("http://us.download.nvidia.com/XFree86/Linux-x86/${pkgver}/NVIDIA-Linux-x86-${pkgver}.run"
"http://us.download.nvidia.com/XFree86/Linux-x86_64/${pkgver}/NVIDIA-Linux-x86_64-${pkgver}-no-compat32.run"
@@ -45,7 +43,12 @@
make SYSSRC=/usr/lib/modules/"${_kernver}/build" module
}
-package() {
+package_nvidia-304xx() {
+ pkgdesc="NVIDIA drivers for linux, 304xx legacy branch"
+ depends=('linux>=4.1' 'linux<4.2' 'libgl' "nvidia-304xx-utils=${pkgver}")
+ conflict+=('nvidia-304xx-dkms')
+ install=nvidia-304xx.install
+
install -D -m644 "${srcdir}/${_pkg}/kernel/nvidia.ko" \
"${pkgdir}/usr/lib/modules/${_extramodules}/nvidia.ko"
install -d -m755 "${pkgdir}/usr/lib/modprobe.d"
@@ -55,3 +58,18 @@
# the license file is part of nvidia-304xx-utils - the module depends on it, so we don't ship it another time.
}
+
+package_nvidia-304xx-dkms() {
+ pkgdesc="NVIDIA driver sources for linux, 304xx legacy branch"
+ depends=('dkms' "nvidia-304xx-utils=$pkgver")
+ optdepends=('linux-headers: Build the module for Arch kernel'
+ 'linux-lts-headers: Build the module for LTS Arch kernel')
+ conflict+=('nvidia-304xx')
+ install=nvidia-304xx-dkms.install
+
+ cd ${_pkg}
+ make -C kernel clean
+ install -dm 755 "${pkgdir}"/usr/{lib/modprobe.d,src}
+ cp -dr --no-preserve='ownership' kernel "${pkgdir}"/usr/src/nvidia-${pkgver}
+ echo 'blacklist nouveau' > "${pkgdir}"/usr/lib/modprobe.d/nvidia.conf
+}
Added: nvidia-304xx-dkms.install
===================================================================
--- nvidia-304xx-dkms.install (rev 0)
+++ nvidia-304xx-dkms.install 2015-07-25 00:21:09 UTC (rev 242482)
@@ -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:
More information about the arch-commits
mailing list