public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Viorel Munteanu" <ceamac@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/virtualbox/, app-emulation/virtualbox/files/
Date: Fri, 21 Apr 2023 16:38:31 +0000 (UTC)	[thread overview]
Message-ID: <1682094922.02799f44453bb226b6d8763632ea89fb690750d4.ceamac@gentoo> (raw)

commit:     02799f44453bb226b6d8763632ea89fb690750d4
Author:     Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 18 18:39:42 2023 +0000
Commit:     Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
CommitDate: Fri Apr 21 16:35:22 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=02799f44

app-emulation/virtualbox: add 7.0.8

Signed-off-by: Viorel Munteanu <ceamac <AT> gentoo.org>

 app-emulation/virtualbox/Manifest                  |   3 +
 ...tualbox-7.0.8-disable-rebuild-iPxeBiosBin.patch |  18 +
 .../files/virtualbox-7.0.8-mtune-keep-size.patch   |  13 +
 .../files/virtualbox-7.0.8-python3_11.patch        |  86 +++
 app-emulation/virtualbox/virtualbox-7.0.8.ebuild   | 733 +++++++++++++++++++++
 5 files changed, 853 insertions(+)

diff --git a/app-emulation/virtualbox/Manifest b/app-emulation/virtualbox/Manifest
index 7216099ce109..41f477b81cac 100644
--- a/app-emulation/virtualbox/Manifest
+++ b/app-emulation/virtualbox/Manifest
@@ -1,5 +1,8 @@
 DIST VirtualBox-6.1.42.tar.bz2 165554573 BLAKE2B 8419793d9e4c4d0804baba926443a27259b012ab90d1bb27c8f9d90b018ddbef83d1cc47e9f5b88e6e247f22c186603584a5ddee4b0c04fe842eba56f3fd103a SHA512 a4861b44ee85d6d1d72ba1d19b5598873503feeb6d562cf7d8c770cc9b466741bdfa5abe74dc4e7952ff189d14c6caf60f584731492c38f688a360baba019ab2
 DIST VirtualBox-6.1.44.tar.bz2 165775421 BLAKE2B e87d7175bc616784c79d02b595d81119cedc7f4df1822b71ca10b85d44d5cd1dacd999e7867a0bef8579ea715ef732b990cef63f3325fff0c139abe394d88ad7 SHA512 49c3baa1a40dcafcc6b31d0abcfecfcb24305de44e5efd3f68ba4443574e21b8cc34d7288e0fbc56730bc3be2bee07089b7dfed14848a88dc38a1433b6dda8af
 DIST VirtualBox-7.0.6.tar.bz2 199512172 BLAKE2B cfe4d7abd57dfdb0294177759e80aa9fda797b9b5433f214771a57764cb23404450169e8c7c30cda13de85b8e02a37024584c7b1f0b5a44b10b100aa66b8d5c5 SHA512 f9db7a154e392f550f50abe774fc6263eb0b6f86dccc069f2c5012fedbe2debbf5b8ba62cca44ea0d5d5475652188176bfb888266f69197677b22854f02b64a0
+DIST VirtualBox-7.0.8.tar.bz2 199298777 BLAKE2B 6e36532516fb1ebee4cf7f356659a8cde6bd5074a509c824499ed34d8d0ffc9aff45211d4dcb35e3977fcd72a9b18796ed57f8760dd45e578d8225814c4c8710 SHA512 4c25f8275269d085cf347596a242b8921f140e0e40d8c44fd6b171742b8cbd0c9a45f4702dbc0c1272e10091be68c3668711c9e4d1a8b3ce57d25f871e0eb9fe
 DIST virtualbox-help-7.0.6.tar.xz 3939412 BLAKE2B ea1326bccb3c2edc33ab37e122a7bedf79475d335e632ee62f99e0dce4b80de7634cbfe121c8c7ccd6588ff3b81effe7b20efe123cc44bc7b1ff4f6a851302a6 SHA512 ffb59f0c99c91b165a0b83d29317e04eee9097b0d0ac92a0d3e71558e70ec8b2807491a4633562a5e820e5f5a8e1339883031fd03de93d09a188f19b8b4d3a93
+DIST virtualbox-help-7.0.8.tar.xz 3941816 BLAKE2B f1c82ccc8a0d4e99f2302a7024a551e7e4a70348b193cf0c3a3b2917a717451c74d652555cadb278f6e27c47dac88a8121acfe9425bc0f5b82b5101475f384b3 SHA512 7483c4321492effb5b4329d48b363d8d2b3aaa248c0259cd06569497090aa438c39e94d6a5da4f511202f424e596f66e7580e37ffa5da66661fd0fadcd99c5ef
 DIST virtualbox-patches-6.1.36.tar.bz2 2733 BLAKE2B dcfebfeca4873d382441515d48b4dfee9343bc7c83ea3cbb5002dbf7975143a79fae9a701b67dc35505e9ca03ff1b6293cb7c3279c4fdfda8ad21ba5fb9b7e87 SHA512 1bed5cdefbf8e7c4b0d9092ba4961ecf2262f27f35c71a91ef6f2e8fe8a1d92ed74f06bafbf58d70ba7165d933997f58073f4d4f4051e3ba5c0339b729066f57
+DIST virtualbox-patches-7.0.8.tar.bz2 2733 BLAKE2B 044dfe02a5bd5e757091318b394b0e5918677b5bbce9caef4a18d4d8df54821559f0df6ffbdd6f52d4934bc4018e9c9d908571c5d3d8804fd3b0f22a7a1aed84 SHA512 93a06aa3f9508d3a8743ca8494a958159b5bc3fd7a0a08ff23414d05c4f31084cf0f1c82a3866e222c83e6996ba004546f0bd33c6eb9a90eec8e548b8b3f2fbf

