PKGBUILD 1.33 KB
Newer Older
AlmAck's avatar
AlmAck committed
1 2
pkgname=nvidia-304xx-lts
pkgver=304.137
AlmAck's avatar
AlmAck committed
3
pkgrel=4
AlmAck's avatar
AlmAck committed
4 5 6
pkgdesc="NVIDIA drivers for linux."
arch=('x86_64')
url="http://www.nvidia.com/"
AlmAck's avatar
AlmAck committed
7 8
depends=("linux-lts=4.4.147" "nvidia-304xx-utils=${pkgver}")
makedepends=("linux-lts-headers=4.4.147")
AlmAck's avatar
AlmAck committed
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
conflicts=('nvidia-340xx-lts' 'nvidia-lts')
license=('custom')
_extramodules=extramodules-CHAKRA-LTS
_pkg="NVIDIA-Linux-${arch}-${pkgver}-no-compat32"
source=("http://us.download.nvidia.com/XFree86/Linux-${arch}/${pkgver}/${_pkg}.run")
md5sums=('485506ee6a7c54780488dacddf1d56b1')

prepare() {
    cd "${srcdir}"
    sed -i -e "s/EXTRAMODULES='.*'/EXTRAMODULES='${_extramodules}'/" "${startdir}/nvidia.install"
    sh "${_pkg}.run" --extract-only
    cd "${_pkg}"
}

build() {
    KERNEL_VERSION=$(</usr/lib/modules/$_extramodules/version)
    msg2 "Kernel = $KERNEL_VERSION"
    
    cd "${_pkg}/kernel"
    make SYSSRC=/usr/lib/modules/$KERNEL_VERSION/build module
}

package() {
    install -D -m644 "${srcdir}/${_pkg}/kernel/nvidia.ko" \
        "${pkgdir}/usr/lib/modules/${_extramodules}/nvidia.ko"
    install -d -m755 "${pkgdir}/etc/modprobe.d"
    sed -i -e "s/EXTRAMODULES='.*'/EXTRAMODULES='${_extramodules}'/" "${startdir}/nvidia.install"
    gzip "${pkgdir}/usr/lib/modules/${_extramodules}/nvidia.ko"
    echo "blacklist nouveau" |
      install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modprobe.d/${pkgname}.conf"
}