mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 07:53:19 +00:00
Merge pull request #223415 from caarlos0/nfpm-cmp-man
nfpm: add man and completions
This commit is contained in:
commit
25c7ebab8d
@ -1,4 +1,10 @@
|
||||
{ lib, buildGoModule, fetchFromGitHub }:
|
||||
{ stdenv
|
||||
, lib
|
||||
, buildGoModule
|
||||
, fetchFromGitHub
|
||||
, installShellFiles
|
||||
, buildPackages
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "nfpm";
|
||||
@ -15,6 +21,19 @@ buildGoModule rec {
|
||||
|
||||
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 = with lib; {
|
||||
description = "A simple deb and rpm packager written in Go";
|
||||
homepage = "https://github.com/goreleaser/nfpm";
|
||||
|
Loading…
Reference in New Issue
Block a user