summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorDaniel Bermond2018-10-20 16:21:08 +0000
committerDaniel Bermond2018-10-20 16:21:08 +0000
commit9c19a9c1a5eadeaa598ced0540f37c1a9abe0f0e (patch)
tree85e2f2ce040e45e557420851817ab6e9c2fc1099 /PKGBUILD
parentdcb5f5c800ac95b53d2b56164ced8d6876b130c1 (diff)
downloadaur-9c19a9c1a5eadeaa598ced0540f37c1a9abe0f0e.tar.gz
Updated to version 410.66
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD161
1 files changed, 57 insertions, 104 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 4ef3fcd6ac6c..106a81cb04e1 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,122 +4,75 @@
# Based on nvidia-beta: https://aur.archlinux.org/packages/nvidia-beta/
pkgname=nvidia-beta-all
-pkgver=410.57
+pkgver=410.66
pkgrel=1
-pkgdesc="NVIDIA drivers for all kernels on the system (beta)"
+pkgdesc='NVIDIA drivers for all kernels on the system (beta)'
arch=('x86_64')
-url="http://www.nvidia.com/"
+url='http://www.nvidia.com/'
license=('custom:NVIDIA')
-depends=("nvidia-utils-beta>=$pkgver" 'libgl')
+depends=("nvidia-utils-beta>=${pkgver}" 'libgl')
makedepends=('linux-headers')
-provides=("nvidia=$pkgver")
-conflicts=('nvidia-96xx' 'nvidia-173xx' 'nvidia')
+provides=("nvidia=${pkgver}" "nvidia-beta=${pkgver}")
+conflicts=('nvidia')
options=('!strip')
-install=$pkgname.install
-_pkg="NVIDIA-Linux-x86_64-$pkgver-no-compat32"
-source=("http://us.download.nvidia.com/XFree86/Linux-x86_64/$pkgver/$_pkg.run")
-sha256sums=('1ad40d83ec712843c1b5593949abefc9093399fb26a418ae9a571fbd1d9b228e')
-
-# Patches
-## restore phys_to_dma support
-## https://bugs.archlinux.org/task/58074
-source+=('linux-4.16.patch')
-sha256sums+=('622ac792ec200b2239cb663c0010392118b78c9904973d82cd261165c16d6385')
-
-# Auto-add *.patch files from $startdir to source=()
-for _patch in $(find "$startdir" -maxdepth 1 -name '*.patch' -printf "%f\n"); do
- # Don't duplicate already listed ones
- if [[ ! " ${source[@]} " =~ " $_patch " ]]; then # https://stackoverflow.com/a/15394738/1821548
- source+=("$_patch")
- sha256sums+=('SKIP')
- fi
-done
+_pkg="NVIDIA-Linux-${CARCH}-${pkgver}-no-compat32"
+source=("http://us.download.nvidia.com/XFree86/Linux-${CARCH}/${pkgver}/${_pkg}.run"
+ 'linux-4.16.patch')
+sha256sums=('c4e297ed93341841c7ccb32569c179baecbb6ea253215cbc3668a51d729227cd'
+ '622ac792ec200b2239cb663c0010392118b78c9904973d82cd261165c16d6385')
prepare() {
- # Remove previous builds
- [[ -d $_pkg ]] && rm -rf $_pkg
-
- # Extract
- msg2 "Self-Extracting $_pkg.run..."
- sh $_pkg.run -x
- cd $_pkg
-
- # Loop kernels (e.g. 4.18.3-arch1-1-ARCH)
- for _kernel in $(cat /usr/lib/modules/extramodules-*/version); do
- # Use separate source directories
- cp -r kernel kernel-$_kernel
-
- # Loop patches (e.g. linux-4.18.patch, lol.patch, ...)
- for _patch in $(printf -- '%s\n' ${source[@]} | grep .patch); do # https://stackoverflow.com/a/21058239/1821548
- # Get patch version (if any) from filename
- _patchver=$(echo $_patch | grep -Po "\d+\.\d+")
-
- # Cd in place
- cd kernel-$_kernel
-
- # Compare versions
- if (( $(vercmp "$_kernel" "$_patchver") >= 0 )); then
- msg2 "Applying $_patch for $_kernel..."
- patch -p2 -i "$srcdir"/$_patch
- else
- msg2 "Skipping $_patch..." # List these, instead of ignoring silently
- fi
-
- # Return
- cd ..
+ local _kernel
+
+ # extract the source file
+ [ -d "$_pkg" ] && rm -rf "$_pkg"
+ printf '%s\n' " -> Self-Extracting ${_pkg}.run..."
+ sh "${_pkg}.run" --extract-only
+
+ cd "$_pkg"
+
+ # create a build directory for each installed kernel
+ for _kernel in $(cat /usr/lib/modules/extramodules-*/version)
+ do
+ cp -a kernel "kernel-${_kernel}"
+
+ printf '%s\n' " -> Applying patch(es) for kernel ${_kernel}..."
+ cd "kernel-${_kernel}"
+
+ # restore phys_to_dma support
+ # https://bugs.archlinux.org/task/58074
+ patch -Np2 -i "${srcdir}/linux-4.16.patch"
+
+ cd ..
done
- done
}
build() {
- # Build for all kernels
- for _kernel in $(cat /usr/lib/modules/extramodules-*/version); do
- cd "$srcdir"/$_pkg/kernel-$_kernel
-
- # Build module
- msg2 "Building Nvidia module for $_kernel..."
- make SYSSRC=/usr/lib/modules/$_kernel/build module
- done
+ local _kernel
+
+ for _kernel in $(cat /usr/lib/modules/extramodules-*/version)
+ do
+ cd "${srcdir}/${_pkg}/kernel-${_kernel}"
+
+ printf '%s\n' " -> Building Nvidia module for ${_kernel}..."
+ make SYSSRC="/usr/lib/modules/${_kernel}/build" module
+ done
}
package() {
- # Install for all kernels
- for _path in $(find /usr/lib/modules/extramodules-*/version -printf '%h\n'); do
- _extramodules=$(cat $_path/version)
-
- # Nvidia kernel module; provides low-level access to your NVIDIA hardware for the other components. Generally
- # loaded into the kernel when the X server is started, to be used by the X driver and OpenGL. Consists of two
- # pieces: the binary-only core, and a kernel interface that must be compiled specifically for your kernel version,
- # because the Linux kernel doesn't have a consistent binary interface like the X server.
- install -Dm644 $_pkg/kernel-$_extramodules/nvidia.ko \
- "$pkgdir"/$_path/nvidia.ko
-
- # NVIDIA Unified Memory kernel module; provides functionality for sharing memory between the CPU and GPU in
- # CUDA programs. Generally loaded into the kernel when a CUDA program is started, and used by the CUDA
- # driver on supported platforms: http://devblogs.nvidia.com/parallelforall/unified-memory-in-cuda-6/
- install -Dm644 $_pkg/kernel-$_extramodules/nvidia-uvm.ko \
- "$pkgdir"/$_path/nvidia-uvm.ko
-
- # Kernel module responsible for programming the display engine of the GPU. User-mode NVIDIA driver components
- # such as the NVIDIA X driver, OpenGL driver, and VDPAU driver communicate with nvidia-modeset.ko through the
- # /dev/nvidia-modeset device file.
- install -Dm644 $_pkg/kernel-$_extramodules/nvidia-modeset.ko \
- "$pkgdir"/$_path/nvidia-modeset.ko
-
- # NVIDIA DRM kernel module; registers as a DRM driver to provide GEM and PRIME DRM capabilities
- # for atomic DRM KMS and graphics display offload on Optimus notebooks:
- # https://devtalk.nvidia.com/default/topic/925605/linux/nvidia-364-12-release-vulkan-glvnd-drm-kms-and-eglstreams/
- install -Dm644 $_pkg/kernel-$_extramodules/nvidia-drm.ko \
- "$pkgdir"/$_path/nvidia-drm.ko
-
- # Compress
- gzip "$pkgdir"/$_path/nvidia*.ko
- done
-
- # Blacklist Nouveau
- install -d "$pkgdir"/usr/lib/modprobe.d/
- echo "blacklist nouveau" >> "$pkgdir"/usr/lib/modprobe.d/nvidia.conf
-
- # License
- install -Dm644 $_pkg/LICENSE "$pkgdir"/usr/share/licenses/nvidia/LICENSE
+ local _dir
+ local _kernel
+
+ for _dir in $(find /usr/lib/modules -maxdepth 1 -type d -name 'extramodules-*')
+ do
+ _kernel="$(cat "${_dir}/version")"
+
+ install -D -m644 "${_pkg}/kernel-${_kernel}/"nvidia{,-drm,-modeset,-uvm}.ko -t "${pkgdir}/${_dir}"
+
+ gzip -n "${pkgdir}/${_dir}/"*.ko
+ done
+
+ printf '%s\n' 'blacklist nouveau' | install -D -m644 /dev/stdin "${pkgdir}/usr/lib/modprobe.d/nvidia.conf"
+
+ install -D -m644 "${_pkg}/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}"
}