From f633e168adb632633a469a0b925fa32e806c54eb Mon Sep 17 00:00:00 2001 From: Pedro Pombeiro Date: Thu, 1 Aug 2019 19:28:08 +0200 Subject: [PATCH] nix: Upgrade to latest gomobile - Makes a couple of patches redundant; - Allows specifying min Android SDK level Signed-off-by: Pedro Pombeiro --- nix/status-go/default.nix | 2 +- nix/status-go/gomobile/default.nix | 9 ++++----- .../ignore-nullability-error-on-ios.patch | 12 ----------- nix/status-go/gomobile/ndk-search-path.patch | 20 ------------------- 4 files changed, 5 insertions(+), 38 deletions(-) delete mode 100644 nix/status-go/gomobile/ignore-nullability-error-on-ios.patch delete mode 100644 nix/status-go/gomobile/ndk-search-path.patch diff --git a/nix/status-go/default.nix b/nix/status-go/default.nix index b8bf4d9f0e..44ca5e3066 100644 --- a/nix/status-go/default.nix +++ b/nix/status-go/default.nix @@ -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"; diff --git a/nix/status-go/gomobile/default.nix b/nix/status-go/gomobile/default.nix index 448a7a7f54..6263365380 100644 --- a/nix/status-go/gomobile/default.nix +++ b/nix/status-go/gomobile/default.nix @@ -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\`"''} diff --git a/nix/status-go/gomobile/ignore-nullability-error-on-ios.patch b/nix/status-go/gomobile/ignore-nullability-error-on-ios.patch deleted file mode 100644 index e9c94c8917..0000000000 --- a/nix/status-go/gomobile/ignore-nullability-error-on-ios.patch +++ /dev/null @@ -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 - } diff --git a/nix/status-go/gomobile/ndk-search-path.patch b/nix/status-go/gomobile/ndk-search-path.patch deleted file mode 100644 index eb61334eec..0000000000 --- a/nix/status-go/gomobile/ndk-search-path.patch +++ /dev/null @@ -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 - }