summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorDet2015-06-14 04:13:28 +0300
committerDet2015-06-14 04:14:15 +0300
commitc9c67fcda37ff43f2a7ad9dec2bd9bc749cfcca9 (patch)
tree824c2e817d07209dd1c122175f2a9403d5046f20 /PKGBUILD
downloadaur-c9c67fcda37ff43f2a7ad9dec2bd9bc749cfcca9.tar.gz
Initial import: 352.09-1
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD104
1 files changed, 104 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..9bc49218bf7a
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,104 @@
+# Maintainer: Det <nimetonmaili g-mail>
+# Contributor: Ng Oon-Ee
+# Based on nvidia-beta: https://aur.archlinux.org/packages/nvidia-beta/
+
+pkgname=nvidia-beta-all
+pkgver=352.09
+pkgrel=1
+pkgdesc="NVIDIA drivers for all kernels (beta)"
+arch=('i686' 'x86_64')
+url="http://www.nvidia.com/"
+license=('custom:NVIDIA')
+depends=("nvidia-utils-beta=$pkgver" 'libgl')
+makedepends=('linux-headers' 'pacman>=4.2.0')
+provides=('nvidia')
+conflicts=('nvidia-96xx' 'nvidia-173xx' 'nvidia')
+options=('!strip')
+install=$pkgname.install
+
+# Installer name
+case "$CARCH" in
+ i686) _pkg="NVIDIA-Linux-x86-$pkgver" ;;
+ x86_64) _pkg="NVIDIA-Linux-x86_64-$pkgver-no-compat32" ;;
+esac
+
+# Source
+#source=('linux-4.0.patch')
+source_i686=("http://us.download.nvidia.com/XFree86/Linux-x86/$pkgver/NVIDIA-Linux-x86-$pkgver.run")
+source_x86_64=("http://us.download.nvidia.com/XFree86/Linux-x86_64/$pkgver/NVIDIA-Linux-x86_64-$pkgver-no-compat32.run")
+#md5sums=('fb510521aae27ebc91c0f3065ba73f11')
+md5sums_i686=('0e009686400c522209eaa8ab835ff81f')
+md5sums_x86_64=('eb5ad6a07dc03e0a19d5f6fa069c494b')
+
+prepare() {
+ # Remove previous builds
+ if [[ -d $_pkg ]]; then
+ rm -rf $_pkg
+ fi
+
+ # Extract
+ msg2 "Self-Extracting $_pkg.run..."
+ sh $_pkg.run -x
+ cd $_pkg
+
+ for _kernel in $(cat /usr/lib/modules/extramodules-*/version); do
+ # Use separate source directories
+ cp -r kernel kernel-$_kernel
+ # Patch
+ if [[ $(ls "$srcdir"/*.patch 2>/dev/null) ]]; then
+ # Loop
+ cd kernel-$_kernel
+ for _patch in "$srcdir"/*.patch; do
+ # Check version
+ _major_patch=$(echo $_patch | grep -Po "\d+\.\d+")
+ if (( $(vercmp $_kernel $_major_patch) >= 0 )); then
+ msg2 "Applying ${_patch##*/} for $_kernel..."
+ patch -p2 -i "$_patch"
+ fi
+ done
+ cd ..
+ fi
+ done
+}
+
+build() {
+ # Build for all kernels
+ for _kernel in $(cat /usr/lib/modules/extramodules-*/version); do
+ cd "$srcdir"/$_pkg/kernel-$_kernel
+
+ # Main module
+ msg2 "Building Nvidia module for $_kernel..."
+ make SYSSRC=/usr/lib/modules/$_kernel/build module
+
+ # Unified memory: http://devblogs.nvidia.com/parallelforall/unified-memory-in-cuda-6/
+ if [[ $CARCH = x86_64 ]]; then
+ cd uvm
+ msg2 "Building Unified memory module for $_kernel..."
+ make SYSSRC=/usr/lib/modules/$_kernel/build module
+ fi
+ done
+}
+
+package() {
+ # Install for all kernels
+ for _extramod in $(find /usr/lib/modules/extramodules-*/version -printf '%h\n'); do
+ _kernel=$(cat $_extramod/version)
+
+ # Install
+ install -Dm644 $_pkg/kernel-$_kernel/nvidia.ko \
+ "$pkgdir"/$_extramod/nvidia.ko
+
+ # Unified Memory
+ if [[ $CARCH = x86_64 ]]; then
+ install -Dm644 $_pkg/kernel-$_kernel/uvm/nvidia-uvm.ko \
+ "$pkgdir/$_extramod/nvidia-uvm.ko"
+ fi
+
+ # Compress
+ gzip "$pkgdir"/$_extramod/nvidia*.ko
+ done
+
+ # Blacklist Nouveau
+ install -d "$pkgdir"/usr/lib/modprobe.d/
+ echo "blacklist nouveau" >> "$pkgdir"/usr/lib/modprobe.d/nvidia.conf
+} \ No newline at end of file