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

77 lines
1.5 KiB
Nix

{
lib,
rustPlatform,
fetchFromGitHub,
pkg-config,
libgit2,
oniguruma,
zlib,
stdenv,
darwin,
gitMinimal,
}:
rustPlatform.buildRustPackage rec {
pname = "git-dive";
version = "0.1.6";
src = fetchFromGitHub {
owner = "gitext-rs";
repo = "git-dive";
rev = "v${version}";
hash = "sha256-sy2qNFn8JLE173HVWfFXBx21jcx4kpFMwi9a0m38lso=";
};
useFetchCargoVendor = true;
cargoHash = "sha256-qRF111ofiM8SNUjQfpDg75OPpJnP7fOqM8Ih3NQUdGY=";
nativeBuildInputs = [
pkg-config
];
buildInputs =
[
libgit2
oniguruma
zlib
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
darwin.apple_sdk.frameworks.Security
];
nativeCheckInputs = [
gitMinimal
];
# don't use vendored libgit2
buildNoDefaultFeatures = true;
checkFlags = [
# requires internet access
"--skip=screenshot"
];
preCheck = ''
export HOME=$(mktemp -d)
git config --global user.name nixbld
git config --global user.email nixbld@example.com
'';
env = {
LIBGIT2_NO_VENDOR = 1;
RUSTONIG_SYSTEM_LIBONIG = true;
};
meta = with lib; {
description = "Dive into a file's history to find root cause";
homepage = "https://github.com/gitext-rs/git-dive";
changelog = "https://github.com/gitext-rs/git-dive/blob/${src.rev}/CHANGELOG.md";
license = with licenses; [
asl20
mit
];
maintainers = with maintainers; [ figsoda ];
mainProgram = "git-dive";
};
}