2017-06-28 22:30:50 +02:00
|
|
|
{ stdenv, kernel, perl
|
|
|
|
, hostPlatform
|
|
|
|
}:
|
2014-01-05 02:57:21 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
baseBuildFlags = [ "INSTALL_HDR_PATH=$(out)" "headers_install" ];
|
|
|
|
in stdenv.mkDerivation {
|
|
|
|
name = "linux-headers-${kernel.version}";
|
|
|
|
|
|
|
|
inherit (kernel) src patches;
|
|
|
|
|
2016-04-07 12:34:15 +02:00
|
|
|
nativeBuildInputs = [ perl ];
|
2014-01-05 02:57:21 +01:00
|
|
|
|
|
|
|
buildFlags = [ "ARCH=${stdenv.platform.kernelArch}" ] ++ baseBuildFlags;
|
|
|
|
|
|
|
|
crossAttrs = {
|
|
|
|
inherit (kernel.crossDrv) src patches;
|
2017-06-28 22:30:50 +02:00
|
|
|
buildFlags = [ "ARCH=${hostPlatform.platform.kernelArch}" ] ++ baseBuildFlags;
|
2014-01-05 02:57:21 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
find $out \( -name ..install.cmd -o -name .install \) -print0 | xargs -0 rm
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Headers shouldn't reference anything else
|
|
|
|
allowedReferences = [];
|
2016-04-06 13:42:45 +02:00
|
|
|
|
|
|
|
meta.platforms = stdenv.lib.platforms.linux;
|
2014-01-05 02:57:21 +01:00
|
|
|
}
|