summaryrefslogtreecommitdiffstats
path: root/core/modules/vbox-src/module.build
diff options
context:
space:
mode:
authorJonathan Bauer2018-01-29 16:52:30 +0100
committerJonathan Bauer2018-01-29 16:52:30 +0100
commit685eeb25269314855d3712c88c1d8c28f84c159a (patch)
treeaaccd2827e6d1c3279ab4f3c2972f8bc35881cde /core/modules/vbox-src/module.build
parent[nvidia_kernel] build nvidia_kernel chroot inside (diff)
downloadmltk-685eeb25269314855d3712c88c1d8c28f84c159a.tar.gz
mltk-685eeb25269314855d3712c88c1d8c28f84c159a.tar.xz
mltk-685eeb25269314855d3712c88c1d8c28f84c159a.zip
[vbox] new vbox module 'vbox-src' (wip)
* builds virtualbox from source instead of deb packages * currently only builds stuff, does not copy anything to target build dir
Diffstat (limited to 'core/modules/vbox-src/module.build')
-rw-r--r--core/modules/vbox-src/module.build35
1 files changed, 35 insertions, 0 deletions
diff --git a/core/modules/vbox-src/module.build b/core/modules/vbox-src/module.build
new file mode 100644
index 00000000..14ab8d2a
--- /dev/null
+++ b/core/modules/vbox-src/module.build
@@ -0,0 +1,35 @@
+#!/bin/bash
+fetch_source() {
+ [ -d "${MODULE_WORK_DIR}/src" ] && rm -rf "${MODULE_WORK_DIR}/src"
+ [ -z "${REQUIRED_VBOX_VERSION}" ] && perror "REQUIRED_VBOX_VERSION is not set!"
+
+ local BASE_URL="https://download.virtualbox.org/virtualbox"
+ local DOWNLOAD_URL="${BASE_URL}/${REQUIRED_VBOX_VERSION}/VirtualBox-${REQUIRED_VBOX_VERSION}.tar.bz2"
+ download_untar "$DOWNLOAD_URL" "${MODULE_WORK_DIR}/src" || \
+ perror "Could not download_untar '$DOWNLOAD_URL' to '${MODULE_WORK_DIR}/src'."
+}
+
+build() {
+ cd "${MODULE_WORK_DIR}/src/VirtualBox-${REQUIRED_VBOX_VERSION}" || \
+ perror "Could not cd to '${MODULE_WORK_DIR}/src/VirtualBox-${REQUIRED_VBOX_VERSION}'."
+ [ -n "${KERNEL_HEADERS_DIR}" ] || perror "KERNEL_HEADERS_DIR not set, kernel module present?"
+ local VBOX_BUILD_DIR="${MODULE_WORK_DIR}/build"
+ ./configure \
+ --disable-docs \
+ --disable-java \
+ --disable-python \
+ --disable-libvpx \
+ --build-headless \
+ --with-linux="${KERNEL_HEADERS_DIR}" \
+ --out-path="${VBOX_BUILD_DIR}" \
+ || perror "'configure' failed."
+
+ # the configure script should have created a file called 'env.sh'
+ [ -r "${VBOX_BUILD_DIR}/env.sh" ] || perror "Generated file '${VBOX_BUILD_DIR}/env.sh' not found."
+ source "${VBOX_BUILD_DIR}/env.sh" || perror "Failed to source '${VBOX_BUILD_DIR}/env.sh'."
+ kmk || perror "Failed to execute 'kmk'."
+}
+
+post_copy() {
+ :
+}