gomobile: make providing Android SDK optional
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 <jakub@status.im>
This commit is contained in:
parent
65135081f6
commit
22c0c35724
|
@ -1,6 +1,7 @@
|
||||||
{ stdenv, lib, fetchgit, buildGoModule, zlib, makeWrapper, xcodeenv, androidenv
|
{ stdenv, lib, fetchgit, buildGoModule, zlib, makeWrapper, xcodeenv, androidenv
|
||||||
, xcodeWrapperArgs ? { }
|
, xcodeWrapperArgs ? { }
|
||||||
, xcodeWrapper ? xcodeenv.composeXcodeWrapper xcodeWrapperArgs
|
, xcodeWrapper ? xcodeenv.composeXcodeWrapper xcodeWrapperArgs
|
||||||
|
, withAndroidPkgs ? true
|
||||||
, androidPkgs ? androidenv.composeAndroidPackages {
|
, androidPkgs ? androidenv.composeAndroidPackages {
|
||||||
includeNDK = true;
|
includeNDK = true;
|
||||||
ndkVersion = "22.1.7171670";
|
ndkVersion = "22.1.7171670";
|
||||||
|
@ -43,10 +44,12 @@ buildGoModule {
|
||||||
mkdir -p $out/src/golang.org/x
|
mkdir -p $out/src/golang.org/x
|
||||||
ln -s $src $out/src/golang.org/x/mobile
|
ln -s $src $out/src/golang.org/x/mobile
|
||||||
wrapProgram $out/bin/gomobile \
|
wrapProgram $out/bin/gomobile \
|
||||||
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ zlib ]}" \
|
'' + lib.optionalString withAndroidPkgs ''
|
||||||
--prefix PATH : "${androidPkgs.androidsdk}/bin" \
|
--prefix PATH : "${androidPkgs.androidsdk}/bin" \
|
||||||
--set ANDROID_NDK_HOME "${androidPkgs.androidsdk}/libexec/android-sdk/ndk-bundle" \
|
--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; {
|
meta = with lib; {
|
||||||
|
|
Loading…
Reference in a new issue