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.
 
 
 
 
 

162 lines
5.4 KiB

# NOTE: This package uses a prebuilt BIOS image, that can only be properly built with OpenWatcom.
import 'vcs/svn'
import 'misc/debian'
name=VirtualBox
deb_name=virtualbox
version=5.2.18
version_kbuild_rev=3149
version_kbuild=0.1.9998svn$version_kbuild_rev+dfsg
define_option 'pam: Use PAM for authentication'
misc_debian_download -r contrib -n "$deb_name" -O dfsg-1 \
'cf6ced2af27d76d8ed949659e4150886'
dlfile "http://download.virtualbox.org/virtualbox/$orig_version/$name-$orig_version.tar.bz2" \
'd8e291525b84569356773eef507c49ce'
( name=kbuild version="$version_kbuild"
misc_debian_download -V -v "$version_kbuild_rev" 3 \
'e0d990b4900783060479514a1d4075f4' \
'1a9b1e67651af062a032695926612954'
)
version_kbuild+="-3"
_
# Unpack and sanitize the source tarball
extract "${deb_name}_$version.debian.tar.xz"
( cd debian
# We don't need to repack the sources.
sed -i -e '/^tar.*-cJf/,+2d' get-orig-source.sh
./get-orig-source.sh --upstream-version "$orig_version"
)
mv debian "$name-$orig_version"
# Build and install kbuild
cat > "kbuild-$version_kbuild/SvnInfo.kmk" << EOF
KBUILD_SVN_URL := http://svn.netlabs.org/repos/kbuild/trunk
KBUILD_SVN_REV := $version_kbuild_rev
EOF
( cd "kbuild-$version_kbuild"
misc_debian_patch
kBuild/env.sh --full make -f bootstrap.gmk
)
mv "kbuild-$version_kbuild/kBuild" "$name-$orig_version"
cd "$name-$orig_version"
# Exclude some patches
misc_debian_patch_exclude 01-build-arch.patch # Debian-exclusive patch that uses dpkg-architecture.
misc_debian_patch_exclude 04-vboxdrv-references.patch # Debian-specific error messages.
misc_debian_patch_exclude 12-make-module.patch # Debian uses amd64 instead of x86_64.
misc_debian_patch_exclude 13-modules-mismatch.patch # Debian-specific error messages.
# Replace /usr/include with whatever we're using
sed -i -e "/^+\t\/usr\/include/s/usr\/include/$(safe_sed "$dir_prefix/$dir_include")/" debian/patches/18-system-xorg.patch
# Apply debian patches
misc_debian_patch
# Fix path to sysconfdir in some scripts
sed -i -e "s/\/etc\/vbox\//$(safe_sed "/$dir_prefix/$dir_sysconf/vbox/")/g" \
src/VBox/Installer/linux/VBox.sh \
src/VBox/Installer/linux/vboxdrv.sh \
src/VBox/Installer/linux/*-service.sh \
src/VBox/HostDrivers/*/linux/Makefile
# Make vboxdrv.sh find the proper kernel sources
sed -i -e 's/\${INSTALL_DIR}\/src\/vboxhost/\${INSTALL_DIR}\/src/' \
-e '/^elif test -x \/usr\/lib\/virtualbox\/VirtualBox/,+2d' src/VBox/Installer/linux/vboxdrv.sh
# Make sure VBox.sh finds the proper INSTALL_DIR
sed -i -e '/^if test -f \/usr\/lib\/virtualbox\/VirtualBox/,+2d' \
-e 's/^elif test -f "${MY_DIR}/if test -f "${MY_DIR}/' src/VBox/Installer/linux/VBox.sh
# Qt5 requires -std=c++11
sed -i -e 's/^CXX_FLAGS="\(.*\)"/CXX_FLAGS="\1 -std=c++11"/' configure
# Copy debian's configuration, barring a few things
egrep -vf - debian/LocalConfig.kmk > LocalConfig.kmk << 'EOF'
^VBOX_JAVA_HOME
^VBOX_PATH_DOCBOOK_DTD
EOF
# Append our configuration
cat >> LocalConfig.kmk << EOF
VBOX_PATH_APP_PRIVATE_ARCH := /$dir_prefix/$dir_lib/$name
VBOX_PATH_SHARED_LIBS := \$(VBOX_PATH_APP_PRIVATE_ARCH)
VBOX_WITH_RUNPATH := \$(VBOX_PATH_APP_PRIVATE_ARCH)
VBOX_PATH_APP_PRIVATE := /$dir_prefix/$dir_data/$name
VBOX_PATH_APP_DOCS = /$dir_prefix/$dir_doc/$name
VBOX_GCC_OPT := $CXXFLAGS
VBOX_USE_SYSTEM_XORG_HEADERS := 1
VBOX_NO_LEGACY_XORG_X11 := 1
VBOX_WITH_REGISTRATION_REQUEST :=
VBOX_WITH_UPDATE_REQUEST :=
VBOX_WITH_EXTPACK_VBOXDTRACE :=
VBOX_WITHOUT_ADDITIONS := 1
$(option pam || echo VBOX_WITH_PAM :=)
EOF
./configure \
--ose \
--disable-kmods \
--with-makeself=/bin/true \
--disable-java \
--disable-docs \
$(pkg-config --exists libpulse || echo --disable-pulse)
source ./env.sh
kmk LOCALCFG=./LocalConfig.kmk
# Install VirtualBox
# manpages (by debian)
install -Dm644 -t "$dir_install/$dir_prefix/$dir_man/man1" \
debian/manpages/VirtualBox.1 \
debian/manpages/VBoxManage.1 \
debian/manpages/VBoxSDL.1 \
debian/manpages/VBoxHeadless.1 \
debian/manpages/VBoxBalloonCtrl.1 \
debian/manpages/vboxwebsrv.1
cd "out/$BUILD_PLATFORM.$BUILD_PLATFORM_ARCH/release/bin"
rm -f *.debug
# Apply suid to VirtualBox
chmod 4711 VirtualBox VBoxSDL VBoxHeadless
# binaries
mkdir -p "$dir_install/$dir_prefix/$dir_bin"
for i in VirtualBox VBoxManage VBoxSDL VBoxHeadless VBoxAutostart VBoxBalloonCtrl VBoxBugReport VBoxDTrace vboxwebsrv; do
ln -sf "/$dir_prefix/$dir_lib/$name/VBox.sh" "$dir_install/$dir_prefix/$dir_bin/$i"
done
# icons
mkdir -p "$dir_install/$dir_prefix/$dir_data/pixmaps"
mv VBox.png "$dir_install/$dir_prefix/$dir_data/pixmaps"
for i in icons/*; do
mkdir -p "$dir_install/$dir_prefix/$dir_data/icons/hicolor/$(basename $i)/mimetypes"
mv $i/* "$dir_install/$dir_prefix/$dir_data/icons/hicolor/$(basename $i)/mimetypes"
done
rm -rf icons
# desktop
mkdir -p "$dir_install/$dir_prefix/$dir_data/applications" "$dir_install/$dir_prefix/$dir_data/mime/packages"
mv virtualbox.desktop "$dir_install/$dir_prefix/$dir_data/applications"
mv virtualbox.xml "$dir_install/$dir_prefix/$dir_data/mime/packages"
# install configuration
mkdir -p "$dir_install/$dir_prefix/$dir_sysconf/vbox"
echo "INSTALL_DIR='/$dir_prefix/$dir_lib/$name'" > "$dir_install/$dir_prefix/$dir_sysconf/vbox/vbox.cfg"
# Move the directory
mkdir -p "$dir_install/$dir_prefix/$dir_lib"
cp -Ta . "$dir_install/$dir_prefix/$dir_lib/$name"
# vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab: