1{
2 lib,
3 python3,
4 fetchFromGitHub,
5 installShellFiles,
6 git,
7 nix-update-script,
8}:
9
10python3.pkgs.buildPythonApplication rec {
11 pname = "git-machete";
12 version = "3.36.1";
13 format = "pyproject";
14
15 src = fetchFromGitHub {
16 owner = "virtuslab";
17 repo = "git-machete";
18 rev = "v${version}";
19 hash = "sha256-uVzER0Ll7d5cFrwtr1KcWeI70iioHDE6kpZYAiOxPnE=";
20 };
21
22 build-system = with python3.pkgs; [ setuptools ];
23
24 nativeBuildInputs = [ installShellFiles ];
25
26 nativeCheckInputs = [
27 git
28 ]
29 ++ (with python3.pkgs; [
30 pytest-mock
31 pytestCheckHook
32 ]);
33
34 disabledTests = [
35 # Requires fully functioning shells including zsh modules and bash
36 # completion.
37 "completion_e2e"
38 ];
39
40 postInstall = ''
41 installShellCompletion --bash --name git-machete completion/git-machete.completion.bash
42 installShellCompletion --zsh --name _git-machete completion/git-machete.completion.zsh
43 installShellCompletion --fish completion/git-machete.fish
44 '';
45
46 postInstallCheck = ''
47 test "$($out/bin/git-machete version)" = "git-machete version ${version}"
48 '';
49
50 passthru = {
51 updateScript = nix-update-script { };
52 };
53
54 meta = {
55 homepage = "https://github.com/VirtusLab/git-machete";
56 description = "Git repository organizer and rebase/merge workflow automation tool";
57 changelog = "https://github.com/VirtusLab/git-machete/releases/tag/v${version}";
58 license = lib.licenses.mit;
59 maintainers = with lib.maintainers; [ blitz ];
60 mainProgram = "git-machete";
61 };
62}