bscpkgs/garlic/stages/perf.nix
Rodrigo Arias Mallo c3659d316d Add perf stage
2020-11-03 19:09:58 +01:00

31 lines
429 B
Nix

{
stdenv
, perf
, garlicTools
}:
{
nextStage
, perfOptions
}:
with garlicTools;
let
program = stageProgram nextStage;
in
stdenv.mkDerivation {
name = "perf";
phases = [ "installPhase" ];
preferLocalBuild = true;
dontPatchShebangs = true;
installPhase = ''
cat > $out <<EOF
#!/bin/sh
exec ${perf}/bin/perf ${perfOptions} ${program}
EOF
chmod +x $out
'';
}