mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-11 07:04:28 +00:00
8bd89c922d
Putting the kernel modules into the same output path as the main VirtualBox derivation causes all of VirtualBox to be rebuilt on every single kernel update. The build process of VirtualBox already outputs the kernel module source along with the generated files for the configuration of the main VirtualBox package. We put this into a different output called "modsrc" which we re-use from linuxPackages.virtualbox, which is now only containing the resulting kernel modules without the main user space implementation. This not only has the advantage of decluttering the Nix expression for the user space portions but also gets rid of the need to nuke references and the need to patch out "depmod -a". Signed-off-by: aszlig <aszlig@redmoonstudios.org>
24 lines
603 B
Nix
24 lines
603 B
Nix
{ stdenv, virtualbox, kernel, strace }:
|
|
|
|
stdenv.mkDerivation {
|
|
name = "virtualbox-modules-${virtualbox.version}-${kernel.version}";
|
|
src = virtualbox.modsrc;
|
|
hardeningDisable = [
|
|
"fortify" "pic" "stackprotector"
|
|
];
|
|
|
|
makeFlags = [
|
|
"-C ${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
|
"INSTALL_MOD_PATH=$(out)"
|
|
];
|
|
preBuild = "makeFlagsArray+=(\"M=$(pwd)\")";
|
|
buildFlags = [ "modules" ];
|
|
installTargets = [ "modules_install" ];
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
meta = virtualbox.meta // {
|
|
description = virtualbox.meta.description + " (kernel modules)";
|
|
};
|
|
}
|