5 , gsettings-desktop-schemas
22 pVersion = "1.15.0.20231206";
23 pVersionTriple = lib.splitVersion pVersion;
24 majorVersion = lib.elemAt pVersionTriple 0;
25 minorVersion = lib.elemAt pVersionTriple 1;
26 patchVersion = lib.elemAt pVersionTriple 2;
27 baseVersion = "${majorVersion}.${minorVersion}.${patchVersion}";
30 stdenv.mkDerivation rec {
31 pname = "eclipse-mat";
35 url = "http://ftp.halifax.rwth-aachen.de/eclipse//mat/${baseVersion}/rcp/MemoryAnalyzer-${version}-linux.gtk.x86_64.zip";
36 sha256 = "sha256-icmo5zdK0XaH32kXwZUVaQ0VPSGEgvlLr7v7PtdbmCg=";
39 desktopItem = makeDesktopItem {
43 comment = "Eclipse Memory Analyzer";
44 desktopName = "Eclipse MAT";
45 genericName = "Java Memory Analyzer";
46 categories = [ "Development" ];
59 interpreter=$(echo ${stdenv.cc.libc}/lib/ld-linux*.so.2)
60 libCairo=$out/eclipse/libcairo-swt.so
61 patchelf --set-interpreter $interpreter $out/mat/MemoryAnalyzer
62 [ -f $libCairo ] && patchelf --set-rpath ${
63 lib.makeLibraryPath [ freetype fontconfig libX11 libXrender zlib ]
66 # Create wrapper script. Pass -configuration to store settings in ~/.eclipse-mat/<version>
67 makeWrapper $out/mat/MemoryAnalyzer $out/bin/eclipse-mat \
68 --prefix PATH : ${jdk}/bin \
69 --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath ([ glib gtk3 libXtst webkitgtk ])} \
70 --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH" \
71 --add-flags "-configuration \$HOME/.eclipse-mat/''${version}/configuration"
73 # Create desktop item.
74 mkdir -p $out/share/applications
75 cp ${desktopItem}/share/applications/* $out/share/applications
76 mkdir -p $out/share/pixmaps
77 find $out/mat/plugins -name 'eclipse*.png' -type f -exec cp {} $out/share/pixmaps \;
78 mv $out/share/pixmaps/eclipse64.png $out/share/pixmaps/eclipse.png
81 nativeBuildInputs = [ unzip makeWrapper ];
86 gsettings-desktop-schemas
101 description = "Fast and feature-rich Java heap analyzer";
102 mainProgram = "eclipse-mat";
104 The Eclipse Memory Analyzer is a tool that helps you find memory
105 leaks and reduce memory consumption. Use the Memory Analyzer to
106 analyze productive heap dumps with hundreds of millions of
107 objects, quickly calculate the retained sizes of objects, see
108 who is preventing the Garbage Collector from collecting objects,
109 run a report to automatically extract leak suspects.
111 homepage = "https://www.eclipse.org/mat";
112 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
113 license = licenses.epl20;
114 maintainers = [ maintainers.ktor ];
115 platforms = [ "x86_64-linux" ];