2021-01-31 16:26:07 +00:00
|
|
|
{ lib, stdenv, buildGoModule, fetchFromGitHub, fetchurl, installShellFiles }:
|
2017-11-24 12:12:47 +00:00
|
|
|
|
2021-01-31 16:26:07 +00:00
|
|
|
buildGoModule rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "cloudfoundry-cli";
|
2021-01-31 16:26:07 +00:00
|
|
|
version = "7.2.0";
|
2017-11-24 12:12:47 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2018-04-21 19:57:22 +00:00
|
|
|
owner = "cloudfoundry";
|
|
|
|
repo = "cli";
|
2017-11-24 12:12:47 +00:00
|
|
|
rev = "v${version}";
|
2021-01-31 16:26:07 +00:00
|
|
|
sha256 = "0cf5vshyz6j70sv7x43r1404hdcmkzxgdb7514kjilp5z6wsr1nv";
|
2020-07-27 20:33:58 +00:00
|
|
|
};
|
2021-01-31 16:26:07 +00:00
|
|
|
# vendor directory stale
|
|
|
|
deleteVendor = true;
|
|
|
|
vendorSha256 = "0p0s0dr7kpmmnim4fps62vj4zki2qxxdq5ww0fzrf1372xbl4kp2";
|
|
|
|
|
|
|
|
subPackages = [ "." ];
|
2020-07-27 20:33:58 +00:00
|
|
|
|
|
|
|
# upstream have helpfully moved the bash completion script to a separate
|
|
|
|
# repo which receives no releases or even tags
|
|
|
|
bashCompletionScript = fetchurl {
|
|
|
|
url = "https://raw.githubusercontent.com/cloudfoundry/cli-ci/6087781a0e195465a35c79c8e968ae708c6f6351/ci/installers/completion/cf7";
|
|
|
|
sha256 = "1vhg9jcgaxcvvb4pqnhkf27b3qivs4d3w232j0gbh9393m3qxrvy";
|
2017-11-24 12:12:47 +00:00
|
|
|
};
|
|
|
|
|
2020-04-27 09:30:47 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2021-01-31 16:26:07 +00:00
|
|
|
buildFlagsArray = [
|
|
|
|
"-ldflags="
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X code.cloudfoundry.org/cli/version.binaryBuildDate=1970-01-01"
|
|
|
|
"-X code.cloudfoundry.org/cli/version.binaryVersion=${version}"
|
|
|
|
];
|
2017-11-24 12:12:47 +00:00
|
|
|
|
2021-01-31 16:26:07 +00:00
|
|
|
postInstall = ''
|
|
|
|
mv "$out/bin/cli" "$out/bin/cf"
|
2020-07-27 20:33:58 +00:00
|
|
|
installShellCompletion --bash $bashCompletionScript
|
2017-11-24 12:12:47 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-23 12:26:19 +00:00
|
|
|
meta = with lib; {
|
2017-11-24 12:12:47 +00:00
|
|
|
description = "The official command line client for Cloud Foundry";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/cloudfoundry/cli";
|
2017-11-24 12:12:47 +00:00
|
|
|
maintainers = with maintainers; [ ris ];
|
|
|
|
license = licenses.asl20;
|
|
|
|
};
|
|
|
|
}
|