2018-05-15 23:04:52 +02:00
|
|
|
#!/bin/bash -eu
|
2021-06-06 19:28:02 +02:00
|
|
|
#
|
|
|
|
# Build on all supported architectures & operating systems
|
2017-06-18 15:40:38 +02:00
|
|
|
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
|
2020-04-13 16:10:09 +02:00
|
|
|
export GO111MODULE=on
|
2017-06-18 15:40:38 +02:00
|
|
|
B="go build -tags without_openssl"
|
|
|
|
|
2018-05-15 23:04:52 +02:00
|
|
|
set -x
|
|
|
|
|
2021-06-06 19:28:02 +02:00
|
|
|
export CGO_ENABLED=0
|
|
|
|
|
|
|
|
GOOS=linux GOARCH=amd64 $B
|
|
|
|
|
2020-02-29 21:51:34 +01:00
|
|
|
# See https://github.com/golang/go/wiki/GoArm
|
|
|
|
GOOS=linux GOARCH=arm GOARM=7 $B
|
2020-04-13 16:10:09 +02:00
|
|
|
GOOS=linux GOARCH=arm64 $B
|
2020-02-29 21:51:34 +01:00
|
|
|
|
2021-06-05 15:07:18 +02:00
|
|
|
# MacOS on Intel
|
2017-06-18 15:40:38 +02:00
|
|
|
GOOS=darwin GOARCH=amd64 $B
|
|
|
|
|
2021-06-06 21:10:24 +02:00
|
|
|
# MacOS on Apple Silicon M1.
|
|
|
|
# Go 1.16 added support for the M1 and added ios/arm64,
|
|
|
|
# so we use this to check if we should attempt a build.
|
|
|
|
if go tool dist list | grep ios/arm64 ; then
|
|
|
|
GOOS=darwin GOARCH=arm64 $B
|
|
|
|
fi
|
2021-06-05 15:07:18 +02:00
|
|
|
|
2017-06-18 15:40:38 +02:00
|
|
|
# The cross-built binary is not useful on the compile host.
|
|
|
|
rm gocryptfs
|