depot/third_party/nixpkgs/pkgs/development/tools/analysis/hotspot/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

102 lines
2.2 KiB
Nix

{ lib
, stdenv
, binutils
, cmake
, extra-cmake-modules
, patchelfUnstable
, wrapQtAppsHook
, elfutils
, fetchFromGitHub
, fetchpatch
, kconfigwidgets
, kddockwidgets
, ki18n
, kio
, kitemmodels
, kitemviews
, kparts
, kwindowsystem
, libelf
, linuxPackages
, qtbase
, qtsvg
, rustc-demangle
, syntax-highlighting
, threadweaver
, zstd
}:
stdenv.mkDerivation rec {
pname = "hotspot";
version = "1.5.0";
src = fetchFromGitHub {
owner = "KDAB";
repo = "hotspot";
rev = "refs/tags/v${version}";
hash = "sha256-FJkDPWqNwoWg/15tvMnwke7PVtWVuqT0gtJBFQE0qZ4=";
fetchSubmodules = true;
};
patches = [
# Backport stuck UI bug fix
# FIXME: remove in next update
(fetchpatch {
url = "https://github.com/KDAB/hotspot/commit/7639dee8617dba9b88182c7ff4887e8d3714ac98.patch";
hash = "sha256-aAo9uEy+MBztMhnC5jB08moZBeRCENU22R39pqSBXOY=";
})
];
nativeBuildInputs = [
cmake
extra-cmake-modules
# stable patchelf corrupts the binary
patchelfUnstable
wrapQtAppsHook
];
buildInputs = [
(elfutils.override { enableDebuginfod = true; }) # perfparser needs to find debuginfod.h
kconfigwidgets
kddockwidgets
ki18n
kio
kitemmodels
kitemviews
kparts
kwindowsystem
libelf
qtbase
qtsvg
rustc-demangle
syntax-highlighting
threadweaver
zstd
];
qtWrapperArgs = [
"--suffix PATH : ${lib.makeBinPath [ linuxPackages.perf binutils ]}"
];
preFixup = ''
patchelf \
--add-rpath ${lib.makeLibraryPath [ rustc-demangle ]} \
--add-needed librustc_demangle.so \
$out/libexec/hotspot-perfparser
'';
meta = with lib; {
description = "GUI for Linux perf";
mainProgram = "hotspot";
longDescription = ''
hotspot is a GUI replacement for `perf report`.
It takes a perf.data file, parses and evaluates its contents and
then displays the result in a graphical way.
'';
homepage = "https://github.com/KDAB/hotspot";
changelog = "https://github.com/KDAB/hotspot/releases/tag/v${version}";
license = with licenses; [ gpl2Only gpl3Only ];
platforms = platforms.linux;
maintainers = with maintainers; [ nh2 ];
};
}