diff options
author | Robert Scott <robert.scott@digital.cabinet-office.gov.uk> | 2018-12-18 17:53:01 +0000 |
---|---|---|
committer | Robert Scott <robert.scott@digital.cabinet-office.gov.uk> | 2018-12-21 09:56:14 +0000 |
commit | 61fad2cdceb6dc6181d3208fc5acced2515f36e0 (patch) | |
tree | 62af7041ed03208a86c37495b6ddf96631649d49 /pkgs/development/tools/cloudfoundry-cli | |
parent | a6050ab9d0e2e5b37bb64328ed44328af3b8ec40 (diff) | |
download | nixlib-61fad2cdceb6dc6181d3208fc5acced2515f36e0.tar nixlib-61fad2cdceb6dc6181d3208fc5acced2515f36e0.tar.gz nixlib-61fad2cdceb6dc6181d3208fc5acced2515f36e0.tar.bz2 nixlib-61fad2cdceb6dc6181d3208fc5acced2515f36e0.tar.lz nixlib-61fad2cdceb6dc6181d3208fc5acced2515f36e0.tar.xz nixlib-61fad2cdceb6dc6181d3208fc5acced2515f36e0.tar.zst nixlib-61fad2cdceb6dc6181d3208fc5acced2515f36e0.zip |
cloudfoundry-cli: fix build on multiple platforms, notably darwin, to produce correct binary for target
Diffstat (limited to 'pkgs/development/tools/cloudfoundry-cli')
-rw-r--r-- | pkgs/development/tools/cloudfoundry-cli/default.nix | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/pkgs/development/tools/cloudfoundry-cli/default.nix b/pkgs/development/tools/cloudfoundry-cli/default.nix index 3ce9e64c0f7a..bdcc8b18d218 100644 --- a/pkgs/development/tools/cloudfoundry-cli/default.nix +++ b/pkgs/development/tools/cloudfoundry-cli/default.nix @@ -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" ]; }; } |