PKGBUILD 2.41 KB
Newer Older
Helmut Stult's avatar
Helmut Stult committed
1 2 3 4 5 6 7 8 9 10
# Maintainer: Philip Müller <philm[at]manjaro[dot]org>
# Maintainer: Bernhard Landauer <bernhard[at]manjaro[dot]org>
# Maintainer: Helmut Stult <helmut[at]manjaro[dot]org>

# Arch credits:
# Maintainer : Thomas Baechler <thomas@archlinux.org>

_linuxprefix=linux512
_extramodules=extramodules-5.12-MANJARO
# don't edit here
Helmut Stult's avatar
Helmut Stult committed
11
pkgver=465.31
Helmut Stult's avatar
Helmut Stult committed
12

Helmut Stult's avatar
Helmut Stult committed
13
_nver=465
Helmut Stult's avatar
Helmut Stult committed
14
# edit here for new version
Helmut Stult's avatar
Helmut Stult committed
15
_sver=31
Helmut Stult's avatar
Helmut Stult committed
16
# edit here for new build
Helmut Stult's avatar
Helmut Stult committed
17
pkgrel=8
Helmut Stult's avatar
Helmut Stult committed
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
pkgname=$_linuxprefix-nvidia
_pkgname=nvidia
_pkgver="${_nver}.${_sver}"
pkgdesc="NVIDIA drivers for linux."
arch=('x86_64')
url="http://www.nvidia.com/"
depends=("$_linuxprefix" "nvidia-utils=${_pkgver}")
makedepends=("$_linuxprefix-headers")
groups=("$_linuxprefix-extramodules")
provides=("$_pkgname=$pkgver" "$_linuxprefix-nvidia-418xx" "$_linuxprefix-nvidia-430xx"
          "$_linuxprefix-nvidia-435xx" "$_linuxprefix-nvidia-440xx" "$_linuxprefix-nvidia-450xx")
conflicts=("$_linuxprefix-nvidia-340xx" "$_linuxprefix-nvidia-390xx" "$_linuxprefix-nvidia-418xx"
           "$_linuxprefix-nvidia-430xx" "$_linuxprefix-nvidia-435xx" "$_linuxprefix-nvidia-440xx"
           "$_linuxprefix-nvidia-450xx")
license=('custom')
install=nvidia.install
options=(!strip)
durl="https://us.download.nvidia.com/XFree86/Linux-x86"
Helmut Stult's avatar
Helmut Stult committed
36
source=("${durl}_64/${_pkgver}/NVIDIA-Linux-x86_64-${_pkgver}-no-compat32.run")
Helmut Stult's avatar
Helmut Stult committed
37
sha256sums=('2d423f1299561f770b2c1195f310c0bc9a4ce7b7095327b7cf67a3efc340ea58')
Helmut Stult's avatar
Helmut Stult committed
38 39 40 41 42 43 44 45 46 47

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

pkgver() {
  printf '%s' "${_pkgver}"
}

prepare() {
    sh "${_pkg}.run" --extract-only
    cd "${_pkg}/kernel"
Helmut Stult's avatar
Helmut Stult committed
48 49
    msg2 "cd ${_pkg}"
    # patches here
Helmut Stult's avatar
Helmut Stult committed
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
}

build() {
    _kernver="$(cat /usr/lib/modules/${_extramodules}/version)"
    cd "${_pkg}"/kernel
    make SYSSRC=/usr/lib/modules/"${_kernver}/build" module
}

package() {
    install -D -m644 "${srcdir}/${_pkg}/kernel/nvidia.ko" \
        "${pkgdir}/usr/lib/modules/${_extramodules}/nvidia.ko"
    install -D -m644 "${srcdir}/${_pkg}/kernel/nvidia-modeset.ko" \
         "${pkgdir}/usr/lib/modules/${_extramodules}/nvidia-modeset.ko"
    install -D -m644 "${srcdir}/${_pkg}/kernel/nvidia-drm.ko" \
         "${pkgdir}/usr/lib/modules/${_extramodules}/nvidia-drm.ko"
    install -D -m644 "${srcdir}/${_pkg}/kernel/nvidia-uvm.ko" \
         "${pkgdir}/usr/lib/modules/${_extramodules}/nvidia-uvm.ko"
    gzip "${pkgdir}/usr/lib/modules/${_extramodules}/"*.ko
    sed -i -e "s/EXTRAMODULES='.*'/EXTRAMODULES='${_extramodules}'/" "${startdir}/nvidia.install"
}