1{
2 lib,
3 rustPlatform,
4 fetchFromGitHub,
5 pkg-config,
6 libgit2,
7 oniguruma,
8 zlib,
9 gitMinimal,
10}:
11
12rustPlatform.buildRustPackage rec {
13 pname = "git-dive";
14 version = "0.1.6";
15
16 src = fetchFromGitHub {
17 owner = "gitext-rs";
18 repo = "git-dive";
19 rev = "v${version}";
20 hash = "sha256-sy2qNFn8JLE173HVWfFXBx21jcx4kpFMwi9a0m38lso=";
21 };
22
23 cargoHash = "sha256-qRF111ofiM8SNUjQfpDg75OPpJnP7fOqM8Ih3NQUdGY=";
24
25 nativeBuildInputs = [
26 pkg-config
27 ];
28
29 buildInputs = [
30 libgit2
31 oniguruma
32 zlib
33 ];
34
35 nativeCheckInputs = [
36 gitMinimal
37 ];
38
39 # don't use vendored libgit2
40 buildNoDefaultFeatures = true;
41
42 checkFlags = [
43 # requires internet access
44 "--skip=screenshot"
45 ];
46
47 preCheck = ''
48 export HOME=$(mktemp -d)
49 git config --global user.name nixbld
50 git config --global user.email nixbld@example.com
51 '';
52
53 env = {
54 LIBGIT2_NO_VENDOR = 1;
55 RUSTONIG_SYSTEM_LIBONIG = true;
56 };
57
58 meta = with lib; {
59 description = "Dive into a file's history to find root cause";
60 homepage = "https://github.com/gitext-rs/git-dive";
61 changelog = "https://github.com/gitext-rs/git-dive/blob/${src.rev}/CHANGELOG.md";
62 license = with licenses; [
63 asl20
64 mit
65 ];
66 maintainers = with maintainers; [ figsoda ];
67 mainProgram = "git-dive";
68 };
69}