diff --git a/app-emulation/virtualbox/files/virtualbox-7.0.8-disable-rebuild-iPxeBiosBin.patch b/app-emulation/virtualbox/files/virtualbox-7.0.8-disable-rebuild-iPxeBiosBin.patch
new file mode 100644
index 000000000000..29ec3aee72c1
--- /dev/null
+++ b/app-emulation/virtualbox/files/virtualbox-7.0.8-disable-rebuild-iPxeBiosBin.patch
@@ -0,0 +1,18 @@
+When compiling with clang we get:
+
+src/VBox/Devices/PC/ipxe/src/core/settings.c:310:8: error: fields must have a constant size: 'variable length array in structure' extension will never be supported
+
+Apply this patch conditionally to disable rebuilding iPxeBiosBin.rom when using clang.
+
+--- a/src/VBox/Devices/PC/ipxe/Makefile.kmk
++++ b/src/VBox/Devices/PC/ipxe/Makefile.kmk
+@@ -45,7 +45,8 @@
+ iPxeBiosBin_CLEAN    = \
+ 	$(iPxeBiosBin_0_OUTDIR)/iPxeBiosBin.c \
+ 
+-if1of ($(KBUILD_TARGET), darwin os2 solaris win)
++# Disable building on Linux if using clang
++if1of ($(KBUILD_TARGET), darwin os2 solaris win linux)
+  $$(iPxeBiosBin_0_OUTDIR)/iPxeBiosBin.c: $(PATH_SUB_CURRENT)/iPxeBiosBin.rom $(VBOX_BIN2C) | $$(dir $$@)
+ 	$(call MSG_TOOL,bin2c,iPxeBiosBin,$<,$@)
+ 	$(QUIET)$(VBOX_BIN2C) -min 32 -max 56 -mask 0x1ff -export NetBiosBinary $< $@

diff --git a/app-emulation/virtualbox/files/virtualbox-7.0.8-mtune-keep-size.patch b/app-emulation/virtualbox/files/virtualbox-7.0.8-mtune-keep-size.patch
new file mode 100644
index 000000000000..e37d9d6dcb94
--- /dev/null
+++ b/app-emulation/virtualbox/files/virtualbox-7.0.8-mtune-keep-size.patch
@@ -0,0 +1,13 @@
+Force -mtune=i386.  Random -mtune can lead to iPxeBiosBin.rom getting too
+large (larger than 56k).  This can happen because we support custom CFLAGS.
+
+--- a/src/VBox/Devices/PC/ipxe/Makefile.kmk
++++ b/src/VBox/Devices/PC/ipxe/Makefile.kmk
+@@ -125,6 +125,7 @@
+ 	-ffreestanding \
+ 	-ffunction-sections \
+ 	-march=i386 \
++	-mtune=i386 \
+ 	-fomit-frame-pointer \
+ 	-fstrength-reduce \
+ 	-falign-jumps=1 \

