nixpkgs-suyu/pkgs/development/mobile/gomobile/resolve-nix-android-sdk.patch
Jakub Sokołowski dd2a8245a1
gomobile: init at 2020-06-22
The Android SDK is provided by `nixpkgs`, and in case of the Status Project
we build our app using that SDK in combination with gomobile since our
protocol library is written in Go:
https://github.com/golang/mobile

This tool is quite powerful and allows you even to build entire applications in Go:
https://pkg.go.dev/golang.org/x/mobile/cmd/gomobile#hdr-Compile_android_APK_and_iOS_app

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2021-04-23 11:17:17 +02:00

15 lines
570 B
Diff

diff --git a/cmd/gomobile/bind_androidapp.go b/cmd/gomobile/bind_androidapp.go
index 3b01adc..76216fa 100644
--- a/cmd/gomobile/bind_androidapp.go
+++ b/cmd/gomobile/bind_androidapp.go
@@ -372,6 +372,10 @@ func androidAPIPath() (string, error) {
var apiVer int
for _, fi := range fis {
name := fi.Name()
+ // Resolve symlinked directories (this is how the Nix Android SDK package is built)
+ if fi2, err := os.Stat(filepath.Join(sdkDir.Name(), name)); err == nil {
+ fi = fi2
+ }
if !fi.IsDir() || !strings.HasPrefix(name, "android-") {
continue
}