1{ stdenv, fetchzip, lib, makeWrapper, jdk, gtk }:
2
3stdenv.mkDerivation rec {
4 name = "visualvm-1.3.8";
5
6 src = fetchzip {
7 url = "https://java.net/projects/visualvm/downloads/download/release138/visualvm_138.zip";
8 sha256 = "09wsi85z1g7bwyfhb37vw0gy3wl0j1cy35aj59rg7067q262gy1y";
9 };
10
11 nativeBuildInputs = [ makeWrapper ];
12
13 installPhase = ''
14 rm bin/visualvm.exe
15
16 substituteInPlace etc/visualvm.conf \
17 --replace "#visualvm_jdkhome=" "visualvm_jdkhome=" \
18 --replace "/path/to/jdk" "${jdk.home}" \
19 --replace 'visualvm_default_options="' 'visualvm_default_options="--laf com.sun.java.swing.plaf.gtk.GTKLookAndFeel -J-Dawt.useSystemAAFontSettings=lcd -J-Dswing.aatext=true '
20
21 cp -r . $out
22
23 # To get the native LAF, JVM needs to see GTK’s .so-s.
24 wrapProgram $out/bin/visualvm \
25 --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ gtk ]}"
26 '';
27
28 meta = with stdenv.lib; {
29 description = "A visual interface for viewing information about Java applications";
30 longDescription = ''
31 VisualVM is a visual tool integrating several commandline JDK
32 tools and lightweight profiling capabilities. Designed for both
33 production and development time use, it further enhances the
34 capability of monitoring and performance analysis for the Java
35 SE platform.
36 '';
37 homepage = https://visualvm.java.net/;
38 license = licenses.gpl2ClasspathPlus;
39 platforms = platforms.all;
40 maintainers = with maintainers; [ michalrus ];
41 };
42}