Was supposed to be a linux distribution, now just a collection of build scripts for packages on top of (ideally) any distribution.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

116 lines
3.8 KiB

# NOTE: This package uses a prebuilt BIOS image, that can only be properly built with OpenWatcom.
import 'vcs/svn'
name=VirtualBox
version=5.1.10
update_url='https://www.virtualbox.org/wiki/Downloads'
define_option 'pulseaudio: Add pulseaudio support'
define_option 'pam: Use PAM for authentication'
define_option 'docs: Build documentation (requires texlive)'
dlextract "http://download.virtualbox.org/virtualbox/$version/$name-$version.tar.bz2" \
'889d90a7d8119a6bcc699be258ca4a96'
dlfile 'https://git.archlinux.org/svntogit/community.git/plain/trunk/003-ogl-include-path.patch?h=packages/virtualbox&id=580e187e0eeb4952f8a5dd7f284962b714a88b34' \
'9e49bbaa2192b141c27ee43cef8cbab7'
# VirtualBox requires this specific revision of kBuild to build.
vcs_svn 'http://svn.netlabs.org/repos/kbuild/trunk' 2823
header_end
# Remove prebuilt binaries
rm -rf trunk/kBuild/bin "$name-$version/kBuild" "$name-$version/tools"
# Build kBuild
( cd trunk
kBuild/env.sh --full make -f bootstrap.gmk
mv kBuild "../$name-$version"
)
# Build VirtualBox
cd "$name-$version"
# Build with system X libraries
sed -i -e "/^+\t\/usr\/include/s/usr/$(safe_sed "$dir_prefix")/" ../003-ogl-include-path.patch
patch -p1 -i ../003-ogl-include-path.patch
# Qt5 requires -std=c++11
sed -i -e '/^CXX_FLAGS=/cCXX_FLAGS="-std=c++11"' configure
cat > LocalConfig.kmk << EOF
VBOX_GCC_OPT := $CXXFLAGS
VBOX_WITH_ORIGIN :=
VBOX_PATH_APP_PRIVATE := /$dir_prefix/$dir_datadir/$name
VBOX_PATH_APP_PRIVATE_ARCH := /$dir_prefix/$dir_libdir/$name
VBOX_PATH_SHARED_LIBS := \$(VBOX_PATH_APP_PRIVATE_ARCH)
VBOX_WITH_RUNPATH := \$(VBOX_PATH_APP_PRIVATE_ARCH)
VBOX_PATH_APP_DOCS := /$dir_prefix/$dir_docdir/$name
VBOX_PATH_PACKAGE_DOCS := \$(VBOX_PATH_APP_DOCS)
VBOX_WITH_TESTCASES :=
VBOX_WITH_TESTSUITE :=
VBOX_WITH_VALIDATIONKIT :=
VBOX_GCC_WERR :=
VBOX_GCC_WARN :=
VBOX_USE_SYSTEM_XORG_HEADERS := 1
VBOX_NO_LINUX_RUN_INSTALLER := 1
$(option pam || echo VBOX_WITH_PAM :=)
EOF
./configure \
--with-makeself=/bin/true \
--disable-kmods \
--disable-java \
--disable-extpack \
$(option pulseaudio || echo --disable-pulse) \
$(option docs || echo --disable-docs)
source ./env.sh
kmk LOCALCFG=./LocalConfig.kmk
# Install VirtualBox
cd "out/$BUILD_PLATFORM.$BUILD_PLATFORM_ARCH/release/bin"
rm -f *.debug
# binaries
mkdir -p "$dir_install/$dir_prefix/$dir_bindir"
for i in VBoxHeadless VBoxManage VBoxSDL VirtualBox VBoxBalloonCtrl VBoxBugReport VBoxDTrace vboxwebsrv; do
ln -sf "$dir_sysroot/$dir_prefix/$dir_libdir/$name/VBox.sh" "$dir_install/$dir_prefix/$dir_bindir/$i"
ln -sf "$dir_sysroot/$dir_prefix/$dir_libdir/$name/VBox.sh" "$dir_install/$dir_prefix/$dir_bindir/$(echo $i | tr '[:upper:]' '[:lower:]')"
done
chmod 4511 VBoxHeadless VBoxNetAdpCtl VBoxNetDHCP VBoxNetNAT VBoxSDL VBoxVolInfo VirtualBox
# icons
mkdir -p "$dir_install/$dir_prefix/$dir_datadir/pixmaps"
mv VBox.png "$dir_install/$dir_prefix/$dir_datadir/pixmaps"
for i in icons/*; do
mkdir -p "$dir_install/$dir_prefix/$dir_datadir/icons/hicolor/$(basename $i)/mimetypes"
mv $i/* "$dir_install/$dir_prefix/$dir_datadir/icons/hicolor/$(basename $i)/mimetypes"
done
rm -rf icons
# desktop
mkdir -p "$dir_install/$dir_prefix/$dir_datadir/applications" "$dir_install/$dir_prefix/$dir_datadir/mime/packages"
mv virtualbox.desktop "$dir_install/$dir_prefix/$dir_datadir/applications"
mv virtualbox.xml "$dir_install/$dir_prefix/$dir_datadir/mime/packages"
# install configuration
mkdir -p "$dir_install/$dir_sysconfdir/vbox"
echo "INSTALL_DIR='$dir_sysroot/$dir_prefix/$dir_libdir/$name'" > "$dir_install/$dir_sysconfdir/vbox/vbox.cfg"
# Fix the kernel source directory
mkdir vboxhost
mv src/* vboxhost
mv vboxhost src
# Move the directory
mkdir -p "$dir_install/$dir_prefix/$dir_libdir/$name"
cp -a * "$dir_install/$dir_prefix/$dir_libdir/$name"
# vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab: