forked from jketterl/openwebrx
-
Notifications
You must be signed in to change notification settings - Fork 53
/
buildall.sh
executable file
·284 lines (259 loc) · 8.34 KB
/
buildall.sh
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
#!/bin/bash
#
# This script will check out and build all the latest OpenWebRX+
# packages in the BUILD_DIR folder, placing .deb files into
# OUTPUT_DIR folder.
#
set -euo pipefail
GIT_CSDR=https://github.com/luarvique/csdr.git
GIT_PYCSDR=https://github.com/luarvique/pycsdr.git
GIT_OWRXCONNECTOR=https://github.com/luarvique/owrx_connector.git
GIT_CODECSERVER=https://github.com/jketterl/codecserver.git
GIT_DIGIHAM=https://github.com/jketterl/digiham.git
GIT_PYDIGIHAM=https://github.com/jketterl/pydigiham.git
GIT_CSDR_ETI=https://github.com/luarvique/csdr-eti.git
GIT_PYCSDR_ETI=https://github.com/luarvique/pycsdr-eti.git
GIT_JS8PY=https://github.com/jketterl/js8py.git
GIT_REDSEA=https://github.com/luarvique/redsea.git
GIT_CWSKIMMER=https://github.com/luarvique/csdr-cwskimmer.git
GIT_SOAPYSDRPLAY3=https://github.com/luarvique/SoapySDRPlay3.git
GIT_OPENWEBRX=https://github.com/luarvique/openwebrx.git
BUILD_DIR=./owrx-build/`uname -m`
OUTPUT_DIR=./owrx-output/`uname -m`
if [ "${1:-}" == "--ask" ]; then
echo;read -n1 -p "Build csdr? [yN] " ret
[[ "$ret" == [Yy]* ]] && BUILD_CSDR=y || BUILD_CSDR=n
echo;read -n1 -p "Build pycsdr? [yN] " ret
[[ "$ret" == [Yy]* ]] && BUILD_PYCSDR=y || BUILD_PYCSDR=n
echo;read -n1 -p "Build owrxconnector? [yN] " ret
[[ "$ret" == [Yy]* ]] && BUILD_OWRXCONNECTOR=y || BUILD_OWRXCONNECTOR=n
echo;read -n1 -p "Build codecserver? [yN] " ret
[[ "$ret" == [Yy]* ]] && BUILD_CODECSERVER=y || BUILD_CODECSERVER=n
echo;read -n1 -p "Build digiham? [yN] " ret
[[ "$ret" == [Yy]* ]] && BUILD_DIGIHAM=y || BUILD_DIGIHAM=n
echo;read -n1 -p "Build pydigiham? [yN] " ret
[[ "$ret" == [Yy]* ]] && BUILD_PYDIGIHAM=y || BUILD_PYDIGIHAM=n
echo;read -n1 -p "Build csdr-eti? [yN] " ret
[[ "$ret" == [Yy]* ]] && BUILD_CSDR_ETI=y || BUILD_CSDR_ETI=n
echo;read -n1 -p "Build pycsdr-eti? [yN] " ret
[[ "$ret" == [Yy]* ]] && BUILD_PYCSDR_ETI=y || BUILD_PYCSDR_ETI=n
echo;read -n1 -p "Build js8py? [yN] " ret
[[ "$ret" == [Yy]* ]] && BUILD_JS8PY=y || BUILD_JS8PY=n
echo;read -n1 -p "Build Redsea? [yN] " ret
[[ "$ret" == [Yy]* ]] && BUILD_REDSEA=y || BUILD_REDSEA=n
echo;read -n1 -p "Build csdr-cwskimmer? [yN] " ret
[[ "$ret" == [Yy]* ]] && BUILD_CWSKIMMER=y || BUILD_CWSKIMMER=n
echo;read -n1 -p "Build SoapySDRPlay3? [yN] " ret
[[ "$ret" == [Yy]* ]] && BUILD_SOAPYSDRPLAY3=y || BUILD_SOAPYSDRPLAY3=n
echo;read -n1 -p "Build OpenWebRX+? [Yn] " ret
[[ "$ret" == [Nn]* ]] && BUILD_OWRX=n || BUILD_OWRX=y
echo;read -n1 -p "Clean the Output folder? [yN] " ret
[[ "$ret" == [Yy]* ]] && CLEAN_OUTPUT=y || CLEAN_OUTPUT=n
else
# build all by default
BUILD_OWRX=y
BUILD_CSDR=y
BUILD_PYCSDR=y
BUILD_OWRXCONNECTOR=y
BUILD_SOAPYSDRPLAY3=y
BUILD_CODECSERVER=y
BUILD_DIGIHAM=y
BUILD_PYDIGIHAM=y
BUILD_CSDR_ETI=y
BUILD_PYCSDR_ETI=y
BUILD_JS8PY=y
BUILD_REDSEA=y
BUILD_CWSKIMMER=y
CLEAN_OUTPUT=y
fi
#
# Update build targets based on dependencies
#
if [ "${BUILD_OWRX:-}" == "y" ]; then
BUILD_PYCSDR=y
BUILD_OWRXCONNECTOR=y
fi
if [ "${BUILD_PYCSDR_ETI:-}" == "y" ]; then
BUILD_CSDR_ETI=y
fi
if [ "${BUILD_PYDIGIHAM:-}" == "y" ]; then
BUILD_DIGIHAM=y
fi
if [ "${BUILD_DIGIHAM:-}" == "y" ]; then
BUILD_CODECSERVER=y
fi
if [ "${BUILD_PYCSDR:-}" == "y" ] || [ "${BUILD_OWRXCONNECTOR:-}" == "y" ] || [ "${BUILD_CSDR_ETI:-}" == "y" ]; then
BUILD_CSDR=y
fi
echo ======================================
echo "Building:"
echo "csdr: $BUILD_CSDR"
echo "pycsdr: $BUILD_PYCSDR"
echo "owrx connector: $BUILD_OWRXCONNECTOR"
echo "codec server: $BUILD_CODECSERVER"
echo "digiham: $BUILD_DIGIHAM"
echo "pydigiham: $BUILD_PYDIGIHAM"
echo "csdr-eti: $BUILD_CSDR_ETI"
echo "pycsdr-eti: $BUILD_PYCSDR_ETI"
echo "js8py: $BUILD_JS8PY"
echo "redsea: $BUILD_REDSEA"
echo "csdr-cwskimmer: $BUILD_CWSKIMMER"
echo "SoapySDRPlay3: $BUILD_SOAPYSDRPLAY3"
echo "OpenWebRx: $BUILD_OWRX"
echo "Clean OUTPUT folder: $CLEAN_OUTPUT"
echo ======================================
if [ "${1:-}" == "--ask" ]; then
read -p "Press [ENTER] to continue, or CTRL-C, to exit."
fi
rm -rf ${BUILD_DIR}
if [ "${CLEAN_OUTPUT:-}" == "y" ]; then
rm -rf ${OUTPUT_DIR}
fi
mkdir -p ${BUILD_DIR} ${OUTPUT_DIR}
pushd ${BUILD_DIR}
if [ "${BUILD_CSDR:-}" == "y" ]; then
echo "##### Building CSDR... #####"
git clone -b master "$GIT_CSDR"
pushd csdr
if [ `gcc -dumpversion` -gt 10 ]; then
# fix armhf builds on gcc>=11 (bookworm)
sed -i 's/-march=armv7-a /-march=armv7-a+fp /g' CMakeLists.txt
fi
dpkg-buildpackage -us -uc
popd
# PyCSDR, CSDR-ETI, and OWRX-Connector depend on the latest CSDR
sudo dpkg -i csdr*.deb libcsdr*.deb nmux*.deb
fi
if [ "${BUILD_PYCSDR:-}" == "y" ]; then
echo "##### Building PyCSDR... #####"
git clone -b master "$GIT_PYCSDR"
pushd pycsdr
dpkg-buildpackage -us -uc
popd
# OpenWebRX build depends on the latest PyCSDR
sudo dpkg -i python3-csdr*.deb
fi
if [ "${BUILD_OWRXCONNECTOR:-}" == "y" ]; then
echo "##### Building OWRX-Connector... #####"
git clone -b master "$GIT_OWRXCONNECTOR"
pushd owrx_connector
dpkg-buildpackage -us -uc
popd
# Not installing OWRX-Connectors here since there are no
# further build steps depending on it
#sudo dpkg -i *connector*.deb
fi
if [ "${BUILD_CODECSERVER:-}" == "y" ]; then
echo "##### Building CodecServer... #####"
git clone -b master "$GIT_CODECSERVER"
pushd codecserver
dpkg-buildpackage -us -uc
popd
# Digiham depends on libcodecserver-dev
sudo dpkg -i libcodecserver_*.deb codecserver_*.deb libcodecserver-dev_*.deb
fi
if [ "${BUILD_DIGIHAM:-}" == "y" ]; then
echo "##### Building DigiHAM... #####"
git clone -b master "$GIT_DIGIHAM"
pushd digiham
dpkg-buildpackage -us -uc
popd
# PyDigiHAM build depends on the latest DigiHAM
sudo dpkg -i *digiham*.deb
fi
if [ "${BUILD_PYDIGIHAM:-}" == "y" ]; then
echo "##### Building PyDigiHAM... #####"
git clone -b master "$GIT_PYDIGIHAM"
pushd pydigiham
dpkg-buildpackage -us -uc
popd
# Not installing PyDigiHAM here since there are no further
# build steps depending on it
#sudo dpkg -i python3-digiham*.deb
fi
if [ "${BUILD_CSDR_ETI:-}" == "y" ]; then
echo "##### Building CSDR-ETI... #####"
git clone "$GIT_CSDR_ETI"
pushd csdr-eti
dpkg-buildpackage -us -uc
popd
# PyCSDR-ETI build depends on the latest CSDR-ETI
sudo dpkg -i libcsdr-eti*.deb
fi
if [ "${BUILD_PYCSDR_ETI:-}" == "y" ]; then
echo "##### Building PyCSDR-ETI... #####"
git clone "$GIT_PYCSDR_ETI"
pushd pycsdr-eti
dpkg-buildpackage -us -uc
popd
# Not installing PyCSDR-ETI here since there are no further
# build steps depending on it
#sudo dpkg -i python3-csdr-eti*.deb
fi
if [ "${BUILD_JS8PY:-}" == "y" ]; then
echo "##### Building JS8Py... #####"
git clone -b master "$GIT_JS8PY"
pushd js8py
dpkg-buildpackage -us -uc
popd
# Not installing JS8Py here since there are no further
# build steps depending on it
#sudo dpkg -i *js8py*.deb
fi
if [ "${BUILD_REDSEA:-}" == "y" ]; then
echo "##### Building Redsea... #####"
git clone -b master "$GIT_REDSEA"
pushd redsea
dpkg-buildpackage -us -uc
popd
# Not installing Redsea here since there are no further
# build steps depending on it
#sudo dpkg -i *redsea*.deb
fi
if [ "${BUILD_CWSKIMMER:-}" == "y" ]; then
echo "##### Building csdr-cwskimmer... #####"
git clone "$GIT_CWSKIMMER"
pushd csdr-cwskimmer
dpkg-buildpackage -us -uc
popd
# Not installing csdr-cwskimmer here since there are no further
# build steps depending on it
#sudo dpkg -i csdr-cwskimmer*.deb
fi
if [ "${BUILD_SOAPYSDRPLAY3:-}" == "y" ]; then
echo "##### Building SoapySDRPlay3 ... #####"
git clone -b master "$GIT_SOAPYSDRPLAY3"
pushd SoapySDRPlay3
case $(uname -m) in
arm*) git checkout 0.8.7 ;;
esac
# Debian Bullseye uses SoapySDR v0.7
HAVE_SOAPY=`apt-cache search libsoapysdr0.7`
if [ ! -z "${HAVE_SOAPY}" ] ; then
echo "##### Building SoapySDRPlay3 v0.7 (Debian) ... #####"
cp debian/control.debian debian/control
dpkg-buildpackage -us -uc
fi
# Ubuntu Jammy uses SoapySDR v0.8
HAVE_SOAPY=`apt-cache search libsoapysdr0.8`
if [ ! -z "${HAVE_SOAPY}" ] ; then
echo "##### Building SoapySDRPlay3 v0.8 (Ubuntu) ... #####"
cp debian/control.ubuntu debian/control
dpkg-buildpackage -us -uc
fi
popd
fi
if [ "${BUILD_OWRX:-}" == "y" ]; then
echo "##### Building OpenWebRX... #####"
git clone -b master "$GIT_OPENWEBRX"
pushd openwebrx
dpkg-buildpackage -us -uc
popd
# Not installing OpenWebRX here since there are no further
# build steps depending on it
#sudo dpkg -i openwebrx*.deb
fi
echo "##### Moving packages to ${OUTPUT_DIR} ... #####"
popd
mv ${BUILD_DIR}/*.deb ${OUTPUT_DIR}
echo "##### ALL DONE! #####"