3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #121544 from petabyteboy/feature/bpftools

bpftools: build bpf_asm, bpf_dbg
This commit is contained in:
Austin Seipp 2021-05-03 00:46:37 -05:00 committed by GitHub
commit b3676834ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 40 additions and 31 deletions

View file

@ -1,30 +0,0 @@
{ lib, 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 lib; {
description = "Debugging/program analysis tool for the eBPF subsystem";
license = [ licenses.gpl2 licenses.bsd2 ];
platforms = platforms.linux;
maintainers = with maintainers; [ thoughtpolice ];
};
}

View file

@ -0,0 +1,38 @@
{ 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_helpers_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 ];
};
}

View file

@ -70,6 +70,7 @@ mapAliases ({
bazaarTools = throw "bazaar has been deprecated by breezy."; # added 2020-04-19
beegfs = throw "beegfs has been removed."; # added 2019-11-24
bluezFull = bluez; # Added 2019-12-03
bpftool = bpftools; # Added 2021-05-03
brackets = throw "brackets has been removed, it was unmaintained and had open vulnerabilities"; # added 2021-01-24
bridge_utils = bridge-utils; # added 2015-02-20
bro = zeek; # added 2019-09-29

View file

@ -12558,7 +12558,7 @@ in
libbpf = callPackage ../os-specific/linux/libbpf { };
bpftool = callPackage ../os-specific/linux/bpftool { };
bpftools = callPackage ../os-specific/linux/bpftools { };
bpm-tools = callPackage ../tools/audio/bpm-tools { };