nixpkgs/pkgs/tools/misc/goreleaser/default.nix
Carlos Alexandro Becker 481c4657d5
goreleaser: 1.19.2 -> 1.20.0
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-08-30 12:19:19 +00:00

54 lines
1.3 KiB
Nix

{ stdenv
, lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
, buildPackages
}:
buildGoModule rec {
pname = "goreleaser";
version = "1.20.0";
src = fetchFromGitHub {
owner = "goreleaser";
repo = pname;
rev = "v${version}";
sha256 = "iZqX/03+0koxLTbeUOxpQoEita6S/eszB8kMe/NtDcc=";
};
vendorHash = "sha256-YYFCoLwgx8OBfI4VcWO6AUqNZU2JdgGAJm26koJAzWA=";
ldflags =
[ "-s" "-w" "-X main.version=${version}" "-X main.builtBy=nixpkgs" ];
# tests expect the source files to be a build repo
doCheck = false;
nativeBuildInputs = [ installShellFiles ];
postInstall =
let emulator = stdenv.hostPlatform.emulator buildPackages;
in ''
${emulator} $out/bin/goreleaser man > goreleaser.1
installManPage ./goreleaser.1
installShellCompletion --cmd goreleaser \
--bash <(${emulator} $out/bin/goreleaser completion bash) \
--fish <(${emulator} $out/bin/goreleaser completion fish) \
--zsh <(${emulator} $out/bin/goreleaser completion zsh)
'';
meta = with lib; {
description = "Deliver Go binaries as fast and easily as possible";
homepage = "https://goreleaser.com";
maintainers = with maintainers; [
c0deaddict
endocrimes
sarcasticadmin
techknowlogick
developer-guy
caarlos0
];
license = licenses.mit;
};
}