tokei: modernize, adopt (#409910)

This commit is contained in:
Aleksana
2025-05-26 13:06:29 +08:00
committed by GitHub
+20 -13
View File
@@ -5,42 +5,49 @@
rustPlatform,
libiconv,
zlib,
versionCheckHook,
nix-update-script,
}:
rustPlatform.buildRustPackage rec {
rustPlatform.buildRustPackage (finalAttrs: {
pname = "tokei";
version = "13.0.0-alpha.8";
src = fetchFromGitHub {
owner = "XAMPPRocky";
repo = pname;
rev = "v${version}";
sha256 = "sha256-jCI9VM3y76RI65E5UGuAPuPkDRTMyi+ydx64JWHcGfE=";
repo = "tokei";
tag = "v${finalAttrs.version}";
hash = "sha256-jCI9VM3y76RI65E5UGuAPuPkDRTMyi+ydx64JWHcGfE=";
};
useFetchCargoVendor = true;
cargoHash = "sha256-LzlyrKaRjUo6JnVLQnHidtI4OWa+GrhAc4D8RkL+nmQ=";
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
libiconv
];
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
checkInputs = lib.optionals stdenv.hostPlatform.isDarwin [ zlib ];
# enable all output formats
buildFeatures = [ "all" ];
meta = with lib; {
description = "Program that allows you to count your code, quickly";
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgramArg = "--version";
doInstallCheck = true;
passthru.updateScript = nix-update-script { extraArgs = [ "--version=unstable" ]; };
meta = {
description = "Count your code, quickly";
longDescription = ''
Tokei is a program that displays statistics about your code. Tokei will show number of files, total lines within those files and code, comments, and blanks grouped by language.
Tokei is a program that displays statistics about your code. Tokei will show the number of files, total lines within those files and code, comments, and blanks grouped by language.
'';
homepage = "https://github.com/XAMPPRocky/tokei";
license = with licenses; [
changelog = "https://github.com/XAMPPRocky/tokei/blob/v${finalAttrs.version}/CHANGELOG.md";
license = with lib.licenses; [
asl20 # or
mit
];
maintainers = with maintainers; [ ];
maintainers = with lib.maintainers; [ defelo ];
mainProgram = "tokei";
};
}
})