forked from cwtch.im/libcwtch-go
Merge branch 'trunk' into segfault
This commit is contained in:
commit
0d06f802a4
|
@ -82,7 +82,7 @@ steps:
|
|||
- find . -type f -exec sha256sum {} \; > ./../sha256s.txt
|
||||
- mv ./../sha256s.txt .
|
||||
- cd ..
|
||||
- scp -r -o StrictHostKeyChecking=no -i ~/id_rsa $DIR buildfiles@openprivacy.ca:/home/buildfiles/buildfiles/
|
||||
- scp -r -o StrictHostKeyChecking=no -i ~/id_rsa $DIR buildfiles@build.openprivacy.ca:/home/buildfiles/buildfiles/
|
||||
|
||||
- name: gitea-release
|
||||
image: plugins/gitea-release
|
||||
|
|
|
@ -4,3 +4,4 @@ cwtch.aar
|
|||
libCwtch.h
|
||||
libCwtch.so
|
||||
libCwtch.dll
|
||||
ios/
|
||||
|
|
31
Makefile
31
Makefile
|
@ -1,11 +1,15 @@
|
|||
.PHONY: all linux android windows clean
|
||||
IOS_OUT := ./ios
|
||||
|
||||
.PHONY: all linux android windows macos clean ios
|
||||
|
||||
DEFAULT_GOAL: linux
|
||||
|
||||
all: linux android
|
||||
all: linux android windows
|
||||
|
||||
linux: libCwtch.so
|
||||
|
||||
macos: libCwtch.so
|
||||
|
||||
android: cwtch.aar
|
||||
|
||||
windows: libCwtch.dll
|
||||
|
@ -24,3 +28,26 @@ libCwtch.dll: lib.go
|
|||
|
||||
clean:
|
||||
rm -f cwtch.aar cwtch_go.apk libCwtch.h libCwtch.so cwtch-sources.jar libCwtch.dll
|
||||
|
||||
# iOS - for testing purposes only for now, not officially supported
|
||||
|
||||
ios-arm64:
|
||||
CGO_ENABLED=1 \
|
||||
GOOS=darwin \
|
||||
GOARCH=arm64 \
|
||||
SDK=iphoneos \
|
||||
CGO_CFLAGS="-fembed-bitcode" \
|
||||
CC=$(PWD)/clangwrap.sh \
|
||||
go build -buildmode=c-archive -tags ios -o $(IOS_OUT)/arm64.a .
|
||||
|
||||
ios-x86_64:
|
||||
CGO_ENABLED=1 \
|
||||
GOOS=darwin \
|
||||
GOARCH=amd64 \
|
||||
SDK=iphonesimulator \
|
||||
CC=$(PWD)/clangwrap.sh \
|
||||
go build -buildmode=c-archive -tags ios -o $(IOS_OUT)/x86_64.a .
|
||||
|
||||
ios: ios-arm64 ios-x86_64
|
||||
lipo $(IOS_OUT)/x86_64.a $(IOS_OUT)/arm64.a -create -output $(IOS_OUT)/cwtch.a
|
||||
cp $(IOS_OUT)/arm64.h $(IOS_OUT)/cwtch.h
|
||||
|
|
10
README.md
10
README.md
|
@ -2,9 +2,13 @@
|
|||
|
||||
C-bindings for the Go Cwtch Library.
|
||||
|
||||
# Build Instructions...
|
||||
# Build Instructions
|
||||
make linux
|
||||
make android
|
||||
make windows
|
||||
|
||||
## Experimental iOS support
|
||||
make ios
|
||||
|
||||
# Using
|
||||
|
||||
|
@ -16,3 +20,7 @@ C-bindings for the Go Cwtch Library.
|
|||
## Android
|
||||
|
||||
- copy `cwtch.aar` into `flutter_app/android/cwtch`
|
||||
|
||||
## Windows
|
||||
|
||||
- copy libCwtch.dll into the directory of the `.exe` using it
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
#!/bin/sh
|
||||
|
||||
# go/clangwrap.sh
|
||||
|
||||
SDK_PATH=`xcrun --sdk $SDK --show-sdk-path`
|
||||
CLANG=`xcrun --sdk $SDK --find clang`
|
||||
|
||||
if [ "$GOARCH" == "amd64" ]; then
|
||||
CARCH="x86_64"
|
||||
elif [ "$GOARCH" == "arm64" ]; then
|
||||
CARCH="arm64"
|
||||
fi
|
||||
|
||||
exec $CLANG -arch $CARCH -isysroot $SDK_PATH -mios-version-min=10.0 "$@"
|
|
@ -1,5 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
sed -i "s/^package cwtch/\/\/package cwtch/" lib.go
|
||||
sed -i "s/^\/\/package main/package main/" lib.go
|
||||
sed -i "s/^\/\/func main()/func main()/" lib.go
|
||||
# using '-i.bak' and 'rm .bak' for gnu sed (linux) and bsd sed (macosx) compat
|
||||
sed -i.bak "s/^package cwtch/\/\/package cwtch/" lib.go
|
||||
sed -i.bak "s/^\/\/package main/package main/" lib.go
|
||||
sed -i.bak "s/^\/\/func main()/func main()/" lib.go
|
||||
rm lib.go.bak
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
sed -i "s/^\/\/package cwtch/package cwtch/" lib.go
|
||||
sed -i "s/^package main/\/\/package main/" lib.go
|
||||
sed -i "s/^func main()/\/\/func main()/" lib.go
|
||||
# using '-i.bak' and 'rm .bak' for gnu sed (linux) and bsd sed (macosx) compat
|
||||
sed -i.bak "s/^\/\/package cwtch/package cwtch/" lib.go
|
||||
sed -i.bak "s/^package main/\/\/package main/" lib.go
|
||||
sed -i.bak "s/^func main()/\/\/func main()/" lib.go
|
||||
rm lib.go.bak
|
||||
|
|
Loading…
Reference in New Issue