1{
2 lib,
3 stdenv,
4 binutils,
5 cmake,
6 extra-cmake-modules,
7 patchelfUnstable,
8 wrapQtAppsHook,
9 elfutils,
10 fetchFromGitHub,
11 kconfigwidgets,
12 kddockwidgets,
13 ki18n,
14 kio,
15 kitemmodels,
16 kitemviews,
17 konsole,
18 kparts,
19 kwindowsystem,
20 libelf,
21 linuxPackages,
22 qtbase,
23 qtsvg,
24 rustc-demangle,
25 syntax-highlighting,
26 threadweaver,
27 zstd,
28}:
29
30stdenv.mkDerivation rec {
31 pname = "hotspot";
32 version = "1.5.1";
33
34 src = fetchFromGitHub {
35 owner = "KDAB";
36 repo = "hotspot";
37 tag = "v${version}";
38 hash = "sha256-O2wp19scyHIwIY2AzKmPmorGXDH249/OhSg+KtzOYhI=";
39 fetchSubmodules = true;
40 };
41
42 nativeBuildInputs = [
43 cmake
44 extra-cmake-modules
45 # stable patchelf corrupts the binary
46 patchelfUnstable
47 wrapQtAppsHook
48 ];
49
50 buildInputs = [
51 (elfutils.override { enableDebuginfod = true; }) # perfparser needs to find debuginfod.h
52 kconfigwidgets
53 kddockwidgets
54 ki18n
55 kio
56 kitemmodels
57 kitemviews
58 konsole
59 kparts
60 kwindowsystem
61 libelf
62 qtbase
63 qtsvg
64 rustc-demangle
65 syntax-highlighting
66 threadweaver
67 zstd
68 ];
69
70 qtWrapperArgs = [
71 "--suffix PATH : ${
72 lib.makeBinPath [
73 linuxPackages.perf
74 binutils
75 ]
76 }"
77 ];
78
79 preFixup = ''
80 patchelf \
81 --add-rpath ${lib.makeLibraryPath [ rustc-demangle ]} \
82 --add-needed librustc_demangle.so \
83 $out/libexec/hotspot-perfparser
84 '';
85
86 meta = with lib; {
87 description = "GUI for Linux perf";
88 mainProgram = "hotspot";
89 longDescription = ''
90 hotspot is a GUI replacement for `perf report`.
91 It takes a perf.data file, parses and evaluates its contents and
92 then displays the result in a graphical way.
93 '';
94 homepage = "https://github.com/KDAB/hotspot";
95 changelog = "https://github.com/KDAB/hotspot/releases/tag/v${version}";
96 license = with licenses; [
97 gpl2Only
98 gpl3Only
99 ];
100 platforms = platforms.linux;
101 maintainers = with maintainers; [ nh2 ];
102 };
103}