nixpkgs/pkgs/by-name/co/commitmsgfmt/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

35 lines
910 B
Nix

{
lib,
rustPlatform,
fetchFromGitLab,
testers,
commitmsgfmt,
}:
rustPlatform.buildRustPackage rec {
pname = "commitmsgfmt";
version = "1.6.0";
src = fetchFromGitLab {
owner = "mkjeldsen";
repo = "commitmsgfmt";
rev = "v${version}";
hash = "sha256-HEkPnTO1HeJg8gpHFSUTkEVBPWJ0OdfUhNn9iGfaDD4=";
};
useFetchCargoVendor = true;
cargoHash = "sha256-cej+Jpp12QEaru1mecuXtIFDEnSBvTwpx0Vgp8s7jj8=";
passthru.tests.version = testers.testVersion {
package = commitmsgfmt;
command = "commitmsgfmt -V";
};
meta = with lib; {
homepage = "https://gitlab.com/mkjeldsen/commitmsgfmt";
changelog = "https://gitlab.com/mkjeldsen/commitmsgfmt/-/raw/v${version}/CHANGELOG.md";
description = "Formats commit messages better than fmt(1) and Vim";
mainProgram = "commitmsgfmt";
license = licenses.asl20;
maintainers = with maintainers; [ mmlb ];
};
}