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

58 lines
1.3 KiB
Nix
Raw Normal View History

2024-10-19 17:01:04 +01:00
{
lib,
buildGo123Module,
fetchFromGitLab,
installShellFiles,
stdenv,
}:
2020-11-26 15:27:31 +00:00
2024-10-09 18:45:00 +01:00
buildGo123Module rec {
2020-11-26 15:27:31 +00:00
pname = "glab";
2024-11-15 07:28:43 +00:00
version = "1.49.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-11-15 07:28:43 +00:00
hash = "sha256-G9z9lISalj3ZXlvDY+qA+0NB6F7flBd1cTcGfxrM91U=";
2020-11-26 15:27:31 +00:00
};
2024-11-15 07:28:43 +00:00
vendorHash = "sha256-SsWZO77KqDPzyEK57WaK4NpnDWUtZPP0qur2EvEoiL0=";
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.buildPlatform.canExecute stdenv.hostPlatform) ''
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)
'';
2024-10-19 17:06:23 +01:00
meta = {
description = "GitLab CLI tool bringing GitLab to your command line";
2024-10-19 17:06:23 +01:00
license = lib.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}";
2024-10-19 17:06:23 +01:00
maintainers = with lib.maintainers; [
freezeboy
luftmensch-luftmensch
];
2023-11-27 01:17:53 +00:00
mainProgram = "glab";
2020-11-26 15:27:31 +00:00
};
}