15 stdenv.mkDerivation rec {
19 url = "https://git.kernel.org/pub/scm/devel/pahole/pahole.git/snapshot/pahole-${version}.tar.gz";
20 hash = "sha256-BwA17lc2yegmOzLfoIu8OmG/PVdc+4sOGzB8Jc4ZjGM=";
23 nativeBuildInputs = [ cmake pkg-config ];
24 buildInputs = [ elfutils zlib libbpf ]
25 ++ lib.optionals stdenv.hostPlatform.isMusl [
31 # https://github.com/acmel/dwarves/pull/51 / https://lkml.kernel.org/r/20240626032253.3406460-1-asmadeus@codewreck.org
32 ./threading-reproducibility.patch
33 # https://github.com/acmel/dwarves/issues/53
35 name = "fix-clang-btf-generation-bug.patch";
36 url = "https://github.com/acmel/dwarves/commit/6a2b27c0f512619b0e7a769a18a0fb05bb3789a5.patch";
37 hash = "sha256-Le1BAew/a/QKkYNLgSQxEvZ9mEEglUw8URwz1kiheeE=";
40 name = "fix-clang-btf-generation-bug-2.patch";
41 url = "https://github.com/acmel/dwarves/commit/94a01bde592c555b3eb526aeb4c2ad695c5660d8.patch";
42 hash = "sha256-SMIxLEBjBkprAqVNX1h7nXxAsgbwvCD/Bz7c1ekwg5w=";
46 # Put libraries in "lib" subdirectory, not top level of $out
47 cmakeFlags = [ "-D__LIB=lib" "-DLIBBPF_EMBEDDED=OFF" ];
50 inherit (nixosTests) bpf;
54 homepage = "https://git.kernel.org/pub/scm/devel/pahole/pahole.git/";
55 description = "Shows, manipulates, and pretty-prints debugging information in DWARF, CTF, and BTF formats";
56 license = licenses.gpl2Only;
58 platforms = platforms.linux;
59 maintainers = with maintainers; [ bosu martinetd ];