nixpkgs/pkgs/by-name/du/dua/package.nix
Alyssa Ross 63bff8c132
treewide: migrate to fetchCargoVendor, batch 1
Cargo 1.84.0 seems to have changed the output format of cargo vendor
again, once again invalidating fetchCargoTarball FOD hashes.  It's
time to fix this once and for all, switching across the board to
fetchCargoVendor, which is not dependent on cargo vendor's output
format.

It should be possible to reproduce this diff.  To do so, get the list
of files changed by this commit, e.g. with git diff --name-only, then
run the following two commands, each with that list of files as their
standard input:

	xargs sed -i 's/^\(. *\)\(cargoHash\)\b/\1useFetchCargoVendor = true;\n\1cargoHash/'
	cut -d / -f 4 | xargs -n 1 nix-update --version=skip

This will take a long time.  It might be possible to parallelize it
using xargs' -P option.  I haven't tested it.
2025-01-23 11:46:43 +01:00

56 lines
1.6 KiB
Nix

{
lib,
rustPlatform,
fetchFromGitHub,
versionCheckHook,
nix-update-script,
}:
rustPlatform.buildRustPackage rec {
pname = "dua";
version = "2.29.4";
src = fetchFromGitHub {
owner = "Byron";
repo = "dua-cli";
tag = "v${version}";
hash = "sha256-TVwRz5bAdJMtmhhzfZZ/NuV+YrLcnuK6d86Oj/JmgW4=";
# Remove unicode file names which leads to different checksums on HFS+
# vs. other filesystems because of unicode normalisation.
postFetch = ''
rm -r $out/tests/fixtures
'';
};
useFetchCargoVendor = true;
cargoHash = "sha256-I8Is6jjBgxcqHkLrA/hesa7z3rrDVK6sjyw2/mQoRVs=";
checkFlags = [
# Skip interactive tests
"--skip=interactive::app::tests::journeys_readonly::simple_user_journey_read_only"
"--skip=interactive::app::tests::journeys_with_writes::basic_user_journey_with_deletion"
"--skip=interactive::app::tests::unit::it_can_handle_ending_traversal_reaching_top_but_skipping_levels"
"--skip=interactive::app::tests::unit::it_can_handle_ending_traversal_without_reaching_the_top"
];
nativeInstallCheckInputs = [
versionCheckHook
];
versionCheckProgramArg = [ "--version" ];
doInstallCheck = true;
passthru.updateScript = nix-update-script { };
meta = {
description = "Tool to conveniently learn about the disk usage of directories";
homepage = "https://github.com/Byron/dua-cli";
changelog = "https://github.com/Byron/dua-cli/blob/v${version}/CHANGELOG.md";
license = with lib.licenses; [ mit ];
maintainers = with lib.maintainers; [
figsoda
killercup
];
mainProgram = "dua";
};
}