2023-03-16 16:31:12 +01:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pkg-config
|
2024-02-11 23:31:38 +01:00
|
|
|
, libgit2
|
2023-03-23 21:04:03 +01:00
|
|
|
, oniguruma
|
2023-03-16 16:31:12 +01:00
|
|
|
, zlib
|
2023-03-23 21:04:03 +01:00
|
|
|
, stdenv
|
|
|
|
, darwin
|
|
|
|
, git
|
2023-03-16 16:31:12 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "git-dive";
|
2023-04-13 18:09:18 +02:00
|
|
|
version = "0.1.6";
|
2023-03-16 16:31:12 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gitext-rs";
|
|
|
|
repo = "git-dive";
|
|
|
|
rev = "v${version}";
|
2023-04-13 18:09:18 +02:00
|
|
|
hash = "sha256-sy2qNFn8JLE173HVWfFXBx21jcx4kpFMwi9a0m38lso=";
|
2023-03-16 16:31:12 +01:00
|
|
|
};
|
|
|
|
|
2023-04-13 18:09:18 +02:00
|
|
|
cargoHash = "sha256-Z3TgVunC/qNzUe0X9xIg3fTFXFk2w9yDA+EskSCg0Qo=";
|
2023-03-16 16:31:12 +01:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2024-02-11 23:31:38 +01:00
|
|
|
libgit2
|
2023-03-23 21:04:03 +01:00
|
|
|
oniguruma
|
2023-03-16 16:31:12 +01:00
|
|
|
zlib
|
2023-03-23 21:04:03 +01:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
darwin.apple_sdk.frameworks.Security
|
2023-03-16 16:31:12 +01:00
|
|
|
];
|
|
|
|
|
2023-03-23 21:04:03 +01:00
|
|
|
nativeCheckInputs = [
|
|
|
|
git
|
|
|
|
];
|
|
|
|
|
|
|
|
# don't use vendored libgit2
|
|
|
|
buildNoDefaultFeatures = true;
|
|
|
|
|
2023-03-16 16:31:12 +01:00
|
|
|
checkFlags = [
|
|
|
|
# requires internet access
|
|
|
|
"--skip=screenshot"
|
|
|
|
];
|
|
|
|
|
2023-03-23 21:04:03 +01:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
git config --global user.name nixbld
|
|
|
|
git config --global user.email nixbld@example.com
|
|
|
|
'';
|
|
|
|
|
2024-02-11 23:31:38 +01:00
|
|
|
env = {
|
|
|
|
LIBGIT2_NO_VENDOR = 1;
|
|
|
|
RUSTONIG_SYSTEM_LIBONIG = true;
|
|
|
|
};
|
2023-03-16 16:31:12 +01:00
|
|
|
|
|
|
|
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 ];
|
2023-11-27 02:17:53 +01:00
|
|
|
mainProgram = "git-dive";
|
2023-03-16 16:31:12 +01:00
|
|
|
};
|
|
|
|
}
|