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";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "2.40.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "goreleaser";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-hBA15pHCYgBKTeHBVBZkhPqoMnDkd13wx9afygTDPWk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
vendorHash = "sha256-d4MuoKc7LF5KCXhLxIwuqS2Xu7ClLhyJZH4/+/LYm3w=";
|
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; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Simple deb and rpm packager written in Go";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/goreleaser/nfpm";
|
2023-07-15 17:15:38 +00:00
|
|
|
changelog = "https://github.com/goreleaser/nfpm/releases/tag/v${version}";
|
2024-05-15 15:35:15 +00:00
|
|
|
maintainers = with maintainers; [ techknowlogick caarlos0 ];
|
2022-03-30 09:31:56 +00:00
|
|
|
license = with licenses; [ mit ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "nfpm";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2020-08-20 17:08:02 +00:00
|
|
|
}
|