Commit fc82180c authored by Philip Müller's avatar Philip Müller

Initial commit

parents
# Based on the file created for Arch Linux by:
# Maintainer : Thomas Baechler <thomas@archlinux.org>
# Maintainer: Philip Müller <philm@manjaro.org>
_linuxprefix=linux421
_extramodules=extramodules-4.21-MANJARO
pkgname=$_linuxprefix-nvidia
_pkgname=nvidia
pkgver=415.25
pkgrel=0
epoch=1
provides=("$_pkgname=$pkgver")
groups=("$_linuxprefix-extramodules")
pkgdesc="NVIDIA drivers for linux."
arch=('x86_64')
url="http://www.nvidia.com/"
depends=("$_linuxprefix" "nvidia-utils=${epoch}:${pkgver}")
makedepends=("$_linuxprefix-headers")
conflicts=('nvidia-96xx' 'nvidia-173xx')
license=('custom')
install=nvidia.install
options=(!strip)
durl="http://us.download.nvidia.com/XFree86/Linux-x86"
source_x86_64=("${durl}_64/${pkgver}/NVIDIA-Linux-x86_64-${pkgver}-no-compat32.run")
sha256sums_x86_64=('2031f3227df1bb2bff84f5783e97b2a72ad5cf064cfa3ad68dd369ff27dc95e6')
[[ "$CARCH" = "x86_64" ]] && _pkg="NVIDIA-Linux-x86_64-${pkgver}-no-compat32"
prepare() {
sh "${_pkg}.run" --extract-only
cd "${_pkg}"
# patches here
}
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"
if [[ "$CARCH" = "x86_64" ]]; then
install -D -m644 "${srcdir}/${_pkg}/kernel/nvidia-uvm.ko" \
"${pkgdir}/usr/lib/modules/${_extramodules}/nvidia-uvm.ko"
fi
gzip "${pkgdir}/usr/lib/modules/${_extramodules}/"*.ko
sed -i -e "s/EXTRAMODULES='.*'/EXTRAMODULES='${_extramodules}'/" "${startdir}/nvidia.install"
}
post_install() {
EXTRAMODULES='extramodules-4.20-MANJARO'
depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
echo 'In order to use nvidia module, reboot the system.'
}
post_upgrade() {
EXTRAMODULES='extramodules-4.20-MANJARO'
depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
if [ "$(vercmp $2 310.19-2)" -lt 0 ]; then
echo 'If your card is from the 7xxx series or earlier, install nvidia-304xx'
fi
}
post_remove() {
EXTRAMODULES='extramodules-4.20-MANJARO'
depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment