biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / applications / version-management / git-town / default.nix
blob00d2722bcdbe44a257bc6417bd32773ec6387f79
1 { lib, buildGoModule, fetchFromGitHub, installShellFiles, git, testers, git-town, makeWrapper }:
3 buildGoModule rec {
4   pname = "git-town";
5   version = "16.3.0";
7   src = fetchFromGitHub {
8     owner = "git-town";
9     repo = "git-town";
10     rev = "v${version}";
11     hash = "sha256-q4bRUz6ZI6y0AYEDMUBMN1YJxmHkIDDkUiMd4rQbDHk=";
12   };
14   vendorHash = null;
16   nativeBuildInputs = [ installShellFiles makeWrapper ];
18   buildInputs = [ git ];
20   ldflags =
21     let
22       modulePath = "github.com/git-town/git-town/v${lib.versions.major version}";
23     in
24     [
25       "-s"
26       "-w"
27       "-X ${modulePath}/src/cmd.version=v${version}"
28       "-X ${modulePath}/src/cmd.buildDate=nix"
29     ];
31   nativeCheckInputs = [ git ];
33   preCheck = ''
34     HOME=$(mktemp -d)
36     # this runs tests requiring local operations
37     rm main_test.go
38   '';
40   checkFlags =
41     let
42       # Disable tests requiring local operations
43       skippedTests = [
44         "TestGodog"
45         "TestMockingRunner/MockCommand"
46         "TestMockingRunner/QueryWith"
47         "TestTestCommands/CreateChildFeatureBranch"
48       ];
49     in
50     [ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ];
52   postInstall = ''
53     installShellCompletion --cmd git-town \
54       --bash <($out/bin/git-town completions bash) \
55       --fish <($out/bin/git-town completions fish) \
56       --zsh <($out/bin/git-town completions zsh)
58     wrapProgram $out/bin/git-town --prefix PATH : ${lib.makeBinPath [ git ]}
59   '';
61   passthru.tests.version = testers.testVersion {
62     package = git-town;
63     command = "git-town --version";
64     inherit version;
65   };
67   meta = with lib; {
68     description = "Generic, high-level git support for git-flow workflows";
69     homepage = "https://www.git-town.com/";
70     license = licenses.mit;
71     maintainers = with maintainers; [ allonsy blaggacao gabyx ];
72     mainProgram = "git-town";
73   };