From d494f3b2679faa8ed0a7cb4cc337155a6ac4afc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Tue, 19 May 2020 15:35:56 +0200 Subject: [PATCH] nix: enforce xcode only for status-go for ios MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to gomobile docs Xcode is only necessary for iOS: >For -target ios, gomobile must be run on an OS X machine with Xcode installed. https://godoc.org/golang.org/x/mobile/cmd/gomobile Signed-off-by: Jakub SokoĊ‚owski --- nix/status-go/mobile/build.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nix/status-go/mobile/build.nix b/nix/status-go/mobile/build.nix index 81b4fa0a2b..ff7daae0d3 100644 --- a/nix/status-go/mobile/build.nix +++ b/nix/status-go/mobile/build.nix @@ -9,6 +9,7 @@ , outputFileName ? "status-go-${source.shortRev}-${platform}.aar" }: let + inherit (stdenv) isDarwin; inherit (lib) concatStrings concatStringsSep concatMapStrings optionalString getAttr attrValues makeBinPath optional; @@ -28,13 +29,13 @@ in buildGoPackage { nativeBuildInputs = [ gomobile ] ++ optional (platform == "android") openjdk - ++ optional stdenv.isDarwin xcodeWrapper; + ++ optional isDarwin xcodeWrapper; # Fixes Cgo related build failures (see https://github.com/NixOS/nixpkgs/issues/25959 ) hardeningDisable = [ "fortify" ]; - # Ensure XCode is present, instead of failing at the end of the build - preConfigure = optionalString stdenv.isDarwin utils.enforceXCodeAvailable; + # Ensure XCode is present for iOS build, instead of failing at the end of the build + preConfigure = optionalString (isDarwin && platform == "ios") utils.enforceXCodeAvailable; # Build mobile libraries preBuild = let