depot/pkgs/by-name/as/async-profiler/package.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

46 lines
1.1 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
jdk,
makeWrapper,
}:
stdenv.mkDerivation rec {
pname = "async-profiler";
version = "3.0";
src = fetchFromGitHub {
owner = "jvm-profiling-tools";
repo = "async-profiler";
rev = "v${version}";
hash = "sha256-0CCJoRjRLq4LpiRD0ibzK8So9qSQymePCTYUI60Oy2k=";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ jdk ];
installPhase =
let
ext = stdenv.hostPlatform.extensions.sharedLibrary;
in
''
runHook preInstall
install -D build/bin/asprof "$out/bin/async-profiler"
install -D build/lib/libasyncProfiler${ext} "$out/lib/libasyncProfiler${ext}"
runHook postInstall
'';
fixupPhase = ''
wrapProgram $out/bin/async-profiler --prefix PATH : ${lib.makeBinPath [ jdk ]}
'';
meta = with lib; {
description = "Low overhead sampling profiler for Java that does not suffer from Safepoint bias problem";
homepage = "https://github.com/jvm-profiling-tools/async-profiler";
license = licenses.asl20;
maintainers = with maintainers; [ mschuwalow ];
platforms = platforms.all;
mainProgram = "async-profiler";
};
}