2018-04-18 04:01:39 +02:00
|
|
|
|
{ stdenv, fetchzip, lib, makeWrapper, makeDesktopItem, jdk, gtk2, gawk }:
|
2016-08-15 05:45:48 +02:00
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2018-04-18 04:01:39 +02:00
|
|
|
|
version = "1.4";
|
|
|
|
|
name = "visualvm-${version}";
|
2016-08-15 05:45:48 +02:00
|
|
|
|
|
|
|
|
|
src = fetchzip {
|
2018-04-18 04:01:39 +02:00
|
|
|
|
url = "https://github.com/visualvm/visualvm.src/releases/download/${version}/visualvm_${builtins.replaceStrings ["."] [""] version}.zip";
|
|
|
|
|
sha256 = "0qpkal3yc8c8di4dmdglq54a4m7hciqximn5n6hwx2zqnfwx909z";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
|
name = "visualvm";
|
|
|
|
|
exec = "visualvm";
|
|
|
|
|
comment = "Java Troubleshooting Tool";
|
|
|
|
|
desktopName = "VisualVM";
|
|
|
|
|
genericName = "Java Troubleshooting Tool";
|
|
|
|
|
categories = "Application;Development;";
|
2016-08-15 05:45:48 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
|
|
installPhase = ''
|
2018-04-18 04:01:39 +02:00
|
|
|
|
find . -type f -name "*.dll" -o -name "*.exe" -delete;
|
2016-08-15 05:45:48 +02:00
|
|
|
|
|
|
|
|
|
substituteInPlace etc/visualvm.conf \
|
|
|
|
|
--replace "#visualvm_jdkhome=" "visualvm_jdkhome=" \
|
|
|
|
|
--replace "/path/to/jdk" "${jdk.home}" \
|
|
|
|
|
--replace 'visualvm_default_options="' 'visualvm_default_options="--laf com.sun.java.swing.plaf.gtk.GTKLookAndFeel -J-Dawt.useSystemAAFontSettings=lcd -J-Dswing.aatext=true '
|
|
|
|
|
|
2017-08-21 12:25:21 +02:00
|
|
|
|
substituteInPlace platform/lib/nbexec \
|
|
|
|
|
--replace /usr/bin/\''${awk} ${gawk}/bin/awk
|
|
|
|
|
|
2016-08-15 05:45:48 +02:00
|
|
|
|
cp -r . $out
|
|
|
|
|
|
|
|
|
|
# To get the native LAF, JVM needs to see GTK’s .so-s.
|
|
|
|
|
wrapProgram $out/bin/visualvm \
|
2016-09-11 23:24:51 +02:00
|
|
|
|
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ gtk2 ]}"
|
2016-08-15 05:45:48 +02:00
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
|
description = "A visual interface for viewing information about Java applications";
|
|
|
|
|
longDescription = ''
|
|
|
|
|
VisualVM is a visual tool integrating several commandline JDK
|
|
|
|
|
tools and lightweight profiling capabilities. Designed for both
|
|
|
|
|
production and development time use, it further enhances the
|
|
|
|
|
capability of monitoring and performance analysis for the Java
|
|
|
|
|
SE platform.
|
|
|
|
|
'';
|
|
|
|
|
homepage = https://visualvm.java.net/;
|
|
|
|
|
license = licenses.gpl2ClasspathPlus;
|
|
|
|
|
platforms = platforms.all;
|
2018-04-18 04:01:39 +02:00
|
|
|
|
maintainers = with maintainers; [ michalrus moaxcp ];
|
2016-08-15 05:45:48 +02:00
|
|
|
|
};
|
|
|
|
|
}
|