1{ stdenv, fetchzip, lib, makeWrapper, makeDesktopItem, jdk, gawk }:
2
3stdenv.mkDerivation rec {
4 version = "2.0.4";
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 = "1ic6gjsw90j7pr1yyplmk1zc319ld49i6d4zlgs7mlz1m4bn5jv3";
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 substituteInPlace platform/lib/nbexec \
31 --replace /usr/bin/\''${awk} ${gawk}/bin/awk
32
33 cp -r . $out
34 '';
35
36 meta = with stdenv.lib; {
37 description = "A visual interface for viewing information about Java applications";
38 longDescription = ''
39 VisualVM is a visual tool integrating several commandline JDK
40 tools and lightweight profiling capabilities. Designed for both
41 production and development time use, it further enhances the
42 capability of monitoring and performance analysis for the Java
43 SE platform.
44 '';
45 homepage = "https://visualvm.github.io";
46 license = licenses.gpl2ClasspathPlus;
47 platforms = platforms.all;
48 maintainers = with maintainers; [ michalrus moaxcp ];
49 };
50}