Merge pull request #111482 from risicle/ris-cloudfoundry-cli-7.2.0

This commit is contained in:
Sandro 2021-01-31 19:32:39 +01:00 committed by GitHub
commit 0ebabc7057
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 27 deletions

View File

@ -1,19 +1,20 @@
{ lib, stdenv, buildGoPackage, fetchFromGitHub, fetchurl, installShellFiles }: { lib, stdenv, buildGoModule, fetchFromGitHub, fetchurl, installShellFiles }:
buildGoPackage rec { buildGoModule rec {
pname = "cloudfoundry-cli"; pname = "cloudfoundry-cli";
version = "7.0.1"; version = "7.2.0";
goPackagePath = "code.cloudfoundry.org/cli";
subPackages = [ "." ];
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "cloudfoundry"; owner = "cloudfoundry";
repo = "cli"; repo = "cli";
rev = "v${version}"; rev = "v${version}";
sha256 = "0jh4x7xlijp1naak5qyc256zkzlrczl6g4iz94s8wx2zj7np0q5l"; sha256 = "0cf5vshyz6j70sv7x43r1404hdcmkzxgdb7514kjilp5z6wsr1nv";
}; };
# vendor directory stale
deleteVendor = true;
vendorSha256 = "0p0s0dr7kpmmnim4fps62vj4zki2qxxdq5ww0fzrf1372xbl4kp2";
subPackages = [ "." ];
# upstream have helpfully moved the bash completion script to a separate # upstream have helpfully moved the bash completion script to a separate
# repo which receives no releases or even tags # repo which receives no releases or even tags
@ -24,24 +25,16 @@ buildGoPackage rec {
nativeBuildInputs = [ installShellFiles ]; nativeBuildInputs = [ installShellFiles ];
makeTarget = let hps = stdenv.hostPlatform.system; in buildFlagsArray = [
if hps == "x86_64-darwin" then "-ldflags="
"out/cf-cli_osx" "-s"
else if hps == "x86_64-linux" then "-w"
"out/cf-cli_linux_x86-64" "-X code.cloudfoundry.org/cli/version.binaryBuildDate=1970-01-01"
else if hps == "i686-linux" then "-X code.cloudfoundry.org/cli/version.binaryVersion=${version}"
"out/cf-cli_linux_i686" ];
else
throw "make target for this platform unknown";
buildPhase = '' postInstall = ''
cd go/src/${goPackagePath} mv "$out/bin/cli" "$out/bin/cf"
CF_BUILD_DATE="1970-01-01" make $makeTarget
cp $makeTarget out/cf
'';
installPhase = ''
install -Dm555 out/cf "$out/bin/cf"
installShellCompletion --bash $bashCompletionScript installShellCompletion --bash $bashCompletionScript
''; '';
@ -50,6 +43,5 @@ buildGoPackage rec {
homepage = "https://github.com/cloudfoundry/cli"; homepage = "https://github.com/cloudfoundry/cli";
maintainers = with maintainers; [ ris ]; maintainers = with maintainers; [ ris ];
license = licenses.asl20; license = licenses.asl20;
platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ];
}; };
} }

View File

@ -11859,7 +11859,7 @@ in
cloudcompare = libsForQt5.callPackage ../applications/graphics/cloudcompare {}; cloudcompare = libsForQt5.callPackage ../applications/graphics/cloudcompare {};
cloudfoundry-cli = callPackage ../development/tools/cloudfoundry-cli { }; cloudfoundry-cli = callPackage ../applications/networking/cluster/cloudfoundry-cli { };
clpm = callPackage ../development/tools/clpm {}; clpm = callPackage ../development/tools/clpm {};