2021-03-04 12:54:50 +00:00
|
|
|
{ lib, 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 13:41:18 +01:00
|
|
|
pname = "cloudfoundry-cli";
|
2021-10-10 18:53:22 +01:00
|
|
|
version = "8.0.0";
|
2017-11-24 12:12:47 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2018-04-21 20:57:22 +01:00
|
|
|
owner = "cloudfoundry";
|
|
|
|
repo = "cli";
|
2017-11-24 12:12:47 +00:00
|
|
|
rev = "v${version}";
|
2021-10-10 18:53:22 +01:00
|
|
|
sha256 = "00cwnfylra0msbb423ad21if98s6smzccsyidqsl4r2mrlkhahwm";
|
2020-07-27 21:33:58 +01:00
|
|
|
};
|
2021-10-10 18:53:22 +01:00
|
|
|
vendorSha256 = "0fcgyyd11xfhn8i11bqnaw3h51bj1y8s37b4d8wzv31dr8zswqsc";
|
2021-01-31 16:26:07 +00:00
|
|
|
|
|
|
|
subPackages = [ "." ];
|
2020-07-27 21:33:58 +01:00
|
|
|
|
|
|
|
# upstream have helpfully moved the bash completion script to a separate
|
|
|
|
# repo which receives no releases or even tags
|
|
|
|
bashCompletionScript = fetchurl {
|
2021-10-10 18:53:22 +01:00
|
|
|
url = "https://raw.githubusercontent.com/cloudfoundry/cli-ci/5f4f0d5d01e89c6333673f0fa96056749e71b3cd/ci/installers/completion/cf8";
|
|
|
|
sha256 = "06w26kpnjd3f2wdjhb4pp0kaq2gb9kf87v7pjd9n2g7s7qhdqyhy";
|
2017-11-24 12:12:47 +00:00
|
|
|
};
|
|
|
|
|
2020-04-27 10:30:47 +01:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2021-08-26 07:45:51 +01:00
|
|
|
ldflags = [
|
2021-01-31 16:26:07 +00:00
|
|
|
"-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 21:33:58 +01: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 02:11:51 +01:00
|
|
|
homepage = "https://github.com/cloudfoundry/cli";
|
2017-11-24 12:12:47 +00:00
|
|
|
maintainers = with maintainers; [ ris ];
|
|
|
|
license = licenses.asl20;
|
|
|
|
};
|
|
|
|
}
|