From 7aba9a6840ddbcc6454a1451193554d68d182b48 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 25 Nov 2016 22:18:25 +0000 Subject: vbox OSE 5.1.8 --- app-emulation/virtualbox/Manifest | 2 + app-emulation/virtualbox/files/10-virtualbox.rules | 7 + app-emulation/virtualbox/files/vboxwebsrv-confd | 20 + app-emulation/virtualbox/files/vboxwebsrv-initd | 22 + app-emulation/virtualbox/files/virtualbox-4-config | 1 + .../virtualbox/files/virtualbox-4-localconfig | 45 +++ .../virtualbox/files/virtualbox-5-localconfig | 47 +++ .../virtualbox/files/virtualbox-ose-3-config | 1 + .../virtualbox/files/virtualbox-ose-3-wrapper | 104 +++++ .../virtualbox/files/virtualbox-ose-5-wrapper | 113 ++++++ .../virtualbox/files/virtualbox-ose.desktop-2 | 8 + app-emulation/virtualbox/virtualbox-5.1.8.ebuild | 447 +++++++++++++++++++++ 12 files changed, 817 insertions(+) create mode 100644 app-emulation/virtualbox/Manifest create mode 100644 app-emulation/virtualbox/files/10-virtualbox.rules create mode 100644 app-emulation/virtualbox/files/vboxwebsrv-confd create mode 100644 app-emulation/virtualbox/files/vboxwebsrv-initd create mode 100644 app-emulation/virtualbox/files/virtualbox-4-config create mode 100644 app-emulation/virtualbox/files/virtualbox-4-localconfig create mode 100644 app-emulation/virtualbox/files/virtualbox-5-localconfig create mode 100644 app-emulation/virtualbox/files/virtualbox-ose-3-config create mode 100644 app-emulation/virtualbox/files/virtualbox-ose-3-wrapper create mode 100644 app-emulation/virtualbox/files/virtualbox-ose-5-wrapper create mode 100644 app-emulation/virtualbox/files/virtualbox-ose.desktop-2 create mode 100644 app-emulation/virtualbox/virtualbox-5.1.8.ebuild (limited to 'app-emulation') diff --git a/app-emulation/virtualbox/Manifest b/app-emulation/virtualbox/Manifest new file mode 100644 index 00000000..1cb020f0 --- /dev/null +++ b/app-emulation/virtualbox/Manifest @@ -0,0 +1,2 @@ +DIST VirtualBox-5.1.8.tar.bz2 114688166 SHA256 e447031de468aee746529b2cf60768922f9beff22a13c54284aa430f5e925933 SHA512 178299173ee0062e23aee779faa893a42815d17163eab9ba2ed8b46be63a7110fe1690792de21514dc05ccd5a1752ea0f11357220e0e6f91f101dea3416e819c WHIRLPOOL 20ea8d253d177fd11c4349656aaa0f87f0fb76018511b345e85800d4dd8ab1e2e05c300a1f932670e5f5fac6ea547bfaa0a52b8526c4f363358911c770444a81 +DIST virtualbox-5.1.6-patches-01.tar.xz 4268 SHA256 5bfae08bc53fee06aea501e77b7998348adba43792149248d217ab03dea8c04f SHA512 2401df42ac8c2fd1f4bbc795713b185d5e65c2a36c763fa1d7274686599808aecdc28aaa6443c9efc9842f7b3eeb928818c95d1e7ad3b86239c2ace441a5e116 WHIRLPOOL 25505eaff2eeb820a09a2c8807c2d5cec48cbfe98fcd30b04daf86c4cd7c506f09c67b80d5ecc221ded08af6e48297e0161bae16862e5a1d3204b27945c511b0 diff --git a/app-emulation/virtualbox/files/10-virtualbox.rules b/app-emulation/virtualbox/files/10-virtualbox.rules new file mode 100644 index 00000000..014c164a --- /dev/null +++ b/app-emulation/virtualbox/files/10-virtualbox.rules @@ -0,0 +1,7 @@ +# create second tree of USB devices according to +# http://www.virtualbox.org/ticket/7759#comment:5 + +SUBSYSTEM=="usb_device", ACTION!="remove", RUN="%UDEVDIR%/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass}" +SUBSYSTEM=="usb", ACTION!="remove", ENV{DEVTYPE}=="usb_device", RUN="%UDEVDIR%/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass}" +SUBSYSTEM=="usb_device", ACTION=="remove", RUN="%UDEVDIR%/VBoxCreateUSBNode.sh --remove $major $minor" +SUBSYSTEM=="usb", ACTION=="remove", ENV{DEVTYPE}=="usb_device", RUN="%UDEVDIR%/VBoxCreateUSBNode.sh --remove $major $minor" diff --git a/app-emulation/virtualbox/files/vboxwebsrv-confd b/app-emulation/virtualbox/files/vboxwebsrv-confd new file mode 100644 index 00000000..447348e9 --- /dev/null +++ b/app-emulation/virtualbox/files/vboxwebsrv-confd @@ -0,0 +1,20 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +# The host to bind to (defaults to "localhost"). +VBOXWEBSRV_HOST="localhost" + +# Which port to on the host (defaults to 18083). +VBOXWEBSRV_PORT="18083" + +# Session timeout, in seconds. (defaults to 20). +VBOXWEBSRV_TIMEOUT=20 + +# The interval in which the webservice checks for +# timed-out clients, in seconds. Normally does not +# need to be changed (defaults to 5). +VBOXWEBSRV_INTERVAL=5 + +# User under which vboxwebsrv is running +VBOXWEBSRV_USER="root" diff --git a/app-emulation/virtualbox/files/vboxwebsrv-initd b/app-emulation/virtualbox/files/vboxwebsrv-initd new file mode 100644 index 00000000..d9544962 --- /dev/null +++ b/app-emulation/virtualbox/files/vboxwebsrv-initd @@ -0,0 +1,22 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +depend() { + need net +} + +start() { + ebegin "Starting VirtualBox WebService" + start-stop-daemon --start --quiet --user ${VBOXWEBSRV_USER} --pidfile /var/run/vboxwebsrv.pid \ + --background --make-pidfile --exec /usr/bin/vboxwebsrv \ + -- -H ${VBOXWEBSRV_HOST} -p ${VBOXWEBSRV_PORT} -t ${VBOXWEBSRV_TIMEOUT} -i ${VBOXWEBSRV_INTERVAL} + eend $? +} + +stop() { + ebegin "Stopping VirtualBox WebService" + start-stop-daemon --stop --user ${VBOXWEBSRV_USER} --quiet --pidfile /var/run/vboxwebsrv.pid + eend $? +} diff --git a/app-emulation/virtualbox/files/virtualbox-4-config b/app-emulation/virtualbox/files/virtualbox-4-config new file mode 100644 index 00000000..af782214 --- /dev/null +++ b/app-emulation/virtualbox/files/virtualbox-4-config @@ -0,0 +1 @@ +INSTALL_DIR=/usr/MY_LIBDIR/virtualbox diff --git a/app-emulation/virtualbox/files/virtualbox-4-localconfig b/app-emulation/virtualbox/files/virtualbox-4-localconfig new file mode 100644 index 00000000..5138d925 --- /dev/null +++ b/app-emulation/virtualbox/files/virtualbox-4-localconfig @@ -0,0 +1,45 @@ +# -*- Makefile -*- +# +# Overwrite some default kBuild settings +# + +# +# Copyright (C) 2006-2008 Sun Microsystems, Inc. +# +# This file is part of VirtualBox Open Source Edition (OSE), as +# available from http://www.virtualbox.org. This file is free software; +# you can redistribute it and/or modify it under the terms of the GNU +# General Public License as published by the Free Software Foundation, +# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE +# distribution. VirtualBox OSE is distributed in the hope that it will +# be useful, but WITHOUT ANY WARRANTY of any kind. +# + +# shut up wine complaining about unknown locale +EXEC_X86_WIN32 := wine + +# don't build testcases to save time, they are not needed for the package +VBOX_WITH_TESTCASES := +VBOX_WITH_TESTSUITE := +VBOX_DOCBOOK_WITH_LATEX := 1 + +KBUILD_MSG_STYLE := brief + +## paths, origin, hardening +VBOX_WITH_HARDENING := 1 +VBOX_WITH_ORIGIN := +VBOX_PATH_APP_PRIVATE_ARCH := /usr/MY_LIBDIR/virtualbox +VBOX_PATH_SHARED_LIBS := $(VBOX_PATH_APP_PRIVATE_ARCH) +VBOX_WITH_RUNPATH := $(VBOX_PATH_APP_PRIVATE_ARCH) +VBOX_PATH_APP_PRIVATE := /usr/share/virtualbox +VBOX_PATH_APP_DOCS = $(VBOX_PATH_PACKAGE_DOCS) + +## don't build unwanted/splitted stuff +VBOX_WITHOUT_ADDITIONS := 1 +VBOX_WITH_VBOXDRV := +VBOX_WITH_VBOXBFE := +VBOX_WITH_KCHMVIEWER := + +## don't build with -Werror +VBOX_WITH_WARNINGS_AS_ERRORS := + diff --git a/app-emulation/virtualbox/files/virtualbox-5-localconfig b/app-emulation/virtualbox/files/virtualbox-5-localconfig new file mode 100644 index 00000000..05e7dbab --- /dev/null +++ b/app-emulation/virtualbox/files/virtualbox-5-localconfig @@ -0,0 +1,47 @@ +# -*- Makefile -*- +# +# Overwrite some default kBuild settings +# + +# +# Copyright (C) 2006-2008 Sun Microsystems, Inc. +# +# This file is part of VirtualBox Open Source Edition (OSE), as +# available from http://www.virtualbox.org. This file is free software; +# you can redistribute it and/or modify it under the terms of the GNU +# General Public License as published by the Free Software Foundation, +# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE +# distribution. VirtualBox OSE is distributed in the hope that it will +# be useful, but WITHOUT ANY WARRANTY of any kind. +# + +# shut up wine complaining about unknown locale +EXEC_X86_WIN32 := wine + +# don't build testcases to save time, they are not needed for the package +VBOX_WITH_TESTCASES := +VBOX_WITH_VALIDATIONKIT := +VBOX_DOCBOOK_WITH_LATEX := 1 + +KBUILD_MSG_STYLE := brief + +## paths, origin, hardening +VBOX_WITH_HARDENING := 1 +VBOX_WITH_ORIGIN := +VBOX_PATH_APP_PRIVATE_ARCH := /usr/MY_LIBDIR/virtualbox +VBOX_PATH_SHARED_LIBS := $(VBOX_PATH_APP_PRIVATE_ARCH) +VBOX_WITH_RUNPATH := $(VBOX_PATH_APP_PRIVATE_ARCH) +VBOX_PATH_APP_PRIVATE := /usr/share/virtualbox +VBOX_PATH_APP_DOCS = $(VBOX_PATH_PACKAGE_DOCS) + +## don't build unwanted/splitted stuff +VBOX_WITHOUT_ADDITIONS := 1 +VBOX_WITH_VBOXDRV := +VBOX_WITH_VBOXBFE := +VBOX_WITH_KCHMVIEWER := + +## don't build with -Werror +VBOX_WITH_WARNINGS_AS_ERRORS := + +## fix compilation with USE="doc" (Gentoo bug #554932) +VBOX_PATH_DOCBOOK_DTD := /usr/share/sgml/docbook/sgml-dtd-4.4 diff --git a/app-emulation/virtualbox/files/virtualbox-ose-3-config b/app-emulation/virtualbox/files/virtualbox-ose-3-config new file mode 100644 index 00000000..af782214 --- /dev/null +++ b/app-emulation/virtualbox/files/virtualbox-ose-3-config @@ -0,0 +1 @@ +INSTALL_DIR=/usr/MY_LIBDIR/virtualbox diff --git a/app-emulation/virtualbox/files/virtualbox-ose-3-wrapper b/app-emulation/virtualbox/files/virtualbox-ose-3-wrapper new file mode 100644 index 00000000..6f2da490 --- /dev/null +++ b/app-emulation/virtualbox/files/virtualbox-ose-3-wrapper @@ -0,0 +1,104 @@ +#!/bin/sh +# +# Sun VirtualBox +# +# Copyright (C) 2006-2009 Sun Microsystems, Inc. +# +# This file is part of VirtualBox Open Source Edition (OSE), as +# available from http://www.virtualbox.org. This file is free software; +# you can redistribute it and/or modify it under the terms of the GNU +# General Public License (GPL) as published by the Free Software +# Foundation, in version 2 as it comes in the "COPYING" file of the +# VirtualBox OSE distribution. VirtualBox OSE is distributed in the +# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa +# Clara, CA 95054 USA or visit http://www.sun.com if you need +# additional information or have any questions. +# + +PATH="/usr/bin:/bin:/usr/sbin:/sbin" +CONFIG="/etc/vbox/vbox.cfg" + +if [ ! -r "$CONFIG" ]; then + echo "Could not find VirtualBox installation. Please reinstall." + exit 1 +fi + +. "$CONFIG" + +# Note: This script must not fail if the module was not successfully installed +# because the user might not want to run a VM but only change VM params! + +if [ "$1" = "shutdown" ]; then + SHUTDOWN="true" +elif ! lsmod|grep -q vboxdrv; then + cat << EOF +WARNING: The VirtualBox kernel modules are not loaded. + Please load all the needed kernel modules by: + + for m in vbox{drv,netadp,netflt}; do modprobe \$m; done + + You will not be able to start VMs until this problem is fixed. +EOF +elif [ ! -c /dev/vboxdrv ]; then + cat << EOF +WARNING: The character device /dev/vboxdrv does not exist. + Please try to reload all the needed kernel modules by: + + for m in vbox{netflt,netadp,drv}; do rmmod \$m; done + for m in vbox{drv,netadp,netflt}; do modprobe \$m; done + + and if that is not successful, try to re-install the package by: + + emerge -1av app-emulation/virtualbox-modules + + You will not be able to start VMs until this problem is fixed. +EOF +fi + +SERVER_PID=`ps -U \`whoami\` | grep VBoxSVC | awk '{ print $1 }'` +if [ -z "$SERVER_PID" ]; then + # Server not running yet/anymore, cleanup socket path. + # See IPC_GetDefaultSocketPath()! + if [ -n "$LOGNAME" ]; then + rm -rf /tmp/.vbox-$LOGNAME-ipc > /dev/null 2>&1 + else + rm -rf /tmp/.vbox-$USER-ipc > /dev/null 2>&1 + fi +fi + +if [ "$SHUTDOWN" = "true" ]; then + if [ -n "$SERVER_PID" ]; then + kill -TERM $SERVER_PID + sleep 2 + fi + exit 0 +fi + +APP=`which $0` +APP=`basename $APP` +APP=${APP##/*/} +case "$APP" in + VirtualBox) + exec "$INSTALL_DIR/VirtualBox" "$@" + ;; + VBoxManage) + exec "$INSTALL_DIR/VBoxManage" "$@" + ;; + VBoxSDL) + exec "$INSTALL_DIR/VBoxSDL" "$@" + ;; + VBoxVRDP) + exec "$INSTALL_DIR/VBoxHeadless" "$@" + ;; + VBoxHeadless) + exec "$INSTALL_DIR/VBoxHeadless" "$@" + ;; + vboxwebsrv) + exec "$INSTALL_DIR/vboxwebsrv" "$@" + ;; + *) + echo "Unknown application - $APP" + ;; +esac diff --git a/app-emulation/virtualbox/files/virtualbox-ose-5-wrapper b/app-emulation/virtualbox/files/virtualbox-ose-5-wrapper new file mode 100644 index 00000000..e2249b0e --- /dev/null +++ b/app-emulation/virtualbox/files/virtualbox-ose-5-wrapper @@ -0,0 +1,113 @@ +#!/bin/sh +## @file +# Oracle VM VirtualBox startup script, Linux hosts. +# + +# +# Copyright (C) 2006-2015 Oracle Corporation +# +# This file is part of VirtualBox Open Source Edition (OSE), as +# available from http://www.virtualbox.org. This file is free software; +# you can redistribute it and/or modify it under the terms of the GNU +# General Public License (GPL) as published by the Free Software +# Foundation, in version 2 as it comes in the "COPYING" file of the +# VirtualBox OSE distribution. VirtualBox OSE is distributed in the +# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. +# + +PATH="/usr/bin:/bin:/usr/sbin:/sbin" +CONFIG="/etc/vbox/vbox.cfg" + +test -r "${CONFIG}" && + . "${CONFIG}" +test -z "${INSTALL_DIR}" && + if test -f /usr/lib/virtualbox/VirtualBox && + test -x /usr/lib/virtualbox/VirtualBox; then + INSTALL_DIR=/usr/lib/virtualbox + else + echo "Could not find VirtualBox installation. Please reinstall." + exit 1 + fi + +# Note: This script must not fail if the module was not successfully installed +# because the user might not want to run a VM but only change VM params! + +if [ "$1" = "shutdown" ]; then + SHUTDOWN="true" +elif ! lsmod|grep -q vboxdrv; then + cat << EOF +WARNING: The vboxdrv kernel module is not loaded. Either there is no module + available for the current kernel (`uname -r`) or it failed to + load. Please recompile the kernel module and install it by + + for m in vbox{drv,netadp,netflt}; do modprobe \$m; done + + You will not be able to start VMs until this problem is fixed. +EOF +elif [ ! -c /dev/vboxdrv ]; then + cat << EOF +WARNING: The character device /dev/vboxdrv does not exist. + Please try to reload all the needed kernel modules by: + + for m in vbox{netflt,netadp,drv}; do rmmod \$m; done + for m in vbox{drv,netadp,netflt}; do modprobe \$m; done + + and if that is not successful, try to re-install the package by: + + emerge -1av app-emulation/virtualbox-modules + + You will not be able to start VMs until this problem is fixed. +EOF +fi + +SERVER_PID=`ps -U \`whoami\` | grep VBoxSVC | awk '{ print $1 }'` +if [ -z "$SERVER_PID" ]; then + # Server not running yet/anymore, cleanup socket path. + # See IPC_GetDefaultSocketPath()! + if [ -n "$LOGNAME" ]; then + rm -rf /tmp/.vbox-$LOGNAME-ipc > /dev/null 2>&1 + else + rm -rf /tmp/.vbox-$USER-ipc > /dev/null 2>&1 + fi +fi + +if [ "$SHUTDOWN" = "true" ]; then + if [ -n "$SERVER_PID" ]; then + kill -TERM $SERVER_PID + sleep 2 + fi + exit 0 +fi + +APP=`basename $0` +case "$APP" in + VirtualBox|virtualbox) + exec "$INSTALL_DIR/VirtualBox" "$@" + ;; + VBoxManage|vboxmanage) + exec "$INSTALL_DIR/VBoxManage" "$@" + ;; + VBoxSDL|vboxsdl) + exec "$INSTALL_DIR/VBoxSDL" "$@" + ;; + VBoxVRDP|VBoxHeadless|vboxheadless) + exec "$INSTALL_DIR/VBoxHeadless" "$@" + ;; + VBoxAutostart|vboxautostart) + exec "$INSTALL_DIR/VBoxAutostart" "$@" + ;; + VBoxBalloonCtrl|vboxballoonctrl) + exec "$INSTALL_DIR/VBoxBalloonCtrl" "$@" + ;; + VBoxDTrace|vboxdtrace) + exec "$INSTALL_DIR/VBoxDTrace" "$@" + ;; + vboxwebsrv) + exec "$INSTALL_DIR/vboxwebsrv" "$@" + ;; + *) + echo "Unknown application - $APP" + exit 1 + ;; +esac +exit 0 diff --git a/app-emulation/virtualbox/files/virtualbox-ose.desktop-2 b/app-emulation/virtualbox/files/virtualbox-ose.desktop-2 new file mode 100644 index 00000000..ce798dac --- /dev/null +++ b/app-emulation/virtualbox/files/virtualbox-ose.desktop-2 @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=Oracle xVM VirtualBox +Type=Application +Comment=Run several virtual systems on a single host computer +Exec=VirtualBox +TryExec=VirtualBox +Icon=virtualbox +Categories=System;Emulator; diff --git a/app-emulation/virtualbox/virtualbox-5.1.8.ebuild b/app-emulation/virtualbox/virtualbox-5.1.8.ebuild new file mode 100644 index 00000000..7b7d240b --- /dev/null +++ b/app-emulation/virtualbox/virtualbox-5.1.8.ebuild @@ -0,0 +1,447 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 + +PYTHON_COMPAT=( python2_7 ) +inherit eutils fdo-mime flag-o-matic java-pkg-opt-2 linux-info multilib pax-utils python-single-r1 toolchain-funcs udev + +MY_PV="${PV/beta/BETA}" +MY_PV="${MY_PV/rc/RC}" +MY_P=VirtualBox-${MY_PV} +SRC_URI="http://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}.tar.bz2 + https://dev.gentoo.org/~polynomial-c/${PN}/patchsets/${PN}-5.1.6-patches-01.tar.xz" +S="${WORKDIR}/${MY_P}" + +DESCRIPTION="Family of powerful x86 virtualization products for enterprise and home use" +HOMEPAGE="http://www.virtualbox.org/" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 x86" +IUSE="alsa debug doc headless java libressl lvm pam pulseaudio +opengl python +qt5 +sdk +udev vboxwebsrv vnc" + +RDEPEND="!app-emulation/virtualbox-bin + ~app-emulation/virtualbox-modules-${PV} + dev-libs/libIDL + >=dev-libs/libxslt-1.1.19 + net-misc/curl + dev-libs/libxml2 + media-libs/libpng:0= + media-libs/libvpx:0= + sys-libs/zlib + !headless? ( + media-libs/libsdl:0[X,video] + x11-libs/libX11 + x11-libs/libXcursor + x11-libs/libXext + x11-libs/libXmu + x11-libs/libXt + opengl? ( virtual/opengl media-libs/freeglut ) + qt5? ( + dev-qt/qtcore:5 + dev-qt/qtgui:5 + dev-qt/qtprintsupport:5 + dev-qt/qtwidgets:5 + dev-qt/qtx11extras:5 + opengl? ( dev-qt/qtopengl:5 ) + x11-libs/libXinerama + ) + ) + java? ( >=virtual/jre-1.6:= ) + libressl? ( dev-libs/libressl:= ) + !libressl? ( dev-libs/openssl:0= ) + lvm? ( sys-fs/lvm2 ) + udev? ( >=virtual/udev-171 ) + vnc? ( >=net-libs/libvncserver-0.9.9 )" +DEPEND="${RDEPEND} + >=dev-util/kbuild-0.1.9998_pre20131130-r1 + >=dev-lang/yasm-0.6.2 + sys-devel/bin86 + sys-libs/libcap + sys-power/iasl + virtual/pkgconfig + alsa? ( >=media-libs/alsa-lib-1.0.13 ) + doc? ( + dev-texlive/texlive-basic + dev-texlive/texlive-latex + dev-texlive/texlive-latexrecommended + dev-texlive/texlive-latexextra + dev-texlive/texlive-fontsrecommended + dev-texlive/texlive-fontsextra + ) + !headless? ( x11-libs/libXinerama ) + java? ( >=virtual/jre-1.6:= ) + pam? ( sys-libs/pam ) + pulseaudio? ( media-sound/pulseaudio ) + qt5? ( dev-qt/linguist-tools:5 ) + vboxwebsrv? ( net-libs/gsoap[-gnutls(-)] ) + ${PYTHON_DEPS}" + +QA_TEXTRELS_x86="usr/lib/virtualbox-ose/VBoxGuestPropSvc.so + usr/lib/virtualbox/VBoxSDL.so + usr/lib/virtualbox/VBoxSharedFolders.so + usr/lib/virtualbox/VBoxDD2.so + usr/lib/virtualbox/VBoxOGLrenderspu.so + usr/lib/virtualbox/VBoxPython.so + usr/lib/virtualbox/VBoxDD.so + usr/lib/virtualbox/VBoxDDU.so + usr/lib/virtualbox/VBoxREM64.so + usr/lib/virtualbox/VBoxSharedClipboard.so + usr/lib/virtualbox/VBoxHeadless.so + usr/lib/virtualbox/VBoxRT.so + usr/lib/virtualbox/VBoxREM.so + usr/lib/virtualbox/VBoxSettings.so + usr/lib/virtualbox/VBoxKeyboard.so + usr/lib/virtualbox/VBoxSharedCrOpenGL.so + usr/lib/virtualbox/VBoxVMM.so + usr/lib/virtualbox/VirtualBox.so + usr/lib/virtualbox/VBoxOGLhosterrorspu.so + usr/lib/virtualbox/components/VBoxC.so + usr/lib/virtualbox/components/VBoxSVCM.so + usr/lib/virtualbox/components/VBoxDDU.so + usr/lib/virtualbox/components/VBoxRT.so + usr/lib/virtualbox/components/VBoxREM.so + usr/lib/virtualbox/components/VBoxVMM.so + usr/lib/virtualbox/VBoxREM32.so + usr/lib/virtualbox/VBoxPython2_7.so + usr/lib/virtualbox/VBoxXPCOMC.so + usr/lib/virtualbox/VBoxOGLhostcrutil.so + usr/lib/virtualbox/VBoxNetDHCP.so + usr/lib/virtualbox/VBoxNetNAT.so" + +REQUIRED_USE=" + java? ( sdk ) + python? ( sdk ) + vboxwebsrv? ( java ) + ${PYTHON_REQUIRED_USE} +" + +pkg_setup() { + if ! use headless && ! use qt5 ; then + einfo "No USE=\"qt5\" selected, this build will not include any Qt frontend." + elif use headless && use qt5 ; then + einfo "You selected USE=\"headless qt5\", defaulting to" + einfo "USE=\"headless\", this build will not include any X11/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 + java-pkg-opt-2_pkg_setup + python-single-r1_pkg_setup + + tc-ld-disable-gold #bug 488176 + tc-export CC CXX LD AR RANLIB + export HOST_CC="$(tc-getBUILD_CC)" +} + +src_prepare() { + # Remove shipped binaries (kBuild,yasm), see bug #232775 + rm -r kBuild/bin tools || die + + # Remove pointless GCC version limitations in check_gcc() + sed -e "/\s*-o\s*\\\(\s*\$cc_maj\s*-eq\s*[5-9]\s*-a\s*\$cc_min\s*-gt\s*[0-5]\s*\\\)\s*\\\/d" \ + -i configure || die + + # Disable things unused or split into separate ebuilds + sed -e "s@MY_LIBDIR@$(get_libdir)@" \ + "${FILESDIR}"/${PN}-5-localconfig > LocalConfig.kmk || die + + # 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 + elog "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 + + # Only add nopie patch when we're on hardened + if ! gcc-specs-pie ; then + rm "${WORKDIR}"/patches/050_${PN}-*-nopie.patch || die + fi + + eapply "${WORKDIR}/patches" + + eapply_user +} + +src_configure() { + local myconf + use alsa || myconf+=( --disable-alsa ) + use debug && myconf+=( --build-debug ) + use doc || myconf+=( --disable-docs ) + use java || myconf+=( --disable-java ) + use lvm || myconf+=( --disable-devmapper ) + use opengl || myconf+=( --disable-opengl ) + use pulseaudio || myconf+=( --disable-pulse ) + use python || myconf+=( --disable-python ) + use vboxwebsrv && myconf+=( --enable-webservice ) + use vnc && myconf+=( --enable-vnc ) + if ! use headless ; then + use qt5 || myconf+=( --disable-qt ) + else + myconf+=( --build-headless --disable-opengl ) + fi + if use amd64 && ! has_multilib_profile ; then + myconf+=( --disable-vmmraw ) + fi + # not an autoconf script + ./configure \ + --with-gcc="$(tc-getCC)" \ + --with-g++="$(tc-getCXX)" \ + --disable-dbus \ + --disable-kmods \ + ${myconf[@]} \ + || die "configure failed" +} + +src_compile() { + source ./env.sh || die + + # Force kBuild to respect C[XX]FLAGS and MAKEOPTS (bug #178529) + MAKEJOBS=$(echo ${MAKEOPTS} | egrep -o '(\-j|\-\-jobs)(=?|[[:space:]]*)[[:digit:]]+') + MAKELOAD=$(echo ${MAKEOPTS} | egrep -o '(\-l|\-\-load-average)(=?|[[:space:]]*)[[:digit:]]+') #' + MAKEOPTS="${MAKEJOBS} ${MAKELOAD}" + MAKE="kmk" emake \ + VBOX_BUILD_PUBLISHER=_Gentoo \ + TOOL_GCC3_CC="$(tc-getCC)" TOOL_GCC3_CXX="$(tc-getCXX)" \ + TOOL_GCC3_AS="$(tc-getCC)" TOOL_GCC3_AR="$(tc-getAR)" \ + TOOL_GCC3_LD="$(tc-getCXX)" TOOL_GCC3_LD_SYSMOD="$(tc-getLD)" \ + TOOL_GCC3_CFLAGS="${CFLAGS}" TOOL_GCC3_CXXFLAGS="${CXXFLAGS}" \ + VBOX_GCC_OPT="${CXXFLAGS}" \ + TOOL_YASM_AS=yasm KBUILD_VERBOSE=2 \ + all +} + +src_install() { + local binpath="release" + use debug && binpath="debug" + cd "${S}"/out/linux.${ARCH}/${binpath}/bin || die + + local vbox_inst_path="/usr/$(get_libdir)/${PN}" each fwfile size ico icofile + + vbox_inst() { + local binary="${1}" + local perms="${2:-0750}" + local path="${3:-${vbox_inst_path}}" + + [[ -n "${binary}" ]] || die "vbox_inst: No binray 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 "${D}"/etc/vbox/vbox.cfg || die "vbox.cfg sed failed" + + # Install the wrapper script + exeinto ${vbox_inst_path} + newexe "${FILESDIR}/${PN}-ose-5-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 + + # *.rc files for x86_64 are only available on multilib systems + local rcfiles="*.rc" + if use amd64 && ! has_multilib_profile ; then + rcfiles="" + fi + for each in VBox{ExtPackHelperApp,Manage,SVC,Tunctl,XPCOMIPCD} *so *r0 ${rcfiles} ; 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) + pushd "${S}"/src/VBox/Devices/EFI/FirmwareBin &>/dev/null || die + for fwfile in VBoxEFI{32,64}.fd ; do + vbox_inst ${fwfile} 0644 + done + popd &>/dev/null || die + + # 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 "${D}"${vbox_inst_path}/${each} + done + + # Symlink binaries to the shipped wrapper + for each in vbox{headless,manage} VBox{Headless,Manage,VRDP} ; do + dosym ${vbox_inst_path}/VBox /usr/bin/${each} + done + dosym ${vbox_inst_path}/VBoxTunctl /usr/bin/VBoxTunctl + + # VRDPAuth only works with this (bug #351949) + dosym VBoxAuth.so ${vbox_inst_path}/VRDPAuth.so + + # set an env-variable for 3rd party tools + echo -n "VBOX_APP_HOME=${vbox_inst_path}" > "${T}/90virtualbox" + doenvd "${T}/90virtualbox" + + if ! use headless ; then + vbox_inst VBoxSDL 4750 + pax-mark -m "${D}"${vbox_inst_path}/VBoxSDL + + for each in vboxsdl VBoxSDL ; do + dosym ${vbox_inst_path}/VBox /usr/bin/${each} + done + + if use qt5 ; then + vbox_inst VirtualBox 4750 + pax-mark -m "${D}"${vbox_inst_path}/VirtualBox + + if use opengl ; then + vbox_inst VBoxTestOGL + pax-mark -m "${D}"${vbox_inst_path}/VBoxTestOGL + fi + + for each in virtualbox VirtualBox ; do + dosym ${vbox_inst_path}/VBox /usr/bin/${each} + done + + insinto /usr/share/${PN} + doins -r nls + + newmenu "${FILESDIR}"/${PN}-ose.desktop-2 ${PN}.desktop + fi + + 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 "${D}${vbox_inst_path}/sdk/bindings/xpcom/java/vboxjxpcom.jar" + java-pkg_regso "${D}${vbox_inst_path}/libvboxjxpcom.so" + fi + fi + + if use udev ; then + # New way of handling USB device nodes for VBox (bug #356215) + local udevdir="$(get_udevdir)" + insinto ${udevdir} + doins VBoxCreateUSBNode.sh + fowners root:vboxusers ${udevdir}/VBoxCreateUSBNode.sh + fperms 0750 ${udevdir}/VBoxCreateUSBNode.sh + insinto ${udevdir}/rules.d + sed "s@%UDEVDIR%@${udevdir}@" "${FILESDIR}"/10-virtualbox.rules \ + > "${T}"/10-virtualbox.rules || die + doins "${T}"/10-virtualbox.rules + 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 +} + +pkg_postinst() { + fdo-mime_desktop_database_update + + if use udev ; then + udevadm control --reload-rules \ + && udevadm trigger --subsystem-match=usb + fi + + if ! use headless && use qt5 ; 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 "http://download.virtualbox.org/virtualbox/${PV}/UserManual.pdf" + elog "" + elog "For advanced networking setups you should emerge:" + elog "net-misc/bridge-utils and sys-apps/usermode-utilities" + elog "" + elog "IMPORTANT!" + elog "If you upgrade from app-emulation/virtualbox-ose make sure to run" + elog "\"env-update\" as root and logout and relogin as the user you wish" + elog "to run ${PN} as." + elog "" + elog "Starting with version 4.0.0, ${PN} has USB-1 support." + elog "For USB-2 support, PXE-boot ability and VRDP support please emerge" + elog " app-emulation/virtualbox-extpack-oracle" + elog "package." + elog "Starting with version 5.0.0, ${PN} no longer has the \"additions\" and" + elog "the \"extension\" USE flag. For installation of the guest additions ISO" + elog "image, please emerge" + elog " app-emulation/virtualbox-additions" + elog "and for the USB2, USB3, VRDP and PXE boot ROM modules, please emerge" + elog " app-emulation/virtualbox-extpack-oracle" + if ! use udev ; then + elog "" + elog "WARNING!" + elog "Without USE=udev, USB devices will likely not work in ${PN}." + elif [ -e "${ROOT}/etc/udev/rules.d/10-virtualbox.rules" ] ; then + elog "" + elog "Please remove \"${ROOT}/etc/udev/rules.d/10-virtualbox.rules\"" + elog "or else USB in ${PN} won't work." + fi +} + +pkg_postrm() { + fdo-mime_desktop_database_update +} -- cgit v1.2.3