commit: 6cc53f2559fb3bc2eb21bd4fdb0c18fd18dee4a9
Author: Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 17 11:42:18 2025 +0000
Commit: Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
CommitDate: Thu Apr 17 15:10:48 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6cc53f25
app-emulation/virtualbox: enable py3.12
Sync with 7.1.8.
Enable python 3.12.
Add python tests.
Signed-off-by: Viorel Munteanu <ceamac <AT> gentoo.org>
app-emulation/virtualbox/virtualbox-9999.ebuild | 41 ++++++++++++++++++++++---
1 file changed, 36 insertions(+), 5 deletions(-)
diff --git a/app-emulation/virtualbox/virtualbox-9999.ebuild
b/app-emulation/virtualbox/virtualbox-9999.ebuild
index 14672f2e29a8..46480278e675 100644
--- a/app-emulation/virtualbox/virtualbox-9999.ebuild
+++ b/app-emulation/virtualbox/virtualbox-9999.ebuild
@@ -7,7 +7,6 @@ EAPI=8
# This compiles the latest svn version.
# It also compiles the kernel modules. Does not depend on virtualbox-modules.
# It is not meant to be used, might be very unstable.
-# Upstream seem to have added support for python 3.12, but it crashes.
#
#
#
@@ -23,7 +22,7 @@ EAPI=8
# trunk branch but not release branch.
#
# See bug #785835, bug #856121.
-PYTHON_COMPAT=( python3_{10..11} )
+PYTHON_COMPAT=( python3_{10..12} )
inherit desktop edo flag-o-matic java-pkg-opt-2 linux-mod-r1 multilib
optfeature pax-utils \
python-single-r1 subversion tmpfiles toolchain-funcs udev xdg
@@ -43,7 +42,8 @@ S="${WORKDIR}/trunk"
LICENSE="GPL-2+ GPL-3 LGPL-2.1 MIT dtrace? ( CDDL )"
SLOT="0/$(ver_cut 1-2)"
-IUSE="alsa dbus debug doc dtrace +gui java lvm nls pam pch pulseaudio +opengl
python +sdk +sdl +udev vboxwebsrv vde +vmmraw vnc"
+IUSE="alsa dbus debug doc dtrace +gui java lvm nls pam pch pulseaudio +opengl
python +sdk +sdl test +udev vboxwebsrv vde +vmmraw vnc"
+RESTRICT="!test? ( test )"
unset WATCOM #856769
@@ -59,7 +59,7 @@ COMMON_DEPEND="
sys-libs/zlib
dbus? ( sys-apps/dbus )
gui? (
- dev-qt/qtbase:6[widgets]
+ dev-qt/qtbase:6[X,widgets]
dev-qt/qtscxml:6
dev-qt/qttools:6[assistant]
x11-libs/libX11
@@ -157,7 +157,14 @@ BDEPEND="
gui? ( dev-qt/qttools:6[linguist] )
nls? ( dev-qt/qttools:6[linguist] )
java? ( virtual/jdk:1.8 )
- python? ( ${PYTHON_DEPS} )
+ python? (
+ ${PYTHON_DEPS}
+ test? (
+ $(python_gen_cond_dep '
+ dev-python/pytest[${PYTHON_USEDEP}]
+ ')
+ )
+ )
"
QA_FLAGS_IGNORED="
@@ -243,6 +250,12 @@ src_unpack() {
src_prepare() {
default
+ if use python; then
+ mkdir test
+ cp "${FILESDIR}"/test_python.py test/
+ python_fix_shebang test/test_python.py
+ fi
+
# Only add nopie patch when we're on hardened
if gcc-specs-pie; then
eapply "${FILESDIR}"/050_virtualbox-5.2.8-nopie.patch
@@ -290,6 +303,9 @@ src_prepare() {
java-pkg-opt-2_src_prepare
fi
+ # bug #940482
+ filter-flags -fno-plt
+
# bug #908814
filter-lto
@@ -508,6 +524,21 @@ src_compile() {
linux-mod-r1_src_compile
}
+src_test() {
+ if use python; then
+ local -x VBOX_APP_HOME="${S}"/out/linux.${ARCH}/$(usex debug
debug release)
+ local -x VBOX_INSTALL_PATH="${VBOX_APP_HOME}"
+ local -x VBOX_PROGRAM_PATH="${VBOX_APP_HOME}"/bin
+ local -x VBOX_SDK_PATH="${VBOX_PROGRAM_PATH}"/sdk
+ local -x
PYTHONPATH="${VBOX_SDK_PATH}"/installer/python/vboxapi/src
+ einfo "VBOX_APP_HOME ${VBOX_APP_HOME}"
+ einfo "VBOX_PROGRAM_PATH ${VBOX_PROGRAM_PATH}"
+ einfo "VBOX_SDK_PATH ${VBOX_SDK_PATH}"
+ einfo "PYTHONPATH ${PYTHONPATH}"
+ LD_LIBRARY_PATH="${VBOX_PROGRAM_PATH}" epytest test/
+ fi
+}
+
src_install() {
linux-mod-r1_src_install
insinto /usr/lib/modules-load.d/