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
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
|
#!/bin/bash
# Slackware build script for linphone-desktop
# Copyright 2023, Lockywolf
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Warning! This build _requires_ that linphone-desktop be _uninstalled_ before
# building.
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=linphone-desktop
VERSION=${VERSION:-5.2.6}
PKGVERSION=${PKGVERSION:-5.2.6}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
fi
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
elif [ "$ARCH" = "aarch64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi
source /etc/profile.d/cmake-opt.sh
if [[ -e /opt/$PRGNAM/bin/linphone ]] ; then
printf "This script cannot run if %s is already installed. Uninstall it first.\n" "$PRGNAM" 1>&2
exit 1
fi
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$PKGVERSION
tar xvf $CWD/$PRGNAM-$PKGVERSION.tar.gz
cd $PRGNAM-$PKGVERSION
modulepaths=( external/qtkeychain \
external/ispell \
linphone-sdk \
linphone-sdk/bcg729 \
linphone-sdk/bcmatroska2 \
linphone-sdk/bctoolbox \
linphone-sdk/bcunit \
linphone-sdk/belcard \
linphone-sdk/belle-sip \
linphone-sdk/belr \
linphone-sdk/bzrtp \
linphone-sdk/external/aom \
linphone-sdk/external/bv16-floatingpoint \
linphone-sdk/external/codec2 \
linphone-sdk/external/dav1d \
linphone-sdk/external/decaf \
linphone-sdk/external/ffmpeg \
linphone-sdk/external/gsm \
linphone-sdk/external/jsoncpp \
linphone-sdk/external/libjpeg-turbo \
linphone-sdk/external/liboqs \
linphone-sdk/external/libvpx \
linphone-sdk/external/libxml2 \
linphone-sdk/external/libyuv \
linphone-sdk/external/mbedtls \
linphone-sdk/external/opencore-amr \
linphone-sdk/external/openh264 \
linphone-sdk/external/openldap \
linphone-sdk/external/opus \
linphone-sdk/external/soci \
linphone-sdk/external/speex \
linphone-sdk/external/sqlite3 \
linphone-sdk/external/srtp \
linphone-sdk/external/vo-amrwbenc \
linphone-sdk/external/xerces-c \
linphone-sdk/external/zlib \
linphone-sdk/external/zxing-cpp \
linphone-sdk/liblinphone \
linphone-sdk/lime \
linphone-sdk/mediastreamer2 \
linphone-sdk/msaaudio \
linphone-sdk/msamr \
linphone-sdk/msandroidcamera2 \
linphone-sdk/mscodec2 \
linphone-sdk/msoboe \
linphone-sdk/msopenh264 \
linphone-sdk/mssilk \
linphone-sdk/mswasapi \
linphone-sdk/mswebrtc \
linphone-sdk/ortp \
linphone-sdk/postquantumcryptoengine\
linphone-sdk/msoboe/oboe\
linphone-sdk/mswebrtc/webrtc)
# packagenames=( qtkeychain-bb47857aed7c3e9a66902ff681680a79f44e81e5.tar.gz \
# ispell-05574fe160222c3d0b6283c1433c9b087271fad1 \
# linphone-sdk-5e9455e658e51bd3e23d07479ac27f9144b06075.tar.gz \
# bcg729-faaa895862165acde6df8add722ba4f85a25007d.tar.gz \
# bcmatroska2-4d125bf2788915325c5ab93b9a97835f96d566d3.tar.gz \
# bctoolbox-c2888c536b06b114cd36caf652e71394639e9e37.tar.gz \
# bcunit-e9101548b1aba4298a18c3817ebee053c7f3a0a7.tar.gz \
# belcard-f50f203d6a44b6ec3bfd897d8057a94dfefa3e57.tar.gz \
# belle-sip-ac2a77241d528f578b671b75c86a085fd9059d55.tar.gz \
# belr-4a0cf1debc2dfc211491a599501fac35ba11b233.tar.gz \
# bzrtp-bf66d442d1881eff4310ce9516e25f2616adfd35.tar.gz \
# bv16-floatingpoint-c64804e46b2edd6a941db7f1b28233c5735a4479.tar.gz \
# codec2-4e154e6bbbe92cc76e333a0b4acb365b5c042ec6.tar.gz \
# decaf-876ddb4d465c94f97beba1be450e8538d866cc5d.tar.gz \
# ffmpeg-8b92b3898b00cc214e81f39cc9f020c2ce69c533.tar.gz \
# gsm-5b603ccf4620d76c9e642ca8c4560e3c43650017.tar.gz \
# b1bd848241880ccea2d940f67343a899b9f65d5d.tar.gz \
# libjpeg-turbo-d4da2a4869361c82b61188f00a1fb0085ddae748.tar.gz \
# liboqs-fe69ee473c878a3f015f405000877c5eb1de8996.tar.gz \
# libvpx-894d0f3b1e0e4224fc3c353a224ffb770c31d48c.tar.gz \
# libxml2-3efe42fd5facc2b476e8f5f288ef241930160e79.tar.gz \
# libyuv-7f813af29c72e531a3a0394252c328ec8c5245c0.tar.gz \
# mbedtls-a4f4f947c1c1dbaba7052a96eb4995a75aa4e523.tar.gz \
# opencore-amr-8731a39f6e805e4537153541e165da34d9fa93bd.tar.gz \
# openh264-b16b12c031362bbe605549eec39922521b61fc72.tar.gz \
# openldap-2bca580b6b2ef22c44fbeaeabac6cbdc7c4756e7.tar.gz \
# opus-a97fe72ad43d51f103a3b508b6302c587435317b.tar.gz \
# soci-bc4f22657b9f2ce6cfe15d904b9fa54ee79b8a06.tar.gz \
# speex-c8fcd72ef8d29bc913b0f384c9d8578b3e59718b.tar.gz \
# sqlite3-953ffcf472e7ced41003b6ec5be040b9f815df79.tar.gz \
# srtp-2481874bc4c24cdcc16577313d9460f8423dc57c.tar.gz \
# vo-amrwbenc-36dd497b9a570968b7ffaf74613334bc41d94199.tar.gz \
# xerces-c-27f09a04c5c02921e69210067ac14bb9e31091b9.tar.gz \
# zlib-affdc78f119e43bb4277e4c16488dd281a2163b0.tar.gz \
# zxing-cpp-2050520071cb798a1712d4d6f43e45ab94550660.tar.gz \
# liblinphone-616e0cbb66f3e09145765247419071ce092a47f6.tar.gz \
# lime-de7c88d8a4fee9e54b99438cd38da2784bdfb046.tar.gz \
# mediastreamer2-e30db5cbd3a9290a7a9a645523e414b3678b0895.tar.gz \
# msaaudio-a44089d176e52f73d15de444fddb9497e5103de4.tar.gz \
# msamr-e23b62f1556118563cbdf2e4abb2a0b15a296624.tar.gz \
# msandroidcamera2-6761b14dacd8ed8299240c5a1911ceacc8ad5708.tar.gz \
# mscodec2-30d88f890897a8d82a4b195591045e9fe5cf7208.tar.gz \
# msoboe-11d0f703482ddc11d9d15ec81ed8c97d2d9bd317.tar.gz \
# msopenh264-5c7a9522478f5eedc9a3e1600fdd705da1e00d23.tar.gz \
# mssilk-ff9ddf985266bf25ba2dcd3256172fa0ab52e4b1.tar.gz \
# mswasapi-c8a851cc1358b860a93b42c17b267d1d8f6952b8.tar.gz \
# mswebrtc-80b8e33b11516870b887b80279b9da4de8b26ebe.tar.gz \
# mswinrtvid-384dba6ff7ac37f4123f1f02b9b7b2bc40784dc4.tar.gz \
# ortp-6e05272d70456ef8a84684572a3bb847873ec176.tar.gz \
# postquantumcryptoengine-0f71ffb829102cce337ed5cdc42c5a57d06791ab.tar.gz\
# oboe-5975ab04b02861dc126f3c8fd687321520cd8ae4.tar.gz \
# webrtc-583acd27665cfadef8ab03eb85a768d308bd29dd.tar.gz)
# unpackeddirname=( qtkeychain-bb47857aed7c3e9a66902ff681680a79f44e81e5 \
# ispell-05574fe160222c3d0b6283c1433c9b087271fad1 \
# linphone-sdk-5e9455e658e51bd3e23d07479ac27f9144b06075 \
# bcg729-faaa895862165acde6df8add722ba4f85a25007d \
# bcmatroska2-4d125bf2788915325c5ab93b9a97835f96d566d3 \
# bctoolbox-c2888c536b06b114cd36caf652e71394639e9e37 \
# bcunit-e9101548b1aba4298a18c3817ebee053c7f3a0a7 \
# belcard-f50f203d6a44b6ec3bfd897d8057a94dfefa3e57 \
# belle-sip-ac2a77241d528f578b671b75c86a085fd9059d55 \
# belr-4a0cf1debc2dfc211491a599501fac35ba11b233 \
# bzrtp-bf66d442d1881eff4310ce9516e25f2616adfd35 \
# bv16-floatingpoint-c64804e46b2edd6a941db7f1b28233c5735a4479 \
# codec2-4e154e6bbbe92cc76e333a0b4acb365b5c042ec6 \
# decaf-876ddb4d465c94f97beba1be450e8538d866cc5d \
# ffmpeg-8b92b3898b00cc214e81f39cc9f020c2ce69c533 \
# gsm-5b603ccf4620d76c9e642ca8c4560e3c43650017 \
# jsoncpp-b1bd848241880ccea2d940f67343a899b9f65d5d \
# libjpeg-turbo-d4da2a4869361c82b61188f00a1fb0085ddae748 \
# liboqs-fe69ee473c878a3f015f405000877c5eb1de8996 \
# libvpx-894d0f3b1e0e4224fc3c353a224ffb770c31d48c \
# libxml2-3efe42fd5facc2b476e8f5f288ef241930160e79 \
# libyuv-7f813af29c72e531a3a0394252c328ec8c5245c0 \
# mbedtls-a4f4f947c1c1dbaba7052a96eb4995a75aa4e523 \
# opencore-amr-8731a39f6e805e4537153541e165da34d9fa93bd \
# openh264-b16b12c031362bbe605549eec39922521b61fc72 \
# openldap-2bca580b6b2ef22c44fbeaeabac6cbdc7c4756e7 \
# opus-a97fe72ad43d51f103a3b508b6302c587435317b \
# soci-bc4f22657b9f2ce6cfe15d904b9fa54ee79b8a06 \
# speex-c8fcd72ef8d29bc913b0f384c9d8578b3e59718b \
# sqlite3-953ffcf472e7ced41003b6ec5be040b9f815df79 \
# srtp-2481874bc4c24cdcc16577313d9460f8423dc57c \
# vo-amrwbenc-36dd497b9a570968b7ffaf74613334bc41d94199 \
# xerces-c-27f09a04c5c02921e69210067ac14bb9e31091b9 \
# zlib-affdc78f119e43bb4277e4c16488dd281a2163b0 \
# zxing-cpp-2050520071cb798a1712d4d6f43e45ab94550660 \
# liblinphone-616e0cbb66f3e09145765247419071ce092a47f6 \
# lime-de7c88d8a4fee9e54b99438cd38da2784bdfb046 \
# mediastreamer2-e30db5cbd3a9290a7a9a645523e414b3678b0895 \
# msaaudio-a44089d176e52f73d15de444fddb9497e5103de4 \
# msamr-e23b62f1556118563cbdf2e4abb2a0b15a296624 \
# msandroidcamera2-6761b14dacd8ed8299240c5a1911ceacc8ad5708 \
# mscodec2-30d88f890897a8d82a4b195591045e9fe5cf7208 \
# msoboe-11d0f703482ddc11d9d15ec81ed8c97d2d9bd317 \
# msopenh264-5c7a9522478f5eedc9a3e1600fdd705da1e00d23 \
# mssilk-ff9ddf985266bf25ba2dcd3256172fa0ab52e4b1 \
# mswasapi-c8a851cc1358b860a93b42c17b267d1d8f6952b8 \
# mswebrtc-80b8e33b11516870b887b80279b9da4de8b26ebe \
# mswinrtvid-384dba6ff7ac37f4123f1f02b9b7b2bc40784dc4 \
# ortp-6e05272d70456ef8a84684572a3bb847873ec176 \
# postquantumcryptoengine-0f71ffb829102cce337ed5cdc42c5a57d06791ab\
# webrtc-583acd27665cfadef8ab03eb85a768d308bd29dd)
packagenames=( qtkeychain \
ispell \
linphone-sdk \
bcg729 \
bcmatroska2 \
bctoolbox \
bcunit \
belcard \
belle-sip \
belr \
bzrtp \
aom \
bv16-floatingpoint \
codec2 \
dav1d \
decaf \
ffmpeg \
gsm \
jsoncpp \
libjpeg-turbo \
liboqs \
libvpx \
libxml2 \
libyuv \
mbedtls \
opencore-amr \
openh264 \
openldap \
opus \
soci \
speex \
sqlite3 \
srtp \
vo-amrwbenc \
xerces-c \
zlib \
zxing-cpp \
liblinphone \
lime \
mediastreamer2 \
msaaudio \
msamr \
msandroidcamera2 \
mscodec2 \
msoboe \
msopenh264 \
mssilk \
mswasapi \
mswebrtc \
ortp \
postquantumcryptoengine\
oboe \
webrtc)
for i in "${!modulepaths[@]}" ; do
echo "${!modulepaths[@]}"
tar xvf "$CWD"/"${packagenames[i]}"*
rmdir "${modulepaths[i]}"
ln -s "$(pwd)"/"${packagenames[i]}"* "${modulepaths[i]}"
done
git init >> /dev/null
git config user.email "dummy@example.test"
git config user.name "Example"
git add README.md
git commit -m "$PKGVERSION" > /dev/null
git tag -m "$PKGVERSION" "$PKGVERSION"
echo ""
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} + -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} + || true
my_parallel="${MAKEFLAGS##-j}"
my_parallel="${my_parallel:-1}"
sed -i 's/-Wunused-parameter//g' linphone-sdk/liblinphone/CMakeLists.txt || exit 200
sed -i '/bc_apply_compile_flags/d' linphone-sdk/liblinphone/console/CMakeLists.txt || exit 200
sed -i 's/cmake_minimum_required(VERSION 3.22)/cmake_minimum_required(VERSION 3.30.5)/g' CMakeLists.txt
sed -i 's/add_dependencies(sdk opencore-amr)/add_dependencies(sdk opencore-amrwb opencore-amrnb)/g' linphone-sdk/cmake/ExternalDependencies.cmake
sed -i 's/add_dependencies(sdk vo_amrwbenc)/add_dependencies(sdk vo-amrwbenc)/g' linphone-sdk/cmake/ExternalDependencies.cmake
mkdir -p build
cd build
cmake -G Ninja \
-DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS -Wno-error=unused-parameter" \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DLIB_SUFFIX=${LIBDIRSUFFIX} \
-DMAN_INSTALL_DIR=/usr/man \
-DCMAKE_INSTALL_PREFIX=/usr \
-DENABLE_TOOLS=ON \
-DENABLE_PQCRYPTO=ON \
-DENABLE_SOCI_MYSQL=ON \
-DENABLE_MDNS=ON \
-DENABLE_AMRNB=ON \
-DENABLE_AMRWB=ON \
-DENABLE_CODEC2=ON \
-DENABLE_G726=ON -DENABLE_G729=ON -DENABLE_G729B_CNG=ON \
-DENABLE_ILBC=ON -DENABLE_ISAC=ON \
-DENABLE_SILK=ON \
-DENABLE_WEBRTC_VAD=ON -DENABLE_X264=ON \
-DENABLE_QRCODE=ON \
-DENABLE_RTP_MAP_ALWAYS_IN_SDP=ON \
-DENABLE_FFMPEG=ON \
-DENABLE_NON_FREE_FEATURES=ON \
-DENABLE_OPENH264=ON \
-DENABLE_H263=ON -DENABLE_H263P=ON \
-DDNSSD_ROOT=/usr/include/avahi-compat-libdns_sd/ \
-DENABLE_MDNS=ON \
-DENABLE_NLS=ON \
-DENABLE_STRICT=NO \
-DENABLE_GTK_UI=ON \
-DENABLE_DAEMON=ON \
-DENABLE_GPL_THIRD_PARTIES=ON \
-DENABLE_LIME_X3DH=ON \
-DENABLE_CONSOLE_UI=ON \
-DCMAKE_BUILD_TYPE=Release ..
cmake --build .
cmake --install . --prefix $PKG/opt/linphone-desktop
cd ..
chmod +x $PKG/opt/linphone-desktop/lib$LIBDIRSUFFIX/*.so*
(
mkdir -p $PKG/usr/bin
cd $PKG/usr/bin
ln -sr ../../opt/$PRGNAM/bin/linphone $PRGNAM
)
rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
README.md LICENSE.txt CHANGELOG.md \
$PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
|