nixpkgs/pkgs/tools/package-management/nfpm/default.nix

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

45 lines
1.2 KiB
Nix
Raw Normal View History

{ stdenv
, lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
, buildPackages
}:
2019-07-31 05:38:15 +02:00
buildGoModule rec {
pname = "nfpm";
version = "2.32.0";
2019-07-31 05:38:15 +02:00
src = fetchFromGitHub {
owner = "goreleaser";
repo = pname;
rev = "v${version}";
hash = "sha256-qxxa7V96cJJLu9Ki2NL5UreRyiR9sPhIVA9cllF4y70=";
2019-07-31 05:38:15 +02:00
};
vendorHash = "sha256-lVejUufXI5Ihv7hU1N8/MHrwUgIfaHmcj1MR0RTsKVU=";
2021-08-26 08:45:51 +02:00
ldflags = [ "-s" "-w" "-X main.version=${version}" ];
2019-07-31 05:38:15 +02: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)
'';
2019-07-31 05:38:15 +02:00
meta = with lib; {
description = "A 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 maintainers; [ marsam techknowlogick caarlos0 ];
2022-03-19 04:24:36 +01:00
license = with licenses; [ mit ];
2019-07-31 05:38:15 +02:00
};
}