summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/tu/tuleap-cli/package.nix
blob: 507a23f1b0a3f78fc26ab2dbde52e6657400b8a5 (plain)
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
{
  lib,
  buildGoModule,
  fetchFromGitLab,
  installShellFiles,
  stdenv,
}:

buildGoModule (finalAttrs: {
  pname = "tuleap-cli";
  version = "1.2.0";

  src = fetchFromGitLab {
    owner = "csgroup-oss";
    repo = "tuleap-cli";
    tag = finalAttrs.version;
    hash = "sha256-qiQnu167BIF+LzwahheBE0KwxFmRcahdU7quTpPtEEk=";
  };

  vendorHash = "sha256-cO7+wG4uAd9e6n/KWQPYepixNmXBbuBxagT82hcbcIo=";

  nativeBuildInputs = [ installShellFiles ];

  ldflags = [
    "-s"
    "-w"
  ];

  subPackages = [ "." ];

  postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
    installShellCompletion --cmd tuleap-cli \
      --bash <($out/bin/tuleap-cli -s tuleap.example.com completion bash) \
      --fish <($out/bin/tuleap-cli -s tuleap.example.com completion fish) \
      --zsh <($out/bin/tuleap-cli -s tuleap.example.com completion zsh)
  '';

  meta = {
    description = "Command-line interface for the Tuleap API";
    homepage = "https://gitlab.com/csgroup-oss/tuleap-cli";
    license = lib.licenses.gpl3Plus;
    maintainers = with lib.maintainers; [ lesuisse ];
    mainProgram = "tuleap-cli";
  };
})