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-03-27 19:17:25 +00:00
|
|
|
version = "0.1.5";
|
2023-03-24 00:07:29 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gitext-rs";
|
|
|
|
repo = "git-dive";
|
|
|
|
rev = "v${version}";
|
2023-03-27 19:17:25 +00:00
|
|
|
hash = "sha256-LOvrPId/GBWPq73hdCdaMNKH7K7cmGmlkepkQiwGC60=";
|
2023-03-24 00:07:29 +00:00
|
|
|
};
|
|
|
|
|
2023-03-27 19:17:25 +00:00
|
|
|
cargoHash = "sha256-JDybjIUjj9ivJ5hJJB9bvGB18TdwEXQZfKfXPkyopK0=";
|
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 ];
|
|
|
|
};
|
|
|
|
}
|