depot/third_party/nixpkgs/pkgs/tools/package-management/nfpm/default.nix
Default email 87f9c27ba9 Project import generated by Copybara.
GitOrigin-RevId: fe2ecaf706a5907b5e54d979fbde4924d84b65fc
2023-04-12 14:48:02 +02:00

43 lines
1.1 KiB
Nix

{ stdenv
, lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
, buildPackages
}:
buildGoModule rec {
pname = "nfpm";
version = "2.28.0";
src = fetchFromGitHub {
owner = "goreleaser";
repo = pname;
rev = "v${version}";
sha256 = "sha256-KF/R0DearjiBtgmqM1NQxD8LKLNkly23t8CLDxkfqbk=";
};
vendorHash = "sha256-IcV/kXXvs/680zaeS/IQyW2aLTq1O73DEP+32cKXWnU=";
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";
maintainers = with maintainers; [ marsam techknowlogick caarlos0 ];
license = with licenses; [ mit ];
};
}