about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/cargo-flamegraph/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/tools/cargo-flamegraph/default.nix')
-rw-r--r--nixpkgs/pkgs/development/tools/cargo-flamegraph/default.nix14
1 files changed, 11 insertions, 3 deletions
diff --git a/nixpkgs/pkgs/development/tools/cargo-flamegraph/default.nix b/nixpkgs/pkgs/development/tools/cargo-flamegraph/default.nix
index 442035d0f5f8..26b737f13a7b 100644
--- a/nixpkgs/pkgs/development/tools/cargo-flamegraph/default.nix
+++ b/nixpkgs/pkgs/development/tools/cargo-flamegraph/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, rustPlatform
+{ lib, stdenv, fetchFromGitHub, rustPlatform, makeWrapper, perf
 , Security
 }:
 
@@ -15,11 +15,19 @@ rustPlatform.buildRustPackage rec {
 
   cargoSha256 = "0kmw2n4j5bisac0bv3npbwfz2z00ncd6w8ichwaz5hac5mi1a72f";
 
-  buildInputs = stdenv.lib.optionals stdenv.isDarwin [
+  nativeBuildInputs = lib.optionals stdenv.isLinux [ makeWrapper ];
+  buildInputs = lib.optionals stdenv.isDarwin [
     Security
   ];
 
-  meta = with stdenv.lib; {
+  postFixup = lib.optionalString stdenv.isLinux ''
+    wrapProgram $out/bin/cargo-flamegraph \
+      --suffix PATH ':' ${perf}/bin
+    wrapProgram $out/bin/flamegraph \
+      --suffix PATH ':' ${perf}/bin
+  '';
+
+  meta = with lib; {
     description = "Easy flamegraphs for Rust projects and everything else, without Perl or pipes <3";
     homepage = https://github.com/ferrous-systems/flamegraph;
     license = with licenses; [ asl20 /* or */ mit ];