2021-02-22 00:15:59 +00:00
|
|
|
{ fetchurl
|
2020-06-28 01:17:49 +00:00
|
|
|
, fontconfig
|
|
|
|
, freetype
|
|
|
|
, glib
|
|
|
|
, gsettings-desktop-schemas
|
|
|
|
, gtk3
|
|
|
|
, jdk11
|
|
|
|
, lib
|
|
|
|
, libX11
|
|
|
|
, libXrender
|
|
|
|
, libXtst
|
|
|
|
, makeDesktopItem
|
|
|
|
, makeWrapper
|
|
|
|
, shared-mime-info
|
|
|
|
, stdenv
|
|
|
|
, unzip
|
|
|
|
, webkitgtk
|
|
|
|
, zlib
|
|
|
|
}:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
let
|
2022-07-07 11:31:23 +00:00
|
|
|
pVersion = "1.13.0.20220615";
|
2020-06-28 01:17:49 +00:00
|
|
|
pVersionTriple = splitVersion pVersion;
|
|
|
|
majorVersion = elemAt pVersionTriple 0;
|
|
|
|
minorVersion = elemAt pVersionTriple 1;
|
|
|
|
patchVersion = elemAt pVersionTriple 2;
|
|
|
|
baseVersion = "${majorVersion}.${minorVersion}.${patchVersion}";
|
|
|
|
jdk = jdk11;
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "eclipse-mat";
|
2020-11-01 22:39:49 +00:00
|
|
|
version = pVersion;
|
2020-06-28 01:17:49 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://ftp.halifax.rwth-aachen.de/eclipse//mat/${baseVersion}/rcp/MemoryAnalyzer-${version}-linux.gtk.x86_64.zip";
|
2022-07-07 11:31:23 +00:00
|
|
|
sha256 = "sha256-LwtP76kb9xgdcsWCSCXeRbhFVyFS3xkl15F075Cq4Os=";
|
2020-06-28 01:17:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "eclipse-mat";
|
|
|
|
exec = "eclipse-mat";
|
|
|
|
icon = "eclipse";
|
|
|
|
comment = "Eclipse Memory Analyzer";
|
|
|
|
desktopName = "Eclipse MAT";
|
|
|
|
genericName = "Java Memory Analyzer";
|
2022-02-22 14:56:15 +00:00
|
|
|
categories = [ "Development" ];
|
2020-06-28 01:17:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
unpackPhase = ''
|
|
|
|
unzip $src
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildCommand = ''
|
|
|
|
mkdir -p $out
|
|
|
|
unzip $src
|
|
|
|
mv mat $out
|
|
|
|
|
|
|
|
# Patch binaries.
|
2022-05-10 21:52:26 +00:00
|
|
|
interpreter=$(echo ${stdenv.cc.libc}/lib/ld-linux*.so.2)
|
2020-06-28 01:17:49 +00:00
|
|
|
libCairo=$out/eclipse/libcairo-swt.so
|
|
|
|
patchelf --set-interpreter $interpreter $out/mat/MemoryAnalyzer
|
|
|
|
[ -f $libCairo ] && patchelf --set-rpath ${
|
2021-01-23 12:26:19 +00:00
|
|
|
lib.makeLibraryPath [ freetype fontconfig libX11 libXrender zlib ]
|
2020-06-28 01:17:49 +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-01-23 12:26:19 +00:00
|
|
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath ([ glib gtk3 libXtst webkitgtk ])} \
|
2020-06-28 01:17:49 +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-08-15 03:40:21 +00:00
|
|
|
nativeBuildInputs = [ unzip makeWrapper ];
|
2020-06-28 01:17:49 +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-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-06-28 01:17:49 +00:00
|
|
|
description = "Fast and feature-rich Java heap analyzer";
|
|
|
|
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-09 23:42:40 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2020-06-28 01:17:49 +00:00
|
|
|
license = licenses.epl20;
|
|
|
|
maintainers = [ maintainers.ktor ];
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|