virtualbox: Allow to easily change the build type.

Not really changes anything in functionality, but makes it easier to
change the build type to "debug", for example.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
aszlig 2014-12-18 11:34:57 +01:00
parent 38d639745e
commit b69ac6c159
No known key found for this signature in database
GPG key ID: D0EBD0EC8C2DC961

View file

@ -12,24 +12,25 @@
with stdenv.lib; with stdenv.lib;
let let
buildType = "release";
version = "4.3.20"; # changes ./guest-additions as well version = "4.3.20"; # changes ./guest-additions as well
forEachModule = action: '' forEachModule = action: ''
for mod in \ for mod in \
out/linux.*/release/bin/src/vboxdrv \ out/linux.*/${buildType}/bin/src/vboxdrv \
out/linux.*/release/bin/src/vboxpci \ out/linux.*/${buildType}/bin/src/vboxpci \
out/linux.*/release/bin/src/vboxnetadp \ out/linux.*/${buildType}/bin/src/vboxnetadp \
out/linux.*/release/bin/src/vboxnetflt out/linux.*/${buildType}/bin/src/vboxnetflt
do do
if [ "x$(basename "$mod")" != xvboxdrv -a ! -e "$mod/Module.symvers" ] if [ "x$(basename "$mod")" != xvboxdrv -a ! -e "$mod/Module.symvers" ]
then then
cp -v out/linux.*/release/bin/src/vboxdrv/Module.symvers \ cp -v out/linux.*/${buildType}/bin/src/vboxdrv/Module.symvers \
"$mod/Module.symvers" "$mod/Module.symvers"
fi fi
INSTALL_MOD_PATH="$out" INSTALL_MOD_DIR=misc \ INSTALL_MOD_PATH="$out" INSTALL_MOD_DIR=misc \
make -C "$MODULES_BUILD_DIR" DEPMOD=/do_not_use_depmod \ make -C "$MODULES_BUILD_DIR" DEPMOD=/do_not_use_depmod \
"M=\$(PWD)/$mod" ${action} "M=\$(PWD)/$mod" BUILD_TYPE="${buildType}" ${action}
done done
''; '';
@ -129,7 +130,7 @@ in stdenv.mkDerivation {
buildPhase = '' buildPhase = ''
source env.sh source env.sh
kmk kmk BUILD_TYPE="${buildType}"
${forEachModule "modules"} ${forEachModule "modules"}
''; '';
@ -139,7 +140,7 @@ in stdenv.mkDerivation {
# Install VirtualBox files # Install VirtualBox files
mkdir -p "$libexec" mkdir -p "$libexec"
find out/linux.*/release/bin -mindepth 1 -maxdepth 1 \ find out/linux.*/${buildType}/bin -mindepth 1 -maxdepth 1 \
-name src -o -exec cp -avt "$libexec" {} + -name src -o -exec cp -avt "$libexec" {} +
# Install kernel modules # Install kernel modules