2023-03-30 22:05:00 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
, buildPackages
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "nfpm";
|
2023-04-12 12:48:02 +00:00
|
|
|
version = "2.28.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "goreleaser";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-04-12 12:48:02 +00:00
|
|
|
sha256 = "sha256-KF/R0DearjiBtgmqM1NQxD8LKLNkly23t8CLDxkfqbk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
vendorHash = "sha256-IcV/kXXvs/680zaeS/IQyW2aLTq1O73DEP+32cKXWnU=";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2021-08-27 14:25:00 +00:00
|
|
|
ldflags = [ "-s" "-w" "-X main.version=${version}" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-03-30 22:05:00 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
postInstall =
|
|
|
|
let emulator = stdenv.hostPlatform.emulator buildPackages;
|
|
|
|
in ''
|
|
|
|
${emulator} $out/bin/nfpm man > nfpm.1
|
|
|
|
installManPage ./nfpm.1
|
|
|
|
installShellCompletion --cmd nfpm \
|
|
|
|
--bash <(${emulator} $out/bin/nfpm completion bash) \
|
|
|
|
--fish <(${emulator} $out/bin/nfpm completion fish) \
|
|
|
|
--zsh <(${emulator} $out/bin/nfpm completion zsh)
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A simple deb and rpm packager written in Go";
|
|
|
|
homepage = "https://github.com/goreleaser/nfpm";
|
2023-03-27 19:17:25 +00:00
|
|
|
maintainers = with maintainers; [ marsam techknowlogick caarlos0 ];
|
2022-03-30 09:31:56 +00:00
|
|
|
license = with licenses; [ mit ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2020-08-20 17:08:02 +00:00
|
|
|
}
|