elfutils: add support for debuginfod

Signed-off-by: Arthur Gautier <baloo@superbaloo.net>
This commit is contained in:
Arthur Gautier 2021-02-09 00:09:25 +00:00 committed by Frederik Rietdijk
parent 4cbfcb3945
commit c600d5232d
1 changed files with 11 additions and 2 deletions

View File

@ -1,6 +1,8 @@
{ lib, stdenv, fetchurl, fetchpatch, pkg-config, autoreconfHook, musl-fts
, musl-obstack, m4, zlib, bzip2, bison, flex, gettext, xz, setupDebugInfoDirs
, argp-standalone }:
, argp-standalone
, enableDebuginfod ? false, sqlite, curl, libmicrohttpd_0_9_70, libarchive
}:
# TODO: Look at the hardcoded paths to kernel, modules etc.
stdenv.mkDerivation rec {
@ -57,12 +59,18 @@ stdenv.mkDerivation rec {
# We need bzip2 in NativeInputs because otherwise we can't unpack the src,
# as the host-bzip2 will be in the path.
nativeBuildInputs = [ m4 bison flex gettext bzip2 ]
++ lib.optional stdenv.hostPlatform.isMusl [ pkg-config autoreconfHook ];
++ lib.optional stdenv.hostPlatform.isMusl [ pkg-config autoreconfHook ]
++ lib.optional enableDebuginfod [ pkg-config ];
buildInputs = [ zlib bzip2 xz ]
++ lib.optional stdenv.hostPlatform.isMusl [
argp-standalone
musl-fts
musl-obstack
] ++ lib.optionals enableDebuginfod [
sqlite
curl
libmicrohttpd_0_9_70
libarchive
];
propagatedNativeBuildInputs = [ setupDebugInfoDirs ];
@ -74,6 +82,7 @@ stdenv.mkDerivation rec {
configureFlags = [
"--program-prefix=eu-" # prevent collisions with binutils
"--enable-deterministic-archives"
] ++ lib.optionals (!enableDebuginfod) [
"--disable-libdebuginfod"
"--disable-debuginfod"
];