1{
2 lib,
3 fetchFromGitHub,
4 git,
5 ncurses,
6 openssl,
7 pkg-config,
8 rustPlatform,
9 sqlite,
10 stdenv,
11}:
12
13rustPlatform.buildRustPackage rec {
14 pname = "git-branchless";
15 version = "0.10.0";
16
17 src = fetchFromGitHub {
18 owner = "arxanas";
19 repo = "git-branchless";
20 rev = "v${version}";
21 hash = "sha256-8uv+sZRr06K42hmxgjrKk6FDEngUhN/9epixRYKwE3U=";
22 };
23
24 cargoHash = "sha256-i7KpTd4fX3PrhDjj3R9u98rdI0uHkpQCxSmEF+Gu7yk=";
25
26 nativeBuildInputs = [ pkg-config ];
27
28 buildInputs = [
29 ncurses
30 openssl
31 sqlite
32 ];
33
34 postInstall = lib.optionalString (with stdenv; buildPlatform.canExecute hostPlatform) ''
35 $out/bin/git-branchless install-man-pages $out/share/man
36 '';
37
38 preCheck = ''
39 export TEST_GIT=${git}/bin/git
40 export TEST_GIT_EXEC_PATH=$(${git}/bin/git --exec-path)
41 '';
42
43 # Note that upstream has disabled CI tests for git>=2.46
44 # See: https://github.com/arxanas/git-branchless/issues/1416
45 # https://github.com/arxanas/git-branchless/pull/1417
46 # To be re-enabled once arxanas/git-branchless#1416 is resolved
47 doCheck = false;
48
49 checkFlags = [
50 # FIXME: these tests deadlock when run in the Nix sandbox
51 "--skip=test_switch_pty"
52 "--skip=test_next_ambiguous_interactive"
53 "--skip=test_switch_auto_switch_interactive"
54 ];
55
56 meta = with lib; {
57 description = "Suite of tools to help you visualize, navigate, manipulate, and repair your commit history";
58 homepage = "https://github.com/arxanas/git-branchless";
59 license = licenses.gpl2Only;
60 mainProgram = "git-branchless";
61 maintainers = with maintainers; [
62 nh2
63 hmenke
64 bryango
65 ];
66 };
67}