diff --git a/app-emulation/virtualbox/files/virtualbox-7.0.8-python3_11.patch b/app-emulation/virtualbox/files/virtualbox-7.0.8-python3_11.patch
new file mode 100644
index 000000000000..02fc9c1b12fe
--- /dev/null
+++ b/app-emulation/virtualbox/files/virtualbox-7.0.8-python3_11.patch
@@ -0,0 +1,86 @@
+Add support for python 3.11
+
+Virtualbox 7.0.0 will only build a lib named VBoxPython3.so, regardless of the
+actual python version used when compiling.  Remove VBoxPython3m.so, we don't
+use it.
+
+--- a/src/libs/xpcom18a4/python/Makefile.kmk
++++ b/src/libs/xpcom18a4/python/Makefile.kmk
+@@ -30,7 +30,7 @@
+ 
+ #
+ # List of supported Python versions, defining a number of
+-# VBOX_PYTHON[26|27|31|32|32M|33|33M|34|34M|35|35M|36|36M|37|37M|38|38M|39|39M|310|310M|DEF]_[INC|LIB] variables
++# VBOX_PYTHON[26|27|31|32|32M|33|33M|34|34M|35|35M|36|36M|37|37M|38|38M|39|39M|310|310M|311|311M|DEF]_[INC|LIB] variables
+ # which get picked up below.
+ #
+ ifeq ($(KBUILD_TARGET),darwin) # Relatively predictable, don't script.
+@@ -665,6 +665,48 @@
+    endif
+   endif
+ 
++  ifdef VBOX_PYTHON311_INC
++   #
++   # Python 3.11 version
++   #
++   DLLS += VBoxPython3_11
++   VBoxPython3_11_EXTENDS = VBoxPythonBase
++   VBoxPython3_11_EXTENDS_BY = appending
++   VBoxPython3_11_INCS    = $(VBOX_PYTHON311_INC)
++   VBoxPython3_11_LIBS    = $(VBOX_PYTHON311_LIB)
++
++   ifdef VBOX_WITH_32_ON_64_MAIN_API
++    ifdef VBOX_PYTHON311_LIB_X86
++     DLLS += VBoxPython3_11_x86
++     VBoxPython3_11_x86_EXTENDS = VBoxPythonBase_x86
++     VBoxPython3_11_x86_EXTENDS_BY = appending
++     VBoxPython3_11_x86_INCS  = $(VBOX_PYTHON311_INC)
++     VBoxPython3_11_x86_LIBS  = $(VBOX_PYTHON311_LIB_X86)
++    endif
++   endif
++  endif
++
++  ifdef VBOX_PYTHON311M_INC
++   #
++   # Python 3.11 version with pymalloc
++   #
++   DLLS += VBoxPython3_11m
++   VBoxPython3_11m_EXTENDS = VBoxPythonBase_m
++   VBoxPython3_11m_EXTENDS_BY = appending
++   VBoxPython3_11m_INCS    = $(VBOX_PYTHON311M_INC)
++   VBoxPython3_11m_LIBS    = $(VBOX_PYTHON311M_LIB)
++
++   ifdef VBOX_WITH_32_ON_64_MAIN_API
++    ifdef VBOX_PYTHON311M_LIB_X86
++     DLLS += VBoxPython3_11m_x86
++     VBoxPython3_11m_x86_EXTENDS = VBoxPythonBase_x86_m
++     VBoxPython3_11m_x86_EXTENDS_BY = appending
++     VBoxPython3_11m_x86_INCS  = $(VBOX_PYTHON311M_INC)
++     VBoxPython3_11m_x86_LIBS  = $(VBOX_PYTHON311M_LIB_X86)
++    endif
++   endif
++  endif
++
+   ifdef VBOX_PYTHONDEF_INC
+    #
+    # Python without versioning
+@@ -707,18 +749,13 @@
+   # TODO: ASSUMING that we don't need a different headers for pymalloc
+   #       ('m' builds < 3.8) and CRT malloc.
+   #
+-  VBOX_PYTHON_LIMITED_API_VER := $(firstword $(foreach ver, 35 36 38 39 310   34 33 \
++  VBOX_PYTHON_LIMITED_API_VER := $(firstword $(foreach ver, 35 36 38 39 310 311   34 33 \
+   	,$(if-expr defined(VBOX_PYTHON$(ver)_INC),$(ver),)$(if-expr defined(VBOX_PYTHON$(ver)M_INC),$(ver)M,)))
+   ifneq ($(VBOX_PYTHON_LIMITED_API_VER),)
+    DLLS += VBoxPython3
+    VBoxPython3_EXTENDS   = VBoxPythonBase
+    VBoxPython3_DEFS      = $(filter-out VBOX_PYXPCOM_VERSIONED,$(VBoxPythonBase_DEFS)) Py_LIMITED_API=0x03030000
+    VBoxPython3_INCS      = $(VBoxPythonBase_INCS) $(VBOX_PYTHON$(VBOX_PYTHON_LIMITED_API_VER)_INC)
+-
+-   DLLS += VBoxPython3m
+-   VBoxPython3m_EXTENDS  = VBoxPythonBase_m
+-   VBoxPython3m_DEFS     = $(filter-out VBOX_PYXPCOM_VERSIONED,$(VBoxPythonBase_m_DEFS)) Py_LIMITED_API=0x03030000
+-   VBoxPython3m_INCS     = $(VBoxPythonBase_m_INCS) $(VBOX_PYTHON$(VBOX_PYTHON_LIMITED_API_VER)_INC)
+   endif
+  endif # VBOX_WITH_PYTHON_LIMITED_API
+ 

diff --git a/app-emulation/virtualbox/virtualbox-7.0.8.ebuild b/app-emulation/virtualbox/virtualbox-7.0.8.ebuild
new file mode 100644
index 000000000000..dbf3c33aa1b0
--- /dev/null
+++ b/app-emulation/virtualbox/virtualbox-7.0.8.ebuild
@@ -0,0 +1,733 @@
+# Copyright 2022-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# To add a new Python here:
+# 1. Patch src/libs/xpcom18a4/python/Makefile.kmk (copy the previous impl's logic)
+#    Do NOT skip this part. It'll end up silently not-building the Python extension
+#    or otherwise misbehaving if you do.
+#
+# 2. Then update PYTHON_COMPAT & set PYTHON_SINGLE_TARGET for testing w/ USE=python.
+#
+#  May need to look at other distros (e.g. Arch Linux) to find patches for newer
+#  Python versions as upstream tends to lag. Upstream may have patches on their
+#  trunk branch but not release branch.
+#
+#  See bug #785835, bug #856121.
+PYTHON_COMPAT=( python3_{9..11} )
+
+inherit desktop edo flag-o-matic java-pkg-opt-2 linux-info multilib optfeature pax-utils \
+	python-single-r1 tmpfiles toolchain-funcs udev xdg
+
+MY_PN="VirtualBox"
+MY_P=${MY_PN}-${PV}
+
+DESCRIPTION="Family of powerful x86 virtualization products for enterprise and home use"
+HOMEPAGE="https://www.virtualbox.org/"
+SRC_URI="
+	https://download.virtualbox.org/virtualbox/${PV}/${MY_P}.tar.bz2
+	https://gitweb.gentoo.org/proj/virtualbox-patches.git/snapshot/virtualbox-patches-7.0.8.tar.bz2
+	gui? ( !doc? ( https://dev.gentoo.org/~ceamac/${CATEGORY}/${PN}/${PN}-help-${PV}.tar.xz ) )
+"
+S="${WORKDIR}/${MY_PN}-${PV}"
+
+LICENSE="GPL-2+ GPL-3 LGPL-2.1 MIT dtrace? ( CDDL )"
+SLOT="0/$(ver_cut 1-2)"
+KEYWORDS="~amd64"
+IUSE="alsa dbus debug doc dtrace +gui java lvm nls pam pch pulseaudio +opengl python +sdk +sdl +udev vboxwebsrv vde vnc"
+
+unset WATCOM #856769
+
+COMMON_DEPEND="
+	${PYTHON_DEPS}
+	acct-group/vboxusers
+	~app-emulation/virtualbox-modules-${PV}
+	dev-libs/libtpms
+	dev-libs/libxml2
+	dev-libs/openssl:0=
+	media-libs/libpng:0=
+	media-libs/libvpx:0=
+	net-misc/curl
+	sys-libs/zlib
+	dbus? ( sys-apps/dbus )
+	gui? (
+		dev-qt/qtcore:5
+		dev-qt/qtdbus:5
+		dev-qt/qtgui:5
+		dev-qt/qthelp:5
+		dev-qt/qtprintsupport:5
+		dev-qt/qtwidgets:5
+		dev-qt/qtx11extras:5
+		dev-qt/qtxml:5
+		x11-libs/libX11
+		x11-libs/libXt
+		opengl? ( dev-qt/qtopengl:5 )
+	)
+	lvm? ( sys-fs/lvm2 )
+	opengl? (
+		media-libs/libglvnd[X]
+		media-libs/vulkan-loader
+		x11-libs/libX11
+		x11-libs/libXt
+	)
+	pam? ( sys-libs/pam )
+	sdl? (
+		media-libs/libsdl2[X,video]
+		x11-libs/libX11
+		x11-libs/libXcursor
+		x11-libs/libXt
+	)
+	vboxwebsrv? ( net-libs/gsoap[-gnutls(-),debug?] )
+	vde? ( net-misc/vde )
+	vnc? ( >=net-libs/libvncserver-0.9.9 )
+"
+# We're stuck on JDK (and JRE, I guess?) 1.8 because of need for wsimport
+# with USE="vboxwebsrv java". Note that we have to put things in DEPEND,
+# not (only, anyway) BDEPEND, as the eclass magic to set the environment variables
+# based on *DEPEND doesn't work for BDEPEND at least right now.
+#
+# There's a comment in Config.kmk about it
+# ("With Java 11 wsimport was removed, usually part of a separate install now.")
+# but it needs more investigation.
+#
+# See bug #878299 to track this issue.
+DEPEND="
+	${COMMON_DEPEND}
+	>=dev-libs/libxslt-1.1.19
+	virtual/libcrypt:=
+	alsa? ( >=media-libs/alsa-lib-1.0.13 )
+	gui? (
+		x11-base/xorg-proto
+		x11-libs/libxcb:=
+		x11-libs/libXcursor
+		x11-libs/libXext
+		x11-libs/libXinerama
+		x11-libs/libXmu
+		x11-libs/libXrandr
+	)
+	java? ( virtual/jdk:1.8 )
+	opengl? (
+		x11-base/xorg-proto
+		x11-libs/libXcursor
+		x11-libs/libXinerama
+		x11-libs/libXmu
+		x11-libs/libXrandr
+		virtual/glu
+	)
+	sdl? ( x11-libs/libXinerama )
+	pulseaudio? ( media-libs/libpulse )
+	udev? ( >=virtual/udev-171 )
+"
+RDEPEND="
+	${COMMON_DEPEND}
+	gui? ( x11-libs/libxcb:= )
+	java? ( virtual/jre:1.8 )
+"
+BDEPEND="
+	${PYTHON_DEPS}
+	>=app-arch/tar-1.34-r2
+	>=dev-lang/yasm-0.6.2
+	dev-libs/libIDL
+	dev-util/glslang
+	>=dev-util/kbuild-0.1.9998.3592
+	sys-apps/which
+	sys-devel/bin86
+	sys-libs/libcap
+	sys-power/iasl
+	virtual/pkgconfig
+	doc? (
+		app-text/docbook-sgml-dtd:4.4
+		app-text/docbook-xsl-ns-stylesheets
+		dev-texlive/texlive-basic
+		dev-texlive/texlive-latex
+		dev-texlive/texlive-latexrecommended
+		dev-texlive/texlive-latexextra
+		dev-texlive/texlive-fontsrecommended
+		dev-texlive/texlive-fontsextra
+		dev-qt/qthelp:5
+	)
+	gui? ( dev-qt/linguist-tools:5 )
+	nls? ( dev-qt/linguist-tools:5 )
+	java? ( virtual/jdk:1.8 )
+"
+
+QA_FLAGS_IGNORED="
+	usr/lib64/virtualbox/VBoxDDR0.r0
+	usr/lib64/virtualbox/VMMR0.r0
+	usr/lib64/virtualbox/ExtensionPacks/Oracle_VBoxDTrace_Extension_Pack/linux.amd64/VBoxDTraceR0.r0
+	usr/lib64/virtualbox/ExtensionPacks/Oracle_VBoxDTrace_Extension_Pack/linux.amd64/VBoxDTraceR0.debug
+"
+
+QA_TEXTRELS="
+	usr/lib64/virtualbox/VMMR0.r0
+	usr/lib64/virtualbox/ExtensionPacks/Oracle_VBoxDTrace_Extension_Pack/linux.amd64/VBoxDTraceR0.r0
+"
+
+QA_EXECSTACK="
+	usr/lib64/virtualbox/iPxeBaseBin
+	usr/lib64/virtualbox/VMMR0.r0
+	usr/lib64/virtualbox/VBoxDDR0.r0
+	usr/lib64/virtualbox/ExtensionPacks/Oracle_VBoxDTrace_Extension_Pack/linux.amd64/VBoxDTraceR0.r0
+	usr/lib64/virtualbox/ExtensionPacks/Oracle_VBoxDTrace_Extension_Pack/linux.amd64/VBoxDTraceR0.debug
+"
+
+QA_WX_LOAD="
+	usr/lib64/virtualbox/iPxeBaseBin
+"
+
+QA_PRESTRIPPED="
+	usr/lib64/virtualbox/VMMR0.r0
+	usr/lib64/virtualbox/VBoxDDR0.r0
+	usr/lib64/virtualbox/ExtensionPacks/Oracle_VBoxDTrace_Extension_Pack/linux.amd64/VBoxDTraceR0.r0
+"
+
+REQUIRED_USE="
+	java? ( sdk )
+	python? ( sdk )
+	vboxwebsrv? ( java )
+	${PYTHON_REQUIRED_USE}
+"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-6.1.26-configure-include-qt5-path.patch # bug #805365
+
+	# This patch is needed to avoid automagic detection based on a hardcoded
+	# list of Pythons in configure. It's necessary but not sufficient
+	# (see the rest of the ebuild's logic for the remainder) to handle
+	# proper Python selection.
+	"${FILESDIR}"/${PN}-6.1.34-r3-python.patch
+
+	# 865361
+	"${FILESDIR}"/${PN}-6.1.36-fcf-protection.patch
+
+	"${FILESDIR}"/${PN}-7.0.0-fix-compilation-clang.patch
+	"${FILESDIR}"/${PN}-7.0.8-python3_11.patch
+	"${FILESDIR}"/${PN}-7.0.6-gcc-13.patch
+	"${FILESDIR}"/${PN}-7.0.8-mtune-keep-size.patch
+
+	# Downloaded patchset
+	"${WORKDIR}"/virtualbox-patches-7.0.8/patches
+)
+
+pkg_pretend() {
+	if ! use gui; then
+		einfo "No USE=\"gui\" selected, this build will not include any Qt frontend."
+	fi
+
+	if ! use opengl; then
+		einfo "No USE=\"opengl\" selected, this build will lack"
+		einfo "the OpenGL feature."
+	fi
+	if ! use python; then
+		einfo "You have disabled the \"python\" USE flag. This will only"
+		einfo "disable the python bindings being installed."
+	fi
+	if ! use nls && use gui; then
+		einfo "USE=\"gui\" also selects USE=\"nls\".  This build"
+		einfo "will have NLS support."
+	fi
+
+	# 749273
+	local d=${ROOT}
+	for i in usr "$(get_libdir)"; do
+		d="${d}/$i"
+		if [[ "$(stat -L -c "%g %u" "${d}")" != "0 0" ]]; then
+			die "${d} should be owned by root, VirtualBox will not start otherwise"
+		fi
+	done
+}
+
+pkg_setup() {
+	java-pkg-opt-2_pkg_setup
+	python-single-r1_pkg_setup
+}
+
+src_prepare() {
+	default
+
+	# Only add nopie patch when we're on hardened
+	if gcc-specs-pie; then
+		eapply "${FILESDIR}"/050_virtualbox-5.2.8-nopie.patch
+	fi
+
+	# Remove shipped binaries (kBuild, yasm) and tools, see bug #232775
+	rm -r kBuild/bin || die
+	# Remove everything in tools except kBuildUnits
+	find tools -mindepth 1 -maxdepth 1 -name kBuildUnits -prune -o -exec rm -r {} \+ || die
+
+	# Disable things unused or split into separate ebuilds
+	sed -e "s@MY_LIBDIR@$(get_libdir)@" \
+		"${FILESDIR}"/${PN}-5-localconfig > LocalConfig.kmk || die
+
+	if ! use pch; then
+		# bug #753323
+		printf '\n%s\n' "VBOX_WITHOUT_PRECOMPILED_HEADERS=1" \
+			>> LocalConfig.kmk || die
+	fi
+
+	# Respect LDFLAGS
+	sed -e "s@_LDFLAGS\.${ARCH}*.*=@& ${LDFLAGS}@g" \
+		-i Config.kmk src/libs/xpcom18a4/Config.kmk || die
+
+	# Do not use hard-coded ld (related to bug #488176)
+	sed -e '/QUIET)ld /s@ld @$(LD) @' \
+		-i src/VBox/Devices/PC/ipxe/Makefile.kmk || die
+
+	# Use PAM only when pam USE flag is enbaled (bug #376531)
+	if ! use pam; then
+		einfo "Disabling PAM removes the possibility to use the VRDP features."
+		sed -i 's@^.*VBOX_WITH_PAM@#VBOX_WITH_PAM@' Config.kmk || die
+		sed -i 's@\(.*/auth/Makefile.kmk.*\)@#\1@' \
+			src/VBox/HostServices/Makefile.kmk || die
+	fi
+
+	# add correct java path
+	if use java; then
+		sed "s@/usr/lib/jvm/java-6-sun@$(java-config -O)@" \
+			-i "${S}"/Config.kmk || die
+		java-pkg-opt-2_src_prepare
+	fi
+
+	#856811 #864274
+	# cannot filter out only one flag, some combinations of these flags produce buggy executables
+	for i in abm avx avx2 bmi bmi2 fma fma4 popcnt; do
+		append-cflags $(test-flags-CC -mno-$i)
+		append-cxxflags $(test-flags-CXX -mno-$i)
+	done
+
+	# bug #843437
+	cat >> LocalConfig.kmk <<-EOF || die
+		CXXFLAGS=${CXXFLAGS}
+		CFLAGS=${CFLAGS}
+	EOF
+
+	if use sdl; then
+		sed -i 's/sdl-config/sdl2-config/' configure || die
+		echo -e "\nVBOX_WITH_VBOXSDL=1" >> LocalConfig.kmk || die
+	fi
+
+	#443830
+	echo -e "\nVBOX_WITH_VBOX_IMG=1" >> LocalConfig.kmk || die
+
+	if tc-is-clang; then
+		# clang assembler chokes on comments starting with /
+		sed -i -e '/^\//d' src/libs/xpcom18a4/nsprpub/pr/src/md/unix/os_Linux_x86_64.s || die
+
+		# clang does not support this extension
+		eapply "${FILESDIR}"/${PN}-7.0.8-disable-rebuild-iPxeBiosBin.patch
+	fi
+
+	# fix doc generation
+	echo -e "\nVBOX_PATH_DOCBOOK=/usr/share/sgml/docbook/xsl-ns-stylesheets" >> LocalConfig.kmk || die
+	# replace xhtml names with numeric equivalents
+	find doc/manual -name \*.xml -exec sed -i \
+		-e 's/&nbsp;/\&#160;/g' \
+		-e 's/&ndash;/\&#8211;/g' \
+		-e 's/&larr;/\&#8592;/g' \
+		-e 's/&rarr;/\&#8594;/g' \
+		-e 's/&harr;/\&#8596;/g' {} \+ || die
+
+	# fix help path #891879
+	echo -e "\nVBOX_PATH_PACKAGE_DOCS=/usr/share/doc/${PF}" >> LocalConfig.kmk || die
+
+	# 489208
+	# Cannot patch the whole text, many translations.  Use sed instead to replace the command
+	find src/VBox/Frontends/VirtualBox/nls -name \*.ts -exec sed -i \
+		's/&apos;[^&]*\(vboxdrv setup\|vboxconfig\)&apos;/\&apos;emerge -1 virtualbox-modules\&apos;/' {} \+ || die
+	sed -i "s:'/sbin/vboxconfig':'emerge -1 virtualbox-modules':" \
+		src/VBox/Frontends/VirtualBox/src/main.cpp \
+		src/VBox/VMM/VMMR3/VM.cpp || die
+
+	# 890561
+	echo -e "\nVBOX_GTAR=gtar" >> LocalConfig.kmk || die
+
+	if ! use nls && ! use gui; then
+		cat >> LocalConfig.kmk <<-EOF || die
+			VBOX_WITH_NLS :=
+			VBOX_WITH_MAIN_NLS :=
+			VBOX_WITH_PUEL_NLS :=
+			VBOX_WITH_VBOXMANAGE_NLS :=
+		EOF
+	fi
+}
+
+src_configure() {
+	tc-ld-disable-gold # bug #488176
+
+	tc-export AR CC CXX LD RANLIB
+	export HOST_CC="$(tc-getBUILD_CC)"
+
+	local myconf=(
+		--with-gcc="$(tc-getCC)"
+		--with-g++="$(tc-getCXX)"
+
+		--disable-kmods
+
+		$(usev !alsa --disable-alsa)
+		$(usev !dbus --disable-dbus)
+		$(usev debug --build-debug)
+		$(usev !doc --disable-docs)
+		$(usev !java --disable-java)
+		$(usev !lvm --disable-devmapper)
+		$(usev !pulseaudio --disable-pulse)
+		$(usev !python --disable-python)
+		$(usev vboxwebsrv --enable-webservice)
+		$(usev vde --enable-vde)
+		$(usev vnc --enable-vnc)
+	)
+
+	if use gui || use sdl || use opengl; then
+		myconf+=(
+			$(usev !opengl --disable-opengl)
+			$(usev !gui --disable-qt)
+			$(usev !sdl --disable-sdl)
+		)
+	else
+		myconf+=(
+			--build-headless
+		)
+	fi
+
+	if use amd64 && ! has_multilib_profile; then
+		myconf+=( --disable-vmmraw )
+	fi
+
+	# not an autoconf script
+	edo ./configure "${myconf[@]}"
+
+	# Force usage of chosen Python implementation
+	# bug #856121, bug #785835
+	sed -i \
+		-e '/VBOX_WITH_PYTHON.*=/d' \
+		-e '/VBOX_PATH_PYTHON_INC.*=/d' \
+		-e '/VBOX_LIB_PYTHON.*=/d' \
+		AutoConfig.kmk || die
+
+	cat >> AutoConfig.kmk <<-EOF || die
+		VBOX_WITH_PYTHON=$(usev python 1)
+		VBOX_PATH_PYTHON_INC=$(python_get_includedir)
+		VBOX_LIB_PYTHON=$(python_get_library_path)
+	EOF
+
+	if use python; then
+		local mangled_python="${EPYTHON#python}"
+		mangled_python="${mangled_python/.}"
+
+		# Stub out the script which defines what the Makefile ends up
+		# building for. gen_python_deps.py gets called by the Makefile
+		# with some args and it spits out a bunch of paths for a hardcoded
+		# list of Pythons. We just override it with what we're actually using.
+		# This minimises the amount of patching we have to do for new Pythons.
+		cat > src/libs/xpcom18a4/python/gen_python_deps.py <<-EOF || die
+			print("VBOX_PYTHON${mangled_python}_INC=$(python_get_includedir)")
+			print("VBOX_PYTHON${mangled_python}_LIB=$(python_get_library_path)")
+			print("VBOX_PYTHONDEF_INC=$(python_get_includedir)")
+			print("VBOX_PYTHONDEF_LIB=$(python_get_library_path)")
+		EOF
+
+		chmod +x src/libs/xpcom18a4/python/gen_python_deps.py || die
+	fi
+}
+
+src_compile() {
+	source ./env.sh || die
+
+	# Force kBuild to respect C[XX]FLAGS and MAKEOPTS (bug #178529)
+	MAKEJOBS=$(grep -Eo '(\-j|\-\-jobs)(=?|[[:space:]]*)[[:digit:]]+' <<< ${MAKEOPTS})
+	MAKELOAD=$(grep -Eo '(\-l|\-\-load-average)(=?|[[:space:]]*)[[:digit:]]+' <<< ${MAKEOPTS})
+	MAKEOPTS="${MAKEJOBS} ${MAKELOAD}"
+
+	local myemakeargs=(
+		VBOX_BUILD_PUBLISHER=_Gentoo
+		VBOX_WITH_VBOXIMGMOUNT=1
+
+		KBUILD_VERBOSE=2
+
+		AS="$(tc-getCC)"
+		CC="$(tc-getCC)"
+		CXX="$(tc-getCXX)"
+
+		TOOL_GCC3_CC="$(tc-getCC)"
+		TOOL_GCC3_LD="$(tc-getCC)"
+		TOOL_GCC3_AS="$(tc-getCC)"
+		TOOL_GCC3_AR="$(tc-getAR)"
+		TOOL_GCC3_OBJCOPY="$(tc-getOBJCOPY)"
+
+		TOOL_GXX3_CC="$(tc-getCC)"
+		TOOL_GXX3_CXX="$(tc-getCXX)"
+		TOOL_GXX3_LD="$(tc-getCXX)"
+		TOOL_GXX3_AS="$(tc-getCXX)"
+		TOOL_GXX3_AR="$(tc-getAR)"
+		TOOL_GXX3_OBJCOPY="$(tc-getOBJCOPY)"
+
+		TOOL_GCC3_CFLAGS="${CFLAGS}"
+		TOOL_GCC3_CXXFLAGS="${CXXFLAGS}"
+		VBOX_GCC_OPT="${CXXFLAGS}"
+		VBOX_NM="$(tc-getNM)"
+
+		TOOL_YASM_AS=yasm
+	)
+
+	if use amd64 && has_multilib_profile; then
+		myemakeargs+=(
+			CC32="$(tc-getCC) -m32"
+			CXX32="$(tc-getCXX) -m32"
+
+			TOOL_GCC32_CC="$(tc-getCC) -m32"
+			TOOL_GCC32_CXX="$(tc-getCXX) -m32"
+			TOOL_GCC32_LD="$(tc-getCC) -m32"
+			TOOL_GCC32_AS="$(tc-getCC) -m32"
+			TOOL_GCC32_AR="$(tc-getAR)"
+			TOOL_GCC32_OBJCOPY="$(tc-getOBJCOPY)"
+
+			TOOL_GXX32_CC="$(tc-getCC) -m32"
+			TOOL_GXX32_CXX="$(tc-getCXX) -m32"
+			TOOL_GXX32_LD="$(tc-getCXX) -m32"
+			TOOL_GXX32_AS="$(tc-getCXX) -m32"
+			TOOL_GXX32_AR="$(tc-getAR)"
+			TOOL_GXX32_OBJCOPY="$(tc-getOBJCOPY)"
+		)
+	fi
+
+	MAKE="kmk" emake "${myemakeargs[@]}" all
+}
+
+src_install() {
+	cd "${S}"/out/linux.${ARCH}/$(usex debug debug release)/bin || die
+
+	local vbox_inst_path="/usr/$(get_libdir)/${PN}" each size ico icofile
+
+	vbox_inst() {
+		local binary="${1}"
+		local perms="${2:-0750}"
+		local path="${3:-${vbox_inst_path}}"
+
+		[[ -n "${binary}" ]] || die "vbox_inst: No binary given!"
+		[[ ${perms} =~ ^[[:digit:]]+{4}$ ]] || die "vbox_inst: perms must consist of four digits."
+
+		insinto ${path}
+		doins ${binary}
+		fowners root:vboxusers ${path}/${binary}
+		fperms ${perms} ${path}/${binary}
+	}
+
+	# Create configuration files
+	insinto /etc/vbox
+	newins "${FILESDIR}/${PN}-4-config" vbox.cfg
+
+	# Set the correct libdir
+	sed \
+		-e "s@MY_LIBDIR@$(get_libdir)@" \
+		-i "${ED}"/etc/vbox/vbox.cfg || die "vbox.cfg sed failed"
+
+	# Install the wrapper script
+	exeinto ${vbox_inst_path}
+	newexe "${FILESDIR}/${PN}-ose-6-wrapper" "VBox"
+	fowners root:vboxusers ${vbox_inst_path}/VBox
+	fperms 0750 ${vbox_inst_path}/VBox
+
+	# Install binaries and libraries
+	insinto ${vbox_inst_path}
+	doins -r components
+
+	for each in VBox{Autostart,BalloonCtrl,BugReport,CpuReport,ExtPackHelperApp,Manage,SVC,VMMPreload,XPCOMIPCD} \
+		vboximg-mount vbox-img *so *r0; do
+		vbox_inst ${each}
+	done
+
+	# These binaries need to be suid root.
+	for each in VBox{Headless,Net{AdpCtl,DHCP,NAT}} ; do
+		vbox_inst ${each} 4750
+	done
+
+	# Install EFI Firmware files (bug #320757)
+	for each in VBoxEFI{32,64}.fd ; do
+		vbox_inst ${each} 0644
+	done
+
+	# VBoxSVC and VBoxManage need to be pax-marked (bug #403453)
+	# VBoxXPCOMIPCD (bug #524202)
+	for each in VBox{Headless,Manage,SVC,XPCOMIPCD} ; do
+		pax-mark -m "${ED}"${vbox_inst_path}/${each}
+	done
+
+	# Symlink binaries to the shipped wrapper
+	for each in vbox{autostart,balloonctrl,bugreport,headless,manage} \
+		VBox{Autostart,BalloonCtrl,BugReport,Headless,Manage,VRDP} ; do
+			dosym ${vbox_inst_path}/VBox /usr/bin/${each}
+	done
+	dosym ${vbox_inst_path}/vboximg-mount /usr/bin/vboximg-mount
+	dosym ${vbox_inst_path}/vbox-img /usr/bin/vbox-img
+
+	if use pam; then
+		# VRDPAuth only works with this (bug #351949)
+		dosym VBoxAuth.so ${vbox_inst_path}/VRDPAuth.so
+	fi
+
+	# set an env-variable for 3rd party tools
+	echo -n "VBOX_APP_HOME=${vbox_inst_path}" > "${T}/90virtualbox"
+	doenvd "${T}/90virtualbox"
+
+	if use sdl; then
+		vbox_inst VBoxSDL 4750
+		pax-mark -m "${ED}"${vbox_inst_path}/VBoxSDL
+
+		for each in vboxsdl VBoxSDL ; do
+			dosym ${vbox_inst_path}/VBox /usr/bin/${each}
+		done
+	fi
+
+	if use gui; then
+		vbox_inst VirtualBox
+		vbox_inst VirtualBoxVM 4750
+		for each in VirtualBox{,VM} ; do
+			pax-mark -m "${ED}"${vbox_inst_path}/${each}
+		done
+
+		if use opengl; then
+			vbox_inst VBoxTestOGL
+			pax-mark -m "${ED}"${vbox_inst_path}/VBoxTestOGL
+		fi
+
+		for each in virtualbox{,vm} VirtualBox{,VM} ; do
+			dosym ${vbox_inst_path}/VBox /usr/bin/${each}
+		done
+
+		insinto /usr/share/${PN}
+		doins -r nls
+		doins -r UnattendedTemplates
+
+		domenu ${PN}.desktop
+
+		pushd "${S}"/src/VBox/Artwork/OSE &>/dev/null || die
+		for size in 16 32 48 64 128 ; do
+			newicon -s ${size} ${PN}-${size}px.png ${PN}.png
+		done
+		newicon ${PN}-48px.png ${PN}.png
+		doicon -s scalable ${PN}.svg
+		popd &>/dev/null || die
+		pushd "${S}"/src/VBox/Artwork/other &>/dev/null || die
+		for size in 16 24 32 48 64 72 96 128 256 512 ; do
+			for ico in hdd ova ovf vbox{,-extpack} vdi vdh vmdk ; do
+				icofile="${PN}-${ico}-${size}px.png"
+				if [[ -f "${icofile}" ]]; then
+					newicon -s ${size} ${icofile} ${PN}-${ico}.png
+				fi
+			done
+		done
+		popd &>/dev/null || die
+	fi
+
+	if use lvm; then
+		vbox_inst VBoxVolInfo 4750
+		dosym ${vbox_inst_path}/VBoxVolInfo /usr/bin/VBoxVolInfo
+	fi
+
+	if use sdk; then
+		insinto ${vbox_inst_path}
+		doins -r sdk
+
+		if use java; then
+			java-pkg_regjar "${ED}/${vbox_inst_path}/sdk/bindings/xpcom/java/vboxjxpcom.jar"
+			java-pkg_regso "${ED}/${vbox_inst_path}/libvboxjxpcom.so"
+		fi
+	fi
+
+	if use udev; then
+		local udevdir="$(get_udevdir)"
+		local udev_file="VBoxCreateUSBNode.sh"
+		local rules_file="10-virtualbox.rules"
+
+		insinto ${udevdir}
+		doins ${udev_file}
+		fowners root:vboxusers ${udevdir}/${udev_file}
+		fperms 0750 ${udevdir}/${udev_file}
+
+		insinto ${udevdir}/rules.d
+		sed "s@%UDEVDIR%@${udevdir}@" "${FILESDIR}"/${rules_file} \
+			> "${T}"/${rules_file} || die
+		doins "${T}"/${rules_file}
+	fi
+
+	if use vboxwebsrv; then
+		vbox_inst vboxwebsrv
+		dosym ${vbox_inst_path}/VBox /usr/bin/vboxwebsrv
+		newinitd "${FILESDIR}"/vboxwebsrv-initd vboxwebsrv
+		newconfd "${FILESDIR}"/vboxwebsrv-confd vboxwebsrv
+	fi
+
+	# Remove dead symlinks (bug #715338)
+	find "${ED}"/usr/$(get_libdir)/${PN} -xtype l -delete || die
+
+	# Fix version string in extensions or else they don't get accepted
+	# by the virtualbox host process (see bug #438930)
+	find ExtensionPacks -type f -name "ExtPack.xml" -exec sed -i '/Version/s@_Gentoo@@' {} \+ || die
+
+	local extensions_dir="${vbox_inst_path}/ExtensionPacks"
+
+	if use vnc; then
+		insinto ${extensions_dir}
+		doins -r ExtensionPacks/VNC
+	fi
+
+	if use dtrace; then
+		insinto ${extensions_dir}
+		doins -r ExtensionPacks/Oracle_VBoxDTrace_Extension_Pack
+	fi
+
+	if use doc; then
+		dodoc UserManual.pdf UserManual.q{ch,hc}
+		docompress -x /usr/share/doc/${PF}
+	elif use gui; then
+		dodoc "${WORKDIR}"/${PN}-help-${PV}/UserManual.q{ch,hc}
+		docompress -x /usr/share/doc/${PF}
+	fi
+
+	if use python; then
+		local python_path_ext="${ED}/usr/$(get_libdir)/virtualbox/VBoxPython3.so"
+		if [[ ! -x "${python_path_ext}" ]]; then
+			eerror "Couldn't find ${python_path_ext}! Bindings were requested with USE=python"
+			eerror "but none were installed. This may happen if support for a Python target"
+			eerror "(listed in PYTHON_COMPAT in the ebuild) is incomplete within the Makefiles."
+			die "Incomplete installation of Python bindings! File a bug with Gentoo!"
+		fi
+	fi
+
+	newtmpfiles "${FILESDIR}"/${PN}-vboxusb_tmpfilesd ${PN}-vboxusb.conf
+}
+
+pkg_postinst() {
+	xdg_pkg_postinst
+
+	if use udev; then
+		udev_reload
+		udevadm trigger --subsystem-match=usb
+	fi
+
+	tmpfiles_process virtualbox-vboxusb.conf
+
+	if use gui; then
+		elog "To launch VirtualBox just type: \"virtualbox\"."
+	fi
+
+	elog "You must be in the vboxusers group to use VirtualBox."
+	elog ""
+	elog "The latest user manual is available for download at:"
+	elog "https://download.virtualbox.org/virtualbox/${PV}/UserManual.pdf"
+	elog ""
+
+	optfeature "Advanced networking setups" net-misc/bridge-utils sys-apps/usermode-utilities
+	optfeature "USB2, USB3, PXE boot, and VRDP support" app-emulation/virtualbox-extpack-oracle
+	optfeature "Guest additions ISO" app-emulation/virtualbox-additions
+
+	if ! use udev; then
+		ewarn "Without USE=udev, USB devices will likely not work in ${PN}."
+	fi
+}
+
+pkg_postrm() {
+	xdg_pkg_postrm
+
+	use udev && udev_reload
+}


             reply	other threads:[~2023-04-21 16:38 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-21 16:38 Viorel Munteanu [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-10-18 17:16 [gentoo-commits] repo/gentoo:master commit in: app-emulation/virtualbox/, app-emulation/virtualbox/files/ Viorel Munteanu
2024-09-15 13:02 Viorel Munteanu
2024-09-15 13:02 Viorel Munteanu
2024-02-10 16:31 Viorel Munteanu
2024-02-10 16:31 Viorel Munteanu
2024-01-28 10:44 Viorel Munteanu
2023-08-28 10:08 Viorel Munteanu
2023-08-15 12:50 Viorel Munteanu
2023-08-15 12:50 Viorel Munteanu
2023-07-20  9:40 Viorel Munteanu
2023-06-02 18:27 Viorel Munteanu
2023-05-15 14:35 Viorel Munteanu
2023-02-21 15:06 Viorel Munteanu
2023-02-03 14:35 Viorel Munteanu
2022-11-20  8:20 Viorel Munteanu
2022-11-02  6:41 Viorel Munteanu
2022-09-05 12:39 Joonas Niilola
2022-08-18 18:43 Sam James
2022-07-06  6:05 Sam James
2021-04-22 16:55 Lars Wendler
2020-06-03  0:10 Andreas Sturmlechner
2020-06-02 21:52 Andreas Sturmlechner
2019-01-16 12:02 Lars Wendler
2018-12-07 21:42 Lars Wendler
2018-11-17 11:55 Lars Wendler
2018-02-19 14:16 Lars Wendler
2018-02-16 14:56 Lars Wendler
2017-07-26 19:21 Richard Farina
2017-05-11 12:07 Lars Wendler
2017-02-21 22:05 Magnus Granberg
2016-03-11 17:31 Lars Wendler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1682094922.02799f44453bb226b6d8763632ea89fb690750d4.ceamac@gentoo \
    --to=ceamac@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox