biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / tools / package-management / nfpm / default.nix
blob621cd3327058aaf11d0d6d376416b2bc82195b0a
1 { stdenv
2 , lib
3 , buildGoModule
4 , fetchFromGitHub
5 , installShellFiles
6 , buildPackages
7 }:
9 buildGoModule rec {
10   pname = "nfpm";
11   version = "2.40.0";
13   src = fetchFromGitHub {
14     owner = "goreleaser";
15     repo = pname;
16     rev = "v${version}";
17     hash = "sha256-hBA15pHCYgBKTeHBVBZkhPqoMnDkd13wx9afygTDPWk=";
18   };
20   vendorHash = "sha256-d4MuoKc7LF5KCXhLxIwuqS2Xu7ClLhyJZH4/+/LYm3w=";
22   ldflags = [ "-s" "-w" "-X main.version=${version}" ];
24   nativeBuildInputs = [ installShellFiles ];
26   postInstall =
27     let emulator = stdenv.hostPlatform.emulator buildPackages;
28     in ''
29       ${emulator} $out/bin/nfpm man > nfpm.1
30       installManPage ./nfpm.1
31       installShellCompletion --cmd nfpm \
32         --bash <(${emulator} $out/bin/nfpm completion bash) \
33         --fish <(${emulator} $out/bin/nfpm completion fish) \
34         --zsh  <(${emulator} $out/bin/nfpm completion zsh)
35     '';
37   meta = with lib; {
38     description = "Simple deb and rpm packager written in Go";
39     homepage = "https://github.com/goreleaser/nfpm";
40     changelog = "https://github.com/goreleaser/nfpm/releases/tag/v${version}";
41     maintainers = with maintainers; [ techknowlogick caarlos0 ];
42     license = with licenses; [ mit ];
43     mainProgram = "nfpm";
44   };