evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / pa / pahole / package.nix
blobd82c76eb769c9ef0713ab7d03afa8a9c7dae4762
1 { lib
2 , stdenv
3 , fetchzip
4 , pkg-config
5 , libbpf
6 , cmake
7 , elfutils
8 , zlib
9 , argp-standalone
10 , musl-obstack
11 , nixosTests
12 , fetchpatch
15 stdenv.mkDerivation rec {
16   pname = "pahole";
17   version = "1.27";
18   src = fetchzip {
19     url = "https://git.kernel.org/pub/scm/devel/pahole/pahole.git/snapshot/pahole-${version}.tar.gz";
20     hash = "sha256-BwA17lc2yegmOzLfoIu8OmG/PVdc+4sOGzB8Jc4ZjGM=";
21   };
23   nativeBuildInputs = [ cmake pkg-config ];
24   buildInputs = [ elfutils zlib libbpf ]
25     ++ lib.optionals stdenv.hostPlatform.isMusl [
26     argp-standalone
27     musl-obstack
28   ];
30   patches = [
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
34     (fetchpatch {
35       name = "fix-clang-btf-generation-bug.patch";
36       url = "https://github.com/acmel/dwarves/commit/6a2b27c0f512619b0e7a769a18a0fb05bb3789a5.patch";
37       hash = "sha256-Le1BAew/a/QKkYNLgSQxEvZ9mEEglUw8URwz1kiheeE=";
38     })
39     (fetchpatch {
40       name = "fix-clang-btf-generation-bug-2.patch";
41       url = "https://github.com/acmel/dwarves/commit/94a01bde592c555b3eb526aeb4c2ad695c5660d8.patch";
42       hash = "sha256-SMIxLEBjBkprAqVNX1h7nXxAsgbwvCD/Bz7c1ekwg5w=";
43     })
44   ];
46   # Put libraries in "lib" subdirectory, not top level of $out
47   cmakeFlags = [ "-D__LIB=lib" "-DLIBBPF_EMBEDDED=OFF" ];
49   passthru.tests = {
50     inherit (nixosTests) bpf;
51   };
53   meta = with lib; {
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 ];
60   };