glab: 1.61.0 -> 1.62.0, cleanup (#426485)

This commit is contained in:
Pol Dellaiera
2025-07-19 11:03:21 +02:00
committed by GitHub
+39 -6
View File
@@ -3,23 +3,32 @@
buildGoModule,
fetchFromGitLab,
installShellFiles,
makeBinaryWrapper,
stdenv,
nix-update-script,
writableTmpDirAsHomeHook,
versionCheckHook,
gitMinimal,
}:
buildGoModule (finalAttrs: {
pname = "glab";
version = "1.61.0";
version = "1.62.0";
src = fetchFromGitLab {
owner = "gitlab-org";
repo = "cli";
tag = "v${finalAttrs.version}";
hash = "sha256-pouFnmHCfRFDy+MMbRI82o73jO8hRewHeXgGnJ4hnww=";
hash = "sha256-+dXMlNc54i/vEwYV0YRKXrdWejcgfXFW+tFq3tf8TZY=";
leaveDotGit = true;
postFetch = ''
cd "$out"
git rev-parse --short HEAD > $out/COMMIT
find "$out" -name .git -print0 | xargs -0 rm -rf
'';
};
vendorHash = "sha256-COp4RebkU36OChbZFeLALUppXqHLRbrm3D64Hb5RmI4=";
vendorHash = "sha256-sgph04zjHvvgL0QJm2//h8jyDg/5NY7dq50C0G0hYYM=";
ldflags = [
"-s"
@@ -27,12 +36,17 @@ buildGoModule (finalAttrs: {
"-X main.version=${finalAttrs.version}"
];
nativeCheckInputs = [ writableTmpDirAsHomeHook ];
preBuild = ''
ldflags+=" -X main.commit=$(cat COMMIT)"
'';
nativeBuildInputs = [
installShellFiles
makeBinaryWrapper
];
subPackages = [ "cmd/glab" ];
nativeBuildInputs = [ installShellFiles ];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
make manpage
installManPage share/man/man1/*
@@ -40,8 +54,27 @@ buildGoModule (finalAttrs: {
--bash <($out/bin/glab completion -s bash) \
--fish <($out/bin/glab completion -s fish) \
--zsh <($out/bin/glab completion -s zsh)
wrapProgram $out/bin/glab \
--set-default GLAB_CHECK_UPDATE 0 \
--set-default GLAB_SEND_TELEMETRY 0
'';
nativeCheckInputs = [ writableTmpDirAsHomeHook ];
preCheck = ''
git init
'';
doInstallCheck = true;
nativeInstallCheckInputs = [
gitMinimal
versionCheckHook
writableTmpDirAsHomeHook
];
versionCheckProgramArg = "version";
versionCheckKeepEnvironment = [ "HOME" ];
passthru.updateScript = nix-update-script { };
meta = {