diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix index 081cfcaa8b60..5981de673242 100644 --- a/pkgs/os-specific/linux/kernel/generic.nix +++ b/pkgs/os-specific/linux/kernel/generic.nix @@ -140,8 +140,7 @@ let passAsFile = [ "kernelConfig" ]; depsBuildBuild = [ buildPackages.stdenv.cc ]; - nativeBuildInputs = [ perl gmp libmpc mpfr ] - ++ lib.optionals (lib.versionAtLeast version "4.16") [ bison flex ] + nativeBuildInputs = [ perl gmp libmpc mpfr bison flex ] ++ lib.optional (lib.versionAtLeast version "5.2") pahole ++ lib.optionals withRust [ rust-bindgen rustc ] ; diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index 3060ff9ef775..323b77e85140 100644 --- a/pkgs/os-specific/linux/kernel/manual-config.nix +++ b/pkgs/os-specific/linux/kernel/manual-config.nix @@ -1,5 +1,5 @@ { lib, stdenv, buildPackages, runCommand, nettools, bc, bison, flex, perl, rsync, gmp, libmpc, mpfr, openssl -, libelf, cpio, elfutils, zstd, python3Minimal, zlib, pahole, kmod, ubootTools +, cpio, elfutils, zstd, python3Minimal, zlib, pahole, kmod, ubootTools , fetchpatch , rustc, rust-bindgen, rustPlatform }: @@ -120,7 +120,7 @@ let moduleBuildDependencies = [ pahole perl - libelf + elfutils # module makefiles often run uname commands to find out the kernel version (buildPackages.deterministic-uname.override { inherit modDirVersion; }) ] @@ -142,13 +142,24 @@ let inherit src; depsBuildBuild = [ buildPackages.stdenv.cc ]; - nativeBuildInputs = [ perl bc nettools openssl rsync gmp libmpc mpfr zstd python3Minimal kmod ] - ++ optional needsUbootTools ubootTools - ++ optional (lib.versionOlder version "5.8") libelf - ++ optionals (lib.versionAtLeast version "4.16") [ bison flex ] - ++ optionals (lib.versionAtLeast version "5.2") [ cpio pahole zlib ] - ++ optional (lib.versionAtLeast version "5.8") elfutils - ++ optionals withRust [ rustc rust-bindgen ]; + nativeBuildInputs = [ + bison + flex + perl + bc + nettools + openssl + rsync + gmp + libmpc + mpfr + elfutils + zstd + python3Minimal + kmod + ] ++ optional needsUbootTools ubootTools + ++ optionals (lib.versionAtLeast version "5.2") [ cpio pahole zlib ] + ++ optionals withRust [ rustc rust-bindgen ]; RUST_LIB_SRC = lib.optionalString withRust rustPlatform.rustLibSrc; @@ -400,9 +411,6 @@ let }; in -assert lib.versionOlder version "5.8" -> libelf != null; -assert lib.versionAtLeast version "5.8" -> elfutils != null; - stdenv.mkDerivation ((drvAttrs config stdenv.hostPlatform.linux-kernel kernelPatches configfile) // { inherit pname version;