2019-06-06 18:07:39 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
2019-08-19 23:40:17 +02:00
|
|
|
set -euox pipefail
|
2019-06-06 18:07:39 +02:00
|
|
|
|
2020-04-12 18:24:03 -07:00
|
|
|
mkdir -p go
|
2019-08-19 23:40:17 +02:00
|
|
|
export GOPATH="$(pwd)/go"
|
|
|
|
|
export PATH="$PATH:$GOPATH/bin"
|
2019-06-06 18:07:39 +02:00
|
|
|
|
2019-08-19 23:40:17 +02:00
|
|
|
go get -u golang.org/x/mobile/cmd/gomobile || true
|
2020-04-11 23:23:38 -07:00
|
|
|
gomobile init
|
2020-04-12 18:24:03 -07:00
|
|
|
go get -u github.com/mssun/gopenpgp || true
|
2019-06-06 18:07:39 +02:00
|
|
|
|
2020-04-12 18:24:03 -07:00
|
|
|
PACKAGE_PATH="github.com/mssun/gopenpgp"
|
|
|
|
|
mkdir -p $GOPATH/src/github.com/ProtonMail
|
|
|
|
|
GOPENPGP_REVISION="gnu-dummy"
|
|
|
|
|
ln -s $GOPATH/src/github.com/mssun/gopenpgp $GOPATH/src/github.com/ProtonMail/gopenpgp
|
2019-06-06 18:07:39 +02:00
|
|
|
|
2019-11-08 21:17:53 +01:00
|
|
|
( cd "$GOPATH/src/$PACKAGE_PATH" && git checkout "$GOPENPGP_REVISION" && GO111MODULE=on go mod vendor )
|
2019-06-06 18:07:39 +02:00
|
|
|
|
2019-08-19 23:40:17 +02:00
|
|
|
OUTPUT_PATH="$GOPATH/dist"
|
|
|
|
|
mkdir -p "$OUTPUT_PATH"
|
2020-04-12 18:24:03 -07:00
|
|
|
|
2019-09-15 15:13:49 -07:00
|
|
|
"$GOPATH/bin/gomobile" bind -v -ldflags="-s -w" -target ios -o "${OUTPUT_PATH}/Crypto.framework" \
|
2019-08-19 23:40:17 +02:00
|
|
|
"$PACKAGE_PATH"/{crypto,armor,constants,models,subtle}
|