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