1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-11-24 08:22:29 +02:00

Fix mac m1 chip build, get architecture during make mac-app. Fixes #2160 (#2162)

* Fix mac m1 chip build, get architecture during make mac-app. Fixes #2160

* Added goarch amd64 or arm64 on building mac-app
This commit is contained in:
João Aldeano 2022-01-25 09:42:56 +00:00 committed by GitHub
parent 2c16446efd
commit 61e07c3df7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,6 +16,13 @@ LDFLAGS += -X "github.com/mattermost/focalboard/server/model.BuildNumber=$(BUILD
LDFLAGS += -X "github.com/mattermost/focalboard/server/model.BuildDate=$(BUILD_DATE)"
LDFLAGS += -X "github.com/mattermost/focalboard/server/model.BuildHash=$(BUILD_HASH)"
# MAC cpu architecture
ifeq ($(shell uname -m),arm64)
MAC_GO_ARCH := arm64
else
MAC_GO_ARCH := amd64
endif
all: webapp server ## Build server and webapp.
prebuild: ## Run prebuild actions (install dependencies etc.).
@ -33,7 +40,7 @@ server: ## Build server for local environment.
server-mac: ## Build server for Mac.
mkdir -p bin/mac
$(eval LDFLAGS += -X "github.com/mattermost/focalboard/server/model.Edition=mac")
cd server; env GOOS=darwin GOARCH=amd64 go build -ldflags '$(LDFLAGS)' -o ../bin/mac/focalboard-server ./main
cd server; env GOOS=darwin GOARCH=$(MAC_GO_ARCH) go build -ldflags '$(LDFLAGS)' -o ../bin/mac/focalboard-server ./main
server-linux: ## Build server for Linux.
mkdir -p bin/linux
@ -115,7 +122,7 @@ server-test-mysql: ## Run server tests using mysql
@echo Starting docker container for mysql
docker-compose -f ./docker-testing/docker-compose-mysql.yml run start_dependencies
cd server; go test -race -v -count=1 ./...
docker-compose -f ./docker-testing/docker-compose-mysql.yml down -v --remove-orphans
docker-compose -f ./docker-testing/docker-compose-mysql.yml down -v --remove-orphans
server-test-postgres: export FB_UNIT_TESTING=1
server-test-postgres: export FB_STORE_TEST_DB_TYPE=postgres
@ -125,7 +132,7 @@ server-test-postgres: ## Run server tests using postgres
@echo Starting docker container for postgres
docker-compose -f ./docker-testing/docker-compose-postgres.yml run start_dependencies
cd server; go test -race -v -count=1 ./...
docker-compose -f ./docker-testing/docker-compose-postgres.yml down -v --remove-orphans
docker-compose -f ./docker-testing/docker-compose-postgres.yml down -v --remove-orphans
webapp: ## Build webapp.
cd webapp; npm run pack