1{ stdenv, fetchzip, lib, makeWrapper, makeDesktopItem, jdk, gawk }:
2
3stdenv.mkDerivation rec {
4 version = "2.1.8";
5 pname = "visualvm";
6
7 src = fetchzip {
8 url = "https://github.com/visualvm/visualvm.src/releases/download/${version}/visualvm_${builtins.replaceStrings ["."] [""] version}.zip";
9 sha256 = "sha256-yWSB8mqcOG7xd4/8YjPXzGvl7BgyOLdIoyAs69+/kv4=";
10 };
11
12 desktopItem = makeDesktopItem {
13 name = "visualvm";
14 exec = "visualvm";
15 comment = "Java Troubleshooting Tool";
16 desktopName = "VisualVM";
17 genericName = "Java Troubleshooting Tool";
18 categories = [ "Development" ];
19 };
20
21 nativeBuildInputs = [ makeWrapper ];
22
23 installPhase = ''
24 find . -type f -name "*.dll" -o -name "*.exe" -delete;
25
26 substituteInPlace etc/visualvm.conf \
27 --replace "#visualvm_jdkhome=" "visualvm_jdkhome=" \
28 --replace "/path/to/jdk" "${jdk.home}" \
29
30 cp -r . $out
31 '';
32
33 meta = with lib; {
34 description = "A visual interface for viewing information about Java applications";
35 mainProgram = "visualvm";
36 longDescription = ''
37 VisualVM is a visual tool integrating several commandline JDK
38 tools and lightweight profiling capabilities. Designed for both
39 production and development time use, it further enhances the
40 capability of monitoring and performance analysis for the Java
41 SE platform.
42 '';
43 homepage = "https://visualvm.github.io";
44 license = licenses.gpl2ClasspathPlus;
45 platforms = platforms.all;
46 maintainers = with maintainers; [ michalrus moaxcp ];
47 };
48}