about summary refs log tree commit diff
path: root/nixpkgs/pkgs/os-specific/linux/bpftool
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/os-specific/linux/bpftool')
-rw-r--r--nixpkgs/pkgs/os-specific/linux/bpftool/default.nix30
1 files changed, 30 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/os-specific/linux/bpftool/default.nix b/nixpkgs/pkgs/os-specific/linux/bpftool/default.nix
new file mode 100644
index 000000000000..34ddcc3a213f
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/bpftool/default.nix
@@ -0,0 +1,30 @@
+{ stdenv
+, libopcodes, libbfd, libelf
+, linuxPackages_latest, zlib
+, python3
+}:
+
+stdenv.mkDerivation {
+  pname = "bpftool";
+  inherit (linuxPackages_latest.kernel) version src;
+
+  nativeBuildInputs = [ python3 ];
+  buildInputs = [ libopcodes libbfd libelf zlib ];
+
+  preConfigure = ''
+    patchShebangs scripts/bpf_helpers_doc.py
+
+    cd tools/bpf/bpftool
+    substituteInPlace ./Makefile \
+      --replace '/usr/local' "$out" \
+      --replace '/usr'       "$out" \
+      --replace '/sbin'      '/bin'
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Debugging/program analysis tool for the eBPF subsystem";
+    license     = [ licenses.gpl2 licenses.bsd2 ];
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ thoughtpolice ];
+  };
+}