2023-04-12 12:48:02 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
, buildPackages
|
2023-10-09 19:29:22 +00:00
|
|
|
, testers
|
|
|
|
, goreleaser
|
2023-04-12 12:48:02 +00:00
|
|
|
}:
|
2020-11-30 08:33:03 +00:00
|
|
|
buildGoModule rec {
|
|
|
|
pname = "goreleaser";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "1.21.2";
|
2020-11-30 08:33:03 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "goreleaser";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-dH5Fh3F+UJRS/zZkxhZ7TzLWo0ncUNKbLZdjbnBPloE=";
|
2020-11-30 08:33:03 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
vendorHash = "sha256-Ua1Eey0trzha1WyPtwZYvfzOSywb7ThfWcI/VlMgD88=";
|
2020-11-30 08:33:03 +00:00
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
ldflags =
|
|
|
|
[ "-s" "-w" "-X main.version=${version}" "-X main.builtBy=nixpkgs" ];
|
2020-11-30 08:33:03 +00:00
|
|
|
|
|
|
|
# tests expect the source files to be a build repo
|
|
|
|
doCheck = false;
|
|
|
|
|
2023-04-12 12:48:02 +00: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-09 19:29:22 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = goreleaser;
|
|
|
|
command = "goreleaser -v";
|
|
|
|
inherit version;
|
|
|
|
};
|
|
|
|
|
2020-11-30 08:33:03 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Deliver Go binaries as fast and easily as possible";
|
|
|
|
homepage = "https://goreleaser.com";
|
2023-04-12 12:48:02 +00:00
|
|
|
maintainers = with maintainers; [
|
|
|
|
c0deaddict
|
|
|
|
endocrimes
|
|
|
|
sarcasticadmin
|
|
|
|
techknowlogick
|
|
|
|
developer-guy
|
|
|
|
caarlos0
|
|
|
|
];
|
2020-11-30 08:33:03 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|