mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-25 20:34:52 +03:00
Merge branch 'virtualbox-manual-kernel' of github.com:aszlig/nixpkgs
virtualbox: Fix build for manual kernel. This should fix building VirtualBox against kernels made using the new manual kernel configuration system. This has been tested with the standard nixpkgs kernel as well.
This commit is contained in:
commit
18bbb2fa5c
@ -8,13 +8,27 @@
|
||||
|
||||
with stdenv.lib;
|
||||
|
||||
let version = "4.1.18"; in
|
||||
|
||||
stdenv.mkDerivation {
|
||||
let
|
||||
version = "4.1.18";
|
||||
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
|
||||
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"
|
||||
fi
|
||||
INSTALL_MOD_PATH="$out" INSTALL_MOD_DIR=misc \
|
||||
make -C "$MODULES_BUILD_DIR" "M=$mod" DEPMOD=/do_not_use_depmod ${action}
|
||||
done
|
||||
'';
|
||||
in stdenv.mkDerivation {
|
||||
name = "virtualbox-${version}-${kernel.version}";
|
||||
|
||||
NIX_CFLAGS_COMPILE="-I${kernel}/lib/modules/${kernel.modDirVersion}/build/include/generated";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://download.virtualbox.org/virtualbox/${version}/VirtualBox-${version}.tar.bz2";
|
||||
sha256 = "e650e4fdc23581b9edc0e5d5705cc596c76796851ebf65ccda0edb8e413fa3b7";
|
||||
@ -42,10 +56,11 @@ stdenv.mkDerivation {
|
||||
'';
|
||||
|
||||
configurePhase = ''
|
||||
sourcedir="$(pwd)"
|
||||
./configure --with-qt4-dir=${qt4} \
|
||||
${optionalString (!javaBindings) "--disable-java"} \
|
||||
${optionalString (!pythonBindings) "--disable-python"} \
|
||||
--disable-pulse --disable-hardening \
|
||||
--disable-pulse --disable-hardening --disable-kmods \
|
||||
--with-mkisofs=${xorriso}/bin/xorrisofs
|
||||
sed -e 's@PKG_CONFIG_PATH=.*@PKG_CONFIG_PATH=${libIDL}/lib/pkgconfig:${glib}/lib/pkgconfig ${libIDL}/bin/libIDL-config-2@' \
|
||||
-i AutoConfig.kmk
|
||||
@ -63,15 +78,10 @@ stdenv.mkDerivation {
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
preBuild = ''
|
||||
buildPhase = ''
|
||||
source env.sh
|
||||
kmk
|
||||
cd out/linux.*/release/bin/src
|
||||
export KERN_DIR=${kernel}/lib/modules/*/build
|
||||
'';
|
||||
|
||||
postBuild = ''
|
||||
cd ../../../../..
|
||||
${forEachModule "modules"}
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
@ -82,19 +92,8 @@ stdenv.mkDerivation {
|
||||
mkdir -p $libexec
|
||||
cp -av * $libexec
|
||||
|
||||
# Install kernel module
|
||||
cd src
|
||||
kernelVersion=$(cd ${kernel}/lib/modules; ls)
|
||||
export MODULE_DIR=$out/lib/modules/$kernelVersion/misc
|
||||
|
||||
# Remove root ownership stuff, since this does not work in a chroot environment
|
||||
for i in `find . -name Makefile`; do
|
||||
sed -i -e "s|-o root||g" \
|
||||
-e "s|-g root||g" $i
|
||||
done
|
||||
|
||||
# Install kernel modules
|
||||
make install
|
||||
${forEachModule "modules_install"}
|
||||
|
||||
# Create wrapper script
|
||||
mkdir -p $out/bin
|
||||
|
Loading…
Reference in New Issue
Block a user