gomobile: 2021-06-14 -> 2022-05-18

Includes several important fixes for macOS and Catalyst, Android NDKs,
and iOS builds.

- https://go.googlesource.com/mobile/+/8578da9835fd365e78a6e63048c103b27a53a82c
- https://go.googlesource.com/mobile/+/76c259c465ba39f84de7e2751a666612ddca556b
- https://go.googlesource.com/mobile/+/9cba7bc03c0fdba1b8fe7dfd476c2001656dde9e
- https://go.googlesource.com/mobile/+/80cb72e7af8e71b65e7d9e59fb4ec5d620134608
- https://go.googlesource.com/mobile/+/6d8ad35e460371e979b330d80492cba19676f933
- https://go.googlesource.com/mobile/+/b5eb1abba0f2d9331b29a29967d535890e026cec

Also moves use of `wrapProgram` to `postFixup` and dropped `ANDROID_NDK_HOME`.
No longer necessary as `8578da98` detects it from `ANDROID_HOME`.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2022-05-10 17:56:39 +02:00
parent 9ba8f9c6cf
commit 53cf6df9d5
No known key found for this signature in database
GPG Key ID: 09AA5403E54D9931

View File

@ -9,15 +9,15 @@
buildGoModule {
pname = "gomobile";
version = "unstable-2021-06-14";
version = "unstable-2022-05-18";
vendorSha256 = "1irgkgv72rakg7snk1bnp10ibr64ykz9l40s59l4fnl63zsh12a0";
vendorSha256 = "sha256-AmOy3X+d2OD7ZLbFuy+SptdlgWbZJaXYEgO79M64ufE=";
src = fetchgit {
rev = "7c8f154d100840bc5828285bb390bbae1cb5a98c";
rev = "8578da9835fd365e78a6e63048c103b27a53a82c";
name = "gomobile";
url = "https://go.googlesource.com/mobile";
sha256 = "1w9mra1mqf60iafp0ywvja5196fjsjyfhvz4yizqq4qkyll5qmj1";
sha256 = "sha256-AOR/p+DW83f2+BOxm2rFXBCrotcIyunK3UzQ/dnauWY=";
};
subPackages = [ "bind" "cmd/gobind" "cmd/gomobile" ];
@ -32,8 +32,7 @@ buildGoModule {
postPatch = ''
substituteInPlace cmd/gomobile/env.go --replace \
'tmpdir, err = ioutil.TempDir("", "gomobile-work-")' \
'tmpdir = filepath.Join(os.Getenv("NIX_BUILD_TOP"), "gomobile-work")' \
--replace '"io/ioutil"' ""
'tmpdir = filepath.Join(os.Getenv("NIX_BUILD_TOP"), "gomobile-work")'
substituteInPlace cmd/gomobile/init.go --replace \
'tmpdir, err = ioutil.TempDir(gomobilepath, "work-")' \
'tmpdir = filepath.Join(os.Getenv("NIX_BUILD_TOP"), "work")'
@ -43,13 +42,18 @@ buildGoModule {
postInstall = ''
mkdir -p $out/src/golang.org/x
ln -s $src $out/src/golang.org/x/mobile
wrapProgram $out/bin/gomobile \
'';
postFixup = ''
for bin in $(ls $out/bin); do
wrapProgram $out/bin/$bin \
--suffix GOPATH : $out \
'' + 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" \
--prefix PATH : "${androidPkgs.androidsdk}/bin" \
--set-default ANDROID_HOME "${androidPkgs.androidsdk}/libexec/android-sdk" \
'' + ''
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ zlib ]}"
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ zlib ]}"
done
'';
meta = with lib; {