1{
2 lib,
3 stdenv,
4 fetchFromGitLab,
5 cmake,
6 extra-cmake-modules,
7 makeBinaryWrapper,
8 zlib,
9 boost,
10 libunwind,
11 elfutils,
12 sparsehash,
13 zstd,
14 qtbase,
15 wrapQtAppsHook,
16 kio,
17 kitemmodels,
18 threadweaver,
19 kconfigwidgets,
20 kcoreaddons,
21 kdiagram,
22}:
23
24stdenv.mkDerivation {
25 pname = "heaptrack";
26 version = "1.5.0-unstable-2025-07-21";
27
28 src = fetchFromGitLab {
29 domain = "invent.kde.org";
30 owner = "sdk";
31 repo = "heaptrack";
32 rev = "9db5d53df554959478575e080648f6854d362faf";
33 hash = "sha256-8NLpp/+PK3wIB5Sx0Z1185DCDQ18zsGj9Wp5YNKgX8E=";
34 };
35
36 nativeBuildInputs = [
37 cmake
38 extra-cmake-modules
39 makeBinaryWrapper
40 wrapQtAppsHook
41 ];
42
43 buildInputs = [
44 zlib
45 boost
46 libunwind
47 sparsehash
48 zstd
49 qtbase
50 kio
51 kitemmodels
52 threadweaver
53 kconfigwidgets
54 kcoreaddons
55 kdiagram
56 ]
57 ++ lib.optionals stdenv.hostPlatform.isLinux [
58 elfutils
59 ];
60
61 postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
62 makeWrapper \
63 $out/Applications/KDE/heaptrack_gui.app/Contents/MacOS/heaptrack_gui \
64 $out/bin/heaptrack_gui
65 '';
66
67 meta = with lib; {
68 description = "Heap memory profiler for Linux";
69 homepage = "https://github.com/KDE/heaptrack";
70 license = licenses.lgpl21Plus;
71 mainProgram = "heaptrack_gui";
72 maintainers = with maintainers; [ ];
73 platforms = platforms.unix;
74 };
75}