btrbk: add mainProgram
[NixPkgs.git] / pkgs / by-name / bo / bosh-cli / package.nix
blob12c97c83d7755239f23524944fdd1d12387bd485
1 { lib
2 , fetchFromGitHub
3 , buildGoModule
4 , makeWrapper
5 , openssh
6 }:
8 buildGoModule rec {
9   pname = "bosh-cli";
11   version = "7.8.0";
13   src = fetchFromGitHub {
14     owner = "cloudfoundry";
15     repo = pname;
16     rev = "v${version}";
17     sha256 = "sha256-DiW7Vq1rfkOqMM3133mIRmRyFDjFITRkXqY34HMdZtc=";
18   };
19   vendorHash = null;
21   postPatch = ''
22     substituteInPlace cmd/version.go --replace '[DEV BUILD]' '${version}'
23   '';
25   nativeBuildInputs = [ makeWrapper ];
27   subPackages = [ "." ];
29   doCheck = false;
31   postInstall = ''
32     mv $out/bin/bosh-cli $out/bin/bosh
33     wrapProgram $out/bin/bosh --prefix PATH : '${lib.makeBinPath [ openssh ]}'
34   '';
36   meta = with lib; {
37     description = "Command line interface to CloudFoundry BOSH";
38     homepage = "https://bosh.io";
39     changelog = "https://github.com/cloudfoundry/bosh-cli/releases/tag/v${version}";
40     license = licenses.asl20;
41     maintainers = with maintainers; [ ris ];
42     mainProgram = "bosh";
43   };