2
2
sum=" sha1sum"
3
3
4
4
if ! hash sha1sum 2> /dev/null; then
5
- if ! hash shasum 2> /dev/null; then
6
- echo " I can't see 'sha1sum' or 'shasum'"
7
- echo " Please install one of them!"
8
- exit
9
- fi
10
- sum=" shasum"
5
+ if ! hash shasum 2> /dev/null; then
6
+ echo " I can't see 'sha1sum' or 'shasum'"
7
+ echo " Please install one of them!"
8
+ exit
9
+ fi
10
+ sum=" shasum"
11
11
fi
12
12
13
13
[[ -z $upx ]] && upx=" echo pending"
14
14
if [[ $upx == " echo pending" ]] && hash upx 2> /dev/null; then
15
- upx=" upx -9"
15
+ upx=" upx -9"
16
16
fi
17
17
18
18
VERSION=$( git describe --tags)
@@ -25,23 +25,27 @@ ARCHS=(amd64 386)
25
25
mkdir bin
26
26
27
27
for os in ${OSES[@]} ; do
28
- for arch in ${ARCHS[@]} ; do
29
- suffix=" "
30
- if [ " $os " == " windows" ]
31
- then
32
- suffix=" .exe"
33
- fi
34
- env CGO_ENABLED=0 GOOS=$os GOARCH=$arch go build -v -ldflags " $LDFLAGS " -gcflags " $GCFLAGS " -o v2ray-plugin_${os} _${arch}${suffix}
35
- $upx v2ray-plugin_${os} _${arch}${suffix} > /dev/null
36
- tar -zcf bin/v2ray-plugin-${os} -${arch} -$VERSION .tar.gz v2ray-plugin_${os} _${arch}${suffix}
37
- $sum bin/v2ray-plugin-${os} -${arch} -$VERSION .tar.gz
38
- done
28
+ for arch in ${ARCHS[@]} ; do
29
+ # Go 1.15 drops support for 32-bit binaries on macOS, iOS, iPadOS, watchOS, and tvOS (the darwin/386 and darwin/arm ports)
30
+ # Reference URL: https://tip.golang.org/doc/go1.15#darwin
31
+ if [ " $os " == " darwin" ] && [ " $arch " == " 386" ]; then
32
+ continue
33
+ fi
34
+ suffix=" "
35
+ if [ " $os " == " windows" ]; then
36
+ suffix=" .exe"
37
+ fi
38
+ env CGO_ENABLED=0 GOOS=$os GOARCH=$arch go build -v -ldflags " $LDFLAGS " -gcflags " $GCFLAGS " -o v2ray-plugin_${os} _${arch}${suffix}
39
+ $upx v2ray-plugin_${os} _${arch}${suffix} > /dev/null
40
+ tar -zcf bin/v2ray-plugin-${os} -${arch} -$VERSION .tar.gz v2ray-plugin_${os} _${arch}${suffix}
41
+ $sum bin/v2ray-plugin-${os} -${arch} -$VERSION .tar.gz
42
+ done
39
43
done
40
44
41
45
# ARM
42
46
ARMS=(5 6 7)
43
47
for v in ${ARMS[@]} ; do
44
- env CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=$v go build -v -ldflags " $LDFLAGS " -gcflags " $GCFLAGS " -o v2ray-plugin_linux_arm$v
48
+ env CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=$v go build -v -ldflags " $LDFLAGS " -gcflags " $GCFLAGS " -o v2ray-plugin_linux_arm$v
45
49
done
46
50
$upx v2ray-plugin_linux_arm* > /dev/null
47
51
tar -zcf bin/v2ray-plugin-linux-arm-$VERSION .tar.gz v2ray-plugin_linux_arm*
@@ -56,8 +60,8 @@ $sum bin/v2ray-plugin-linux-arm64-$VERSION.tar.gz
56
60
# MIPS
57
61
MIPSS=(mips mipsle)
58
62
for v in ${MIPSS[@]} ; do
59
- env CGO_ENABLED=0 GOOS=linux GOARCH=$v go build -v -ldflags " $LDFLAGS " -gcflags " $GCFLAGS " -o v2ray-plugin_linux_$v
60
- env CGO_ENABLED=0 GOOS=linux GOARCH=$v GOMIPS=softfloat go build -ldflags " $LDFLAGS " -gcflags " $GCFLAGS " -o v2ray-plugin_linux_${v} _sf
63
+ env CGO_ENABLED=0 GOOS=linux GOARCH=$v go build -v -ldflags " $LDFLAGS " -gcflags " $GCFLAGS " -o v2ray-plugin_linux_$v
64
+ env CGO_ENABLED=0 GOOS=linux GOARCH=$v GOMIPS=softfloat go build -ldflags " $LDFLAGS " -gcflags " $GCFLAGS " -o v2ray-plugin_linux_${v} _sf
61
65
done
62
66
$upx v2ray-plugin_linux_mips* > /dev/null
63
67
tar -zcf bin/v2ray-plugin-linux-mips-$VERSION .tar.gz v2ray-plugin_linux_mips*
@@ -66,7 +70,7 @@ $sum bin/v2ray-plugin-linux-mips-$VERSION.tar.gz
66
70
# MIPS64
67
71
MIPS64S=(mips64 mips64le)
68
72
for v in ${MIPS64S[@]} ; do
69
- env CGO_ENABLED=0 GOOS=linux GOARCH=$v go build -v -ldflags " $LDFLAGS " -gcflags " $GCFLAGS " -o v2ray-plugin_linux_$v
73
+ env CGO_ENABLED=0 GOOS=linux GOARCH=$v go build -v -ldflags " $LDFLAGS " -gcflags " $GCFLAGS " -o v2ray-plugin_linux_$v
70
74
done
71
75
tar -zcf bin/v2ray-plugin-linux-mips64-$VERSION .tar.gz v2ray-plugin_linux_mips64*
72
76
$sum bin/v2ray-plugin-linux-mips64-$VERSION .tar.gz
0 commit comments