1{ stdenv, fetchzip, lib, makeWrapper, makeDesktopItem, jdk, gawk }:
2
3stdenv.mkDerivation rec {
4 version = "2.1.6";
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-RqQEeYMYpBlqla+VmrxOUNyrlIGVL4YjZadg2Gq+f8k=";
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 longDescription = ''
36 VisualVM is a visual tool integrating several commandline JDK
37 tools and lightweight profiling capabilities. Designed for both
38 production and development time use, it further enhances the
39 capability of monitoring and performance analysis for the Java
40 SE platform.
41 '';
42 homepage = "https://visualvm.github.io";
43 license = licenses.gpl2ClasspathPlus;
44 platforms = platforms.all;
45 maintainers = with maintainers; [ michalrus moaxcp ];
46 };
47}