cloudfoundry-cli: fix build on multiple platforms, notably darwin, to produce correct binary for target
This commit is contained in:
parent
a6050ab9d0
commit
61fad2cdce
1 changed files with 13 additions and 1 deletions
|
@ -17,9 +17,20 @@ buildGoPackage rec {
|
|||
|
||||
outputs = [ "out" ];
|
||||
|
||||
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 build
|
||||
CF_BUILD_DATE="1970-01-01" make $makeTarget
|
||||
cp $makeTarget out/cf
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
|
@ -33,5 +44,6 @@ buildGoPackage rec {
|
|||
homepage = https://github.com/cloudfoundry/cli;
|
||||
maintainers = with maintainers; [ ris ];
|
||||
license = licenses.asl20;
|
||||
platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ];
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue