@@ -0,0 +1,26 @@
1+{ stdenv, fetchurl
2+, libopcodes, libbfd, libelf
3+, linuxPackages_latest
4+}:
5+
6+stdenv.mkDerivation rec {
7+ pname = "bpftool";
8+ inherit (linuxPackages_latest.kernel) version src;
9+
10+ buildInputs = [ libopcodes libbfd libelf ];
11+
12+ preConfigure = ''
13+ cd tools/bpf/bpftool
14+ substituteInPlace ./Makefile \
15+ --replace '/usr/local' "$out" \
16+ --replace '/usr' "$out" \
17+ --replace '/sbin' '/bin'
18+ '';
19+
20+ meta = with stdenv.lib; {
21+ description = "Debugging/program analysis tool for the eBPF subsystem";
22+ license = [ licenses.gpl2 licenses.bsd2 ];
23+ platforms = platforms.linux;
24+ maintainers = with maintainers; [ thoughtpolice ];
25+ };
26+}