Merge pull request #72287 from oxalica/fix-linux-config

linuxConfig: fix deps and cross-compiling behavior
This commit is contained in:
John Ericson 2019-11-22 09:32:34 -05:00 committed by GitHub
commit 60b52e240a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16519,17 +16519,26 @@ in
linuxManualConfig = makeOverridable (callPackage ../os-specific/linux/kernel/manual-config.nix {});
# Derive one of the default .config files
linuxConfig = { src, makeTarget ? "defconfig", name ? "kernel.config" }:
stdenv.mkDerivation {
inherit name src;
buildPhase = ''
set -x
make ${makeTarget}
'';
installPhase = ''
cp .config $out
'';
};
linuxConfig = {
src,
version ? (builtins.parseDrvName src.name).version,
makeTarget ? "defconfig",
name ? "kernel.config",
}: stdenvNoCC.mkDerivation {
inherit name src;
depsBuildBuild = [ buildPackages.stdenv.cc ]
++ lib.optionals (lib.versionAtLeast version "4.16") [ buildPackages.bison buildPackages.flex ];
buildPhase = ''
set -x
make \
ARCH=${stdenv.hostPlatform.kernelArch} \
HOSTCC=${buildPackages.stdenv.cc.targetPrefix}gcc \
${makeTarget}
'';
installPhase = ''
cp .config $out
'';
};
buildLinux = attrs: callPackage ../os-specific/linux/kernel/generic.nix attrs;