nixpkgs/pkgs/applications/version-management/git-town/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

68 lines
1.7 KiB
Nix
Raw Normal View History

2023-07-04 08:42:08 +00:00
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, git, testers, git-town, makeWrapper }:
2022-06-04 06:49:53 +00:00
buildGoModule rec {
2020-04-02 06:43:26 +00:00
pname = "git-town";
2024-04-06 06:22:30 +00:00
version = "13.0.2";
2020-04-02 06:43:26 +00:00
src = fetchFromGitHub {
2020-09-02 01:44:48 +00:00
owner = "git-town";
2020-04-02 06:43:26 +00:00
repo = "git-town";
rev = "v${version}";
2024-04-06 06:22:30 +00:00
hash = "sha256-NT/d6JRecM2g7e+mREYEi1LbUcRkwxmMEuy+IrpCjFA=";
2020-04-02 06:43:26 +00:00
};
2023-07-04 08:42:08 +00:00
vendorHash = null;
2022-06-04 06:49:53 +00:00
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 ];
2022-06-04 06:49:53 +00:00
preCheck =
let
skippedTests = [
"TestGodog"
"TestMockingShell_MockCommand"
"TestShellRunner_RunStringWith_Input"
];
in
''
HOME=$(mktemp -d)
# Disable tests requiring local operations
buildFlagsArray+=("-run" "[^(${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;
2023-12-04 00:31:28 +00:00
command = "git-town --version";
2024-03-30 17:27:33 +00:00
inherit version;
2022-06-04 06:49:53 +00:00
};
meta = with lib; {
2020-04-02 06:43:26 +00:00
description = "Generic, high-level git support for git-flow workflows";
homepage = "https://www.git-town.com/";
2020-04-02 06:43:26 +00:00
license = licenses.mit;
2024-03-27 00:06:39 +00:00
maintainers = with maintainers; [ allonsy blaggacao gabyx ];
2023-11-27 01:17:53 +00:00
mainProgram = "git-town";
2020-04-02 06:43:26 +00:00
};
}