-
Notifications
You must be signed in to change notification settings - Fork 38
/
check_dependencies.sh
executable file
·265 lines (218 loc) · 6.29 KB
/
check_dependencies.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
#!/usr/bin/env bash
PYTHONEXE=$1
MOC=$2
UIC=$3
set -eEu
#set -x
source configuration.sh
mywhich() {
if which $1 ; then
echo $1 found
else
echo $1 not found
exit -1
fi
}
echo
echo "Checking dependencies: "
mywhich sed
mywhich $PYTHONEXE
#which guile-1.8
mywhich guile
if [[ $4 == "test_packages" ]] ; then
echo "testing packages"
fi
if [[ $4 == "test_build" ]] ; then
echo "testing build"
fi
if $1 -c "import sys ; sys.exit(sys.version[:1] == \"2\")" ; then
echo "Only Python 2 is supported:"
$1 --version
echo
exit 5
fi
if [[ $4 == "test_build" ]] ; then
if ! which $MOC ; then
echo "Can not find moc. Make sure QTDIR and/or MOC is set correctly in the Makefile".
echo
exit 5
fi
if ! which $UIC ; then
echo "Can not find uic. Make sure QTDIR and/or UIC set correctly in the Makefile".
echo
exit 5
fi
if $MOC -v 2>&1 |grep "Qt 3" ; then
echo $MOC "is for QT3. Need moc for QT$RADIUM_QT_VERSION. Make sure MOC is set correctly in the Makefile."
echo
exit 5
fi
if $UIC -v 2>&1 |grep "Qt 3" ; then
echo $UIC "is for QT3. Need uic for QT$RADIUM_QT_VERSION. Make sure UIC is set correctly in the Makefile."
echo
exit 5
fi
fi
input="api/protos.conf"
while IFS= read -r line
do
#echo $line
if [[ "$line" == \#* ]] ; then
true
else
if echo "$line" | grep -e " \*" ; then
echo "This line in api/protos.conf is wrongly formatted. Must use \"<type>*\", not \"<type> *\""
echo
exit 5
fi
fi
done < "$input"
if grep "int seqblockid" api/protos.conf ; then
echo "The above line(s) in api/protos.conf is/are wrong. seqblock id is 64 bit"
echo
exit 5
fi
if grep "int seqblock_id" api/protos.conf ; then
echo "The above line(s) in api/protos.conf is/are wrong. seqblock id is 64 bit"
echo
exit 5
fi
if grep "int instrument_id" api/protos.conf ; then
echo "The above line(s) in api/protos.conf is/are wrong. instrument id is 64 bit"
echo
exit 5
fi
if grep "int guinum" api/protos.conf ; then
echo "The above line(s) in api/protos.conf is/are wrong. guinum is 64 bit"
echo
exit 5
fi
if grep "int id" api/protos.conf ; then
echo "The above line(s) in api/protos.conf is/are wrong. id has so far been 64 bit"
echo
exit 5
fi
#if [ `uname` == "Linux" ] ; then
#
# echo "#include <X11/Xaw/Scrollbar.h>" >temp$$.c
# echo "int main(){return 0;}" >>temp$$.c
# echo >>temp$$.c
# if ! gcc temp$$.c -lXaw ; then
# echo "Might be missing libXaw-devel"
# echo
# rm temp$$.c
# exit 5
# fi
# rm temp$$.c
#fi
if [ `uname` == "Linux" ] ; then
echo "#define PACKAGE 1" >temp$$.c
echo "#define PACKAGE_VERSION 1" >>temp$$.c
echo "#include <bfd.h>" >>temp$$.c
echo "#include <dlfcn.h>" >>temp$$.c
# echo "#include <libiberty.h>" >>temp$$.c
echo "int main(){return 0;}" >>temp$$.c
echo >>temp$$.c
if ! gcc temp$$.c -lbfd -liberty -ldl; then
echo "Couldn't find -lbfd, -ldl, -liberty, or header files for bfd or dlfcn."
echo "On Fedora, binutils-devel, libtool-ltdl or libtool might be missing."
echo "On Debian, libc6-dev or binutils-dev might be missing."
exit 5
fi
rm temp$$.c
fi
if $(./find_moc_and_uic_paths.sh qmake) --version|grep "5\.0\." ; then
echo "Qt is too old. Need at least 5.14"
exit 5
fi
if $(./find_moc_and_uic_paths.sh qmake) --version|grep "5\.1\." ; then
echo "Qt is too old. Need at least 5.14"
exit 5
fi
if $(./find_moc_and_uic_paths.sh qmake) --version|grep "5\.2\." ; then
echo "Qt is too old. Need at least 5.14"
exit 5
fi
if $(./find_moc_and_uic_paths.sh qmake) --version|grep "5\.3\." ; then
echo "Qt is too old. Need at least 5.14"
exit 5
fi
if $(./find_moc_and_uic_paths.sh qmake) --version|grep "5\.4\." ; then
echo "Qt is too old. Need at least 5.14"
exit 5
fi
if $(./find_moc_and_uic_paths.sh qmake) --version|grep "5\.5\." ; then
echo "Qt is too old. Need at least 5.14"
exit 5
fi
if $(./find_moc_and_uic_paths.sh qmake) --version|grep "5\.6\." ; then
echo "Qt is too old. Need at least 5.14"
exit 5
fi
if $(./find_moc_and_uic_paths.sh qmake) --version|grep "5\.7\." ; then
echo "Qt is too old. Need at least 5.14"
exit 5
fi
if $(./find_moc_and_uic_paths.sh qmake) --version|grep "5\.8\." ; then
echo "Qt is too old. Need at least 5.14"
exit 5
fi
if $(./find_moc_and_uic_paths.sh qmake) --version|grep "5\.9\." ; then
echo "Qt is too old. Need at least 5.14"
exit 5
fi
if $(./find_moc_and_uic_paths.sh qmake) --version|grep "5\.10\." ; then
echo "Qt is too old. Need at least 5.14"
exit 5
fi
if $(./find_moc_and_uic_paths.sh qmake) --version|grep "5\.11\." ; then
echo "Qt is too old. Need at least 5.14"
exit 5
fi
if $(./find_moc_and_uic_paths.sh qmake) --version|grep "5\.12\." ; then
echo "Qt is too old. Need at least 5.14"
exit 5
fi
if $(./find_moc_and_uic_paths.sh qmake) --version|grep "5\.13\." ; then
echo "Qt is too old. Need at least 5.14"
exit 5
fi
if $(./find_moc_and_uic_paths.sh qmake) --version|grep "5\.5\." ; then
QT_QPA_PLATFORM_PLUGIN_PATH=`$(./find_moc_and_uic_paths.sh qmake) -query QT_INSTALL_PLUGINS`
if grep -r kf5deprecatedwidgets.so $QT_QPA_PLATFORM_PLUGIN_PATH ; then
echo
echo "The file $QT_QPA_PLATFORM_PLUGIN_PATH/*/kf5deprecatedwidgets.so in Qt 5.5 makes Radium (and other programs) misbehave. You should delete this file or use a different version of Qt."
echo
exit 5
fi
fi
if ! pkg-config --cflags sndfile >/dev/null 2>/dev/null ; then
echo "libsndfile not found"
exit 5
fi
if ! pkg-config --cflags samplerate >/dev/null 2>/dev/null ; then
echo "libsamplerate not found"
exit 5
fi
if [ `uname` == "Linux" ] ; then
if ! pkg-config --cflags lrdf >/dev/null 2>/dev/null ; then
echo "liblrdf not found"
exit 5
fi
fi
if ! pkg-config --cflags glib-2.0 >/dev/null 2>/dev/null ; then
echo "glib-2.0 not found"
exit 5
fi
if [[ $4 == "test_build" ]] ; then
if [ `uname` == "Linux" ] ; then
if [ ! -f bin/packages/deletemetorebuild ] ; then
echo
echo "Packages not build. First run 'make packages'"
echo
exit 5
fi
fi
fi
echo "All seems good"
echo