Skip to content

Commit

Permalink
- Update VirtualBox OSE to 6.1.18
Browse files Browse the repository at this point in the history
- Old VirtualBox OSE 5.2.44 preserved as "-legacy" versions of the
  ports (repocopied)
- Add back extra patch removed in r528258, actually required to
  build DEBUG kmod
- Correctly define WITH_DEBUG when enabling the DEBUG option, so
  binaries are not stripped

Please note that this new version supports only amd64 CPUs. If you need
to use older hardware please install the legacy ports.

Note that moving VM snapshots across major updates is unsupported, it's
strongly suggested to properly shutdown VMs before upgrading, please
check UPDATING for further details.

This update is the result of work from many people, and thanks to all
who gave feedback and tested things.

Patch based on work from: Mario Lobo <lobo@bsd.com.br> and jkim.

PR:			234878
Submitted by:		kunda <chitty_cloud@me.com>
Approved by:		vbox (implicit)
Reviewed by:		decke
Tested by:		jwb,
			martin ilavsky <ilavsky.martin@gmail.com>,
			Mario Lobo <lobo@bsd.com.br>
Relnotes:		https://www.virtualbox.org/wiki/Changelog-6.1
Differential Revision:	https://reviews.freebsd.org/D28871
  • Loading branch information
madpilot78 committed Mar 9, 2021
1 parent 82a7880 commit 42d8425
Show file tree
Hide file tree
Showing 212 changed files with 10,278 additions and 766 deletions.
2 changes: 0 additions & 2 deletions MOVED
Expand Up @@ -6868,8 +6868,6 @@ databases/p5-DBD-FrontBase||2014-09-07|Cascade removal (databases/frontbase)
databases/ruby-frontbase||2014-09-07|Cascade removal (databases/frontbase)
devel/flex-sdk2||2014-09-07|Not staged
devel/flex_compiler_shell||2014-09-07|Cascade removal (devel/flex-sdk2)
emulators/virtualbox-ose-legacy||2014-09-09|Not staged
emulators/virtualbox-ose-kmod-legacy||2014-09-09|No purpose after removal of virtualbox-ose-legacy
devel/arm-eabi-gcc||2014-09-09|Not staged
devel/cross-gcc||2014-09-09|Not staged
devel/arm-eabi-binutils||2014-09-09|No purpose after removal of arm-eabi-gcc
Expand Down
28 changes: 28 additions & 0 deletions UPDATING
Expand Up @@ -5,6 +5,34 @@ they are unavoidable.
You should get into the habit of checking this file for changes each time
you update your ports collection, before attempting any port upgrades.

20210309:
AFFECTS: users of emulators/virtualbox-ose
AUTHOR: madpilot@FreeBSD.org

emulators/virtualbox-ose has been updated to 6.1.18. This new
version only works on amd64 hardware.

Previous version 5.x of the virtualbox ports have been preserved
as emulators/virtualbox-ose-legacy and similarly named ports for
the other parts.

If you can't run the latest version or wish to stay with the old
version, please install the legacy ports.

Also the additions at present build successfully only for amd64.
If you need i386 additions you can fallback to the old legacy
ones.

NOTE: There is no support for moving saved running machine states
across major updates of virtualbox. It is recommended to properly
shutdown all virtual machines before upgrading. Otherwise the saved
state can simply be discarded after the upgrade, if it's not
important to preserve it.

It should also be possible to downgrade to the legacy ports and
shutdown the machine properly from the saved state and then upgrade
back again.

20210302:
AFFECTS: users of editors/emacs-devel
AUTHOR: jrm@FreeBSD.org
Expand Down
5 changes: 5 additions & 0 deletions emulators/Makefile
Expand Up @@ -153,9 +153,14 @@
SUBDIR += vice
SUBDIR += virtualbox-ose
SUBDIR += virtualbox-ose-additions
SUBDIR += virtualbox-ose-additions-legacy
SUBDIR += virtualbox-ose-additions-nox11
SUBDIR += virtualbox-ose-additions-nox11-legacy
SUBDIR += virtualbox-ose-kmod
SUBDIR += virtualbox-ose-kmod-legacy
SUBDIR += virtualbox-ose-legacy
SUBDIR += virtualbox-ose-nox11
SUBDIR += virtualbox-ose-nox11-legacy
SUBDIR += visualboyadvance-m
SUBDIR += vmips
SUBDIR += vmsbackup
Expand Down
174 changes: 174 additions & 0 deletions emulators/virtualbox-ose-additions-legacy/Makefile
@@ -0,0 +1,174 @@
# Created by: Bernhard Froehlich <decke@bluelife.at>
# $FreeBSD$

PORTNAME= virtualbox-ose
PORTVERSION= 5.2.44
PORTREVISION= 3
CATEGORIES= emulators
MASTER_SITES= https://download.oracle.com/virtualbox/${PORTVERSION}/
PKGNAMESUFFIX?= -additions-legacy
DISTNAME= VirtualBox-${PORTVERSION}

