Merge pull request 'add drone step for macos arm64' (#88) from macosarm64 into trunk

Reviewed-on: cwtch.im/libcwtch-go#88
This commit is contained in:
Sarah Jamie Lewis 2022-06-22 19:14:51 +00:00
commit e70e0f8f2f
3 changed files with 26 additions and 6 deletions

View File

@ -158,10 +158,18 @@ steps:
# TODO: upgrade to go1.16, remove mod/vendor, add go install for 1.16 # TODO: upgrade to go1.16, remove mod/vendor, add go install for 1.16
- echo `git describe --tags` > VERSION - echo `git describe --tags` > VERSION
- echo `date +%G-%m-%d-%H-%M` > BUILDDATE - echo `date +%G-%m-%d-%H-%M` > BUILDDATE
- name: build-macos - name: build-macos-x64
commands: commands:
- export PATH=$PATH:/usr/local/go/bin/ - export PATH=$PATH:/usr/local/go/bin/
- make macos - make libCwtch.x64.dylib
- name: build-macos-arm64
when:
event:
- push
status: [ success ]
commands:
- export PATH=$PATH:/usr/local/go/bin/
- make libCwtch.arm.dylib
- name: deploy-buildfiles - name: deploy-buildfiles
environment: environment:
BUILDFILES_KEY: BUILDFILES_KEY:
@ -177,6 +185,7 @@ steps:
- export DIR=libCwtch-go-macos-`cat BUILDDATE`-`cat VERSION` - export DIR=libCwtch-go-macos-`cat BUILDDATE`-`cat VERSION`
- mkdir $DIR - mkdir $DIR
- mv libCwtch.dylib $DIR/ - mv libCwtch.dylib $DIR/
- mv libCwtch.arm64.dylib $DIR/
- cd $DIR - cd $DIR
- find . -type f -exec shasum -a 512 {} \; > ./../sha512s.txt - find . -type f -exec shasum -a 512 {} \; > ./../sha512s.txt
- mv ./../sha512s.txt . - mv ./../sha512s.txt .

View File

@ -8,7 +8,7 @@ all: linux android windows
linux: libCwtch.so linux: libCwtch.so
macos: libCwtch.dylib macos: libCwtch.x64.dylib libCwtch.arm.dylib
android: cwtch.aar android: cwtch.aar
@ -18,9 +18,13 @@ libCwtch.so: lib.go
./switch-ffi.sh ./switch-ffi.sh
go build -ldflags "-X main.buildVer=$(shell git describe --tags) -X main.buildDate=$(shell date +%G-%m-%d-%H-%M)" -buildmode c-shared -o libCwtch.so go build -ldflags "-X main.buildVer=$(shell git describe --tags) -X main.buildDate=$(shell date +%G-%m-%d-%H-%M)" -buildmode c-shared -o libCwtch.so
libCwtch.dylib: lib.go libCwtch.x64.dylib: lib.go
./switch-ffi.sh ./switch-ffi.sh
go build -ldflags "-X main.buildVer=$(shell git describe --tags) -X main.buildDate=$(shell date +%G-%m-%d-%H-%M)" -buildmode c-shared -o libCwtch.dylib go build -ldflags "-X main.buildVer=$(shell git describe --tags) -X main.buildDate=$(shell date +%G-%m-%d-%H-%M)" -buildmode c-shared -o libCwtch.x64.dylib
libCwtch.arm.dylib: lib.go
./switch-ffi.sh
env GOARCH=arm64 GOOS=darwin CGO_ENABLED=1 go build -ldflags "-X main.buildVer=$(shell git describe --tags) -X main.buildDate=$(shell date +%G-%m-%d-%H-%M)" -buildmode c-shared -o libCwtch.arm64.dylib
cwtch.aar: lib.go cwtch.aar: lib.go
./switch-gomobile.sh ./switch-gomobile.sh

View File

@ -6,6 +6,7 @@ C-bindings for the Go Cwtch Library.
make linux make linux
make android make android
make windows make windows
make macos
## Android Build Notes ## Android Build Notes
@ -16,6 +17,12 @@ Go 1.17.4, NDK 22.1.7171670, and gomobile 4e6c2922fdeed32d3596616518aaee7b0d79ce
Other version combinations untested and some definitely do not work. Other version combinations untested and some definitely do not work.
## Windows
Cwtch relies on sqlite which in turn requires the use of CGO. As per [this issue](https://github.com/golang/go/issues/12029)
that means [TDM-GCC](https://jmeubank.github.io/tdm-gcc/download/) is required to be installed and used to compile on Windows.
Install it and add it to your path and `make windows` should then work.
## Experimental iOS support ## Experimental iOS support
make ios make ios
@ -43,4 +50,4 @@ written to `stdout` when `DebugInfo()` is called.
## MacOS ## MacOS
- copy libCwtch.dylib into the directory you are executing from - copy libCwtch.x64.dylib and libCwtch.arm.dylib into the directory you are executing from