0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50:33 +03:00

Merge pull request #321078 from philiptaron/issue-271473/linux-kernel

linuxKernel: depend exclusively on elfutils
This commit is contained in:
K900 2024-06-21 18:24:28 +03:00 committed by GitHub
commit d17e2eb025
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 14 deletions

View file

@ -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 ]
;

View file

@ -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;