nixpkgs/pkgs/tools/misc/goreleaser/default.nix

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

63 lines
1.5 KiB
Nix
Raw Normal View History

{ stdenv
, lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
, buildPackages
2023-10-07 23:20:47 +02:00
, testers
, goreleaser
}:
2020-03-20 10:23:24 +01:00
buildGoModule rec {
pname = "goreleaser";
2023-12-26 20:30:18 +01:00
version = "1.23.0";
2020-03-20 10:23:24 +01:00
src = fetchFromGitHub {
owner = "goreleaser";
repo = pname;
rev = "v${version}";
2023-12-26 20:30:18 +01:00
hash = "sha256-b3yXabHqpw0npkTlO4eKy41agtDV1QnpfctBYv4BV/Q=";
2020-03-20 10:23:24 +01:00
};
2023-12-26 20:30:18 +01:00
vendorHash = "sha256-c9fygb6ywTUwcF1jbgr8YQ0SR7u36C0bRDljakQRdGA=";
2020-03-20 10:23:24 +01:00
ldflags =
[ "-s" "-w" "-X main.version=${version}" "-X main.builtBy=nixpkgs" ];
2020-10-19 05:29:50 +02:00
# tests expect the source files to be a build repo
doCheck = false;
2020-03-20 10:23:24 +01:00
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)
'';
2023-10-07 23:20:47 +02:00
passthru.tests.version = testers.testVersion {
package = goreleaser;
command = "goreleaser -v";
inherit version;
};
2020-03-20 10:23:24 +01:00
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
];
2020-03-20 10:23:24 +01:00
license = licenses.mit;
2023-11-27 02:17:53 +01:00
mainProgram = "goreleaser";
2020-03-20 10:23:24 +01:00
};
}