nix: Upgrade to latest gomobile

- Makes a couple of patches redundant;
- Allows specifying min Android SDK level

Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
This commit is contained in:
Pedro Pombeiro 2019-08-01 19:28:08 +02:00
parent f691304b9d
commit f633e168ad
No known key found for this signature in database
GPG Key ID: C4A24185B2AA48A1
4 changed files with 5 additions and 38 deletions

View File

@ -31,7 +31,7 @@ let
"ANDROID_NDK_HOME=${androidPkgs.ndk-bundle}/libexec/android-sdk/ndk-bundle"
"PATH=${makeBinPath [ openjdk ]}:$PATH"
];
gomobileExtraFlags = [];
gomobileExtraFlags = [ "-androidapi 21" ];
};
ios = {
name = "ios";

View File

@ -11,9 +11,9 @@ let
in buildGoPackage rec {
pname = "gomobile";
version = "20190319-${strings.substring 0 7 rev}";
rev = "167ebed0ec6dd457a6b24a4f61db913f0af11f70";
sha256 = "0lspdhikhnhbwv8v0q6fs3a0pd9sjnhkpg8z03m2dc5h6f84m38w";
version = "20190719-${strings.substring 0 7 rev}";
rev = "d2bd2a29d028cb94031e5e81788b19b371d00eb8";
sha256 = "1nv6vvhnjr01nx9y06q46ww87dppdwpbqrlsfg1xf2587wxl8xiv";
goPackagePath = "golang.org/x/mobile";
subPackages = [ "bind" "cmd/gobind" "cmd/gomobile" ];
@ -24,8 +24,7 @@ in buildGoPackage rec {
# Ensure XCode and the iPhone SDK are present, instead of failing at the end of the build
preConfigure = optionalString isDarwin utils.enforceiPhoneSDKAvailable;
patches = [ ./ndk-search-path.patch ./resolve-nix-android-sdk.patch ]
++ optional isDarwin ./ignore-nullability-error-on-ios.patch;
patches = [ ./resolve-nix-android-sdk.patch ];
postPatch = ''
${optionalString platform.targetAndroid ''substituteInPlace cmd/gomobile/install.go --replace "\`adb\`" "\`${platform-tools}/bin/adb\`"''}

View File

@ -1,12 +0,0 @@
diff --git a/cmd/gomobile/env.go b/cmd/gomobile/env.go
index dbf9c8c..538cf35 100644
--- a/cmd/gomobile/env.go
+++ b/cmd/gomobile/env.go
@@ -138,6 +138,7 @@ func envInit() (err error) {
panic(fmt.Errorf("unknown GOARCH: %q", arch))
}
cflags += " -fembed-bitcode"
+ cflags += " -Wno-nullability-completeness"
if err != nil {
return err
}

View File

@ -1,20 +0,0 @@
diff --git a/cmd/gomobile/env.go b/cmd/gomobile/env.go
index dbf9c8c..a1c835a 100644
--- a/cmd/gomobile/env.go
+++ b/cmd/gomobile/env.go
@@ -165,10 +165,13 @@ func ndkRoot() (string, error) {
if androidHome == "" {
return "", errors.New("The Android SDK was not found. Please set ANDROID_HOME to the root of the Android SDK.")
}
- ndkRoot := filepath.Join(androidHome, "ndk-bundle")
+ ndkRoot := os.Getenv("ANDROID_NDK_HOME")
+ if ndkRoot == "" {
+ ndkRoot = filepath.Join(androidHome, "ndk-bundle")
+ }
_, err := os.Stat(ndkRoot)
if err != nil {
- return "", fmt.Errorf("The NDK was not found in $ANDROID_HOME/ndk-bundle (%q). Install the NDK with `sdkmanager 'ndk-bundle'`", ndkRoot)
+ return "", fmt.Errorf("The NDK was not found in $ANDROID_HOME/ndk-bundle (%q) nor in ANDROID_NDK_HOME. Install the NDK with `sdkmanager 'ndk-bundle'`", ndkRoot)
}
return ndkRoot, nil
}