MAINTAINER= vbox@FreeBSD.org
COMMENT= VirtualBox additions for FreeBSD guests

LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/COPYING

ONLY_FOR_ARCHS= amd64 i386
USES= compiler:c++11-lang cpe iconv kmod tar:bzip2
USE_RC_SUBR= vboxguest vboxservice

BUILD_DEPENDS= yasm:devel/yasm \
kmk:devel/kBuild \
xsltproc:textproc/libxslt

CPE_VENDOR= oracle
CPE_PRODUCT= vm_virtualbox

PATCHDIR= ${.CURDIR}/../${PORTNAME}-legacy/files
WRKSRC= ${WRKDIR}/VirtualBox-${PORTVERSION}
MAKE_JOBS_UNSAFE= yes

HAS_CONFIGURE= yes
CONFIGURE_ARGS+= --disable-alsa \
--disable-docs \
--disable-libvpx \
--disable-opengl \
--disable-pulse \
--disable-python \
--disable-sdl-ttf \
--disable-xpcom
CONFIGURE_ARGS+= --nofatal --with-gcc="${CC}" --with-g++="${CXX}"

CONFLICTS_INSTALL= virtualbox-ose-[0-9]* \
virtualbox-ose-additions-devel-[0-9]* \
virtualbox-ose-devel-[0-9]* \
virtualbox-ose-[0-9]* \
virtualbox-ose-lite-[0-9]* \
virtualbox-ose-nox11-[0-9]*

OPTIONS_DEFINE= DBUS DEBUG X11
OPTIONS_DEFAULT= DBUS X11
OPTIONS_SUB= yes

DBUS_CONFIGURE_OFF= --disable-dbus
DBUS_LIB_DEPENDS= libdbus-1.so:devel/dbus
DEBUG_CONFIGURE_ON= --build-debug
DEBUG_VARS= KMK_BUILDTYPE=debug
DEBUG_VARS_OFF= KMK_BUILDTYPE=release
X11_BUILD_DEPENDS= ${LOCALBASE}/include/xorg/compiler.h:x11-servers/xorg-server
X11_RUN_DEPENDS= xrandr:x11/xrandr
X11_USE= XORG=x11,xcursor,xext,xorgproto,xmu,xrandr,xt
X11_USES= pkgconfig xorg
X11_VARS= VBOX_WITH_X11=1

.include <bsd.port.options.mk>

.if ${SLAVE_PORT} == no
CONFLICTS_INSTALL+= virtualbox-ose-additions-nox11-[0-9]*
.else
CONFLICTS_INSTALL+= virtualbox-ose-additions-[0-9]*
.endif

VIDEODIR= ${PREFIX}/lib/xorg/modules/drivers
INPUTDIR= ${PREFIX}/lib/xorg/modules/input

VBOX_BIN= ${WRKSRC}/out/${KMK_ARCH}/${KMK_BUILDTYPE}/bin/additions
VBOX_SBINS= VBoxControl \
VBoxService \
mount_vboxvfs

BUILD_WRKSRC= ${VBOX_BIN}/src

KMK_ARCH= freebsd.${ARCH:S/i386/x86/}
KMK_CONFIG+= VBOX_LIBPATH_X11=${LOCALBASE} VBOX_FREEBSD_SRC=${SRC_BASE}/sys

.if ${PORT_OPTIONS:MX11}
.else
VBOX_WITH_X11=
.endif

.include <bsd.port.pre.mk>

.if ${COMPILER_TYPE} == clang
.if ${COMPILER_FEATURES:Mlibc++}
EXTRA_PATCHES+= ${PATCHDIR}/extrapatch-src-VBox-Additions-x11-VBoxClient-Makefile.kmk
.endif
.endif

