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