Merge pull request #133655 from 1000teslas/rust-demangle-hotspot

hotspot: add rust demangling support (merge with next hotspot release)
launchpad/nixpkgs/master
Niklas Hambüchen 3 years ago committed by GitHub
commit b13b65b241
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      maintainers/maintainer-list.nix
  2. 29
      pkgs/development/libraries/kddockwidgets/default.nix
  3. 73
      pkgs/development/libraries/rustc-demangle/add-Cargo.lock.patch
  4. 34
      pkgs/development/libraries/rustc-demangle/default.nix
  5. 53
      pkgs/development/tools/analysis/hotspot/default.nix
  6. 4
      pkgs/top-level/all-packages.nix

@ -80,6 +80,12 @@
githubId = 791309;
name = "Jan Hrnko";
};
_1000teslas = {
name = "Kevin Tran";
email = "47207223+1000teslas@users.noreply.github.com";
github = "1000teslas";
githubId = 47207223;
};
_3699n = {
email = "nicholas@nvk.pm";
github = "3699n";

@ -0,0 +1,29 @@
{ lib
, mkDerivation
, fetchFromGitHub
, cmake
, qtbase
, qtx11extras
}:
mkDerivation rec {
pname = "KDDockWidgets";
version = "1.4.0";
src = fetchFromGitHub {
owner = "KDAB";
repo = pname;
rev = "v${version}";
sha256 = "sha256-lgNRuRoJhBw0n/Hb58uxpa+4aXoOrK4bRldtIXYIKLI=";
};
nativeBuildInputs = [ cmake ];
buildInputs = [ qtbase qtx11extras ];
meta = with lib; {
description = "KDAB's Dock Widget Framework for Qt";
homepage = "https://www.kdab.com/development-resources/qt-tools/kddockwidgets";
license = with licenses; [ gpl2Only gpl3Only ];
maintainers = with maintainers; [ _1000teslas ];
};
}

@ -0,0 +1,73 @@
diff --git a/Cargo.lock b/Cargo.lock
new file mode 100644
index 0000000..0268b3b
--- /dev/null
+++ b/Cargo.lock
@@ -0,0 +1,67 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 3
+
+[[package]]
+name = "arbitrary"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "237430fd6ed3740afe94eefcc278ae21e050285be882804e0d6e8695f0c94691"
+
+[[package]]
+name = "cc"
+version = "1.0.69"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2"
+
+[[package]]
+name = "compiler_builtins"
+version = "0.1.49"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "20b1438ef42c655665a8ab2c1c6d605a305f031d38d9be689ddfef41a20f3aa2"
+
+[[package]]
+name = "libfuzzer-sys"
+version = "0.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "36a9a84a6e8b55dfefb04235e55edb2b9a2a18488fcae777a6bdaa6f06f1deb3"
+dependencies = [
+ "arbitrary",
+ "cc",
+ "once_cell",
+]
+
+[[package]]
+name = "once_cell"
+version = "1.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56"
+
+[[package]]
+name = "rustc-demangle"
+version = "0.1.20"
+dependencies = [
+ "compiler_builtins",
+ "rustc-std-workspace-core",
+]
+
+[[package]]
+name = "rustc-demangle-capi"
+version = "0.1.0"
+dependencies = [
+ "rustc-demangle",
+]
+
+[[package]]
+name = "rustc-demangle-fuzz"
+version = "0.0.0"
+dependencies = [
+ "libfuzzer-sys",
+ "rustc-demangle",
+]
+
+[[package]]
+name = "rustc-std-workspace-core"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1956f5517128a2b6f23ab2dadf1a976f4f5b27962e7724c2bf3d45e539ec098c"

@ -0,0 +1,34 @@
{ rustPlatform, fetchFromGitHub, rust, lib, stdenv }:
rustPlatform.buildRustPackage rec {
pname = "rustc-demangle";
version = "0.1.20";
src = fetchFromGitHub {
owner = "alexcrichton";
repo = pname;
rev = version;
sha256 = "sha256-elxclyuLmr3N66s+pR4/6OU98k1oXI2wKVJtzWPY8FI=";
};
cargoPatches = [
# generated using `cargo generate-lockfile` since repo is missing lockfile
./add-Cargo.lock.patch
];
cargoSha256 = "sha256-1tW5TOap5MstxTXAFij3IB8TIpI+FryEX9TXlVXjRl4=";
cargoBuildFlags = "-p rustc-demangle-capi";
postInstall = ''
mkdir -p $out/lib
cp target/${rust.toRustTargetSpec stdenv.hostPlatform}/release/librustc_demangle.so $out/lib
cp -R crates/capi/include $out
'';
meta = with lib; {
description = "Rust symbol demangling";
homepage = "https://github.com/alexcrichton/rustc-demangle";
license = with licenses; [ asl20 mit ];
# upstream supports other platforms, but maintainer can only test on linux
platforms = platforms.linux;
maintainers = with maintainers; [ _1000teslas ];
};
}

@ -1,18 +1,22 @@
{ lib,
mkDerivation,
cmake,
elfutils,
extra-cmake-modules,
fetchFromGitHub,
kconfigwidgets,
ki18n,
kio,
kitemmodels,
kitemviews,
kwindowsystem,
libelf,
qtbase,
threadweaver,
{ lib
, mkDerivation
, cmake
, elfutils
, extra-cmake-modules
, fetchFromGitHub
, kconfigwidgets
, ki18n
, kio
, kitemmodels
, kitemviews
, kwindowsystem
, libelf
, qtbase
, threadweaver
, qtx11extras
, zstd
, kddockwidgets
, rustc-demangle
}:
mkDerivation rec {
@ -27,10 +31,12 @@ mkDerivation rec {
fetchSubmodules = true;
};
nativeBuildInputs = [ cmake ];
nativeBuildInputs = [
cmake
extra-cmake-modules
];
buildInputs = [
elfutils
extra-cmake-modules
kconfigwidgets
ki18n
kio
@ -40,6 +46,10 @@ mkDerivation rec {
libelf
qtbase
threadweaver
qtx11extras
zstd
kddockwidgets
rustc-demangle
];
# hotspot checks for the presence of third party libraries'
@ -47,9 +57,14 @@ mkDerivation rec {
# submodules; but Nix clones them and removes .git (for reproducibility).
# So we need to fake their existence here.
postPatch = ''
mkdir -p 3rdparty/perfparser/.git
mkdir -p 3rdparty/{perfparser,PrefixTickLabels}/.git
'';
cmakeFlags = [
"-DRUSTC_DEMANGLE_INCLUDE_DIR=${rustc-demangle}/include"
"-DRUSTC_DEMANGLE_LIBRARY=${rustc-demangle}/lib/librustc_demangle.so"
];
meta = {
description = "A GUI for Linux perf";
longDescription = ''
@ -58,7 +73,7 @@ mkDerivation rec {
then displays the result in a graphical way.
'';
homepage = "https://github.com/KDAB/hotspot";
license = with lib.licenses; [ gpl2 gpl3 ];
license = with lib.licenses; [ gpl2Only gpl3Only ];
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ nh2 ];
};

@ -16328,6 +16328,8 @@ with pkgs;
judy = callPackage ../development/libraries/judy { };
kddockwidgets = libsForQt5.callPackage ../development/libraries/kddockwidgets { };
keybinder = callPackage ../development/libraries/keybinder {
automake = automake111x;
lua = lua5_1;
@ -18551,6 +18553,8 @@ with pkgs;
rubberband = callPackage ../development/libraries/rubberband { };
rustc-demangle = callPackage ../development/libraries/rustc-demangle { };
s2geometry = callPackage ../development/libraries/s2geometry { };
/* This package references ghc844, which we no longer have. Unfortunately, I

Loading…
Cancel
Save