alpine-overlay/v3.16/nvidia-open-gpu/APKBUILD

43 lines
1.3 KiB
Plaintext
Raw Normal View History

# Contributor: Stefan Reimer <stefan@zero-downtime.net>
# Maintainer: Stefan Reimer <stefan@zero-downtime.net>
pkgname=nvidia-open-gpu
pkgver=515.57
pkgrel=1
pkgdesc="NVIDIA Linux open GPU kernel modules"
url="https://github.com/NVIDIA/open-gpu-kernel-modules"
arch="x86_64"
license="MIT OR GPL-2.0"
makedepends="bash linux-headers linux-virt-dev"
options="!check"
source="nvidia-$pkgver.tar.gz::https://github.com/NVIDIA/open-gpu-kernel-modules/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/open-gpu-kernel-modules-$pkgver"
build() {
# Hack running the build inside a container other uname -r returns host kernel
KERNEL_VERSION=$(basename $(ls -d /lib/modules/*-virt))
make KERNEL_UNAME=$KERNEL_VERSION
}
package() {
KERNEL_VERSION=$(basename $(ls -d /lib/modules/*-virt))
modules="nvidia.ko \
nvidia-drm.ko \
nvidia-modeset.ko \
nvidia-uvm.ko \
nvidia-peermem.ko"
mkdir -p "$pkgdir"/lib/modules/$KERNEL_VERSION/kernel
for m in $modules; do
gzip -9 -c kernel-open/$m > "$pkgdir"/lib/modules/$KERNEL_VERSION/kernel/$m.gz
done
depends="linux-virt=$(apk info linux-virt -d | grep description: | awk '{print $1}' | sed -e 's/linux-virt-//')"
}
sha512sums='
93d59bf0bb1eede40036dd65c8ef956c7b9a79f3a2fe6e87b6f4f16413e52b3c8cdb47aacbcd4c087bd77081a2d35fc1981db93019e352b8a8f85083a9221461 nvidia-515.57.tar.gz
'