summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app-emulation/virtualbox-additions/ChangeLog8
-rw-r--r--app-emulation/virtualbox-additions/virtualbox-additions-4.1.0.ebuild32
-rw-r--r--app-emulation/virtualbox-bin/ChangeLog8
-rw-r--r--app-emulation/virtualbox-bin/virtualbox-bin-4.1.0.ebuild330
-rw-r--r--app-emulation/virtualbox-extpack-oracle/ChangeLog8
-rw-r--r--app-emulation/virtualbox-extpack-oracle/virtualbox-extpack-oracle-4.1.0.ebuild29
-rw-r--r--app-emulation/virtualbox-guest-additions/ChangeLog9
-rw-r--r--app-emulation/virtualbox-guest-additions/files/vboxguest-4.1.0-log-use-c99.patch13
-rw-r--r--app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-4.1.0.ebuild196
-rw-r--r--app-emulation/virtualbox-modules/ChangeLog8
-rw-r--r--app-emulation/virtualbox-modules/virtualbox-modules-4.1.0.ebuild58
-rw-r--r--app-emulation/virtualbox/ChangeLog8
-rw-r--r--app-emulation/virtualbox/files/virtualbox-4.1.0-vboxpci-build.patch18
-rw-r--r--app-emulation/virtualbox/virtualbox-4.1.0.ebuild368
14 files changed, 1087 insertions, 6 deletions
diff --git a/app-emulation/virtualbox-additions/ChangeLog b/app-emulation/virtualbox-additions/ChangeLog
index 17afac74a763..363c1b043ec7 100644
--- a/app-emulation/virtualbox-additions/ChangeLog
+++ b/app-emulation/virtualbox-additions/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for app-emulation/virtualbox-additions
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-emulation/virtualbox-additions/ChangeLog,v 1.29 2011/07/17 21:04:59 polynomial-c Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/virtualbox-additions/ChangeLog,v 1.30 2011/07/19 22:26:01 polynomial-c Exp $
+
+*virtualbox-additions-4.1.0 (19 Jul 2011)
+
+ 19 Jul 2011; Lars Wendler <polynomial-c@gentoo.org>
+ +virtualbox-additions-4.1.0.ebuild:
+ Added 4.1 version branch
*virtualbox-additions-4.0.12 (17 Jul 2011)
diff --git a/app-emulation/virtualbox-additions/virtualbox-additions-4.1.0.ebuild b/app-emulation/virtualbox-additions/virtualbox-additions-4.1.0.ebuild
new file mode 100644
index 000000000000..9e97b41b67d6
--- /dev/null
+++ b/app-emulation/virtualbox-additions/virtualbox-additions-4.1.0.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/virtualbox-additions/virtualbox-additions-4.1.0.ebuild,v 1.1 2011/07/19 22:26:01 polynomial-c Exp $
+
+EAPI=2
+
+inherit eutils
+
+MY_PN=VBoxGuestAdditions
+MY_P=${MY_PN}_${PV}
+
+DESCRIPTION="CD image containing guest additions for VirtualBox"
+HOMEPAGE="http://www.virtualbox.org/"
+SRC_URI="http://download.virtualbox.org/virtualbox/${PV}/${MY_P}.iso"
+
+LICENSE="PUEL"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+RESTRICT="mirror"
+
+RDEPEND="!app-emulation/virtualbox-bin
+ !=app-emulation/virtualbox-9999"
+
+src_unpack() {
+ return 0
+}
+
+src_install() {
+ insinto /usr/share/${PN/-additions}
+ newins "${DISTDIR}"/${MY_P}.iso ${MY_PN}.iso
+}
diff --git a/app-emulation/virtualbox-bin/ChangeLog b/app-emulation/virtualbox-bin/ChangeLog
index 9e85ebad55b3..bfdf0dc43739 100644
--- a/app-emulation/virtualbox-bin/ChangeLog
+++ b/app-emulation/virtualbox-bin/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for app-emulation/virtualbox-bin
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-emulation/virtualbox-bin/ChangeLog,v 1.111 2011/07/17 21:04:32 polynomial-c Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/virtualbox-bin/ChangeLog,v 1.112 2011/07/19 22:25:33 polynomial-c Exp $
+
+*virtualbox-bin-4.1.0 (19 Jul 2011)
+
+ 19 Jul 2011; Lars Wendler <polynomial-c@gentoo.org>
+ +virtualbox-bin-4.1.0.ebuild:
+ Added 4.1 version branch
*virtualbox-bin-4.0.12 (17 Jul 2011)
diff --git a/app-emulation/virtualbox-bin/virtualbox-bin-4.1.0.ebuild b/app-emulation/virtualbox-bin/virtualbox-bin-4.1.0.ebuild
new file mode 100644
index 000000000000..8493ed32724c
--- /dev/null
+++ b/app-emulation/virtualbox-bin/virtualbox-bin-4.1.0.ebuild
@@ -0,0 +1,330 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/virtualbox-bin/virtualbox-bin-4.1.0.ebuild,v 1.1 2011/07/19 22:25:33 polynomial-c Exp $
+
+EAPI=2
+
+inherit eutils fdo-mime pax-utils
+
+MY_PV=${PV}-73009
+SDK_PV=${MY_PV}
+EXTP_PV=${MY_PV}
+MY_P=VirtualBox-${MY_PV}-Linux
+EXTP_PN=Oracle_VM_VirtualBox_Extension_Pack
+
+DESCRIPTION="Family of powerful x86 virtualization products for enterprise as well as home use"
+HOMEPAGE="http://www.virtualbox.org/"
+SRC_URI="amd64? ( http://download.virtualbox.org/virtualbox/${PV}/${MY_P}_amd64.run )
+ x86? ( http://download.virtualbox.org/virtualbox/${PV}/${MY_P}_x86.run )
+ sdk? ( http://download.virtualbox.org/virtualbox/${PV}/VirtualBoxSDK-${SDK_PV}.zip )
+ http://download.virtualbox.org/virtualbox/${PV}/${EXTP_PN}-${EXTP_PV}.vbox-extpack -> ${EXTP_PN}-${EXTP_PV}.tar.gz"
+
+LICENSE="GPL-2 PUEL"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+additions +chm headless python sdk vboxwebsrv rdesktop-vrdp"
+RESTRICT="mirror"
+
+DEPEND="app-arch/unzip"
+
+RDEPEND="!!app-emulation/virtualbox
+ !app-emulation/virtualbox-additions
+ ~app-emulation/virtualbox-modules-${PV}
+ !headless? (
+ x11-libs/libXcursor
+ media-libs/libsdl[X]
+ x11-libs/libXrender
+ x11-libs/libXfixes
+ media-libs/libpng
+ x11-libs/libXi
+ x11-libs/libXrandr
+ x11-libs/libXinerama
+ x11-libs/libXft
+ media-libs/freetype
+ media-libs/fontconfig
+ x11-libs/libXext
+ dev-libs/glib
+ chm? ( dev-libs/expat )
+ )
+ x11-libs/libXt
+ dev-libs/libxml2
+ x11-libs/libXau
+ x11-libs/libX11
+ x11-libs/libXmu
+ x11-libs/libSM
+ x11-libs/libICE
+ x11-libs/libXdmcp
+ python? ( || (
+ dev-lang/python:2.7
+ dev-lang/python:2.6
+ dev-lang/python:2.5
+ dev-lang/python:2.4
+ ) )"
+
+S=${WORKDIR}
+
+QA_TEXTRELS_amd64="opt/VirtualBox/VBoxVMM.so"
+QA_TEXTRELS_x86="opt/VirtualBox/VBoxGuestPropSvc.so
+ opt/VirtualBox/VBoxSDL.so
+ opt/VirtualBox/VBoxDbg.so
+ opt/VirtualBox/VBoxSharedFolders.so
+ opt/VirtualBox/VBoxDD2.so
+ opt/VirtualBox/VBoxOGLrenderspu.so
+ opt/VirtualBox/VBoxPython.so
+ opt/VirtualBox/VBoxPython2_3.so
+ opt/VirtualBox/VBoxPython2_4.so
+ opt/VirtualBox/VBoxPython2_5.so
+ opt/VirtualBox/VBoxPython2_6.so
+ opt/VirtualBox/VBoxPython2_7.so
+ opt/VirtualBox/VBoxPython3_0.so
+ opt/VirtualBox/VBoxPython3_1.so
+ opt/VirtualBox/VBoxDD.so
+ opt/VirtualBox/VBoxVRDP.so
+ opt/VirtualBox/VBoxDDU.so
+ opt/VirtualBox/VBoxREM64.so
+ opt/VirtualBox/VBoxSharedClipboard.so
+ opt/VirtualBox/VBoxHeadless.so
+ opt/VirtualBox/VBoxRT.so
+ opt/VirtualBox/VRDPAuth.so
+ opt/VirtualBox/VBoxREM.so
+ opt/VirtualBox/VBoxSettings.so
+ opt/VirtualBox/VBoxKeyboard.so
+ opt/VirtualBox/VBoxSharedCrOpenGL.so
+ opt/VirtualBox/VBoxVMM.so
+ opt/VirtualBox/VirtualBox.so
+ opt/VirtualBox/VBoxOGLhosterrorspu.so
+ opt/VirtualBox/components/VBoxC.so
+ opt/VirtualBox/components/VBoxSVCM.so
+ opt/VirtualBox/VBoxREM32.so
+ opt/VirtualBox/VBoxPython2_5.so
+ opt/VirtualBox/VBoxXPCOMC.so
+ opt/VirtualBox/VBoxOGLhostcrutil.so
+ opt/VirtualBox/VBoxNetDHCP.so
+ opt/VirtualBox/VBoxGuestControlSvc.so"
+QA_PRESTRIPPED="opt/VirtualBox/VBoxDD.so
+ opt/VirtualBox/VBoxDD2.so
+ opt/VirtualBox/VBoxDDU.so
+ opt/VirtualBox/VBoxDbg.so
+ opt/VirtualBox/VBoxGuestControlSvc.so
+ opt/VirtualBox/VBoxGuestPropSvc.so
+ opt/VirtualBox/VBoxHeadless
+ opt/VirtualBox/VBoxHeadless.so
+ opt/VirtualBox/VBoxKeyboard.so
+ opt/VirtualBox/VBoxManage
+ opt/VirtualBox/VBoxNetAdpCtl
+ opt/VirtualBox/VBoxNetDHCP
+ opt/VirtualBox/VBoxNetDHCP.so
+ opt/VirtualBox/VBoxOGLhostcrutil.so
+ opt/VirtualBox/VBoxOGLhosterrorspu.so
+ opt/VirtualBox/VBoxOGLrenderspu.so
+ opt/VirtualBox/VBoxPython.so
+ opt/VirtualBox/VBoxPython2_3.so
+ opt/VirtualBox/VBoxPython2_4.so
+ opt/VirtualBox/VBoxPython2_5.so
+ opt/VirtualBox/VBoxPython2_6.so
+ opt/VirtualBox/VBoxPython2_7.so
+ opt/VirtualBox/VBoxPython3_0.so
+ opt/VirtualBox/VBoxPython3_1.so
+ opt/VirtualBox/VBoxREM.so
+ opt/VirtualBox/VBoxREM32.so
+ opt/VirtualBox/VBoxREM64.so
+ opt/VirtualBox/VBoxRT.so
+ opt/VirtualBox/VBoxSDL
+ opt/VirtualBox/VBoxSDL.so
+ opt/VirtualBox/VBoxSVC
+ opt/VirtualBox/VBoxSettings.so
+ opt/VirtualBox/VBoxSharedClipboard.so
+ opt/VirtualBox/VBoxSharedCrOpenGL.so
+ opt/VirtualBox/VBoxSharedFolders.so
+ opt/VirtualBox/VBoxTestOGL
+ opt/VirtualBox/VBoxTunctl
+ opt/VirtualBox/VBoxVMM.so
+ opt/VirtualBox/VBoxVRDP.so
+ opt/VirtualBox/VBoxXPCOM.so
+ opt/VirtualBox/VBoxXPCOMC.so
+ opt/VirtualBox/VBoxXPCOMIPCD
+ opt/VirtualBox/VRDPAuth.so
+ opt/VirtualBox/VirtualBox
+ opt/VirtualBox/VirtualBox.so
+ opt/VirtualBox/accessible/libqtaccessiblewidgets.so
+ opt/VirtualBox/components/VBoxC.so
+ opt/VirtualBox/components/VBoxSVCM.so
+ opt/VirtualBox/components/VBoxXPCOMIPCC.so
+ opt/VirtualBox/kchmviewer
+ opt/VirtualBox/libQtCoreVBox.so.4
+ opt/VirtualBox/libQtGuiVBox.so.4
+ opt/VirtualBox/libQtNetworkVBox.so.4
+ opt/VirtualBox/libQtOpenGLVBox.so.4
+ opt/VirtualBox/vboxwebsrv"
+
+src_unpack() {
+ unpack_makeself ${MY_P}_${ARCH}.run
+ unpack ./VirtualBox.tar.bz2
+
+ mkdir "${S}"/${EXTP_PN} || die
+ pushd "${S}"/${EXTP_PN} &>/dev/null || die
+ unpack ${EXTP_PN}-${EXTP_PV}.tar.gz
+ popd &>/dev/null || die
+
+ if use sdk; then
+ unpack VirtualBoxSDK-${SDK_PV}.zip
+ fi
+}
+
+src_install() {
+ # create virtualbox configurations files
+ insinto /etc/vbox
+ newins "${FILESDIR}/${PN}-config" vbox.cfg
+
+ if ! use headless ; then
+ newicon VBox.png ${PN}.png
+ newmenu "${FILESDIR}"/${PN}.desktop-2 ${PN}.desktop
+ fi
+
+ pushd "${S}"/${EXTP_PN} &>/dev/null || die
+ insinto /opt/VirtualBox/ExtensionPacks/${EXTP_PN}
+ doins -r linux.${ARCH}
+ doins ExtPack* PXE-Intel.rom
+ popd &>/dev/null || die
+ rm -rf "${S}"/${EXTP_PN}
+
+ insinto /opt/VirtualBox
+ dodir /opt/bin
+
+ doins UserManual.pdf
+
+ if use sdk ; then
+ doins -r sdk || die
+ fi
+
+ if use additions; then
+ doins -r additions || die
+ fi
+
+ if use vboxwebsrv; then
+ doins vboxwebsrv || die
+ fowners root:vboxusers /opt/VirtualBox/vboxwebsrv
+ fperms 0750 /opt/VirtualBox/vboxwebsrv
+ dosym /opt/VirtualBox/VBox.sh /opt/bin/vboxwebsrv
+ newinitd "${FILESDIR}"/vboxwebsrv-initd vboxwebsrv
+ newconfd "${FILESDIR}"/vboxwebsrv-confd vboxwebsrv
+ fi
+
+ if use rdesktop-vrdp; then
+ doins rdesktop-vrdp || die
+ doins -r rdesktop-vrdp-keymaps || die
+ fperms 0750 /opt/VirtualBox/rdesktop-vrdp
+ dosym /opt/VirtualBox/rdesktop-vrdp /opt/bin/rdesktop-vrdp
+ fi
+
+ if ! use headless && use chm; then
+ doins kchmviewer VirtualBox.chm || die
+ fowners root:vboxusers /opt/VirtualBox/kchmviewer
+ fperms 0750 /opt/VirtualBox/kchmviewer
+ fi
+
+ if use python; then
+ local pyver
+ for pyver in 2.4 2.5 2.6 2.7 3.0 3.1 ; do
+ if has_version "=dev-lang/python-${pyver}*" && [ -f "${S}/VBoxPython${pyver/./_}.so" ] ; then
+ doins VBoxPython${pyver/./_}.so || die
+ fi
+ done
+ fi
+
+ rm -rf src rdesktop* deffiles install* routines.sh runlevel.sh \
+ vboxdrv.sh VBox.sh VBox.png vboxnet.sh additions VirtualBox.desktop \
+ VirtualBox.tar.bz2 LICENSE VBoxSysInfo.sh rdesktop* vboxwebsrv \
+ webtest kchmviewer VirtualBox.chm vbox-create-usb-node.sh \
+ 90-vbox-usb.fdi uninstall.sh vboxshell.py vboxdrv-pardus.py \
+ VBoxPython?_*.so
+
+ if use headless ; then
+ rm -rf VBoxSDL VirtualBox VBoxKeyboard.so
+ fi
+
+ doins -r * || die
+
+ # create symlinks for working around unsupported $ORIGIN/.. in VBoxC.so (setuid)
+ dosym /opt/VirtualBox/VBoxVMM.so /opt/VirtualBox/components/VBoxVMM.so
+ dosym /opt/VirtualBox/VBoxREM.so /opt/VirtualBox/components/VBoxREM.so
+ dosym /opt/VirtualBox/VBoxRT.so /opt/VirtualBox/components/VBoxRT.so
+ dosym /opt/VirtualBox/VBoxDDU.so /opt/VirtualBox/components/VBoxDDU.so
+ dosym /opt/VirtualBox/VBoxXPCOM.so /opt/VirtualBox/components/VBoxXPCOM.so
+
+ local each
+ for each in VBox{Manage,SVC,XPCOMIPCD,Tunctl,NetAdpCtl,NetDHCP,TestOGL,ExtPackHelperApp}; do
+ fowners root:vboxusers /opt/VirtualBox/${each}
+ fperms 0750 /opt/VirtualBox/${each}
+ pax-mark -m "${D}"/opt/VirtualBox/${each}
+ done
+ # VBoxNetAdpCtl and VBoxNetDHCP binaries need to be suid root in any case..
+ fperms 4750 /opt/VirtualBox/VBoxNetAdpCtl
+ fperms 4750 /opt/VirtualBox/VBoxNetDHCP
+
+ if ! use headless ; then
+ # Hardened build: Mark selected binaries set-user-ID-on-execution
+ for each in VBox{SDL,Headless} VirtualBox; do
+ fowners root:vboxusers /opt/VirtualBox/${each}
+ fperms 4510 /opt/VirtualBox/${each}
+ pax-mark -m "${D}"/opt/VirtualBox/${each}
+ done
+
+ dosym /opt/VirtualBox/VBox.sh /opt/bin/VirtualBox
+ dosym /opt/VirtualBox/VBox.sh /opt/bin/VBoxSDL
+ else
+ # Hardened build: Mark selected binaries set-user-ID-on-execution
+ fowners root:vboxusers /opt/VirtualBox/VBoxHeadless
+ fperms 4510 /opt/VirtualBox/VBoxHeadless
+ pax-mark -m "${D}"/opt/VirtualBox/VBoxHeadless
+ fi
+
+ exeinto /opt/VirtualBox
+ newexe "${FILESDIR}/${PN}-3-wrapper" "VBox.sh" || die
+ fowners root:vboxusers /opt/VirtualBox/VBox.sh
+ fperms 0750 /opt/VirtualBox/VBox.sh
+
+ dosym /opt/VirtualBox/VBox.sh /opt/bin/VBoxManage
+ dosym /opt/VirtualBox/VBox.sh /opt/bin/VBoxVRDP
+ dosym /opt/VirtualBox/VBox.sh /opt/bin/VBoxHeadless
+ dosym /opt/VirtualBox/VBoxTunctl /opt/bin/VBoxTunctl
+
+ # set an env-variable for 3rd party tools
+ echo -n "VBOX_APP_HOME=/opt/VirtualBox" > "${T}/90virtualbox"
+ doenvd "${T}/90virtualbox"
+
+ insinto /lib/udev/rules.d
+ doins "${FILESDIR}"/10-virtualbox.rules
+ # move udev scripts into /lib/udev (bug #372491)
+ mv "${D}"/opt/VirtualBox/VBoxCreateUSBNode.sh "${D}"/lib/udev
+ fperms 0750 /lib/udev/VBoxCreateUSBNode.sh
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+
+ udevadm control --reload-rules && udevadm trigger --subsystem-match=usb
+
+ elog ""
+ if ! use headless ; then
+ elog "To launch VirtualBox just type: \"VirtualBox\""
+ elog ""
+ fi
+ elog "You must be in the vboxusers group to use VirtualBox."
+ elog ""
+ elog "For advanced networking setups you should emerge:"
+ elog "net-misc/bridge-utils and sys-apps/usermode-utilities"
+ elog ""
+ elog "Please visit http://www.virtualbox.org/wiki/Editions for"
+ elog "an overview about the different features of ${PN}"
+ elog "and virtualbox-ose"
+ if [ -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
+}
diff --git a/app-emulation/virtualbox-extpack-oracle/ChangeLog b/app-emulation/virtualbox-extpack-oracle/ChangeLog
index 525847c244c6..ad845d118a81 100644
--- a/app-emulation/virtualbox-extpack-oracle/ChangeLog
+++ b/app-emulation/virtualbox-extpack-oracle/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for app-emulation/virtualbox-extpack-oracle
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-emulation/virtualbox-extpack-oracle/ChangeLog,v 1.7 2011/07/17 21:07:03 polynomial-c Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/virtualbox-extpack-oracle/ChangeLog,v 1.8 2011/07/19 22:26:30 polynomial-c Exp $
+
+*virtualbox-extpack-oracle-4.1.0 (19 Jul 2011)
+
+ 19 Jul 2011; Lars Wendler <polynomial-c@gentoo.org>
+ +virtualbox-extpack-oracle-4.1.0.ebuild:
+ Added 4.1 version branch
*virtualbox-extpack-oracle-4.0.12 (17 Jul 2011)
diff --git a/app-emulation/virtualbox-extpack-oracle/virtualbox-extpack-oracle-4.1.0.ebuild b/app-emulation/virtualbox-extpack-oracle/virtualbox-extpack-oracle-4.1.0.ebuild
new file mode 100644
index 000000000000..d3c491ade978
--- /dev/null
+++ b/app-emulation/virtualbox-extpack-oracle/virtualbox-extpack-oracle-4.1.0.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/virtualbox-extpack-oracle/virtualbox-extpack-oracle-4.1.0.ebuild,v 1.1 2011/07/19 22:26:30 polynomial-c Exp $
+
+EAPI=2
+
+inherit eutils
+
+MY_BUILD="73009"
+MY_PN="Oracle_VM_VirtualBox_Extension_Pack"
+MY_P="${MY_PN}-${PV}-${MY_BUILD}"
+
+DESCRIPTION="PUEL extensions for VirtualBox"
+HOMEPAGE="http://www.virtualbox.org/"
+SRC_URI="http://download.virtualbox.org/virtualbox/${PV}/${MY_P}.vbox-extpack -> ${MY_P}.tar.gz"
+
+LICENSE="PUEL"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+RESTRICT="mirror strip"
+
+RDEPEND="~app-emulation/virtualbox-${PV}"
+
+src_install() {
+ insinto /usr/$(get_libdir)/virtualbox/ExtensionPacks/${MY_PN}
+ doins -r linux.${ARCH}
+ doins ExtPack* PXE-Intel.rom
+}
diff --git a/app-emulation/virtualbox-guest-additions/ChangeLog b/app-emulation/virtualbox-guest-additions/ChangeLog
index ac8412c198fd..04b12c181999 100644
--- a/app-emulation/virtualbox-guest-additions/ChangeLog
+++ b/app-emulation/virtualbox-guest-additions/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for app-emulation/virtualbox-guest-additions
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-emulation/virtualbox-guest-additions/ChangeLog,v 1.72 2011/07/17 21:10:03 polynomial-c Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/virtualbox-guest-additions/ChangeLog,v 1.73 2011/07/19 22:28:45 polynomial-c Exp $
+
+*virtualbox-guest-additions-4.1.0 (19 Jul 2011)
+
+ 19 Jul 2011; Lars Wendler <polynomial-c@gentoo.org>
+ +virtualbox-guest-additions-4.1.0.ebuild,
+ +files/vboxguest-4.1.0-log-use-c99.patch:
+ Added 4.1 version branch
*virtualbox-guest-additions-4.0.12 (17 Jul 2011)
diff --git a/app-emulation/virtualbox-guest-additions/files/vboxguest-4.1.0-log-use-c99.patch b/app-emulation/virtualbox-guest-additions/files/vboxguest-4.1.0-log-use-c99.patch
new file mode 100644
index 000000000000..f3a738fa15a1
--- /dev/null
+++ b/app-emulation/virtualbox-guest-additions/files/vboxguest-4.1.0-log-use-c99.patch
@@ -0,0 +1,13 @@
+# https://bugs.gentoo.org/298988
+
+--- vboxguest/Makefile
++++ vboxguest/Makefile
+@@ -104,7 +104,7 @@
+
+ MOD_DEFS = -DVBOX -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_GUEST \
+ -DIN_GUEST_R0 -DIN_MODULE -DRT_WITH_VBOX -DVBGL_VBOXGUEST \
+- -DVBOX_WITH_HGCM
++ -DVBOX_WITH_HGCM -DLOG_USE_C99
+ ifeq ($(BUILD_TARGET_ARCH),amd64)
+ MOD_DEFS += -DRT_ARCH_AMD64
+ else
diff --git a/app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-4.1.0.ebuild b/app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-4.1.0.ebuild
new file mode 100644
index 000000000000..3973d3d956db
--- /dev/null
+++ b/app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-4.1.0.ebuild
@@ -0,0 +1,196 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-4.1.0.ebuild,v 1.1 2011/07/19 22:28:45 polynomial-c Exp $
+
+EAPI=2
+
+inherit eutils linux-mod
+
+MY_P=VirtualBox-${PV}
+DESCRIPTION="VirtualBox kernel modules and user-space tools for Linux guests"
+HOMEPAGE="http://www.virtualbox.org/"
+SRC_URI="http://download.virtualbox.org/virtualbox/${PV}/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="X"
+
+RDEPEND="X? ( ~x11-drivers/xf86-video-virtualbox-${PV}
+ ~x11-drivers/xf86-input-virtualbox-${PV}
+ x11-apps/xrandr
+ x11-apps/xrefresh
+ x11-libs/libXmu
+ x11-libs/libX11
+ x11-libs/libXt
+ x11-libs/libXext
+ x11-libs/libXau
+ x11-libs/libXdmcp
+ x11-libs/libSM
+ x11-libs/libICE )"
+DEPEND="${RDEPEND}
+ >=dev-util/kbuild-0.1.5-r1
+ >=dev-lang/yasm-0.6.2
+ sys-devel/bin86
+ sys-devel/dev86
+ sys-libs/pam
+ sys-power/iasl
+ X? ( x11-proto/renderproto )
+ !X? ( x11-proto/xproto )"
+
+BUILD_TARGETS="all"
+BUILD_TARGET_ARCH="${ARCH}"
+MODULE_NAMES="vboxguest(misc:${WORKDIR}/vboxguest:${WORKDIR}/vboxguest)
+ vboxsf(misc:${WORKDIR}/vboxsf:${WORKDIR}/vboxsf)"
+
+S="${WORKDIR}/${MY_P}_OSE"
+
+pkg_setup() {
+ linux-mod_pkg_setup
+ BUILD_PARAMS="KERN_DIR=${KV_DIR} KERNOUT=${KV_OUT_DIR}"
+ enewgroup vboxguest
+ enewuser vboxguest -1 /bin/sh /var/run/vboxguest vboxguest
+}
+
+src_unpack() {
+ unpack ${A}
+
+ # Create and unpack a tarball with the sources of the Linux guest
+ # kernel modules, to include all the needed files
+ "${S}"/src/VBox/Additions/linux/export_modules "${WORKDIR}/vbox-kmod.tar.gz"
+ unpack ./vbox-kmod.tar.gz
+
+ # Remove shipped binaries (kBuild,yasm), see bug #232775
+ cd "${S}"
+ rm -rf kBuild/bin tools
+}
+
+src_prepare() {
+ # PaX fixes (see bug #298988)
+ pushd "${WORKDIR}" &>/dev/null || die
+ epatch "${FILESDIR}"/vboxguest-4.1.0-log-use-c99.patch
+ popd &>/dev/null || die
+
+ # Disable things unused or splitted into separate ebuilds
+ cp "${FILESDIR}/${PN}-3-localconfig" LocalConfig.kmk
+
+ # stupid new header references...
+ for vboxheader in {product,revision}-generated.h ; do
+ for mdir in vbox{guest,sf} ; do
+ ln -sf "${S}"/out/linux.${ARCH}/release/${vboxheader} \
+ "${WORKDIR}/${mdir}/${vboxheader}"
+ done
+ done
+}
+
+src_compile() {
+ # build the user-space tools, warnings are harmless
+ ./configure --nofatal \
+ --disable-xpcom \
+ --disable-sdl-ttf \
+ --disable-pulse \
+ --disable-alsa \
+ --build-headless || die "configure failed"
+ source ./env.sh
+
+ for each in /src/VBox/{Runtime,Additions/common} \
+ /src/VBox/Additions/linux/{sharedfolders,daemon} ; do
+ cd "${S}"${each}
+ MAKE="kmk" emake TOOL_YASM_AS=yasm \
+ KBUILD_PATH="${S}/kBuild" \
+ || die "kmk VBoxControl failed"
+ done
+
+ if use X; then
+ cd "${S}"/src/VBox/Additions/x11/VBoxClient
+ MAKE="kmk" emake TOOL_YASM_AS=yasm \
+ KBUILD_PATH="${S}/kBuild" \
+ || die "kmk VBoxClient failed"
+ fi
+
+ # Now creating the kernel modules. We must do this _after_
+ # we compiled the user-space tools as we need two of the
+ # automatically generated header files. (>=3.2.0)
+ linux-mod_src_compile
+}
+
+src_install() {
+ linux-mod_src_install
+
+ cd "${S}"/out/linux.${ARCH}/release/bin/additions
+
+ insinto /sbin
+ newins mount.vboxsf mount.vboxsf
+ fperms 4755 /sbin/mount.vboxsf
+
+ newinitd "${FILESDIR}"/${PN}-7.initd ${PN}
+
+ insinto /usr/sbin/
+ newins VBoxService vboxguest-service
+ fperms 0755 /usr/sbin/vboxguest-service
+
+ insinto /usr/bin
+ doins VBoxControl
+ fperms 0755 /usr/bin/VBoxControl
+
+ # VBoxClient user service and xrandr wrapper
+ if use X; then
+ doins VBoxClient
+ fperms 0755 /usr/bin/VBoxClient
+
+ cd "${S}"/src/VBox/Additions/x11/Installer
+ newins 98vboxadd-xclient VBoxClient-all
+ fperms 0755 /usr/bin/VBoxClient-all
+ fi
+
+ # udev rule for vboxdrv
+ dodir /lib/udev/rules.d
+ echo 'KERNEL=="vboxguest", OWNER="vboxguest", GROUP="vboxguest", MODE="0660"' \
+ >> "${D}/lib/udev/rules.d/60-virtualbox-guest-additions.rules" \
+ || die
+ echo 'KERNEL=="vboxuser", OWNER="vboxguest", GROUP="vboxguest", MODE="0660"' \
+ >> "${D}/lib/udev/rules.d/60-virtualbox-guest-additions.rules" \
+ || die
+
+ # VBoxClient autostart file
+ insinto /etc/xdg/autostart
+ doins "${FILESDIR}"/vboxclient.desktop
+
+ # sample xorg.conf
+ insinto /usr/share/doc/${PF}
+ doins "${FILESDIR}"/xorg.conf.vbox
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+ if ! use X ; then
+ elog "use flag X is off, enable it to install the"
+ elog "X Window System input and video drivers"
+ fi
+ elog ""
+ elog "Please add users to the \"vboxguest\" group so they can"
+ elog "benefit from seamless mode, auto-resize and clipboard."
+ elog ""
+ elog "Please add:"
+ elog "/etc/init.d/${PN}"
+ elog "to the default runlevel in order to start"
+ elog "needed services."
+ elog "To use the VirtualBox X drivers, use the following"
+ elog "file as your /etc/X11/xorg.conf:"
+ elog " /usr/share/doc/${PF}/xorg.conf.xorg"
+ elog ""
+ elog "Also make sure you use the Mesa library for OpenGL:"
+ elog " eselect opengl set xorg-x11"
+ elog ""
+ elog "An autostart .desktop file has been installed to start"
+ elog "VBoxClient in desktop sessions."
+ elog ""
+ elog "You can mount shared folders with:"
+ elog " mount -t vboxsf <shared_folder_name> <mount_point>"
+ elog ""
+ elog "Warning:"
+ elog "this ebuild is only needed if you are running gentoo"
+ elog "inside a VirtualBox Virtual Machine, you don't need"
+ elog "it to run VirtualBox itself."
+ elog ""
+}
diff --git a/app-emulation/virtualbox-modules/ChangeLog b/app-emulation/virtualbox-modules/ChangeLog
index d15f90c2e43c..70492f76c851 100644
--- a/app-emulation/virtualbox-modules/ChangeLog
+++ b/app-emulation/virtualbox-modules/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for app-emulation/virtualbox-modules
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-emulation/virtualbox-modules/ChangeLog,v 1.83 2011/07/17 21:03:55 polynomial-c Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/virtualbox-modules/ChangeLog,v 1.84 2011/07/19 22:24:49 polynomial-c Exp $
+
+*virtualbox-modules-4.1.0 (19 Jul 2011)
+
+ 19 Jul 2011; Lars Wendler <polynomial-c@gentoo.org>
+ +virtualbox-modules-4.1.0.ebuild:
+ Added 4.1 version branch
*virtualbox-modules-4.0.12 (17 Jul 2011)
diff --git a/app-emulation/virtualbox-modules/virtualbox-modules-4.1.0.ebuild b/app-emulation/virtualbox-modules/virtualbox-modules-4.1.0.ebuild
new file mode 100644
index 000000000000..035306eb5ba7
--- /dev/null
+++ b/app-emulation/virtualbox-modules/virtualbox-modules-4.1.0.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/virtualbox-modules/virtualbox-modules-4.1.0.ebuild,v 1.1 2011/07/19 22:24:49 polynomial-c Exp $
+
+# XXX: the tarball here is just the kernel modules split out of the binary
+# package that comes from virtualbox-bin
+
+EAPI=2
+
+inherit eutils linux-mod
+
+MY_P=vbox-kernel-module-src-${PV}
+DESCRIPTION="Kernel Modules for Virtualbox"
+HOMEPAGE="http://www.virtualbox.org/"
+SRC_URI="http://dev.gentoo.org/~polynomial-c/virtualbox/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="!=app-emulation/virtualbox-9999"
+
+S=${WORKDIR}
+
+BUILD_TARGETS="all"
+BUILD_TARGET_ARCH="${ARCH}"
+MODULE_NAMES="vboxdrv(misc:${S}) vboxnetflt(misc:${S}) vboxnetadp(misc:${S}) vboxpci(misc:${S})"
+
+pkg_setup() {
+ linux-mod_pkg_setup
+ BUILD_PARAMS="KERN_DIR=${KV_DIR} KERNOUT=${KV_OUT_DIR}"
+ enewgroup vboxusers
+}
+
+src_prepare() {
+ if kernel_is -ge 2 6 33 ; then
+ # evil patch for new kernels - header moved
+ grep -lR linux/autoconf.h * | xargs sed -i -e 's:<linux/autoconf.h>:<generated/autoconf.h>:'
+ fi
+}
+
+src_install() {
+ linux-mod_src_install
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+ elog "Starting with the 3.x release new kernel modules were added,"
+ elog "be sure to load all the needed modules."
+ elog ""
+ elog "Please add \"vboxdrv\", \"vboxnetflt\" and \"vboxnetadp\" to:"
+ if has_version sys-apps/openrc; then
+ elog "/etc/conf.d/modules"
+ else
+ elog "/etc/modules.autoload.d/kernel-${KV_MAJOR}.${KV_MINOR}"
+ fi
+}
diff --git a/app-emulation/virtualbox/ChangeLog b/app-emulation/virtualbox/ChangeLog
index 0ff565ae2950..9afdfc52a891 100644
--- a/app-emulation/virtualbox/ChangeLog
+++ b/app-emulation/virtualbox/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for app-emulation/virtualbox
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-emulation/virtualbox/ChangeLog,v 1.75 2011/07/17 21:07:34 polynomial-c Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/virtualbox/ChangeLog,v 1.76 2011/07/19 22:27:10 polynomial-c Exp $
+
+*virtualbox-4.1.0 (19 Jul 2011)
+
+ 19 Jul 2011; Lars Wendler <polynomial-c@gentoo.org> +virtualbox-4.1.0.ebuild,
+ +files/virtualbox-4.1.0-vboxpci-build.patch:
+ Added 4.1 version branch
*virtualbox-4.0.12 (17 Jul 2011)
diff --git a/app-emulation/virtualbox/files/virtualbox-4.1.0-vboxpci-build.patch b/app-emulation/virtualbox/files/virtualbox-4.1.0-vboxpci-build.patch
new file mode 100644
index 000000000000..632e6a5f6ca3
--- /dev/null
+++ b/app-emulation/virtualbox/files/virtualbox-4.1.0-vboxpci-build.patch
@@ -0,0 +1,18 @@
+--- VirtualBox-4.1.0_OSE/src/VBox/HostDrivers/VBoxPci/Makefile.kmk
++++ VirtualBox-4.1.0_OSE/src/VBox/HostDrivers/VBoxPci/Makefile.kmk
+@@ -5,6 +5,7 @@
+
+ if1of ($(KBUILD_TARGET), linux)
+
++ ifdef VBOX_WITH_VBOXDRV
+ SYSMODS += VBoxPci
+ VBoxPci_TEMPLATE = VBOXR0DRV
+ VBoxPci_INST = $(INST_VBOXPCI)$(if $(eq $(KBUILD_TARGET),darwin),Contents/MacOS/)
+@@ -23,6 +24,7 @@
+ VBoxPci_LIBS += \
+ $(PATH_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
+
++ endif # VBOX_WITH_VBOXDRV
+ endif
+
+
diff --git a/app-emulation/virtualbox/virtualbox-4.1.0.ebuild b/app-emulation/virtualbox/virtualbox-4.1.0.ebuild
new file mode 100644
index 000000000000..91166d4dc1c0
--- /dev/null
+++ b/app-emulation/virtualbox/virtualbox-4.1.0.ebuild
@@ -0,0 +1,368 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/virtualbox/virtualbox-4.1.0.ebuild,v 1.1 2011/07/19 22:27:10 polynomial-c Exp $
+
+EAPI=4
+
+inherit eutils fdo-mime flag-o-matic linux-info pax-utils qt4-r2 toolchain-funcs java-pkg-opt-2
+
+if [[ ${PV} == "9999" ]] ; then
+ # XXX: should finish merging the -9999 ebuild into this one ...
+ ESVN_REPO_URI="http://www.virtualbox.org/svn/vbox/trunk"
+ inherit linux-mod subversion
+else
+ MY_P=VirtualBox-${PV}
+ SRC_URI="http://download.virtualbox.org/virtualbox/${PV}/${MY_P}.tar.bz2"
+ S="${WORKDIR}/${MY_P}_OSE"
+fi
+
+DESCRIPTION="Software family of powerful x86 virtualization"
+HOMEPAGE="http://www.virtualbox.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+additions alsa doc extensions headless java pulseaudio +opengl python +qt4 +sdk 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/openssl
+ dev-libs/libxml2
+ sys-libs/zlib
+ !headless? (
+ qt4? (
+ x11-libs/qt-gui:4
+ x11-libs/qt-core:4
+ opengl? ( x11-libs/qt-opengl:4 )
+ x11-libs/libXinerama
+ )
+ opengl? ( virtual/opengl media-libs/freeglut )
+ x11-libs/libX11
+ x11-libs/libXcursor
+ x11-libs/libXext
+ x11-libs/libXmu
+ x11-libs/libXt
+ media-libs/libsdl[X,video]
+ )
+ vnc? ( >=net-libs/libvncserver-0.9.7 )
+ java? ( >=virtual/jre-1.5 )"
+DEPEND="${RDEPEND}
+ >=dev-util/kbuild-0.1.5-r1
+ >=dev-lang/yasm-0.6.2
+ sys-devel/bin86
+ sys-devel/dev86
+ sys-power/iasl
+ media-libs/libpng
+ sys-libs/pam
+ sys-libs/libcap
+ 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
+ )
+ java? ( >=virtual/jdk-1.5 )
+ dev-util/pkgconfig
+ alsa? ( >=media-libs/alsa-lib-1.0.13 )
+ !headless? ( x11-libs/libXinerama )
+ pulseaudio? ( media-sound/pulseaudio )
+ python? ( >=dev-lang/python-2.3[threads] )
+ vboxwebsrv? ( >=net-libs/gsoap-2.7.13 )"
+PDEPEND="additions? ( ~app-emulation/virtualbox-additions-${PV} )
+ extensions? ( ~app-emulation/virtualbox-extpack-oracle-${PV} )"
+
+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_4.so
+ usr/lib/virtualbox/VBoxPython2_5.so
+ usr/lib/virtualbox/VBoxPython2_6.so
+ usr/lib/virtualbox/VBoxPython2_7.so
+ usr/lib/virtualbox/VBoxXPCOMC.so
+ usr/lib/virtualbox/VBoxOGLhostcrutil.so
+ usr/lib/virtualbox/VBoxNetDHCP.so"
+
+REQUIRED_USE="java? ( sdk ) python? ( sdk )"
+
+pkg_setup() {
+ if built_with_use sys-devel/gcc hardened && gcc-config -c | grep -qv -E "hardenednopie|vanilla"; then
+ eerror "The PIE feature provided by the \"hardened\" compiler is incompatible with ${PF}."
+ eerror "You must use gcc-config to select a profile without this feature. You may"
+ eerror "choose either \"hardenednopie\", \"hardenednopiessp\" or \"vanilla\" profile;"
+ eerror "however, \"hardenednopie\" is preferred because it gives the most hardening."
+ eerror "Remember to run \"source /etc/profile\" before continuing. See bug #339914."
+ die
+ fi
+
+ if ! use headless && ! use qt4 ; then
+ einfo "No USE=\"qt4\" selected, this build will not include"
+ einfo "any Qt frontend."
+ elif use headless && use qt4 ; then
+ einfo "You selected USE=\"headless qt4\", 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
+ java-pkg-opt-2_pkg_setup
+}
+
+src_prepare() {
+ # Remove shipped binaries (kBuild,yasm), see bug #232775
+ rm -rf kBuild/bin tools
+
+ # Disable things unused or split into separate ebuilds
+ sed -e "s/MY_LIBDIR/$(get_libdir)/" \
+ "${FILESDIR}"/${PN}-4-localconfig > LocalConfig.kmk || die
+
+ # unset useless/problematic checks in configure
+ epatch "${FILESDIR}/${PN}-ose-3.2.8-mesa-check.patch" \
+ "${FILESDIR}/${PN}-4-makeself-check.patch" \
+ "${FILESDIR}/${PN}-4-mkisofs-check.patch"
+
+ # fix build with --as-needed (bug #249295 and bug #350907)
+ epatch "${FILESDIR}/${PN}-4-asneeded.patch"
+
+ # Respect LDFLAGS
+ sed -e "s/_LDFLAGS\.${ARCH}*.*=/& ${LDFLAGS}/g" \
+ -i Config.kmk src/libs/xpcom18a4/Config.kmk || die
+
+ # We still want to use ${HOME}/.VirtualBox/Machines as machines dir.
+ epatch "${FILESDIR}/${PN}-4.0.2-restore_old_machines_dir.patch"
+
+ epatch "${FILESDIR}"/${P}-vboxpci-build.patch
+
+ # add correct java path
+ if use java ; then
+ sed "s:/usr/lib/jvm/java-6-sun:$(java-config -O):" \
+ -i "${S}"/Config.kmk || die
+ fi
+ java-pkg-opt-2_src_prepare
+}
+
+src_configure() {
+ local myconf
+ use alsa || myconf+=" --disable-alsa"
+ use opengl || myconf+=" --disable-opengl"
+ use pulseaudio || myconf+=" --disable-pulse"
+ use python || myconf+=" --disable-python"
+ use java || myconf+=" --disable-java"
+ use vboxwebsrv && myconf+=" --enable-webservice"
+ use vnc && myconf+=" --enable-vnc"
+ use doc || myconf+=" --disable-docs"
+ if ! use headless ; then
+ use qt4 || myconf+=" --disable-qt4"
+ else
+ myconf+=" --build-headless --disable-opengl"
+ fi
+ # not an autoconf script
+ ./configure \
+ --with-gcc="$(tc-getCC)" \
+ --with-g++="$(tc-getCXX)" \
+ --disable-kmods \
+ --disable-dbus \
+ ${myconf} \
+ || die "configure failed"
+}
+
+src_compile() {
+ source ./env.sh
+
+ # Force kBuild to respect C[XX]FLAGS and MAKEOPTS (bug #178529)
+ # and strip all flags
+ # strip-flags
+
+ MAKE="kmk" emake \
+ VBOX_VERSION_STRING='$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)'-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_PATH="${S}/kBuild" \
+ all || die "kmk failed"
+}
+
+src_install() {
+ cd "${S}"/out/linux.${ARCH}/release/bin || die
+
+ # Create configuration files
+ insinto /etc/vbox
+ newins "${FILESDIR}/${PN}-4-config" vbox.cfg
+
+ # Set the right libdir
+ sed -i \
+ -e "s/MY_LIBDIR/$(get_libdir)/" \
+ "${D}"/etc/vbox/vbox.cfg || die "vbox.cfg sed failed"
+
+ # Symlink binaries to the shipped wrapper
+ exeinto /usr/$(get_libdir)/${PN}
+ newexe "${FILESDIR}/${PN}-ose-3-wrapper" "VBox" || die
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/VBox
+ fperms 0750 /usr/$(get_libdir)/${PN}/VBox
+
+ dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VBoxManage
+ dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VBoxVRDP
+ dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VBoxHeadless
+ dosym /usr/$(get_libdir)/${PN}/VBoxTunctl /usr/bin/VBoxTunctl
+
+ # Install binaries and libraries
+ insinto /usr/$(get_libdir)/${PN}
+ doins -r components || die
+
+ if use sdk ; then
+ doins -r sdk || die
+ fi
+
+ if use vboxwebsrv ; then
+ doins vboxwebsrv || die
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/vboxwebsrv
+ fperms 0750 /usr/$(get_libdir)/${PN}/vboxwebsrv
+ dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/vboxwebsrv
+ newinitd "${FILESDIR}"/vboxwebsrv-initd vboxwebsrv
+ newconfd "${FILESDIR}"/vboxwebsrv-confd vboxwebsrv
+ fi
+
+ for each in VBox{Manage,SVC,XPCOMIPCD,Tunctl,NetAdpCtl,NetDHCP,ExtPackHelperApp} *so *r0 *gc ; do
+ doins $each || die
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/${each}
+ fperms 0750 /usr/$(get_libdir)/${PN}/${each}
+ done
+ # VBoxNetAdpCtl and VBoxNetDHCP binaries need to be suid root in any case..
+ fperms 4750 /usr/$(get_libdir)/${PN}/VBoxNetAdpCtl
+ fperms 4750 /usr/$(get_libdir)/${PN}/VBoxNetDHCP
+
+ if ! use headless ; then
+ for each in VBox{SDL,Headless} ; do
+ doins $each || die
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/${each}
+ fperms 4750 /usr/$(get_libdir)/${PN}/${each}
+ pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/${each}
+ done
+
+ if use opengl && use qt4 ; then
+ doins VBoxTestOGL || die
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/VBoxTestOGL
+ fperms 0750 /usr/$(get_libdir)/${PN}/VBoxTestOGL
+ fi
+
+ dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VBoxSDL
+
+ if use qt4 ; then
+ doins VirtualBox || die
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/VirtualBox
+ fperms 4750 /usr/$(get_libdir)/${PN}/VirtualBox
+ pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/VirtualBox
+
+ dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VirtualBox
+
+ newmenu "${FILESDIR}"/${PN}-ose.desktop-2 ${PN}.desktop
+ fi
+
+ newicon "${S}"/src/VBox/Frontends/VirtualBox/images/OSE/VirtualBox_32px.png ${PN}.png
+ else
+ doins VBoxHeadless || die
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/VBoxHeadless
+ fperms 4750 /usr/$(get_libdir)/${PN}/VBoxHeadless
+ pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/VBoxHeadless
+ fi
+
+ # Install EFI Firmware files (bug #320757)
+ pushd "${S}"/src/VBox/Devices/EFI/FirmwareBin &>/dev/null || die
+ for fwfile in VBoxEFI{32,64}.fd ; do
+ doins ${fwfile} || die
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/${fwfile} || die
+ done
+ popd &>/dev/null || die
+
+ # New way of handling USB device nodes for VBox (bug #356215)
+ insinto /lib/udev
+ doins VBoxCreateUSBNode.sh
+ fowners root:vboxusers /lib/udev/VBoxCreateUSBNode.sh
+ fperms 0750 /lib/udev/VBoxCreateUSBNode.sh
+ insinto /lib/udev/rules.d
+ doins "${FILESDIR}"/10-virtualbox.rules
+
+ insinto /usr/share/${PN}
+ if ! use headless && use qt4 ; then
+ doins -r nls
+ fi
+
+ # VRDPAuth only works with this (bug #351949)
+ dosym VBoxAuth.so /usr/$(get_libdir)/${PN}/VRDPAuth.so
+
+ # set an env-variable for 3rd party tools
+ echo -n "VBOX_APP_HOME=/usr/$(get_libdir)/${PN}" > "${T}/90virtualbox"
+ doenvd "${T}/90virtualbox"
+
+ if use java ; then
+ java-pkg_regjar "${D}/usr/$(get_libdir)/${PN}/sdk/bindings/xpcom/java/vboxjxpcom.jar"
+ java-pkg_regso "${D}/usr/$(get_libdir)/${PN}/libvboxjxpcom.so"
+ fi
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+
+ udevadm control --reload-rules && udevadm trigger --subsystem-match=usb
+
+ if ! use headless && use qt4 ; 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."
+ if [ -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
+}