# Maintainer: Ben Allen # Contributor: Ben Allen # when changing _ver we *must* bump _rel _name=virtualbox-guest-modules _ver=6.0.10 _rel=0 _flavor=${FLAVOR:-vanilla} _kpkg=linux-$_flavor _kver=4.19.68 _krel=0 _kpkgver="$_kver-r$_krel" _kabi=$_kver-$_krel-$_flavor _kabi_virt=$_kver-$_krel-virt pkgname=$_name-$_flavor pkgver=$_kver pkgrel=$(($_krel + $_rel)) pkgdesc="VirtualBox Additions guest kernel modules for $_flavor" arch='x86_64' # seems to fail on x86: https://github.com/alpinelinux/aports/pull/8215#issuecomment-496630776 url='https://virtualbox.org/' license="GPL-2.0 custom" makedepends="linux-vanilla-dev=$_kpkgver linux-virt-dev=$_kpkgver sed coreutils" subpackages="$_name-virt:virt" source="https://download.virtualbox.org/virtualbox/$_ver/VirtualBox-$_ver.tar.bz2 " install_if="linux-$_flavor=$_kpkgver virtualbox-guest-additions" builddir="$srcdir"/VirtualBox-$_ver prepare() { local i cd "$builddir" default_prepare # verify the kernel version local _kapkbuild=../../main/linux-$_flavor-/APKBUILD if [ -f $_kapkbuild ]; then ( . $_kapkbuild pkgname=$_name-$_flavor [ "$_kver" != "$pkgver" ] && die "please update _kver to $pkgver" [ "$_krel" != "$pkgrel" ] && die "please update _krel to $pkgrel" return 0 ) fi KERN_VER=$_kabi "$builddir"/src/VBox/Additions/linux/export_modules.sh \ "$srcdir/vbox-kmod-$_ver.tar.gz" for i in $_kabi $_kabi_virt; do mkdir -p "$srcdir/$i" tar -C "$srcdir/$i" -zxf "$srcdir"/vbox-kmod-$_ver.tar.gz done } build() { local i for i in $_kabi $_kabi_virt; do cd "$srcdir/$i" # Build Kernel Modules msg "Build for $i" make KERN_DIR=/lib/modules/${i}/build all done } check() { local i for i in $_kabi $_kabi_virt; do cd "$srcdir/$i" make KERN_DIR=/lib/modules/${i}/build check done } package() { local i module= for i in $_kabi $_kabi_virt; do cd "$srcdir/$i" for module in *.ko; do install -v -D -m644 ${module} \ "$pkgdir/lib/modules/$i/misc/${module}" done done } virt() { pkgdesc="VirtualBox Additions kernel modules for virt" install_if="linux-virt=$_kpkgver virtualbox-guest-additions" mkdir -p "$subpkgdir"/lib/modules/ # vboxvideo.ko won't load with virt kernel as it doesn't have DRM rm "$pkgdir"/lib/modules/$_kabi_virt/misc/vboxvideo.ko mv "$pkgdir"/lib/modules/$_kabi_virt \ "$subpkgdir"/lib/modules/ } sha512sums="96fa3c672790239163829b3c40ac0d75d717b29a7b947ec48709eb7811c5800e314a0fc90d87810e4a03da40b3a65914605f648b287314386b371489e5d974c9 VirtualBox-6.0.10.tar.bz2"