blob: c2d9fd54f00330600c0264165523c8e8d6af7e4f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, git, testers, git-town, makeWrapper }:
buildGoModule rec {
pname = "git-town";
version = "14.2.0";
src = fetchFromGitHub {
owner = "git-town";
repo = "git-town";
rev = "v${version}";
hash = "sha256-+OJ8aUA/VFOAzdCRcOCQKm6/RjRe13TITP1DAWqoAQI=";
};
vendorHash = null;
nativeBuildInputs = [ installShellFiles makeWrapper ];
buildInputs = [ git ];
ldflags =
let
modulePath = "github.com/git-town/git-town/v${lib.versions.major version}";
in
[
"-s"
"-w"
"-X ${modulePath}/src/cmd.version=v${version}"
"-X ${modulePath}/src/cmd.buildDate=nix"
];
nativeCheckInputs = [ git ];
preCheck = ''
HOME=$(mktemp -d)
'';
checkFlags =
let
# Disable tests requiring local operations
skippedTests = [
"TestGodog"
"TestMockingRunner/MockCommand"
"TestMockingRunner/QueryWith"
"TestTestCommands/CreateChildFeatureBranch"
];
in
[ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ];
postInstall = ''
installShellCompletion --cmd git-town \
--bash <($out/bin/git-town completion bash) \
--fish <($out/bin/git-town completion fish) \
--zsh <($out/bin/git-town completion zsh)
wrapProgram $out/bin/git-town --prefix PATH : ${lib.makeBinPath [ git ]}
'';
passthru.tests.version = testers.testVersion {
package = git-town;
command = "git-town --version";
inherit version;
};
meta = with lib; {
description = "Generic, high-level git support for git-flow workflows";
homepage = "https://www.git-town.com/";
license = licenses.mit;
maintainers = with maintainers; [ allonsy blaggacao gabyx ];
mainProgram = "git-town";
};
}
|