3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/os-specific/linux/bpftools/default.nix
Harrison Houghton 8997f8cc70 bpftools: fix
At some point the name of the doc-tool script changed and we stopped
patching up the shabang line. The new one is just scripts/bpf_doc.py.
2021-07-02 20:19:32 -04:00

39 lines
981 B
Nix

{ lib, stdenv
, libopcodes, libbfd, libelf, readline
, linuxPackages_latest, zlib
, python3, bison, flex
}:
stdenv.mkDerivation {
pname = "bpftools";
inherit (linuxPackages_latest.kernel) version src;
nativeBuildInputs = [ python3 bison flex ];
buildInputs = [ libopcodes libbfd libelf zlib readline ];
preConfigure = ''
patchShebangs scripts/bpf_doc.py
cd tools/bpf
substituteInPlace ./bpftool/Makefile \
--replace '/usr/local' "$out" \
--replace '/usr' "$out" \
--replace '/sbin' '/bin'
'';
buildFlags = [ "bpftool" "bpf_asm" "bpf_dbg" ];
installPhase = ''
make -C bpftool install
install -Dm755 -t $out/bin bpf_asm
install -Dm755 -t $out/bin bpf_dbg
'';
meta = with lib; {
description = "Debugging/program analysis tools for the eBPF subsystem";
license = [ licenses.gpl2 licenses.bsd2 ];
platforms = platforms.linux;
maintainers = with maintainers; [ thoughtpolice ];
};
}