From 0f2ae43a811ae645ce05f5b44c949864a328cbdc Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Tue, 19 Sep 2023 20:47:05 +0900 Subject: [PATCH] bpftrace: 0.18.1 -> 0.19.0 - update version - make symlinks relative directly (default postInstall was fixing links anyway, this just makes it so they are correct without fix) - fix shebang on scripts (use store path instead of /usr/bin/env) For some reason patchShebangs didn't work here (should be done automatically in post install fixups as well), use sed directly. --- pkgs/os-specific/linux/bpftrace/default.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/bpftrace/default.nix b/pkgs/os-specific/linux/bpftrace/default.nix index 044d0509b50b..e1fcf832f315 100644 --- a/pkgs/os-specific/linux/bpftrace/default.nix +++ b/pkgs/os-specific/linux/bpftrace/default.nix @@ -9,13 +9,13 @@ stdenv.mkDerivation rec { pname = "bpftrace"; - version = "0.18.1"; + version = "0.19.0"; src = fetchFromGitHub { owner = "iovisor"; repo = "bpftrace"; rev = "v${version}"; - hash = "sha256-hwxArrTdjJoab7Twf57PRmRhghV/9EcjRXI0lKRQC0k="; + hash = "sha256-+aU27mxK4R0SHSsdGQzv02fK0L/m9uCIv7AkLyLSGQY="; }; @@ -44,10 +44,14 @@ stdenv.mkDerivation rec { "-DUSE_SYSTEM_BPF_BCC=ON" ]; + # Pull BPF scripts into $PATH (next to their bcc program equivalents), but do # not move them to keep `${pkgs.bpftrace}/share/bpftrace/tools/...` working. postInstall = '' - ln -s $out/share/bpftrace/tools/*.bt $out/bin/ + ln -sr $out/share/bpftrace/tools/*.bt $out/bin/ + # do not use /usr/bin/env for shipped tools + # If someone can get patchShebangs to work here please fix. + sed -i -e "1s:#!/usr/bin/env bpftrace:#!$out/bin/bpftrace:" $out/share/bpftrace/tools/*.bt ''; outputs = [ "out" "man" ];