1{ stdenv, buildGoPackage, fetchFromGitHub, go }:
2
3buildGoPackage rec {
4 name = "cloudfoundry-cli-${version}";
5 version = "6.37.0";
6
7 goPackagePath = "code.cloudfoundry.org/cli";
8
9 subPackages = [ "." ];
10
11 src = fetchFromGitHub {
12 owner = "cloudfoundry";
13 repo = "cli";
14 rev = "v${version}";
15 sha256 = "1v4f1fyydpzkfir46g4ppbf3zmk3ym6kxswpkdjls8h3dbb2fbnv";
16 };
17
18 outputs = [ "out" ];
19
20 buildPhase = ''
21 cd go/src/${goPackagePath}
22 CF_BUILD_DATE="1970-01-01" make build
23 '';
24
25 installPhase = ''
26 install -Dm555 out/cf "$out/bin/cf"
27 remove-references-to -t ${go} "$out/bin/cf"
28 install -Dm444 -t "$out/share/bash-completion/completions/" "$src/ci/installers/completion/cf"
29 '';
30
31 meta = with stdenv.lib; {
32 description = "The official command line client for Cloud Foundry";
33 homepage = https://github.com/cloudfoundry/cli;
34 maintainers = with maintainers; [ ris ];
35 license = licenses.asl20;
36 };
37}