nixpkgs/pkgs/by-name/gl/glab/package.nix

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

49 lines
1.3 KiB
Nix
Raw Normal View History

{ lib, buildGoModule, fetchFromGitLab, installShellFiles, stdenv }:
2020-11-26 15:27:31 +00:00
buildGoModule rec {
pname = "glab";
2024-08-02 05:46:52 +01:00
version = "1.45.0";
2020-11-26 15:27:31 +00:00
src = fetchFromGitLab {
owner = "gitlab-org";
repo = "cli";
2020-11-26 15:27:31 +00:00
rev = "v${version}";
2024-08-02 05:46:52 +01:00
hash = "sha256-jTpddpS+FYSQg2aRxQiVlG+bitiIqmZ4kxOJLPZkICo=";
2020-11-26 15:27:31 +00:00
};
2024-08-02 05:46:52 +01:00
vendorHash = "sha256-o0sYObTeDgG+3X3YEnDbk1h4DkEiMwEgYMF7hGjCL3Q=";
2020-11-26 15:27:31 +00:00
2021-08-11 12:40:24 +01:00
ldflags = [
"-s"
"-w"
2021-08-11 12:40:24 +01:00
"-X main.version=${version}"
];
preCheck = ''
# failed to read configuration: mkdir /homeless-shelter: permission denied
export HOME=$TMPDIR
'';
2020-11-26 15:27:31 +00:00
subPackages = [ "cmd/glab" ];
nativeBuildInputs = [ installShellFiles ];
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
2023-09-13 05:20:00 +01:00
make manpage
installManPage share/man/man1/*
installShellCompletion --cmd glab \
--bash <($out/bin/glab completion -s bash) \
--fish <($out/bin/glab completion -s fish) \
--zsh <($out/bin/glab completion -s zsh)
'';
2020-11-26 15:27:31 +00:00
meta = with lib; {
description = "GitLab CLI tool bringing GitLab to your command line";
2020-11-26 15:27:31 +00:00
license = licenses.mit;
homepage = "https://gitlab.com/gitlab-org/cli";
2023-09-13 05:20:00 +01:00
changelog = "https://gitlab.com/gitlab-org/cli/-/releases/v${version}";
2020-11-26 15:27:31 +00:00
maintainers = with maintainers; [ freezeboy ];
2023-11-27 01:17:53 +00:00
mainProgram = "glab";
2020-11-26 15:27:31 +00:00
};
}