summary refs log tree commit diff
path: root/pkgs/os-specific/linux/bpftool/default.nix
blob: 34ddcc3a213f813f029c17ac4a4a0a424deb779c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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 ];
  };
}