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:
parent
38d639745e
commit
b69ac6c159
1 changed files with 9 additions and 8 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue