Files

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

56 lines
1.3 KiB
Nix
Raw Permalink Normal View History

2025-10-09 14:15:47 +02:00
{
stdenv,
lib,
buildGoModule,
fetchFromGitHub,
installShellFiles,
buildPackages,
}:
buildGoModule rec {
pname = "nfpm";
version = "2.43.2";
src = fetchFromGitHub {
owner = "goreleaser";
repo = "nfpm";
rev = "v${version}";
hash = "sha256-RHYGVSR/hMekaNoIxBP2zw3RZi/SSj4RlSMJNvgbigw=";
};
vendorHash = "sha256-7OhiaB0PpwvFj+yLyoN0+/qpF+p/c/Vw+7Tn2XVYYjg=";
ldflags = [
"-s"
"-w"
"-X main.version=${version}"
];
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)
'';
meta = {
description = "Simple deb and rpm packager written in Go";
homepage = "https://github.com/goreleaser/nfpm";
changelog = "https://github.com/goreleaser/nfpm/releases/tag/v${version}";
maintainers = with lib.maintainers; [
techknowlogick
caarlos0
];
license = with lib.licenses; [ mit ];
mainProgram = "nfpm";
};
}