2022-05-19 04:20:00 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-02-28 00:56:29 +00:00
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
2019-11-01 02:04:12 +00:00
|
|
|
, Security
|
|
|
|
}:
|
2018-04-11 12:12:47 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2019-08-31 11:41:23 +00:00
|
|
|
pname = "tealdeer";
|
2022-11-04 15:20:43 +00:00
|
|
|
version = "1.6.1";
|
2018-04-11 12:12:47 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dbrgn";
|
|
|
|
repo = "tealdeer";
|
|
|
|
rev = "v${version}";
|
2022-11-04 15:20:43 +00:00
|
|
|
sha256 = "sha256-zQzYukhruVUVP1v76/5522ag7wjN9QoE9BtfMNYQ7UY=";
|
2018-04-11 12:12:47 +00:00
|
|
|
};
|
|
|
|
|
2022-11-04 15:20:43 +00:00
|
|
|
cargoSha256 = "sha256-VeJsCWU7sJy88uvGGjpuGRzsAgBRvzOYU1FwpImpiLk=";
|
2018-04-11 12:12:47 +00:00
|
|
|
|
2022-10-02 01:36:38 +00:00
|
|
|
buildInputs = lib.optional stdenv.isDarwin Security;
|
2018-04-11 12:12:47 +00:00
|
|
|
|
2022-10-02 01:36:38 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
2020-02-28 00:56:29 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2022-05-19 04:20:00 +00:00
|
|
|
installShellCompletion --cmd tldr \
|
2022-10-02 01:36:38 +00:00
|
|
|
--bash completion/bash_tealdeer \
|
|
|
|
--fish completion/fish_tealdeer \
|
|
|
|
--zsh completion/zsh_tealdeer
|
2020-02-28 00:56:29 +00:00
|
|
|
'';
|
|
|
|
|
2022-10-02 01:36:38 +00:00
|
|
|
# Disable tests that require Internet access:
|
|
|
|
checkFlags = [
|
|
|
|
"--skip test_autoupdate_cache"
|
|
|
|
"--skip test_create_cache_directory_path"
|
|
|
|
"--skip test_pager_flag_enable"
|
|
|
|
"--skip test_quiet_cache"
|
|
|
|
"--skip test_quiet_failures"
|
|
|
|
"--skip test_quiet_old_cache"
|
|
|
|
"--skip test_spaces_find_command"
|
|
|
|
"--skip test_update_cache"
|
|
|
|
];
|
2018-04-11 12:12:47 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-10-24 10:07:36 +00:00
|
|
|
description = "A very fast implementation of tldr in Rust";
|
2018-04-11 12:12:47 +00:00
|
|
|
homepage = "https://github.com/dbrgn/tealdeer";
|
2022-11-04 15:20:43 +00:00
|
|
|
maintainers = with maintainers; [ davidak newam ];
|
2018-04-11 12:12:47 +00:00
|
|
|
license = with licenses; [ asl20 mit ];
|
2021-09-02 19:42:33 +00:00
|
|
|
mainProgram = "tldr";
|
2018-04-11 12:12:47 +00:00
|
|
|
};
|
|
|
|
}
|