Skip to content

Commit

Permalink
fix(gomobile): Makefile
Browse files Browse the repository at this point in the history
Signed-off-by: Godefroy Ponsinet <godefroy.ponsinet@outlook.com>
  • Loading branch information
90dy committed Nov 8, 2018
1 parent 1a6532e commit ba04e40
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
4 changes: 3 additions & 1 deletion build/docker/android-ci/Makefile
@@ -1,7 +1,9 @@
MAKEFILE_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
IMAGE ?= bertychat/android-ci:v2

build:
docker build --pull -t $(IMAGE) .
cp $(MAKEFILE_DIR)/../patch/gomobile-env-flag.diff .
docker build --pull -t $(IMAGE) $(MAKEFILE_DIR)

release: build
docker push $(IMAGE)
11 changes: 11 additions & 0 deletions build/docker/patch/gomobile-env-flag.diff
@@ -0,0 +1,11 @@
--- env.go
+++ env.go
@@ -130,7 +130,7 @@ func envInit() (err error) {
"CXX="+clang+"++",
"CGO_CFLAGS="+cflags+" -arch "+archClang(arch),
"CGO_CXXFLAGS="+cflags+" -arch "+archClang(arch),
- "CGO_LDFLAGS="+cflags+" -arch "+archClang(arch),
+ "CGO_LDFLAGS="+cflags+" -arch "+archClang(arch)+" "+os.Getenv("CGO_LDFLAGS"),
"CGO_ENABLED=1",
)
darwinEnv[arch] = env
11 changes: 5 additions & 6 deletions client/react-native/gomobile/Makefile
Expand Up @@ -5,9 +5,7 @@ CORE_MOBILE := $(MAKEFILE_DIR)/core
CORE_SOURCES := $(shell find $(CORE_PACKAGE) -type f -name "*.go") \
$(shell find $(CORE_MOBILE) -type f -name "*.go")

BUILD_PATCH_PATH := $(MAKEFILE_DIR)/../../../.circleci/docker

GOPATH ?= $(HOME)/go
BUILD_PATCH_PATH := $(MAKEFILE_DIR)/../../../build/docker/patch

CGO_CPPFLAGS ?= -I$(MAKEFILE_DIR)/../../common/openssl/built/include

Expand Down Expand Up @@ -36,10 +34,11 @@ deps-osx:

.PHONY: deps
deps:
GO111MODULE=off go get golang.org/x/mobile/cmd/gomobile
patch -N ~/go/src/golang.org/x/mobile/cmd/gomobile/env.go $(BUILD_PATCH_PATH)/gomobile-env-flag.diff || true
rm -rf $(GOPATH)/src/golang.org/x/mobile
GO111MODULE=off go get -u golang.org/x/mobile/cmd/gomobile
go get -u golang.org/x/mobile/cmd/gobind
patch -N $(GOPATH)/src/golang.org/x/mobile/cmd/gomobile/env.go $(BUILD_PATCH_PATH)/gomobile-env-flag.diff || true
go install golang.org/x/mobile/cmd/gomobile
go get -v golang.org/x/mobile/cmd/gobind

.PHONY: init
init: deps
Expand Down

0 comments on commit ba04e40

Please sign in to comment.