2021-12-20 02:04:22 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
2024-03-26 04:20:00 +00:00
|
|
|
, installShellFiles
|
2021-12-20 02:04:22 +00:00
|
|
|
, rustPlatform
|
|
|
|
, protobuf
|
2024-07-10 11:52:28 +00:00
|
|
|
, stdenv
|
2021-12-20 02:04:22 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "tokio-console";
|
2024-10-25 05:44:06 +00:00
|
|
|
version = "0.1.13";
|
2021-12-20 02:04:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tokio-rs";
|
|
|
|
repo = "console";
|
|
|
|
rev = "tokio-console-v${version}";
|
2024-10-25 05:44:06 +00:00
|
|
|
hash = "sha256-KqX+s1oQIRyqAP+0iGrZiT8lB+cGviY1vtHaXy5Q6TA=";
|
2021-12-20 02:04:22 +00:00
|
|
|
};
|
|
|
|
|
2024-10-25 05:44:06 +00:00
|
|
|
cargoHash = "sha256-QJdTysoVIbeLsTMt62Q355S8zx8tNCikZAyeRs7cz4o=";
|
2021-12-20 02:04:22 +00:00
|
|
|
|
2024-05-24 00:12:42 +00:00
|
|
|
buildAndTestSubdir = "tokio-console";
|
|
|
|
|
2024-03-26 04:20:00 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
protobuf
|
|
|
|
];
|
2021-12-20 02:04:22 +00:00
|
|
|
|
2022-10-22 10:23:42 +00:00
|
|
|
# uses currently unstable tokio features
|
|
|
|
RUSTFLAGS = "--cfg tokio_unstable";
|
|
|
|
|
|
|
|
checkFlags = [
|
|
|
|
# tests depend upon git repository at test execution time
|
|
|
|
"--skip bootstrap"
|
|
|
|
"--skip config::tests::args_example_changed"
|
|
|
|
"--skip config::tests::toml_example_changed"
|
|
|
|
];
|
|
|
|
|
2024-07-10 11:52:28 +00:00
|
|
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
2024-03-26 04:20:00 +00:00
|
|
|
installShellCompletion --cmd tokio-console \
|
|
|
|
--bash <($out/bin/tokio-console --log-dir $(mktemp -d) gen-completion bash) \
|
|
|
|
--fish <($out/bin/tokio-console --log-dir $(mktemp -d) gen-completion fish) \
|
|
|
|
--zsh <($out/bin/tokio-console --log-dir $(mktemp -d) gen-completion zsh)
|
|
|
|
'';
|
|
|
|
|
2021-12-20 02:04:22 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Debugger for asynchronous Rust code";
|
|
|
|
homepage = "https://github.com/tokio-rs/console";
|
2023-07-02 12:31:46 +00:00
|
|
|
mainProgram = "tokio-console";
|
2021-12-20 02:04:22 +00:00
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ max-niederman ];
|
|
|
|
};
|
|
|
|
}
|