File: crossbuild.bash

package info (click to toggle)
gocryptfs 2.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,132 kB
  • sloc: sh: 1,091; ansic: 208; makefile: 88
file content (33 lines) | stat: -rwxr-xr-x 779 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
#
# Build on all supported architectures & operating systems

function build {
	# Discard resulting binary by writing to /dev/null
	go build -tags without_openssl -o /dev/null
}

function compile_tests {
	for i in $(go list ./...) ; do
		go test -c -tags without_openssl -o /dev/null "$i" > /dev/null
	done
}

set -eux

export CGO_ENABLED=0

GOOS=linux  GOARCH=amd64         build
GOOS=linux  GOARCH=386           build

# See https://go.dev/wiki/GoArm
GOOS=linux  GOARCH=arm   GOARM=7 build
GOOS=linux  GOARCH=arm64         build

# MacOS on Intel
GOOS=darwin GOARCH=amd64 build
# Catch tests that don't work on MacOS (takes a long time so we only run it once)
time GOOS=darwin GOARCH=amd64 compile_tests

# MacOS on Apple Silicon M1.
GOOS=darwin GOARCH=arm64 build