nixpkgs/pkgs/development/tools/cloudfoundry-cli/default.nix

47 lines
1.3 KiB
Nix
Raw Normal View History

2017-11-24 12:12:47 +00:00
{ stdenv, buildGoPackage, fetchFromGitHub, go }:
buildGoPackage rec {
name = "cloudfoundry-cli-${version}";
2018-12-19 12:50:42 +00:00
version = "6.41.0";
2017-11-24 12:12:47 +00:00
goPackagePath = "code.cloudfoundry.org/cli";
subPackages = [ "." ];
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}";
2018-12-19 12:50:42 +00:00
sha256 = "1dkd0lfq55qpnxsrigffaqm2nlcxr0bm0jsl4rsjlmb8p2vgpx8b";
2017-11-24 12:12:47 +00:00
};
makeTarget = let hps = stdenv.hostPlatform.system; in
if hps == "x86_64-darwin" then
"out/cf-cli_osx"
else if hps == "x86_64-linux" then
"out/cf-cli_linux_x86-64"
else if hps == "i686-linux" then
"out/cf-cli_linux_i686"
else
throw "make target for this platform unknown";
buildPhase = ''
cd go/src/${goPackagePath}
CF_BUILD_DATE="1970-01-01" make $makeTarget
cp $makeTarget out/cf
2017-11-24 12:12:47 +00:00
'';
installPhase = ''
install -Dm555 out/cf "$bin/bin/cf"
install -Dm444 -t "$bin/share/bash-completion/completions/" "$src/ci/installers/completion/cf"
2017-11-24 12:12:47 +00:00
'';
meta = with stdenv.lib; {
description = "The official command line client for Cloud Foundry";
homepage = https://github.com/cloudfoundry/cli;
maintainers = with maintainers; [ ris ];
license = licenses.asl20;
platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ];
2017-11-24 12:12:47 +00:00
};
}