Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, buildGoModule, fetchFromGitHub, less, more, installShellFiles, testers, jira-cli-go, nix-update-script }:
2
3buildGoModule rec {
4 pname = "jira-cli-go";
5 version = "1.4.0";
6
7 src = fetchFromGitHub {
8 owner = "ankitpokhrel";
9 repo = "jira-cli";
10 rev = "v${version}";
11 hash = "sha256-+8OPXyOTEnX864Lr8IugHh890XtmRtUr1pEN1/QxMz4=";
12 };
13
14 vendorSha256 = "sha256-sG/ZKQRVxBfaMKnLk2+HdmRhojI6BZVob1XDIAYMfY0=";
15
16 ldflags = [
17 "-s" "-w"
18 "-X github.com/ankitpokhrel/jira-cli/internal/version.GitCommit=${src.rev}"
19 "-X github.com/ankitpokhrel/jira-cli/internal/version.SourceDateEpoch=0"
20 "-X github.com/ankitpokhrel/jira-cli/internal/version.Version=${version}"
21 ];
22
23 __darwinAllowLocalNetworking = true;
24
25 nativeCheckInputs = [ less more ]; # Tests expect a pager in $PATH
26
27 passthru = {
28 tests.version = testers.testVersion {
29 package = jira-cli-go;
30 command = "jira version";
31 inherit version;
32 };
33 updateScript = nix-update-script { };
34 };
35
36 nativeBuildInputs = [ installShellFiles ];
37 postInstall = ''
38 installShellCompletion --cmd jira \
39 --bash <($out/bin/jira completion bash) \
40 --zsh <($out/bin/jira completion zsh)
41
42 $out/bin/jira man --generate --output man
43 installManPage man/*
44 '';
45
46 meta = with lib; {
47 description = "Feature-rich interactive Jira command line";
48 homepage = "https://github.com/ankitpokhrel/jira-cli";
49 changelog = "https://github.com/ankitpokhrel/jira-cli/releases/tag/v${version}";
50 license = licenses.mit;
51 maintainers = with maintainers; [ bryanasdev000 anthonyroussel ];
52 mainProgram = "jira";
53 };
54}