Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv, fetchFromGitHub, rustPlatform, makeWrapper, perf, nix-update-script 2, Security 3}: 4 5rustPlatform.buildRustPackage rec { 6 pname = "cargo-flamegraph"; 7 version = "0.6.3"; 8 9 src = fetchFromGitHub { 10 owner = "flamegraph-rs"; 11 repo = "flamegraph"; 12 rev = "v${version}"; 13 sha256 = "sha256-npPE9dB7yxIfCxq3NGgI1J6OkDI7qfsusY/dD9w3bp4="; 14 }; 15 16 cargoSha256 = "sha256-m92PT89uTuJWlGAAL/wopHYv7vXaRd3woEW70S7kVUI="; 17 18 nativeBuildInputs = lib.optionals stdenv.isLinux [ makeWrapper ]; 19 buildInputs = lib.optionals stdenv.isDarwin [ 20 Security 21 ]; 22 23 postFixup = lib.optionalString stdenv.isLinux '' 24 wrapProgram $out/bin/cargo-flamegraph \ 25 --set-default PERF ${perf}/bin/perf 26 wrapProgram $out/bin/flamegraph \ 27 --set-default PERF ${perf}/bin/perf 28 ''; 29 30 passthru.updateScript = nix-update-script { }; 31 32 meta = with lib; { 33 description = "Easy flamegraphs for Rust projects and everything else, without Perl or pipes <3"; 34 homepage = "https://github.com/flamegraph-rs/flamegraph"; 35 license = with licenses; [ asl20 /* or */ mit ]; 36 maintainers = with maintainers; [ killercup ]; 37 }; 38}