Skip to content

Commit

Permalink
linux: add nativeBuildInputs for extra build tools
Browse files Browse the repository at this point in the history
  • Loading branch information
kloenk authored and Artturin committed Oct 16, 2021
1 parent d7b844e commit ddf902d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkgs/os-specific/linux/kernel/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
# Additional make flags passed to kbuild
, extraMakeFlags ? []

, # List of packages needed to build this specific kernel extra, additionally
# the default tools
nativeBuildInputs ? []

, # kernel intermediate config overrides, as a set
structuredExtraConfig ? {}

Expand Down Expand Up @@ -112,6 +116,7 @@ let

depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ perl gmp libmpc mpfr ]
++ nativeBuildInputs
++ lib.optionals (lib.versionAtLeast version "4.16") [ bison flex ];

platformName = stdenv.hostPlatform.linux-kernel.name;
Expand Down Expand Up @@ -181,7 +186,7 @@ let
}; # end of configfile derivation

kernel = (callPackage ./manual-config.nix { inherit buildPackages; }) {
inherit version modDirVersion src kernelPatches randstructSeed lib stdenv extraMakeFlags extraMeta configfile;
inherit version modDirVersion src kernelPatches randstructSeed lib stdenv extraMakeFlags extraMeta configfile nativeBuildInputs;

config = { CONFIG_MODULES = "y"; CONFIG_FW_LOADER = "m"; };
};
Expand Down
4 changes: 4 additions & 0 deletions pkgs/os-specific/linux/kernel/manual-config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ in {
# Use defaultMeta // extraMeta
extraMeta ? {},

# Extra build tools
nativeBuildInputs ? [],

# for module compatibility
isZen ? false,
isLibre ? false,
Expand Down Expand Up @@ -313,6 +316,7 @@ stdenv.mkDerivation ((drvAttrs config stdenv.hostPlatform.linux-kernel kernelPat

depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ perl bc nettools openssl rsync gmp libmpc mpfr gawk zstd python3Minimal ]
++ nativeBuildInputs
++ optional (stdenv.hostPlatform.linux-kernel.target == "uImage") buildPackages.ubootTools
++ optional (lib.versionAtLeast version "4.14" && lib.versionOlder version "5.8") libelf
# Removed util-linuxMinimal since it should not be a dependency.
Expand Down

0 comments on commit ddf902d

Please sign in to comment.