summaryrefslogtreecommitdiff
path: root/app-emulation/virtualbox-modules/virtualbox-modules-7.0.8.ebuild
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-04-22 00:03:23 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-04-22 00:03:23 +0100
commitd3bd579653c6e5f8e1c0a36517372a262ade6c8d (patch)
tree7078b1e6375421ced0dbdd93a81dee1c6a3e04a3 /app-emulation/virtualbox-modules/virtualbox-modules-7.0.8.ebuild
parentebd51986f51b430f84c569c6c0f2fe051158d444 (diff)
gentoo auto-resync : 22:04:2023 - 00:03:23
Diffstat (limited to 'app-emulation/virtualbox-modules/virtualbox-modules-7.0.8.ebuild')
-rw-r--r--app-emulation/virtualbox-modules/virtualbox-modules-7.0.8.ebuild82
1 files changed, 82 insertions, 0 deletions
diff --git a/app-emulation/virtualbox-modules/virtualbox-modules-7.0.8.ebuild b/app-emulation/virtualbox-modules/virtualbox-modules-7.0.8.ebuild
new file mode 100644
index 000000000000..ed823a969cbf
--- /dev/null
+++ b/app-emulation/virtualbox-modules/virtualbox-modules-7.0.8.ebuild
@@ -0,0 +1,82 @@
+# Copyright 2022-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# XXX: the tarball here is just the kernel modules split out of the binary
+# package that comes from VirtualBox-*.run
+# XXX: update: now it is split from virtualbox-*-Debian~bullseye_amd64.deb
+
+EAPI=8
+
+inherit linux-mod toolchain-funcs
+
+MY_P="vbox-kernel-module-src-${PV}"
+DESCRIPTION="Kernel Modules for Virtualbox"
+HOMEPAGE="https://www.virtualbox.org/"
+SRC_URI="https://dev.gentoo.org/~ceamac/${CATEGORY}/${PN}/${MY_P}.tar.xz"
+S="${WORKDIR}"
+
+LICENSE="GPL-3"
+SLOT="0/$(ver_cut 1-2)"
+KEYWORDS="~amd64"
+
+BUILD_TARGETS="all"
+MODULE_NAMES="vboxdrv(misc:${S}) vboxnetflt(misc:${S}) vboxnetadp(misc:${S})"
+MODULESD_VBOXDRV_ENABLED="yes"
+MODULESD_VBOXNETADP_ENABLED="no"
+MODULESD_VBOXNETFLT_ENABLED="no"
+CONFIG_CHECK="~!SPINLOCK JUMP_LABEL"
+
+# Check if the build directory exists and all directories above it have sane permissions
+virtualbox_check_kv_dir() {
+ if [[ ! -d ${KV_DIR} ]]; then
+ [[ -z $a ]] && return 1
+ elog "Directory not found: ${KV_DIR}"
+ local a=$(dirname "${KV_DIR}")
+ while [[ -n $a && $a != '/' && $1 != '.' ]]; do
+ if [[ -d $a && ( ! -r $a || ! -x $a ) ]]; then
+ elog "Please check permissions of $a"
+ fi
+ a=$(dirname "$a")
+ done
+ return 1
+ fi
+ return 0
+}
+
+pkg_pretend() {
+ # bug 893286
+ get_version
+ virtualbox_check_kv_dir
+}
+
+pkg_setup() {
+ linux-mod_pkg_setup
+ virtualbox_check_kv_dir || die
+ BUILD_PARAMS="CC=\"$(tc-getBUILD_CC)\" KERN_DIR=${KV_DIR} KERN_VER=${KV_FULL} O=${KV_OUT_DIR} V=1 KBUILD_VERBOSE=1"
+ if linux_chkconfig_present CC_IS_CLANG; then
+ ewarn "Warning: building ${PN} with a clang-built kernel is experimental."
+
+ BUILD_PARAMS+=' CC=${CHOST}-clang'
+ if linux_chkconfig_present LD_IS_LLD; then
+ BUILD_PARAMS+=' LD=ld.lld'
+ if linux_chkconfig_present LTO_CLANG_THIN; then
+ # kernel enables cache by default leading to sandbox violations
+ BUILD_PARAMS+=' ldflags-y=--thinlto-cache-dir= LDFLAGS_MODULE=--thinlto-cache-dir='
+ fi
+ fi
+ fi
+}
+
+src_install() {
+ linux-mod_src_install
+ insinto /usr/lib/modules-load.d/
+ newins "${FILESDIR}"/virtualbox.conf-r1 virtualbox.conf
+}
+
+pkg_postinst() {
+ # Remove vboxpci.ko from current running kernel
+ # This module is obsolete, removed in december 2019, so it may be missing. No || die
+ # TODO: consider removing this line in the near future
+ find /lib/modules/${KV_FULL}/misc -type f -name "vboxpci.ko" -delete
+ linux-mod_pkg_postinst
+}