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
|
|
|
|
2022-01-09 21:38:39 -08:00
|
|
|
GOPENPGP_VERSION="passforios"
|
2021-06-20 00:33:48 +02:00
|
|
|
|
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
|
|
|
|
2021-06-20 00:33:48 +02:00
|
|
|
OUTPUT_PATH="go/dist"
|
|
|
|
|
CHECKOUT_PATH="go/checkout"
|
|
|
|
|
GOPENPGP_PATH="$CHECKOUT_PATH/gopenpgp"
|
2020-04-19 15:44:09 +02:00
|
|
|
|
2021-06-20 00:33:48 +02:00
|
|
|
mkdir -p "$OUTPUT_PATH"
|
|
|
|
|
mkdir -p "$CHECKOUT_PATH"
|
2020-04-19 15:44:09 +02:00
|
|
|
|
2022-05-22 16:26:00 -07:00
|
|
|
go install golang.org/x/mobile/cmd/gomobile@latest
|
2021-06-20 00:33:48 +02:00
|
|
|
gomobile init
|
2019-06-06 18:07:39 +02:00
|
|
|
|
2022-01-09 21:38:39 -08:00
|
|
|
git clone --depth 1 --branch "$GOPENPGP_VERSION" https://github.com/mssun/gopenpgp.git "$GOPENPGP_PATH"
|
2019-06-06 18:07:39 +02:00
|
|
|
|
2022-05-22 16:26:00 -07:00
|
|
|
pushd "$GOPENPGP_PATH"
|
|
|
|
|
mkdir -p dist
|
|
|
|
|
go mod download github.com/ProtonMail/go-crypto
|
|
|
|
|
gomobile bind -tags mobile -target ios -iosversion 12.0 -v -x -ldflags="-s -w" -o dist/Gopenpgp.xcframework \
|
|
|
|
|
github.com/ProtonMail/gopenpgp/v2/crypto \
|
|
|
|
|
github.com/ProtonMail/gopenpgp/v2/armor \
|
|
|
|
|
github.com/ProtonMail/gopenpgp/v2/constants \
|
|
|
|
|
github.com/ProtonMail/gopenpgp/v2/models \
|
|
|
|
|
github.com/ProtonMail/gopenpgp/v2/subtle github.com/ProtonMail/gopenpgp/v2/helper
|
|
|
|
|
popd
|
2021-06-20 00:33:48 +02:00
|
|
|
|
2022-01-09 21:38:39 -08:00
|
|
|
cp -r "$GOPENPGP_PATH/dist/Gopenpgp.xcframework" "$OUTPUT_PATH"
|
2020-04-12 18:24:03 -07:00
|
|
|
|