yourkit-java: refactored

This commit is contained in:
Guanpeng Xu
2023-12-31 09:04:33 -08:00
parent 7fc8aa0d52
commit 7fcafd3f1e
2 changed files with 39 additions and 9 deletions
@@ -1,11 +1,11 @@
{ fetchzip
, lib
, stdenv
, jdk17
, copyDesktopItems
, makeDesktopItem
, jre
}:
let
jre = jdk17;
vPath = v: lib.elemAt (lib.splitString "-" v) 0;
arch = if stdenv.targetPlatform.system == "x86_64-linux"
@@ -13,31 +13,59 @@ let
else if stdenv.targetPlatform.system == "aarch64-linux"
then "arm64"
else throw "Unsupported system";
desktopItem = makeDesktopItem {
name = "Yourkit JavaProfiler";
exec = "yourkit-java-profiler";
comment = "Award winning, fully featured low overhead profiler for Java EE and Java SE platforms";
desktopName = "YourKit JavaProfiler";
type = "Application";
icon = "yourkit-java-profiler";
terminal = false;
categories = [ "Development" ];
startupWMClass = "yourkit-java-profiler";
startupNotify = false;
};
in
stdenv.mkDerivation rec {
pname = "YourKit-JavaProfiler";
pname = "yourkit-java";
version = "2023.9-b103";
src = fetchzip {
url = "https://download.yourkit.com/yjp/${vPath version}/${pname}-${version}-${arch}.zip";
url = "https://download.yourkit.com/yjp/${vPath version}/YourKit-JavaProfiler-${version}-${arch}.zip";
hash = "sha256-fJk39cQEU924FViCwTcISIyhiwJEviVeqxLiNQifRis=";
};
buildInputs = [ jre ];
nativeBuildInputs = [ copyDesktopItems ];
desktopItems = [ desktopItem ];
installPhase = ''
runHook preInstall
mkdir -p $out
sed -i -e 's|JAVA_EXE="$YD/jre64/bin/java"|JAVA_EXE=${jdk17}/bin/java|' bin/profiler.sh
cp -pr bin lib license.html license-redist.txt probes samples $out
for i in attach integrate profiler; do
mv $out/bin/$i.sh $out/bin/yourkit-java-$i
done
mv $out/bin/profiler.ico $out/bin/yourkit-java-profiler.ico
sed -i -e 's|JAVA_EXE="$YD/jre64/bin/java"|JAVA_EXE=${jre}/bin/java|' \
$out/bin/yourkit-java-profiler
runHook postInstall
'';
meta = with lib; {
homepage = "https://www.yourkit.com";
description = "Award winning, fully featured low overhead profiler for Java EE and Java SE platforms";
homepage = "https://www.yourkit.com";
changelog = "https://www.yourkit.com/changes/";
license = licenses.unfree;
maintainers = with maintainers; [ herberteuler ];
mainProgram = "yourkit-java-profiler";
platforms = platforms.linux;
sourceProvenance = with sourceTypes; [ binaryBytecode ];
maintainers = with maintainers; [ herberteuler ];
};
}
+3 -1
View File
@@ -20451,7 +20451,9 @@ with pkgs;
yodl = callPackage ../development/tools/misc/yodl { };
yourkit-java = callPackage ../development/tools/yourkit-java { };
yourkit-java = callPackage ../development/tools/yourkit-java {
jre = jdk17;
};
yq = python3.pkgs.toPythonApplication python3.pkgs.yq;