summaryrefslogtreecommitdiff
path: root/app-emulation/virtualbox
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-11-20 13:02:32 +0000
committerV3n3RiX <venerix@koprulu.sector>2022-11-20 13:02:32 +0000
commit65c1a6f8d7210639cbdc1565ccee4758f45dfc45 (patch)
treed7bea8e8d228e76b177eccb0ffc1f45a58a1e2f7 /app-emulation/virtualbox
parentc4f077d9f57bf57fcded75904bf512075191d2d2 (diff)
gentoo auto-resync : 20:11:2022 - 13:02:32
Diffstat (limited to 'app-emulation/virtualbox')
-rw-r--r--app-emulation/virtualbox/Manifest7
-rw-r--r--app-emulation/virtualbox/files/virtualbox-7.0.4-fix-compilation.patch26
-rw-r--r--app-emulation/virtualbox/virtualbox-6.1.40.ebuild1
-rw-r--r--app-emulation/virtualbox/virtualbox-7.0.2.ebuild8
-rw-r--r--app-emulation/virtualbox/virtualbox-7.0.4.ebuild692
5 files changed, 731 insertions, 3 deletions
diff --git a/app-emulation/virtualbox/Manifest b/app-emulation/virtualbox/Manifest
index 4496af5f9fdd..d58407152be6 100644
--- a/app-emulation/virtualbox/Manifest
+++ b/app-emulation/virtualbox/Manifest
@@ -12,11 +12,14 @@ AUX virtualbox-6.1.36-python3.10.patch 855 BLAKE2B b6df3e3bf9d9c8d6cfc21a1a21373
AUX virtualbox-7.0.0-fix-compilation-clang.patch 1638 BLAKE2B 2c1c021a5b95ffdbd46982249c3a60e97d79db17994491c3c1774d7fc889d5b5a0da974d05859e21772b6f265bf1009ad3f13d19a5d264c7f8b4b2bacd6a9bdb SHA512 9c83dfb1550463fc9ddce68dd0648b12721ad1f9fa92fac2e7234ac8149fc5a1a5698a759d1352fc8003d737ce987fbc476ed9a9b350490cf52e42e1a08444dd
AUX virtualbox-7.0.0-fix-compilation.patch 1845 BLAKE2B 6dd22251c53e064593113c61b6982caacba766e9e313c31797c20c84352d036fb9346e99d64172e9cab99da49d44a2ddb5592f197ca47d303ab13a068e571091 SHA512 60604e41787b226b14474a832eff5ac37ecc47bd353c51e95f1e2c9ba1948ea9b1a33b0148e9a01953ecbf151e82849b2997da253d74d7dd23593d9843af56ea
AUX virtualbox-7.0.0-python3_11.patch 3258 BLAKE2B 366b799159039caf3d7c41b06780aa80e131fe01b6b0985375a1bcf8de3cf98b611f5c19fdc1762d0de8e052fbe3cf117085c50b4f3e468e9eaf5a5545cf0f92 SHA512 ccc3ba08ec0ebebda9c17fd2a2bb53f2555da9e1c2dee5cf942b300d8c6e745ad46f3d12a5811a9e5c4c582ca796152b9a4fd92e66ab10b421bac0796106f4f9
+AUX virtualbox-7.0.4-fix-compilation.patch 919 BLAKE2B 656a41064773f0d96a3a31287e82537cf93e24d0794c3d4a24ba3378607028b8dc9a9b77a20ee001e2dbff5603043f8e306195610742461d4b1030ecdd3e9918 SHA512 7eb266aee12a489c5e89e1d2f682a421865aa459eb9ac5a9be9c59afa4e0cc8f9f2eb46650d73ef11cdc8c27a021ea37ef9c1150bddf818130d16c29d334651a
AUX virtualbox-ose-6-wrapper 3578 BLAKE2B c150e578212435268de3c5fb0eea701bc843ec2241dc3839d3d1e33604fc01f6bdff6ed0425ba6917072f652b8c29d0df9a550a92900ca13306fcd36521afbee SHA512 315d981f3e92f2e0134946f6bbb8ad4ea4228afb8f73aaed7feead59b3f55cef01cec4285a7fdaf30ce0931d8b69bda4698baebd63d11f2cd9dfe9d0591a0f40
AUX virtualbox-vboxusb_tmpfilesd 35 BLAKE2B 56937e236a0e4d1a2aa085271e8ae0af9553fdf7c3b804af4d3fda3aa8dbc32d63762fee90bc949390cb9cd67f2f0111894c8af084731dab6920ae1675c69a64 SHA512 72e4602f5f214f8833486f5c787c263a10390e8bdf65b5615d67c35ec44048f02add12fe43b19f9c57a9d2f12d768c52e54fcfb9052c0611d06cc988a698c171
DIST VirtualBox-6.1.40.tar.bz2 165769795 BLAKE2B 5c216f23422be3fc4f7760881c666c57a516d12726ed8ef040bbdf918f1af53c69d204b22949e25f751cbe788b00c810c49c27b7c51c1837fd1c503a3eff202c SHA512 0dace071fe58500d0912fe4da4751de6840752375039554a56c8c753a0880a419c4a1ed7f1b0ebc51230f7099ca3f5d987dc7b91ad4d98dbd75bf63e3c27e096
DIST VirtualBox-7.0.2.tar.bz2 199461536 BLAKE2B 94f7c2961c13530b6086bf4576f243b5b260f43ec445c8a2e411205989a9db229715502f2b76b8f3cb45a49ff565410701be90f1e850f069aae5579c0796b503 SHA512 c79d6365f83e1fde356a7f4a6ccd23bc7306d1b5b4be669634c575f08ba53338caca684758c9409ecef2b05ab6f9ad37dfa6075ad6afbc5d7909d46ee6794927
+DIST VirtualBox-7.0.4.tar.bz2 199658172 BLAKE2B 51bde109805e8f3e25f179a05fac532de7a428010955c7cc2a7c9e8c072246d69c5f51f8a51e39b6a1b9f246bd945edc38e0f0cc0630c357a5e9641c38dcac21 SHA512 70f2031c4897249177131795281bf6bd5a75166067d1921db70fd1e21f5638285b5a0c3298a7070e272ac2f093a60c35eb3cab4e5f7d16a68d17b211f637b0bc
DIST virtualbox-patches-6.1.36.tar.bz2 2733 BLAKE2B dcfebfeca4873d382441515d48b4dfee9343bc7c83ea3cbb5002dbf7975143a79fae9a701b67dc35505e9ca03ff1b6293cb7c3279c4fdfda8ad21ba5fb9b7e87 SHA512 1bed5cdefbf8e7c4b0d9092ba4961ecf2262f27f35c71a91ef6f2e8fe8a1d92ed74f06bafbf58d70ba7165d933997f58073f4d4f4051e3ba5c0339b729066f57
-EBUILD virtualbox-6.1.40.ebuild 18317 BLAKE2B bda3b31a13adbc1e1a66ef275e2be6b05b2447e63e5bc2a3140a3e320608d1a7d4cff9ae39a45fcf3a3cc81f0e7ca61140ba27aaf528d0f1473acee43c29c650 SHA512 fd40c238b5f7f0c8035295245df29959c198cefc1035c73daf92ca2dba10b3aece746fab3a58a72d91bd59feb8155f42f00b4ebaeb60f1a6df18195508648185
-EBUILD virtualbox-7.0.2.ebuild 19260 BLAKE2B 492cb8f9f590ad155d8e89ad0a232032f1c2b37f9a8e77fcdf5f46138ae0d2ffaa6b72be7b687d14c1402ecb01792fb3f255ae8dbb3eeb81f40f6840e783977d SHA512 d3bbfaee12a3bb5b50eb48f8106bfbb25d7173c3b0dac8affa25f96ecb9fc2f23b5e19ccf530d93cc3b16fedd6ccb27381c52c948c853611417d777b0078a431
+EBUILD virtualbox-6.1.40.ebuild 18338 BLAKE2B aa2b2cb1bece62809d6684197adfb736562f8f9d7b650f01e5f0862316be2a870536b5501e1d8c25f546fbf755004a181d89a90199d8de49e0d216c4a86f752a SHA512 4c0f08304b8e96ae48bf8b2073dc5e86ad3aa0f0d835e3b8744a3161c6b6b43b4d6f67d23dee7134220d579804f15ab03af7c12ecab9002644abd48619eb68bb
+EBUILD virtualbox-7.0.2.ebuild 19455 BLAKE2B 387d070776423dc7c63c38f919e12c78aabd2c1605bb7be6b471d605f32057797182612841f70442c366299de3bf5616b9bc6880e693d168c8c927fa9079f094 SHA512 367f413c924054f9a06ff2b0be5e235354aaedd194c2be657499a83e3a1762dcd09dd79914fb23ec08be883c52cbf9247016a44eb0913bdebdf5e589feabc0eb
+EBUILD virtualbox-7.0.4.ebuild 19484 BLAKE2B b491b23a5cc5f130a86e7fca8a039c2e8d8f98003e0c523c3b510ae5c822e9eef2f4a372a9ee84038a3d1643d11050010c215e38ff7a03af4ef452105728ebe8 SHA512 57c3942b797c0f71ba003294ed46e99fd9bf3cc474fb8ed077202264dd982a1c8ccf91922a75c694d929e37483f453b159dc6a640d248f19c5d1f0708b6adf63
MISC metadata.xml 771 BLAKE2B 0a8fc6454533217d8edba15349eb95d9db1fa076e92c4ca951251d16d1c266e1ee1b1ca8ab41de963ffa010cdd7b73e86ab4e134f7e1b4dbfbb4925000caccf9 SHA512 7630419b477f31b5a2fa93d0909407470ebafda39180217b0f3d43943d5a0cc23b5db39310a9bd76261f23f1025c10d927e771d27fcf50c5789bb04b2c61c0b1
diff --git a/app-emulation/virtualbox/files/virtualbox-7.0.4-fix-compilation.patch b/app-emulation/virtualbox/files/virtualbox-7.0.4-fix-compilation.patch
new file mode 100644
index 000000000000..4452d22fdfd2
--- /dev/null
+++ b/app-emulation/virtualbox/files/virtualbox-7.0.4-fix-compilation.patch
@@ -0,0 +1,26 @@
+Fix compilation if VBOX_WITH_AUDIO_OSS is defined while VBOX_WITH_AUDIO_PULSE and VBOX_WITH_AUDIO_ALSA are not
+
+--- a/src/VBox/Main/xml/Settings.cpp
++++ b/src/VBox/Main/xml/Settings.cpp
+@@ -8931,6 +8931,9 @@
+ RTCLock lock(s_mtx);
+ if (s_enmLinuxDriver == AudioDriverType_Null)
+ {
++# ifdef VBOX_WITH_AUDIO_OSS
++ s_enmLinuxDriver = AudioDriverType_OSS;
++# endif /* VBOX_WITH_AUDIO_OSS */
+ # ifdef VBOX_WITH_AUDIO_PULSE
+ /* Check for the pulse library & that the pulse audio daemon is running. */
+ if (RTProcIsRunningByName("pulseaudio") &&
+@@ -8943,10 +8946,7 @@
+ if (RTLdrIsLoadable("libasound.so.2"))
+ s_enmLinuxDriver = AudioDriverType_ALSA;
+ # endif /* VBOX_WITH_AUDIO_ALSA */
+-# ifdef VBOX_WITH_AUDIO_OSS
+- else
+- s_enmLinuxDriver = AudioDriverType_OSS;
+-# endif /* VBOX_WITH_AUDIO_OSS */
++ ;
+ }
+ return s_enmLinuxDriver;
+
diff --git a/app-emulation/virtualbox/virtualbox-6.1.40.ebuild b/app-emulation/virtualbox/virtualbox-6.1.40.ebuild
index 7067d184bf7e..cdb56ccbd418 100644
--- a/app-emulation/virtualbox/virtualbox-6.1.40.ebuild
+++ b/app-emulation/virtualbox/virtualbox-6.1.40.ebuild
@@ -95,6 +95,7 @@ DEPEND="
alsa? ( >=media-libs/alsa-lib-1.0.13 )
!headless? (
x11-libs/libXinerama
+ x11-libs/libXrandr
opengl? ( virtual/opengl )
)
java? ( virtual/jdk:1.8 )
diff --git a/app-emulation/virtualbox/virtualbox-7.0.2.ebuild b/app-emulation/virtualbox/virtualbox-7.0.2.ebuild
index 4a23f2b624d2..bc613d5df1fa 100644
--- a/app-emulation/virtualbox/virtualbox-7.0.2.ebuild
+++ b/app-emulation/virtualbox/virtualbox-7.0.2.ebuild
@@ -131,6 +131,7 @@ BDEPEND="
dev-texlive/texlive-latexextra
dev-texlive/texlive-fontsrecommended
dev-texlive/texlive-fontsextra
+ dev-qt/qthelp:5
)
java? ( virtual/jdk:1.8 )
"
@@ -200,6 +201,11 @@ pkg_pretend() {
einfo "USE=\"headless\", this build will not include any X11/Qt frontend."
fi
+ if use headless && use sdl; then
+ einfo "You selected USE=\"headless sdl\", defaulting to"
+ einfo "USE=\"headless\", this build will not include SDL."
+ fi
+
if ! use opengl; then
einfo "No USE=\"opengl\" selected, this build will lack"
einfo "the OpenGL feature."
@@ -288,7 +294,7 @@ src_prepare() {
CFLAGS=${CFLAGS}
EOF
- if use sdl; then
+ if ! use headless && use sdl; then
echo -e "\nVBOX_WITH_VBOXSDL=1" >> LocalConfig.kmk || die
fi
diff --git a/app-emulation/virtualbox/virtualbox-7.0.4.ebuild b/app-emulation/virtualbox/virtualbox-7.0.4.ebuild
new file mode 100644
index 000000000000..5794887625c9
--- /dev/null
+++ b/app-emulation/virtualbox/virtualbox-7.0.4.ebuild
@@ -0,0 +1,692 @@
+# Copyright 2022 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_{8..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-6.1.36.tar.bz2"
+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 pam pch pulseaudio +opengl python +sdk +sdl +udev vboxwebsrv vnc"
+
+unset WATCOM #856769
+
+COMMON_DEPEND="
+ ${PYTHON_DEPS}
+ acct-group/vboxusers
+ ~app-emulation/virtualbox-modules-${PV}
+ 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]
+ x11-libs/libX11
+ x11-libs/libXt
+ )
+ pam? ( sys-libs/pam )
+ sdl? (
+ media-libs/libsdl:0[X,video]
+ x11-libs/libX11
+ x11-libs/libXcursor
+ x11-libs/libXt
+ )
+ vboxwebsrv? ( net-libs/gsoap[-gnutls(-)] )
+ 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-libs/libxcb:=
+ x11-libs/libXcursor
+ x11-libs/libXext
+ x11-libs/libXinerama
+ x11-libs/libXmu
+ x11-libs/libXrandr
+ opengl? ( virtual/opengl )
+ )
+ java? ( virtual/jdk:1.8 )
+ opengl? (
+ x11-libs/libXcursor
+ x11-libs/libXinerama
+ x11-libs/libXmu
+ x11-libs/libXrandr
+ virtual/glu
+ )
+ sdl? ( x11-libs/libXinerama )
+ pulseaudio? ( media-sound/pulseaudio )
+ udev? ( >=virtual/udev-171 )
+"
+RDEPEND="
+ ${COMMON_DEPEND}
+ gui? ( x11-libs/libxcb:= )
+ java? ( virtual/jre:1.8 )
+"
+BDEPEND="
+ ${PYTHON_DEPS}
+ >=dev-lang/yasm-0.6.2
+ dev-libs/libIDL
+ dev-qt/linguist-tools:5
+ dev-util/glslang
+ >=dev-util/kbuild-0.1.9998.3127
+ 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
+ )
+ 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.4-fix-compilation.patch
+ "${FILESDIR}"/${PN}-7.0.0-fix-compilation-clang.patch
+ "${FILESDIR}"/${PN}-7.0.0-python3_11.patch
+
+ # Downloaded patchset
+ "${WORKDIR}"/virtualbox-patches-6.1.36/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
+
+ # 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
+ echo -e "\nVBOX_WITH_VBOXSDL=1" >> LocalConfig.kmk || die
+ fi
+
+ #443830
+ echo -e "\nVBOX_WITH_VBOX_IMG=1" >> LocalConfig.kmk || die
+
+ # clang assembler chokes on comments starting with /
+ if tc-is-clang; then
+ sed -i -e '/^\//d' src/libs/xpcom18a4/nsprpub/pr/src/md/unix/os_Linux_x86_64.s || die
+ 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
+
+ # 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
+}
+
+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
+
+ $(usex alsa '' --disable-alsa)
+ $(usex dbus '' --disable-dbus)
+ $(usex debug --build-debug '')
+ $(usex doc '' --disable-docs)
+ $(usex java '' --disable-java)
+ $(usex lvm '' --disable-devmapper)
+ $(usex pulseaudio '' --disable-pulse)
+ $(usex python '' --disable-python)
+ $(usex vboxwebsrv --enable-webservice '')
+ $(usex vnc --enable-vnc '')
+ )
+
+ if use gui || use sdl || use opengl; then
+ myconf+=(
+ $(usex opengl '' --disable-opengl)
+ $(usex gui '' --disable-qt)
+ $(usex 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
+ docompress -x /usr/share/doc/${PF}/qt
+ docinto qt
+ dodoc UserManual.q{ch,hc}
+ 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
+}