2023-07-15 17:15:38 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, git, testers, git-town, makeWrapper }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
buildGoModule rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "git-town";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "16.1.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2020-09-25 04:45:31 +00:00
|
|
|
owner = "git-town";
|
2020-04-24 23:36:52 +00:00
|
|
|
repo = "git-town";
|
|
|
|
rev = "v${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-H4FtFSI/c7UxRLZB8kz873DIN6kLUwmRZtz3+4zaR7w=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
vendorHash = null;
|
2022-07-14 12:49:19 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles makeWrapper ];
|
|
|
|
|
|
|
|
buildInputs = [ git ];
|
|
|
|
|
|
|
|
ldflags =
|
|
|
|
let
|
2024-05-15 15:35:15 +00:00
|
|
|
modulePath = "github.com/git-town/git-town/v${lib.versions.major version}";
|
|
|
|
in
|
2022-07-14 12:49:19 +00:00
|
|
|
[
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X ${modulePath}/src/cmd.version=v${version}"
|
|
|
|
"-X ${modulePath}/src/cmd.buildDate=nix"
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ git ];
|
2024-05-15 15:35:15 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
HOME=$(mktemp -d)
|
2024-09-19 14:19:46 +00:00
|
|
|
|
|
|
|
# this runs tests requiring local operations
|
|
|
|
rm main_test.go
|
2024-05-15 15:35:15 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
checkFlags =
|
2022-07-14 12:49:19 +00:00
|
|
|
let
|
2024-05-15 15:35:15 +00:00
|
|
|
# Disable tests requiring local operations
|
2022-07-14 12:49:19 +00:00
|
|
|
skippedTests = [
|
|
|
|
"TestGodog"
|
2024-05-15 15:35:15 +00:00
|
|
|
"TestMockingRunner/MockCommand"
|
|
|
|
"TestMockingRunner/QueryWith"
|
|
|
|
"TestTestCommands/CreateChildFeatureBranch"
|
2022-07-14 12:49:19 +00:00
|
|
|
];
|
|
|
|
in
|
2024-05-15 15:35:15 +00:00
|
|
|
[ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ];
|
2022-07-14 12:49:19 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --cmd git-town \
|
2024-06-05 15:53:02 +00:00
|
|
|
--bash <($out/bin/git-town completions bash) \
|
|
|
|
--fish <($out/bin/git-town completions fish) \
|
|
|
|
--zsh <($out/bin/git-town completions zsh)
|
2022-07-14 12:49:19 +00:00
|
|
|
|
|
|
|
wrapProgram $out/bin/git-town --prefix PATH : ${lib.makeBinPath [ git ]}
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = git-town;
|
2024-01-02 11:29:13 +00:00
|
|
|
command = "git-town --version";
|
2024-04-21 15:54:59 +00:00
|
|
|
inherit version;
|
2022-07-14 12:49:19 +00:00
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Generic, high-level git support for git-flow workflows";
|
2020-10-07 09:15:18 +00:00
|
|
|
homepage = "https://www.git-town.com/";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2024-04-21 15:54:59 +00:00
|
|
|
maintainers = with maintainers; [ allonsy blaggacao gabyx ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "git-town";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|