2018-07-21 02:44:44 +02:00
|
|
|
{ stdenv, virtualbox, kernel }:
|
2016-09-13 03:42:16 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "virtualbox-modules-${virtualbox.version}-${kernel.version}";
|
|
|
|
src = virtualbox.modsrc;
|
|
|
|
hardeningDisable = [
|
|
|
|
"fortify" "pic" "stackprotector"
|
|
|
|
];
|
|
|
|
|
2017-12-28 09:11:36 +01:00
|
|
|
nativeBuildInputs = kernel.moduleBuildDependencies;
|
|
|
|
|
2017-11-15 16:03:44 +01:00
|
|
|
patches = [
|
|
|
|
./fix_kerndir.patch
|
|
|
|
./fix_kbuild.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
KERN_DIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";
|
|
|
|
INCLUDE_BASE = "${virtualbox.modsrc}";
|
|
|
|
|
2016-09-13 03:42:16 +02:00
|
|
|
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)";
|
|
|
|
};
|
|
|
|
}
|