base16-schemes: unstable-2024-06-21 -> unstable-2024-11-12
[NixPkgs.git] / pkgs / by-name / as / async-profiler / package.nix
blobe82ebcd62f22de3a65d0cf936cdf7f8605d7fa0f
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   jdk,
6   makeWrapper,
7 }:
8 stdenv.mkDerivation rec {
9   pname = "async-profiler";
10   version = "3.0";
12   src = fetchFromGitHub {
13     owner = "jvm-profiling-tools";
14     repo = "async-profiler";
15     rev = "v${version}";
16     hash = "sha256-0CCJoRjRLq4LpiRD0ibzK8So9qSQymePCTYUI60Oy2k=";
17   };
19   nativeBuildInputs = [ makeWrapper ];
21   buildInputs = [ jdk ];
23   installPhase =
24     let
25       ext = stdenv.hostPlatform.extensions.sharedLibrary;
26     in
27     ''
28       runHook preInstall
29       install -D build/bin/asprof "$out/bin/async-profiler"
30       install -D build/lib/libasyncProfiler${ext} "$out/lib/libasyncProfiler${ext}"
31       runHook postInstall
32     '';
34   fixupPhase = ''
35     wrapProgram $out/bin/async-profiler --prefix PATH : ${lib.makeBinPath [ jdk ]}
36   '';
38   meta = with lib; {
39     description = "Low overhead sampling profiler for Java that does not suffer from Safepoint bias problem";
40     homepage = "https://github.com/jvm-profiling-tools/async-profiler";
41     license = licenses.asl20;
42     maintainers = with maintainers; [ mschuwalow ];
43     platforms = platforms.all;
44     mainProgram = "async-profiler";
45   };