at 24.05-pre 44 lines 1.4 kB view raw
1{ lib, stdenv, fetchFromGitHub, jdk, makeWrapper }: 2 3stdenv.mkDerivation rec { 4 pname = "async-profiler"; 5 version = "2.9"; 6 7 src = fetchFromGitHub { 8 owner = "jvm-profiling-tools"; 9 repo = "async-profiler"; 10 rev = "v${version}"; 11 sha256 = "sha256-ngLUg6Fq6Ay06klGa/y8lod8W6rYMqhMhXFn5OBCSpk="; 12 }; 13 14 nativeBuildInputs = [ makeWrapper ]; 15 16 buildInputs = [ jdk ]; 17 18 installPhase = '' 19 runHook preInstall 20 install -D "$src/profiler.sh" "$out/bin/async-profiler" 21 install -D build/jattach "$out/bin/jattach" 22 install -D build/libasyncProfiler.so "$out/lib/libasyncProfiler.so" 23 install -D -t "$out/share/java/" build/*.jar 24 runHook postInstall 25 ''; 26 27 fixupPhase = '' 28 substituteInPlace $out/bin/async-profiler \ 29 --replace 'JATTACH=$SCRIPT_DIR/build/jattach' \ 30 'JATTACH=${placeholder "out"}/bin/jattach' \ 31 --replace 'PROFILER=$SCRIPT_DIR/build/libasyncProfiler.so' \ 32 'PROFILER=${placeholder "out"}/lib/libasyncProfiler.so' 33 34 wrapProgram $out/bin/async-profiler --prefix PATH : ${lib.makeBinPath [ jdk ]} 35 ''; 36 37 meta = with lib; { 38 description = "A low overhead sampling profiler for Java that does not suffer from Safepoint bias problem"; 39 homepage = "https://github.com/jvm-profiling-tools/async-profiler"; 40 license = licenses.asl20; 41 maintainers = with maintainers; [ mschuwalow ]; 42 platforms = platforms.all; 43 }; 44}