Debian Codegraph @

.ci/ci-build.sh

raw symbols SCIP
1 #! /bin/sh
2
3 PACKAGE_VERSION="$1"
4
5 cd dnscrypt-proxy || exit 1
6
7 go clean
8 env GOOS=windows GOARCH=386 go build -mod vendor -ldflags="-s -w"
9 mkdir win32
10 ln dnscrypt-proxy.exe win32/
11 cp ../LICENSE example-dnscrypt-proxy.toml localhost.pem example-*.txt win32/
12 for i in win32/LICENSE win32/*.toml win32/*.txt; do ex -bsc '%!awk "{sub(/$/,\"\r\")}1"' -cx "$i"; done
13 ln ../windows/* win32/
14 zip -9 -r dnscrypt-proxy-win32-${PACKAGE_VERSION:-dev}.zip win32
15
16 go clean
17 env GOOS=windows GOARCH=amd64 go build -mod vendor -ldflags="-s -w"
18 mkdir win64
19 ln dnscrypt-proxy.exe win64/
20 cp ../LICENSE example-dnscrypt-proxy.toml localhost.pem example-*.txt win64/
21 for i in win64/LICENSE win64/*.toml win64/*.txt; do ex -bsc '%!awk "{sub(/$/,\"\r\")}1"' -cx "$i"; done
22 ln ../windows/* win64/
23 zip -9 -r dnscrypt-proxy-win64-${PACKAGE_VERSION:-dev}.zip win64
24
25 go clean
26 env GOOS=windows GOARCH=arm64 go build -mod vendor -ldflags="-s -w"
27 mkdir winarm
28 ln dnscrypt-proxy.exe winarm/
29 cp ../LICENSE example-dnscrypt-proxy.toml localhost.pem example-*.txt winarm/
30 for i in winarm/LICENSE winarm/*.toml winarm/*.txt; do ex -bsc '%!awk "{sub(/$/,\"\r\")}1"' -cx "$i"; done
31 ln ../windows/* winarm/
32 zip -9 -r dnscrypt-proxy-winarm-${PACKAGE_VERSION:-dev}.zip winarm
33
34 go clean
35 env GO386=softfloat GOOS=openbsd GOARCH=386 go build -mod vendor -ldflags="-s -w"
36 mkdir openbsd-i386
37 ln dnscrypt-proxy openbsd-i386/
38 ln ../LICENSE example-dnscrypt-proxy.toml localhost.pem example-*.txt openbsd-i386/
39 tar czpvf dnscrypt-proxy-openbsd_i386-${PACKAGE_VERSION:-dev}.tar.gz openbsd-i386
40
41 go clean
42 env GOOS=openbsd GOARCH=amd64 go build -mod vendor -ldflags="-s -w"
43 mkdir openbsd-amd64
44 ln dnscrypt-proxy openbsd-amd64/
45 ln ../LICENSE example-dnscrypt-proxy.toml localhost.pem example-*.txt openbsd-amd64/
46 tar czpvf dnscrypt-proxy-openbsd_amd64-${PACKAGE_VERSION:-dev}.tar.gz openbsd-amd64
47
48 go clean
49 env GOOS=freebsd GOARCH=386 go build -mod vendor -ldflags="-s -w"
50 mkdir freebsd-i386
51 ln dnscrypt-proxy freebsd-i386/
52 ln ../LICENSE example-dnscrypt-proxy.toml localhost.pem example-*.txt freebsd-i386/
53 tar czpvf dnscrypt-proxy-freebsd_i386-${PACKAGE_VERSION:-dev}.tar.gz freebsd-i386
54
55 go clean
56 env GOOS=freebsd GOARCH=amd64 go build -mod vendor -ldflags="-s -w"
57 mkdir freebsd-amd64
58 ln dnscrypt-proxy freebsd-amd64/
59 ln ../LICENSE example-dnscrypt-proxy.toml localhost.pem example-*.txt freebsd-amd64/
60 tar czpvf dnscrypt-proxy-freebsd_amd64-${PACKAGE_VERSION:-dev}.tar.gz freebsd-amd64
61
62 go clean
63 env GOOS=freebsd GOARCH=arm GOARM=5 go build -mod vendor -ldflags="-s -w"
64 mkdir freebsd-arm
65 ln dnscrypt-proxy freebsd-arm/
66 ln ../LICENSE example-dnscrypt-proxy.toml localhost.pem example-*.txt freebsd-arm/
67 tar czpvf dnscrypt-proxy-freebsd_arm-${PACKAGE_VERSION:-dev}.tar.gz freebsd-arm
68
69 go clean
70 env GOOS=freebsd GOARCH=arm64 go build -mod vendor -ldflags="-s -w"
71 mkdir freebsd-arm64
72 ln dnscrypt-proxy freebsd-arm64/
73 ln ../LICENSE example-dnscrypt-proxy.toml localhost.pem example-*.txt freebsd-arm64/
74 tar czpvf dnscrypt-proxy-freebsd_arm64-${PACKAGE_VERSION:-dev}.tar.gz freebsd-arm64
75
76 go clean
77 env GOOS=dragonfly GOARCH=amd64 go build -mod vendor -ldflags="-s -w"
78 mkdir dragonflybsd-amd64
79 ln dnscrypt-proxy dragonflybsd-amd64/
80 ln ../LICENSE example-dnscrypt-proxy.toml localhost.pem example-*.txt dragonflybsd-amd64/
81 tar czpvf dnscrypt-proxy-dragonflybsd_amd64-${PACKAGE_VERSION:-dev}.tar.gz dragonflybsd-amd64
82
83 go clean
84 env GOOS=netbsd GOARCH=386 go build -mod vendor -ldflags="-s -w"
85 mkdir netbsd-i386
86 ln dnscrypt-proxy netbsd-i386/
87 ln ../LICENSE example-dnscrypt-proxy.toml localhost.pem example-*.txt netbsd-i386/
88 tar czpvf dnscrypt-proxy-netbsd_i386-${PACKAGE_VERSION:-dev}.tar.gz netbsd-i386
89
90 go clean
91 env GOOS=netbsd GOARCH=amd64 go build -mod vendor -ldflags="-s -w"
92 mkdir netbsd-amd64
93 ln dnscrypt-proxy netbsd-amd64/
94 ln ../LICENSE example-dnscrypt-proxy.toml localhost.pem example-*.txt netbsd-amd64/
95 tar czpvf dnscrypt-proxy-netbsd_amd64-${PACKAGE_VERSION:-dev}.tar.gz netbsd-amd64
96
97 go clean
98 env GOOS=solaris GOARCH=amd64 go build -mod vendor -ldflags="-s -w"
99 mkdir solaris-amd64
100 ln dnscrypt-proxy solaris-amd64/
101 ln ../LICENSE example-dnscrypt-proxy.toml localhost.pem example-*.txt solaris-amd64/
102 tar czpvf dnscrypt-proxy-solaris_amd64-${PACKAGE_VERSION:-dev}.tar.gz solaris-amd64
103
104 go clean
105 env CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -mod vendor -ldflags="-s -w"
106 mkdir linux-i386
107 ln dnscrypt-proxy linux-i386/
108 ln ../LICENSE example-dnscrypt-proxy.toml localhost.pem example-*.txt linux-i386/
109 tar czpvf dnscrypt-proxy-linux_i386-${PACKAGE_VERSION:-dev}.tar.gz linux-i386
110
111 go clean
112 env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -mod vendor -ldflags="-s -w"
113 mkdir linux-x86_64
114 ln dnscrypt-proxy linux-x86_64/
115 ln ../LICENSE example-dnscrypt-proxy.toml localhost.pem example-*.txt linux-x86_64/
116 tar czpvf dnscrypt-proxy-linux_x86_64-${PACKAGE_VERSION:-dev}.tar.gz linux-x86_64
117
118 go clean
119 env CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=5 go build -mod vendor -ldflags="-s -w"
120 mkdir linux-arm
121 ln dnscrypt-proxy linux-arm/
122 ln ../LICENSE example-dnscrypt-proxy.toml localhost.pem example-*.txt linux-arm/
123 tar czpvf dnscrypt-proxy-linux_arm-${PACKAGE_VERSION:-dev}.tar.gz linux-arm
124
125 go clean
126 env CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -mod vendor -ldflags="-s -w"
127 mkdir linux-arm64
128 ln dnscrypt-proxy linux-arm64/
129 ln ../LICENSE example-dnscrypt-proxy.toml localhost.pem example-*.txt linux-arm64/
130 tar czpvf dnscrypt-proxy-linux_arm64-${PACKAGE_VERSION:-dev}.tar.gz linux-arm64
131
132 go clean
133 env CGO_ENABLED=0 GOOS=linux GOARCH=mips GOMIPS=softfloat go build -mod vendor -ldflags="-s -w"
134 mkdir linux-mips
135 ln dnscrypt-proxy linux-mips/
136 ln ../LICENSE example-dnscrypt-proxy.toml localhost.pem example-*.txt linux-mips/
137 tar czpvf dnscrypt-proxy-linux_mips-${PACKAGE_VERSION:-dev}.tar.gz linux-mips
138
139 go clean
140 env CGO_ENABLED=0 GOOS=linux GOARCH=mipsle GOMIPS=softfloat go build -mod vendor -ldflags="-s -w"
141 mkdir linux-mipsle
142 ln dnscrypt-proxy linux-mipsle/
143 ln ../LICENSE example-dnscrypt-proxy.toml localhost.pem example-*.txt linux-mipsle/
144 tar czpvf dnscrypt-proxy-linux_mipsle-${PACKAGE_VERSION:-dev}.tar.gz linux-mipsle
145
146 go clean
147 env CGO_ENABLED=0 GOOS=linux GOARCH=mips64 GOMIPS64=softfloat go build -mod vendor -ldflags="-s -w"
148 mkdir linux-mips64
149 ln dnscrypt-proxy linux-mips64/
150 ln ../LICENSE example-dnscrypt-proxy.toml localhost.pem example-*.txt linux-mips64/
151 tar czpvf dnscrypt-proxy-linux_mips64-${PACKAGE_VERSION:-dev}.tar.gz linux-mips64
152
153 go clean
154 env CGO_ENABLED=0 GOOS=linux GOARCH=mips64le GOMIPS64=softfloat go build -mod vendor -ldflags="-s -w"
155 mkdir linux-mips64le
156 ln dnscrypt-proxy linux-mips64le/
157 ln ../LICENSE example-dnscrypt-proxy.toml localhost.pem example-*.txt linux-mips64le/
158 tar czpvf dnscrypt-proxy-linux_mips64le-${PACKAGE_VERSION:-dev}.tar.gz linux-mips64le
159
160 go clean
161 env CGO_ENABLED=0 GOOS=linux GOARCH=riscv64 go build -mod vendor -ldflags="-s -w"
162 mkdir linux-riscv64
163 ln dnscrypt-proxy linux-riscv64/
164 ln ../LICENSE example-dnscrypt-proxy.toml localhost.pem example-*.txt linux-riscv64/
165 tar czpvf dnscrypt-proxy-linux_riscv64-${PACKAGE_VERSION:-dev}.tar.gz linux-riscv64
166
167 go clean
168 env CGO_ENABLED=0 GOOS=linux GOARCH=loong64 go build -mod vendor -ldflags="-s -w"
169 mkdir linux-loong64
170 ln dnscrypt-proxy linux-loong64/
171 ln ../LICENSE example-dnscrypt-proxy.toml localhost.pem example-*.txt linux-loong64/
172 tar czpvf dnscrypt-proxy-linux_loong64-${PACKAGE_VERSION:-dev}.tar.gz linux-loong64
173
174 go clean
175 env GOOS=darwin GOARCH=amd64 go build -mod vendor -ldflags="-s -w"
176 mkdir macos-x86_64
177 ln dnscrypt-proxy macos-x86_64/
178 ln ../LICENSE example-dnscrypt-proxy.toml localhost.pem example-*.txt macos-x86_64/
179 tar czpvf dnscrypt-proxy-macos_x86_64-${PACKAGE_VERSION:-dev}.tar.gz macos-x86_64
180
181 go clean
182 env GOOS=darwin GOARCH=arm64 go build -mod vendor -ldflags="-s -w"
183 mkdir macos-arm64
184 ln dnscrypt-proxy macos-arm64/
185 ln ../LICENSE example-dnscrypt-proxy.toml localhost.pem example-*.txt macos-arm64/
186 tar czpvf dnscrypt-proxy-macos_arm64-${PACKAGE_VERSION:-dev}.tar.gz macos-arm64
187
188 # Android
189
190 NDK_VER=r20
191 curl -LOs https://dl.google.com/android/repository/android-ndk-${NDK_VER}-linux-x86_64.zip
192 unzip -q android-ndk-${NDK_VER}-linux-x86_64.zip -d ${HOME}
193 rm android-ndk-${NDK_VER}-linux-x86_64.zip
194 NDK_TOOLS=${HOME}/android-ndk-${NDK_VER}
195 export PATH=${PATH}:${NDK_TOOLS}/toolchains/llvm/prebuilt/linux-x86_64/bin
196
197 go clean
198 env CC=armv7a-linux-androideabi19-clang CXX=armv7a-linux-androideabi19-clang++ CGO_ENABLED=1 GOOS=android GOARCH=arm GOARM=7 go build -mod vendor -ldflags="-s -w"
199 mkdir android-arm
200 ln dnscrypt-proxy android-arm/
201 cp ../LICENSE example-dnscrypt-proxy.toml localhost.pem example-*.txt android-arm/
202 zip -9 -r dnscrypt-proxy-android_arm-${PACKAGE_VERSION:-dev}.zip android-arm
203
204 go clean
205 env CC=aarch64-linux-android21-clang CXX=aarch64-linux-android21-clang++ CGO_ENABLED=1 GOOS=android GOARCH=arm64 go build -mod vendor -ldflags="-s -w"
206 mkdir android-arm64
207 ln dnscrypt-proxy android-arm64/
208 cp ../LICENSE example-dnscrypt-proxy.toml localhost.pem example-*.txt android-arm64/
209 zip -9 -r dnscrypt-proxy-android_arm64-${PACKAGE_VERSION:-dev}.zip android-arm64
210
211 go clean
212 env CC=i686-linux-android19-clang CXX=i686-linux-android19-clang++ CGO_ENABLED=1 GOOS=android GOARCH=386 go build -mod vendor -ldflags="-s -w"
213 mkdir android-i386
214 ln dnscrypt-proxy android-i386/
215 cp ../LICENSE example-dnscrypt-proxy.toml localhost.pem example-*.txt android-i386/
216 zip -9 -r dnscrypt-proxy-android_i386-${PACKAGE_VERSION:-dev}.zip android-i386
217
218 go clean
219 env CC=x86_64-linux-android21-clang CXX=x86_64-linux-android21-clang++ CGO_ENABLED=1 GOOS=android GOARCH=amd64 go build -mod vendor -ldflags="-s -w"
220 mkdir android-x86_64
221 ln dnscrypt-proxy android-x86_64/
222 cp ../LICENSE example-dnscrypt-proxy.toml localhost.pem example-*.txt android-x86_64/
223 zip -9 -r dnscrypt-proxy-android_x86_64-${PACKAGE_VERSION:-dev}.zip android-x86_64
224
225 # Done
226
227 ls -l dnscrypt-proxy-*.tar.gz dnscrypt-proxy-*.zip