From 22c0c35724dc3b0cb791444b4f2fe4d3275f18e3 Mon Sep 17 00:00:00 2001 From: Jakub Sokołowski Date: Fri, 5 Nov 2021 13:59:33 +0100 Subject: gomobile: make providing Android SDK optional MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently there are no `aarch64-darwin` builds of Android SDK available. For this reason attempts to build `gomobile` on that platform fail with: ``` No Android SDK tarballs are available for system architecture: aarch64-darwin ``` Signed-off-by: Jakub Sokołowski --- pkgs/development/mobile/gomobile/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'pkgs') diff --git a/pkgs/development/mobile/gomobile/default.nix b/pkgs/development/mobile/gomobile/default.nix index ce44b7dd934..4087f1cca80 100644 --- a/pkgs/development/mobile/gomobile/default.nix +++ b/pkgs/development/mobile/gomobile/default.nix @@ -1,6 +1,7 @@ { stdenv, lib, fetchgit, buildGoModule, zlib, makeWrapper, xcodeenv, androidenv , xcodeWrapperArgs ? { } , xcodeWrapper ? xcodeenv.composeXcodeWrapper xcodeWrapperArgs +, withAndroidPkgs ? true , androidPkgs ? androidenv.composeAndroidPackages { includeNDK = true; ndkVersion = "22.1.7171670"; @@ -43,10 +44,12 @@ buildGoModule { mkdir -p $out/src/golang.org/x ln -s $src $out/src/golang.org/x/mobile wrapProgram $out/bin/gomobile \ - --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ zlib ]}" \ + '' + lib.optionalString withAndroidPkgs '' --prefix PATH : "${androidPkgs.androidsdk}/bin" \ --set ANDROID_NDK_HOME "${androidPkgs.androidsdk}/libexec/android-sdk/ndk-bundle" \ - --set ANDROID_HOME "${androidPkgs.androidsdk}/libexec/android-sdk" + --set ANDROID_HOME "${androidPkgs.androidsdk}/libexec/android-sdk" \ + '' + '' + --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ zlib ]}" ''; meta = with lib; { -- cgit 1.4.1