2021-02-24 18:30:23 +00:00
|
|
|
{ fetchurl
|
2020-07-18 16:06:22 +00:00
|
|
|
, fontconfig
|
|
|
|
, freetype
|
|
|
|
, glib
|
|
|
|
, gsettings-desktop-schemas
|
|
|
|
, gtk3
|
2024-01-13 08:15:51 +00:00
|
|
|
, jdk17
|
2020-07-18 16:06:22 +00:00
|
|
|
, lib
|
|
|
|
, libX11
|
|
|
|
, libXrender
|
|
|
|
, libXtst
|
|
|
|
, makeDesktopItem
|
|
|
|
, makeWrapper
|
|
|
|
, shared-mime-info
|
|
|
|
, stdenv
|
|
|
|
, unzip
|
|
|
|
, webkitgtk
|
|
|
|
, zlib
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2024-04-21 15:54:59 +00:00
|
|
|
pVersion = "1.15.0.20231206";
|
2023-02-02 18:25:31 +00:00
|
|
|
pVersionTriple = lib.splitVersion pVersion;
|
|
|
|
majorVersion = lib.elemAt pVersionTriple 0;
|
|
|
|
minorVersion = lib.elemAt pVersionTriple 1;
|
|
|
|
patchVersion = lib.elemAt pVersionTriple 2;
|
2020-07-18 16:06:22 +00:00
|
|
|
baseVersion = "${majorVersion}.${minorVersion}.${patchVersion}";
|
2024-01-13 08:15:51 +00:00
|
|
|
jdk = jdk17;
|
2020-07-18 16:06:22 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "eclipse-mat";
|
2020-11-03 02:18:15 +00:00
|
|
|
version = pVersion;
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://ftp.halifax.rwth-aachen.de/eclipse//mat/${baseVersion}/rcp/MemoryAnalyzer-${version}-linux.gtk.x86_64.zip";
|
2024-04-21 15:54:59 +00:00
|
|
|
sha256 = "sha256-icmo5zdK0XaH32kXwZUVaQ0VPSGEgvlLr7v7PtdbmCg=";
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "eclipse-mat";
|
|
|
|
exec = "eclipse-mat";
|
|
|
|
icon = "eclipse";
|
|
|
|
comment = "Eclipse Memory Analyzer";
|
|
|
|
desktopName = "Eclipse MAT";
|
|
|
|
genericName = "Java Memory Analyzer";
|
2022-03-05 16:20:37 +00:00
|
|
|
categories = [ "Development" ];
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
unpackPhase = ''
|
|
|
|
unzip $src
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildCommand = ''
|
|
|
|
mkdir -p $out
|
|
|
|
unzip $src
|
|
|
|
mv mat $out
|
|
|
|
|
|
|
|
# Patch binaries.
|
2022-06-16 17:23:12 +00:00
|
|
|
interpreter=$(echo ${stdenv.cc.libc}/lib/ld-linux*.so.2)
|
2020-07-18 16:06:22 +00:00
|
|
|
libCairo=$out/eclipse/libcairo-swt.so
|
|
|
|
patchelf --set-interpreter $interpreter $out/mat/MemoryAnalyzer
|
|
|
|
[ -f $libCairo ] && patchelf --set-rpath ${
|
2021-02-05 17:12:51 +00:00
|
|
|
lib.makeLibraryPath [ freetype fontconfig libX11 libXrender zlib ]
|
2020-07-18 16:06:22 +00:00
|
|
|
} $libCairo
|
|
|
|
|
|
|
|
# Create wrapper script. Pass -configuration to store settings in ~/.eclipse-mat/<version>
|
|
|
|
makeWrapper $out/mat/MemoryAnalyzer $out/bin/eclipse-mat \
|
|
|
|
--prefix PATH : ${jdk}/bin \
|
2021-02-05 17:12:51 +00:00
|
|
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath ([ glib gtk3 libXtst webkitgtk ])} \
|
2020-07-18 16:06:22 +00:00
|
|
|
--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH" \
|
|
|
|
--add-flags "-configuration \$HOME/.eclipse-mat/''${version}/configuration"
|
|
|
|
|
|
|
|
# Create desktop item.
|
|
|
|
mkdir -p $out/share/applications
|
|
|
|
cp ${desktopItem}/share/applications/* $out/share/applications
|
|
|
|
mkdir -p $out/share/pixmaps
|
|
|
|
find $out/mat/plugins -name 'eclipse*.png' -type f -exec cp {} $out/share/pixmaps \;
|
|
|
|
mv $out/share/pixmaps/eclipse64.png $out/share/pixmaps/eclipse.png
|
|
|
|
'';
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
nativeBuildInputs = [ unzip makeWrapper ];
|
2020-07-18 16:06:22 +00:00
|
|
|
buildInputs = [
|
|
|
|
fontconfig
|
|
|
|
freetype
|
|
|
|
glib
|
|
|
|
gsettings-desktop-schemas
|
|
|
|
gtk3
|
|
|
|
jdk
|
|
|
|
libX11
|
|
|
|
libXrender
|
|
|
|
libXtst
|
|
|
|
zlib
|
|
|
|
shared-mime-info
|
|
|
|
webkitgtk
|
|
|
|
];
|
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
dontConfigure = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-07-18 16:06:22 +00:00
|
|
|
description = "Fast and feature-rich Java heap analyzer";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "eclipse-mat";
|
2020-07-18 16:06:22 +00:00
|
|
|
longDescription = ''
|
|
|
|
The Eclipse Memory Analyzer is a tool that helps you find memory
|
|
|
|
leaks and reduce memory consumption. Use the Memory Analyzer to
|
|
|
|
analyze productive heap dumps with hundreds of millions of
|
|
|
|
objects, quickly calculate the retained sizes of objects, see
|
|
|
|
who is preventing the Garbage Collector from collecting objects,
|
|
|
|
run a report to automatically extract leak suspects.
|
|
|
|
'';
|
|
|
|
homepage = "https://www.eclipse.org/mat";
|
2022-06-26 10:26:21 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2020-07-18 16:06:22 +00:00
|
|
|
license = licenses.epl20;
|
|
|
|
maintainers = [ maintainers.ktor ];
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|