nixpkgs/pkgs/applications/version-management/git-dive/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

70 lines
1.3 KiB
Nix
Raw Normal View History

2023-03-16 16:31:12 +01:00
{ lib
, rustPlatform
, fetchFromGitHub
, pkg-config
2024-02-11 23:31:38 +01:00
, libgit2
, oniguruma
2023-03-16 16:31:12 +01:00
, zlib
, stdenv
, darwin
, git
2023-03-16 16:31:12 +01:00
}:
rustPlatform.buildRustPackage rec {
pname = "git-dive";
version = "0.1.6";
2023-03-16 16:31:12 +01:00
src = fetchFromGitHub {
owner = "gitext-rs";
repo = "git-dive";
rev = "v${version}";
hash = "sha256-sy2qNFn8JLE173HVWfFXBx21jcx4kpFMwi9a0m38lso=";
2023-03-16 16:31:12 +01: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
oniguruma
2023-03-16 16:31:12 +01:00
zlib
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
2023-03-16 16:31:12 +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"
];
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
};
}