post-patch:
@${ECHO_CMD} 'VBOX_ONLY_ADDITIONS = 1' > ${WRKSRC}/LocalConfig.kmk
@${ECHO_CMD} 'VBOX_WITH_DRAG_AND_DROP = ${VBOX_WITH_X11}' >> \
${WRKSRC}/LocalConfig.kmk
@${ECHO_CMD} 'VBOX_WITH_DRAG_AND_DROP_GH = ${VBOX_WITH_X11}' >> \
${WRKSRC}/LocalConfig.kmk
@${ECHO_CMD} 'VBOX_WITH_X11_ADDITIONS = ${VBOX_WITH_X11}' >> \
${WRKSRC}/LocalConfig.kmk
@${ECHO_CMD} 'VBOX_GCC_std = -std=c++11' >> ${WRKSRC}/LocalConfig.kmk
.if ${COMPILER_TYPE} == clang
@${REINPLACE_CMD} -e 's| -finline-limit=8000||' \
-e 's| -fno-merge-constants||' \
-e 's| -mpreferred-stack-boundary=2||' ${WRKSRC}/Config.kmk
.endif
@${REINPLACE_CMD} -e 's|/usr/X11|${LOCALBASE}|g' \
${WRKSRC}/src/VBox/Additions/x11/VBoxClient/display.cpp
@${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \
${WRKSRC}/Config.kmk ${WRKSRC}/configure \
${WRKSRC}/kBuild/header.kmk ${WRKSRC}/kBuild/units/qt4.kmk \
${WRKSRC}/kBuild/units/qt5.kmk ${WRKSRC}/kBuild/sdks/LIBSDL.kmk \
${WRKSRC}/src/VBox/Additions/common/crOpenGL/load.c \
${WRKSRC}/src/VBox/Additions/x11/Installer/98vboxadd-xclient \
${WRKSRC}/src/VBox/Additions/x11/Installer/vboxclient.desktop \
${WRKSRC}/src/VBox/Additions/x11/vboxmouse/Makefile.kmk \
${WRKSRC}/src/VBox/Additions/x11/vboxvideo/Makefile.kmk
@${REINPLACE_CMD} \
-e 's|\$$KBUILDDIR_BIN/kmk_sed|${LOCALBASE}/bin/kmk_sed|g' \
${WRKSRC}/configure
.if empty(ICONV_LIB)
@${REINPLACE_CMD} -e 's|iconv||' ${WRKSRC}/Config.kmk \
${WRKSRC}/src/VBox/Runtime/Makefile.kmk \
${WRKSRC}/src/VBox/Additions/x11/VBoxClient/Makefile.kmk
@${ECHO_CMD} 'VBOX_ICONV_DEFS = LIBICONV_PLUG' >> ${WRKSRC}/LocalConfig.kmk
.endif

post-patch-X11-on:
@${ECHO_CMD} 'VBOX_USE_SYSTEM_XORG_HEADERS = 1' >> \
${WRKSRC}/LocalConfig.kmk

pre-build:
cd ${WRKSRC} && ${SH} -c \
". env.sh && ${KMK_CONFIG} ${LOCALBASE}/bin/kmk"

do-install:
${MKDIR} ${STAGEDIR}${KMODDIR}
${INSTALL_KLD} ${VBOX_BIN}/src/vboxguest/vboxguest.ko \
${STAGEDIR}${KMODDIR}
${INSTALL_KLD} ${VBOX_BIN}/vboxvfs.ko ${STAGEDIR}${KMODDIR}
${INSTALL_LIB} ${VBOX_BIN}/pam_vbox.so ${STAGEDIR}${PREFIX}/lib
${INSTALL_PROGRAM} ${VBOX_SBINS:S|^|${VBOX_BIN}/|} \
${STAGEDIR}${PREFIX}/sbin/

do-install-X11-on:
${INSTALL_PROGRAM} ${VBOX_BIN}/VBoxClient ${STAGEDIR}${PREFIX}/bin/
${INSTALL_SCRIPT} \
${WRKSRC}/src/VBox/Additions/x11/Installer/98vboxadd-xclient \
${STAGEDIR}${PREFIX}/bin/VBoxClient-all
# X11 autostart
${MKDIR} ${STAGEDIR}${PREFIX}/etc/xdg/autostart/
${INSTALL_DATA} \
${WRKSRC}/src/VBox/Additions/x11/Installer/vboxclient.desktop \
${STAGEDIR}${PREFIX}/etc/xdg/autostart/
# KDE autostart
${MKDIR} ${STAGEDIR}${PREFIX}/share/autostart/
${INSTALL_DATA} \
${WRKSRC}/src/VBox/Additions/x11/Installer/vboxclient.desktop \
${STAGEDIR}${PREFIX}/share/autostart/
${MKDIR} ${STAGEDIR}${VIDEODIR}
${INSTALL_DATA} ${VBOX_BIN}/vboxvideo_drv_system.so \
${STAGEDIR}${VIDEODIR}/vboxvideo_drv.so
${MKDIR} ${STAGEDIR}${INPUTDIR}
${INSTALL_DATA} ${VBOX_BIN}/vboxmouse_drv_system.so \
${STAGEDIR}${INPUTDIR}/vboxmouse_drv.so

.include <bsd.port.post.mk>
3 changes: 3 additions & 0 deletions emulators/virtualbox-ose-additions-legacy/distinfo
@@ -0,0 +1,3 @@
TIMESTAMP = 1594821235
SHA256 (VirtualBox-5.2.44.tar.bz2) = ad83b11cfae2734f7d6f619dd2f8bdada7d33492cd7682fab98cb4053122295e
SIZE (VirtualBox-5.2.44.tar.bz2) = 124016934
67 changes: 67 additions & 0 deletions emulators/virtualbox-ose-additions-legacy/files/vboxguest.in
@@ -0,0 +1,67 @@
#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: vboxguest
# REQUIRE: FILESYSTEMS
# BEFORE: netif
# KEYWORD: nojail

#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# vboxguest_enable (bool): Set to NO by default.
# Set it to YES to enable vboxguest on startup

. /etc/rc.subr

name="vboxguest"
rcvar=vboxguest_enable
start_cmd="vboxguest_start"
stop_cmd="vboxguest_stop"

vboxguest_modules="vboxguest:pci/vboxguest"

vboxguest_start()
{
local _k _m

for _m in ${vboxguest_modules}; do
_k=${_m%:*}
_m=${_m#*:}
if ! kldstat -q -m ${_m}; then
if ! kldload ${_k} > /dev/null 2>&1; then
warn "Can't load ${_k} module."
return 1
fi
fi
done
}

vboxguest_stop()
{
local _k _m _r

_r=
for _m in ${vboxguest_modules}; do
_r="${_m} ${_r}"
done
for _m in ${_r}; do
_k=${_m%:*}
_m=${_m#*:}
if kldstat -q -m ${_m}; then
if ! kldunload ${_k} > /dev/null 2>&1; then
warn "Can't unload ${_k} module."
return 1
fi
fi
done
}

load_rc_config $name

: ${vboxguest_enable="NO"}

run_rc_command "$1"
25 changes: 25 additions & 0 deletions emulators/virtualbox-ose-additions-legacy/files/vboxservice.in
@@ -0,0 +1,25 @@
#!/bin/sh

# $FreeBSD$

# PROVIDE: vboxservice
# REQUIRE: DAEMON vboxguest
# BEFORE: LOGIN
# KEYWORD: shutdown

# Define vboxservice_enable in /etc/rc.conf[.local] to enable it.
#
# vboxservice_enable (bool): Set to "NO" by default.
# Set it to "YES" to enable VBoxService.

. /etc/rc.subr

name="vboxservice"
rcvar=vboxservice_enable
command="%%PREFIX%%/sbin/VBoxService"

load_rc_config $name

: ${vboxservice_enable="NO"}

run_rc_command "$1"
@@ -0,0 +1,5 @@
libEGL.so.1 VBoxEGL.so
libGL.so.1 VBoxOGL.so

[libglx.so]
libGL.so.1 libGL.so.1
9 changes: 9 additions & 0 deletions emulators/virtualbox-ose-additions-legacy/pkg-descr
@@ -0,0 +1,9 @@
These additions are for installation inside a FreeBSD guest.

VirtualBox is a family of powerful x86 virtualization products for
enterprise as well as home use. Not only is VirtualBox an extremely
feature rich, high performance product for enterprise customers, it
is also the only professional solution that is freely available as
Open Source Software under the terms of the GNU General Public License.

WWW: https://www.virtualbox.org/
23 changes: 23 additions & 0 deletions emulators/virtualbox-ose-additions-legacy/pkg-message
@@ -0,0 +1,23 @@
[
{ type: install
message: <<EOM
VirtualBox Guest Additions were installed.


You need to enable the vboxguest startscript to load the kernel module and
vboxservice to use host time synchronization.

vboxguest_enable="YES"
vboxservice_enable="YES"

You also have to add all X11 users that want to use any of the additional
features (clipboard sharing, window scaling) to the wheel group.

% pw groupmod wheel -m jerry

Reboot the machine to load the needed kernel modules.

For detailed informations please visit http://wiki.freebsd.org/VirtualBox
EOM
}
]
12 changes: 12 additions & 0 deletions emulators/virtualbox-ose-additions-legacy/pkg-plist
@@ -0,0 +1,12 @@
%%X11%%bin/VBoxClient
%%X11%%bin/VBoxClient-all
%%X11%%etc/xdg/autostart/vboxclient.desktop
lib/pam_vbox.so
%%X11%%lib/xorg/modules/drivers/vboxvideo_drv.so
%%X11%%lib/xorg/modules/input/vboxmouse_drv.so
sbin/VBoxControl
sbin/VBoxService
sbin/mount_vboxvfs
%%X11%%share/autostart/vboxclient.desktop
/%%KMODDIR%%/vboxguest.ko
/%%KMODDIR%%/vboxvfs.ko
9 changes: 9 additions & 0 deletions emulators/virtualbox-ose-additions-nox11-legacy/Makefile
@@ -0,0 +1,9 @@
# $FreeBSD$

PKGNAMESUFFIX= -additions-nox11-legacy

OPTIONS_EXCLUDE= DBUS DEBUG OPENGL X11

MASTERDIR= ${.CURDIR}/../virtualbox-ose-additions-legacy

.include "${MASTERDIR}/Makefile"

0 comments on commit 42d8425

Please sign in to comment.