forked from mirrors/nixpkgs
virtualbox: Explicitly excempt src during install.
Instead of coping it to $out and later deleting it, we now exclude the src directory during copy. Also, we no longer cd into the release directory during installPhase, which should make sure that we are constantly in $sourceRoot. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
parent
ddacac4393
commit
5a8c5d2768
|
@ -17,18 +17,19 @@ let
|
|||
|
||||
forEachModule = action: ''
|
||||
for mod in \
|
||||
$sourcedir/out/linux.*/release/bin/src/vboxdrv \
|
||||
$sourcedir/out/linux.*/release/bin/src/vboxpci \
|
||||
$sourcedir/out/linux.*/release/bin/src/vboxnetadp \
|
||||
$sourcedir/out/linux.*/release/bin/src/vboxnetflt
|
||||
out/linux.*/release/bin/src/vboxdrv \
|
||||
out/linux.*/release/bin/src/vboxpci \
|
||||
out/linux.*/release/bin/src/vboxnetadp \
|
||||
out/linux.*/release/bin/src/vboxnetflt
|
||||
do
|
||||
if [ "x$(basename "$mod")" != xvboxdrv -a ! -e "$mod/Module.symvers" ]
|
||||
then
|
||||
cp -v $sourcedir/out/linux.*/release/bin/src/vboxdrv/Module.symvers \
|
||||
"$mod/Module.symvers"
|
||||
cp -v out/linux.*/release/bin/src/vboxdrv/Module.symvers \
|
||||
"$mod/Module.symvers"
|
||||
fi
|
||||
INSTALL_MOD_PATH="$out" INSTALL_MOD_DIR=misc \
|
||||
make -C "$MODULES_BUILD_DIR" "M=$mod" DEPMOD=/do_not_use_depmod ${action}
|
||||
make -C "$MODULES_BUILD_DIR" DEPMOD=/do_not_use_depmod \
|
||||
"M=\$(PWD)/$mod" ${action}
|
||||
done
|
||||
'';
|
||||
|
||||
|
@ -87,7 +88,6 @@ in stdenv.mkDerivation {
|
|||
patches = optional enableHardening ./hardened.patch;
|
||||
|
||||
configurePhase = ''
|
||||
sourcedir="$(pwd)"
|
||||
cat >> LocalConfig.kmk <<LOCAL_CONFIG
|
||||
VBOX_WITH_TESTCASES :=
|
||||
VBOX_WITH_TESTSUITE :=
|
||||
|
@ -133,9 +133,9 @@ in stdenv.mkDerivation {
|
|||
share="${if enableHardening then "$out/share/virtualbox" else "$libexec"}"
|
||||
|
||||
# Install VirtualBox files
|
||||
cd out/linux.*/release/bin
|
||||
mkdir -p $libexec
|
||||
cp -av * $libexec
|
||||
mkdir -p "$libexec"
|
||||
find out/linux.*/release/bin -mindepth 1 -maxdepth 1 \
|
||||
-name src -o -exec cp -avt "$libexec" {} +
|
||||
|
||||
# Install kernel modules
|
||||
${forEachModule "modules_install"}
|
||||
|
@ -169,9 +169,6 @@ in stdenv.mkDerivation {
|
|||
ln -s $libexec/icons/$size/*.png $out/share/icons/hicolor/$size/apps
|
||||
done
|
||||
|
||||
# Get rid of src cruft.
|
||||
rm -rf $out/libexec/virtualbox/src
|
||||
|
||||
# Get rid of a reference to linux.dev.
|
||||
nuke-refs $out/lib/modules/*/misc/*.ko
|
||||
'';
|
||||
|
|
Loading…
Reference in a new issue