about summary refs log tree commit diff
path: root/pkgs/by-name/pa/pahole/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/pa/pahole/package.nix')
-rw-r--r--pkgs/by-name/pa/pahole/package.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/pkgs/by-name/pa/pahole/package.nix b/pkgs/by-name/pa/pahole/package.nix
new file mode 100644
index 0000000000000..275044ee40c0c
--- /dev/null
+++ b/pkgs/by-name/pa/pahole/package.nix
@@ -0,0 +1,46 @@
+{ lib
+, stdenv
+, fetchzip
+, pkg-config
+, libbpf
+, cmake
+, elfutils
+, zlib
+, argp-standalone
+, musl-obstack
+, nixosTests
+}:
+
+stdenv.mkDerivation rec {
+  pname = "pahole";
+  version = "1.26";
+  src = fetchzip {
+    url = "https://git.kernel.org/pub/scm/devel/pahole/pahole.git/snapshot/pahole-${version}.tar.gz";
+    hash = "sha256-Lf9Z4vHRFplMrUf4VhJ7EDPn+S4RaS1Emm0wyEcG2HU=";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ elfutils zlib libbpf ]
+    ++ lib.optionals stdenv.hostPlatform.isMusl [
+    argp-standalone
+    musl-obstack
+  ];
+
+  patches = [ ./threading-reproducibility.patch ];
+
+  # Put libraries in "lib" subdirectory, not top level of $out
+  cmakeFlags = [ "-D__LIB=lib" "-DLIBBPF_EMBEDDED=OFF" ];
+
+  passthru.tests = {
+    inherit (nixosTests) bpf;
+  };
+
+  meta = with lib; {
+    homepage = "https://git.kernel.org/pub/scm/devel/pahole/pahole.git/";
+    description = "Shows, manipulates, and pretty-prints debugging information in DWARF, CTF, and BTF formats";
+    license = licenses.gpl2Only;
+
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ bosu martinetd ];
+  };
+}