From 10465d1e16fe8679d3ca7dfbd1013b4629d9bfeb Mon Sep 17 00:00:00 2001 From: 1000teslas <47207223+1000teslas@users.noreply.github.com> Date: Tue, 17 Aug 2021 00:12:38 +1000 Subject: [PATCH 1/4] maintainers: add 1000teslas --- maintainers/maintainer-list.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 0bcaf2e4367b..50e7e618a049 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.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"; From 979d0bbe72c6ba0a9b97cb2a769f5622354dc2f3 Mon Sep 17 00:00:00 2001 From: 1000teslas <47207223+1000teslas@users.noreply.github.com> Date: Tue, 17 Aug 2021 00:14:28 +1000 Subject: [PATCH 2/4] rustc-demangle: init at 0.1.20 --- .../rustc-demangle/add-Cargo.lock.patch | 73 +++++++++++++++++++ .../libraries/rustc-demangle/default.nix | 34 +++++++++ 2 files changed, 107 insertions(+) create mode 100644 pkgs/development/libraries/rustc-demangle/add-Cargo.lock.patch create mode 100644 pkgs/development/libraries/rustc-demangle/default.nix diff --git a/pkgs/development/libraries/rustc-demangle/add-Cargo.lock.patch b/pkgs/development/libraries/rustc-demangle/add-Cargo.lock.patch new file mode 100644 index 000000000000..66e8bead8a26 --- /dev/null +++ b/pkgs/development/libraries/rustc-demangle/add-Cargo.lock.patch @@ -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" diff --git a/pkgs/development/libraries/rustc-demangle/default.nix b/pkgs/development/libraries/rustc-demangle/default.nix new file mode 100644 index 000000000000..be02fedfde71 --- /dev/null +++ b/pkgs/development/libraries/rustc-demangle/default.nix @@ -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 ]; + }; +} From 9533cd493cd728ad726d89cbec1683f0296f4877 Mon Sep 17 00:00:00 2001 From: 1000teslas <47207223+1000teslas@users.noreply.github.com> Date: Tue, 17 Aug 2021 00:15:24 +1000 Subject: [PATCH 3/4] kddockwidgets: init at 1.4.0 --- .../libraries/kddockwidgets/default.nix | 29 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 +++ 2 files changed, 33 insertions(+) create mode 100644 pkgs/development/libraries/kddockwidgets/default.nix diff --git a/pkgs/development/libraries/kddockwidgets/default.nix b/pkgs/development/libraries/kddockwidgets/default.nix new file mode 100644 index 000000000000..b63bdc979c42 --- /dev/null +++ b/pkgs/development/libraries/kddockwidgets/default.nix @@ -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 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index cd2f731315d5..b80f14f87001 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 From cd9582b575884ce2c4b873c56b63316fae5b81d9 Mon Sep 17 00:00:00 2001 From: 1000teslas <47207223+1000teslas@users.noreply.github.com> Date: Tue, 17 Aug 2021 00:18:59 +1000 Subject: [PATCH 4/4] hotspot: add rustc-demangle and zstd support --- .../tools/analysis/hotspot/default.nix | 53 ++++++++++++------- 1 file changed, 34 insertions(+), 19 deletions(-) diff --git a/pkgs/development/tools/analysis/hotspot/default.nix b/pkgs/development/tools/analysis/hotspot/default.nix index 94b440f58c8d..5fede1aee5c5 100644 --- a/pkgs/development/tools/analysis/hotspot/default.nix +++ b/pkgs/development/tools/analysis/hotspot/default.nix @@ -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 ]; };