bpftrace: Pull tools into PATH

The *.bt(8) tools are meant to be used as standalone scripts,
their synopsis demonstrates this usage.

Especially under NixOS, calling them via their absoloute path
in interactive shells is a huge pain, however.

Symlink them next to bpftrace(8) itself so they end up in `PATH`
but do not move them to avoid breaking existing setups that expect
them under share/tools/.

This goes in line with our bcc as well as Debian's bpftrace package.

authored by

Klemens Nanni and committed by
Profpatsch
3d54f15c 2c069efa

+10
+10
pkgs/os-specific/linux/bpftrace/default.nix
··· 62 63 # nuke the example/reference output .txt files, for the included tools, 64 # stuffed inside $out. we don't need them at all. 65 postInstall = '' 66 rm -rf $out/share/bpftrace/tools/doc 67 ''; 68 69 outputs = [ "out" "man" ];
··· 62 63 # nuke the example/reference output .txt files, for the included tools, 64 # stuffed inside $out. we don't need them at all. 65 + # (see "Allow skipping examples" for a potential option 66 + # https://github.com/iovisor/bpftrace/pull/2256) 67 + # 68 + # Pull BPF scripts into $PATH (next to their bcc program equivalents), but do 69 + # not move them to keep `${pkgs.bpftrace}/share/bpftrace/tools/...` working. 70 + # (remove `chmod` once a new release "Add executable permission to tools" 71 + # https://github.com/iovisor/bpftrace/commit/77e524e6d276216ed6a6e1984cf204418db07c78) 72 postInstall = '' 73 rm -rf $out/share/bpftrace/tools/doc 74 + 75 + ln -s $out/share/bpftrace/tools/*.bt $out/bin/ 76 + chmod +x $out/bin/*.bt 77 ''; 78 79 outputs = [ "out" "man" ];