PKGBUILD 1.39 KB
Newer Older
1 2
pkgname=('nvidia-lts')
pkgdesc=('NVIDIA drivers for linux-lts')
AlmAck's avatar
AlmAck committed
3
pkgver=396.51
AlmAck's avatar
AlmAck committed
4
pkgrel=2
5
arch=('x86_64')
Phil's avatar
Phil committed
6
url="http://www.nvidia.com/"
AlmAck's avatar
AlmAck committed
7
depends=("linux-lts=4.4.147" "nvidia-utils=${pkgver}" 'libglvnd')
AlmAck's avatar
AlmAck committed
8
makedepends=("linux-lts-headers=4.4.147")
AlmAck's avatar
AlmAck committed
9
_extramodules=extramodules-CHAKRA-LTS
10
license=('custom')
Chaoting Liu's avatar
Chaoting Liu committed
11 12 13 14

_pkg="NVIDIA-Linux-x86_64-${pkgver}-no-compat32"
#_pkg="NVIDIA-Linux-x86_64-${pkgver}"

Chaoting Liu's avatar
Chaoting Liu committed
15
source=("http://us.download.nvidia.com/XFree86/Linux-x86_64/${pkgver}/NVIDIA-Linux-x86_64-${pkgver}-no-compat32.run")
Chaoting Liu's avatar
Chaoting Liu committed
16
#source=("NVIDIA-Linux-x86_64-${pkgver}.run::https://developer.nvidia.com/linux64bit")
AlmAck's avatar
AlmAck committed
17
md5sums=('e41e28d1f380c64ec2eacae344fb5017')
Phil's avatar
Phil committed
18

Xuetian Weng's avatar
Xuetian Weng committed
19
prepare() {
20 21 22
    sh "${_pkg}.run" --extract-only
    cd "${_pkg}"
    # patches here
Xuetian Weng's avatar
Xuetian Weng committed
23
}
AlmAck's avatar
AlmAck committed
24

Phil's avatar
Phil committed
25
build() {
AlmAck's avatar
AlmAck committed
26
    cd "${_pkg}/kernel"
AlmAck's avatar
AlmAck committed
27 28 29
    KERNEL_VERSION=$(</usr/lib/modules/$_extramodules/version)
    msg2 "Kernel = $KERNEL_VERSION"
    make SYSSRC=/usr/lib/modules/$KERNEL_VERSION/build module
Phil's avatar
Phil committed
30 31
}

AlmAck's avatar
AlmAck committed
32 33 34 35 36 37 38 39
package_nvidia() {
    install -Dt "${pkgdir}/usr/lib/modules/${_extramodules}" -m644 \
      "${srcdir}/${_pkg}/kernel"/nvidia{,-modeset,-drm,-uvm}.ko

    find "${pkgdir}" -name '*.ko' -exec gzip -n {} +

    echo "blacklist nouveau" |
        install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modprobe.d/${pkgname}.conf"
40

AlmAck's avatar
AlmAck committed
41
    install -Dt "${pkgdir}/usr/share/licenses/${pkgname}" -m644 "${srcdir}/${_pkg}/LICENSE"
AlmAck's avatar
AlmAck committed
42
    echo "blacklist nouveau" >> "${pkgdir}/usr/lib/modprobe.d/nouveau_blacklist.conf"
43
}