-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
bootstrap-plugins.sh
executable file
·663 lines (504 loc) · 23 KB
/
bootstrap-plugins.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
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
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
#!/bin/bash
set -e
cd $(dirname ${0})
PAWPAW_ROOT="${PWD}"
# ---------------------------------------------------------------------------------------------------------------------
# check target
target="${1}"
if [ -z "${target}" ]; then
echo "usage: ${0} <target>"
exit 1
fi
# ---------------------------------------------------------------------------------------------------------------------
# skip fluidsynth if glib is not wanted (fluidsynth requires glib)
if [ -n "${PAWPAW_SKIP_GLIB}" ] && [ "${PAWPAW_SKIP_GLIB}" -eq 1 ]; then
PAWPAW_SKIP_FLUIDSYNTH=1
fi
# ---------------------------------------------------------------------------------------------------------------------
# run bootstrap dependencies
./bootstrap-common.sh "${target}"
# ---------------------------------------------------------------------------------------------------------------------
# source setup code
source setup/check_target.sh
source setup/env.sh
source setup/functions.sh
source setup/versions.sh
# ---------------------------------------------------------------------------------------------------------------------
# check for depedencies
if [ -z "${autoconf}" ]; then
echo "missing 'autoconf' program, cannot continue!"
exit 2
fi
if [ -z "${PAWPAW_SKIP_LV2}" ] || [ "${PAWPAW_SKIP_LV2}" -eq 0 ]; then
if [ -z "${meson}" ]; then
echo "missing 'meson' program, cannot continue!"
exit 2
fi
if [ -z "${ninja}" ]; then
echo "missing 'ninja' program, cannot continue!"
exit 2
fi
fi
# ---------------------------------------------------------------------------------------------------------------------
# libpng
LIBPNG_EXTRAFLAGS=""
if [ -n "${PAWPAW_NOSIMD}" ] && [ "${PAWPAW_NOSIMD}" -eq 1 ]; then
LIBPNG_EXTRAFLAGS+=" --disable-hardware-optimizations"
fi
# bypass broken zlib configure tests
if [ "${MACOS}" -eq 0 ]; then
LIBPNG_EXTRAFLAGS+=" ac_cv_lib_z_zlibVersion=yes"
export EXTRA_CPPFLAGS="-I${PAWPAW_PREFIX}/include"
fi
# FIXME
if [ "${MACOS_UNIVERSAL}" -eq 1 ]; then
LIBPNG_EXTRAFLAGS+=" --disable-hardware-optimizations"
fi
download libpng "${LIBPNG_VERSION}" "${LIBPNG_URL}" "tar.xz"
build_autoconf libpng "${LIBPNG_VERSION}" "${LIBPNG_EXTRAFLAGS}"
if [ -z "${PAWPAW_SKIP_TESTS}" ] || [ "${PAWPAW_SKIP_TESTS}" -eq 0 ]; then
run_make libpng "${LIBPNG_VERSION}" "check -j 1"
fi
if [ "${MACOS}" -eq 1 ] && [ ! -e "${PAWPAW_PREFIX}/lib/pkgconfig/libpng16.pc-e" ]; then
sed -i -e '/Requires.private: zlib/d' "${PAWPAW_PREFIX}/lib/pkgconfig/libpng16.pc"
touch "${PAWPAW_PREFIX}/lib/pkgconfig/libpng16.pc-e"
fi
# ---------------------------------------------------------------------------------------------------------------------
# libxml2
if [ "${MACOS}" -eq 0 ]; then
LIBXML2_EXTRAFLAGS=""
# ensure no system paths are used
LIBXML2_EXTRAFLAGS+=" -DZLIB_INCLUDE_DIR:PATH=${PAWPAW_PREFIX}/include"
LIBXML2_EXTRAFLAGS+=" -DZLIB_LIBRARY:PATH=${PAWPAW_PREFIX}/lib/libz.a"
# disable stuff typically not needed for plugins
LIBXML2_EXTRAFLAGS+=" -DLIBXML2_WITH_HTML=OFF"
LIBXML2_EXTRAFLAGS+=" -DLIBXML2_WITH_HTTP=OFF"
LIBXML2_EXTRAFLAGS+=" -DLIBXML2_WITH_ICONV=OFF"
LIBXML2_EXTRAFLAGS+=" -DLIBXML2_WITH_LZMA=OFF"
LIBXML2_EXTRAFLAGS+=" -DLIBXML2_WITH_MODULES=OFF"
LIBXML2_EXTRAFLAGS+=" -DLIBXML2_WITH_PROGRAMS=OFF"
LIBXML2_EXTRAFLAGS+=" -DLIBXML2_WITH_PYTHON=OFF"
LIBXML2_EXTRAFLAGS+=" -DLIBXML2_WITH_THREADS=OFF"
download libxml2 "${LIBXML2_VERSION}" "${LIBXML2_URL}" "tar.xz"
build_cmake libxml2 "${LIBXML2_VERSION}" "${LIBXML2_EXTRAFLAGS}"
fi # !MACOS
# ---------------------------------------------------------------------------------------------------------------------
# pixman
PIXMAN_EXTRAFLAGS="--disable-gtk --enable-libpng"
download pixman "${PIXMAN_VERSION}" "${PIXMAN_URL}"
build_autoconf pixman "${PIXMAN_VERSION}" "${PIXMAN_EXTRAFLAGS}"
# FIXME tests fail on i686 CI builds
if ([ -z "${PAWPAW_SKIP_TESTS}" ] || [ "${PAWPAW_SKIP_TESTS}" -eq 0 ]) && [ "x${LINUX_TARGET}" != "xlinux-i686" ]; then
run_make pixman "${PIXMAN_VERSION}" check
fi
# ---------------------------------------------------------------------------------------------------------------------
# freetype
FREETYPE_EXTRAFLAGS=""
FREETYPE_EXTRAFLAGS+=" -DDISABLE_FORCE_DEBUG_POSTFIX=TRUE"
FREETYPE_EXTRAFLAGS+=" -DFT_REQUIRE_PNG=TRUE"
FREETYPE_EXTRAFLAGS+=" -DFT_REQUIRE_ZLIB=TRUE"
FREETYPE_EXTRAFLAGS+=" -DFT_DISABLE_BROTLI=TRUE"
FREETYPE_EXTRAFLAGS+=" -DFT_DISABLE_BZIP2=TRUE"
FREETYPE_EXTRAFLAGS+=" -DFT_DISABLE_HARFBUZZ=TRUE"
# ensure no system paths are used
# FREETYPE_EXTRAFLAGS+=" -DBROTLIDEC_INCLUDE_DIRS:PATH=${PAWPAW_PREFIX}/include"
# FREETYPE_EXTRAFLAGS+=" -DFREETYPE_INCLUDE_DIRS:PATH=${PAWPAW_PREFIX}/include"
# FREETYPE_EXTRAFLAGS+=" -DHarfBuzz_INCLUDE_DIR:PATH=${PAWPAW_PREFIX}/include/harfbuzz"
FREETYPE_EXTRAFLAGS+=" -DPNG_PNG_INCLUDE_DIR:PATH=${PAWPAW_PREFIX}/include"
FREETYPE_EXTRAFLAGS+=" -DPNG_LIBRARY:PATH=${PAWPAW_PREFIX}/lib/libpng.a"
if [ "${MACOS}" -eq 0 ]; then
FREETYPE_EXTRAFLAGS+=" -DZLIB_INCLUDE_DIR:PATH=${PAWPAW_PREFIX}/include"
FREETYPE_EXTRAFLAGS+=" -DZLIB_LIBRARY:PATH=${PAWPAW_PREFIX}/lib/libz.a"
fi
download freetype "${FREETYPE_VERSION}" "${FREETYPE_URL}" "tar.xz"
build_cmake freetype "${FREETYPE_VERSION}" "${FREETYPE_EXTRAFLAGS}"
if [ ! -e "${PAWPAW_PREFIX}/lib/pkgconfig/freetype2.pc-e" ]; then
sed -i -e 's/, libbrotlidec//' "${PAWPAW_PREFIX}/lib/pkgconfig/freetype2.pc"
if [ "${MACOS}" -eq 1 ]; then
sed -i -e 's/Requires: zlib,/Requires:/' "${PAWPAW_PREFIX}/lib/pkgconfig/freetype2.pc"
fi
touch "${PAWPAW_PREFIX}/lib/pkgconfig/freetype2.pc-e"
fi
# ---------------------------------------------------------------------------------------------------------------------
# fontconfig
FONTCONFIG_EXTRAFLAGS="--disable-iconv"
if [ "${MACOS}" -eq 0 ]; then
FONTCONFIG_EXTRAFLAGS+=" --enable-libxml2"
fi
# workaround missing implementation, see https://github.com/emscripten-core/emscripten/issues/12093
if [ "${WASM}" -eq 1 ]; then
export EXTRA_CFLAGS="-Duuid_generate_random=uuid_generate"
fi
download fontconfig "${FONTCONFIG_VERSION}" "${FONTCONFIG_URL}"
build_autoconf fontconfig "${FONTCONFIG_VERSION}" "${FONTCONFIG_EXTRAFLAGS}"
# tests fail on stable release, see https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/177
# if [ -z "${PAWPAW_SKIP_TESTS}" ] || [ "${PAWPAW_SKIP_TESTS}" -eq 0 ]; then
# run_make fontconfig "${FONTCONFIG_VERSION}" check
# fi
# ---------------------------------------------------------------------------------------------------------------------
# cairo
CAIRO_EXTRAFLAGS="ac_cv_lib_z_compress=yes"
CAIRO_EXTRAFLAGS+=" --disable-gtk-doc"
CAIRO_EXTRAFLAGS+=" --disable-qt"
CAIRO_EXTRAFLAGS+=" --disable-os2"
CAIRO_EXTRAFLAGS+=" --disable-beos"
CAIRO_EXTRAFLAGS+=" --disable-drm"
CAIRO_EXTRAFLAGS+=" --disable-gallium"
CAIRO_EXTRAFLAGS+=" --disable-gl"
CAIRO_EXTRAFLAGS+=" --disable-glesv2"
CAIRO_EXTRAFLAGS+=" --disable-glesv3"
CAIRO_EXTRAFLAGS+=" --disable-cogl"
CAIRO_EXTRAFLAGS+=" --disable-directfb"
CAIRO_EXTRAFLAGS+=" --disable-vg"
CAIRO_EXTRAFLAGS+=" --disable-egl"
CAIRO_EXTRAFLAGS+=" --disable-glx"
CAIRO_EXTRAFLAGS+=" --disable-wgl"
CAIRO_EXTRAFLAGS+=" --disable-script"
CAIRO_EXTRAFLAGS+=" --disable-ps"
CAIRO_EXTRAFLAGS+=" --disable-pdf"
CAIRO_EXTRAFLAGS+=" --disable-svg"
CAIRO_EXTRAFLAGS+=" --disable-test-surfaces"
CAIRO_EXTRAFLAGS+=" --disable-svg"
CAIRO_EXTRAFLAGS+=" --disable-tee"
CAIRO_EXTRAFLAGS+=" --disable-xml"
CAIRO_EXTRAFLAGS+=" --disable-gobject"
CAIRO_EXTRAFLAGS+=" --disable-full-testing"
CAIRO_EXTRAFLAGS+=" --enable-interpreter"
CAIRO_EXTRAFLAGS+=" --enable-png"
CAIRO_EXTRAFLAGS+=" --enable-ft"
CAIRO_EXTRAFLAGS+=" --enable-pthread"
# TESTING
CAIRO_EXTRAFLAGS+=" --disable-symbol-lookup"
CAIRO_EXTRAFLAGS+=" --disable-trace"
if [ "${LINUX}" -eq 1 ]; then
CAIRO_EXTRAFLAGS+=" --enable-fc"
CAIRO_EXTRAFLAGS+=" --enable-xlib"
CAIRO_EXTRAFLAGS+=" --enable-xlib-xrender"
# TODO
# CAIRO_EXTRAFLAGS+=" --enable-xcb"
# CAIRO_EXTRAFLAGS+=" --enable-xlib-xcb"
# CAIRO_EXTRAFLAGS+=" --enable-xcb-shm"
CAIRO_EXTRAFLAGS+=" --disable-xcb"
CAIRO_EXTRAFLAGS+=" --disable-xlib-xcb"
CAIRO_EXTRAFLAGS+=" --disable-xcb-shm"
if [ "${LINUX_TARGET}" = "linux-riscv64" ]; then
CAIRO_EXTRAFLAGS+=" ax_cv_c_float_words_bigendian=yes"
else
CAIRO_EXTRAFLAGS+=" ax_cv_c_float_words_bigendian=no"
fi
else
CAIRO_EXTRAFLAGS+=" --disable-fc"
CAIRO_EXTRAFLAGS+=" --disable-xlib"
CAIRO_EXTRAFLAGS+=" --disable-xlib-xrender"
CAIRO_EXTRAFLAGS+=" --disable-xcb"
CAIRO_EXTRAFLAGS+=" --disable-xlib-xcb"
CAIRO_EXTRAFLAGS+=" --disable-xcb-shm"
CAIRO_EXTRAFLAGS+=" ax_cv_c_float_words_bigendian=no"
fi
if [ "${MACOS}" -eq 1 ]; then
CAIRO_EXTRAFLAGS+=" --enable-quartz"
CAIRO_EXTRAFLAGS+=" --enable-quartz-font"
CAIRO_EXTRAFLAGS+=" --enable-quartz-image"
else
CAIRO_EXTRAFLAGS+=" --disable-quartz"
CAIRO_EXTRAFLAGS+=" --disable-quartz-font"
CAIRO_EXTRAFLAGS+=" --disable-quartz-image"
fi
if [ "${WIN32}" -eq 1 ]; then
CAIRO_EXTRAFLAGS+=" --enable-win32"
CAIRO_EXTRAFLAGS+=" --enable-win32-font"
else
CAIRO_EXTRAFLAGS+=" --disable-win32"
CAIRO_EXTRAFLAGS+=" --disable-win32-font"
fi
# fix link of test suite
if [ "${MACOS}" -eq 1 ]; then
export EXTRA_LDFLAGS="-framework CoreFoundation -framework CoreGraphics"
elif [ "${WIN32}" -eq 1 ]; then
export EXTRA_CFLAGS="-Dstrndup=_strndup"
fi
download cairo "${CAIRO_VERSION}" "${CAIRO_URL}" "tar.xz"
# fix build when compiler or linker uses stderr, see https://gitlab.freedesktop.org/cairo/cairo/-/issues/121
patch_file cairo "${CAIRO_VERSION}" "configure" 's/test "x$cairo_cc_stderr" != "x"/false/g'
build_autoconf cairo "${CAIRO_VERSION}" "${CAIRO_EXTRAFLAGS}"
# FIXME tests are failing :(
# if [ -z "${PAWPAW_SKIP_TESTS}" ] || [ "${PAWPAW_SKIP_TESTS}" -eq 0 ]; then
# run_make cairo "${CAIRO_VERSION}" "check -j 1"
# fi
# ---------------------------------------------------------------------------------------------------------------------
# fftw
if [ -z "${PAWPAW_SKIP_FFTW}" ] || [ "${PAWPAW_SKIP_FFTW}" -eq 0 ]; then
# fftw is not compatible with LTO
if [ -z "${PAWPAW_SKIP_LTO}" ] || [ "${PAWPAW_SKIP_LTO}" -eq 0 ]; then
export EXTRA_CFLAGS="-fno-lto"
export EXTRA_LDFLAGS="-fno-lto"
fi
FFTW_EXTRAFLAGS="--disable-alloca --disable-fortran --with-our-malloc"
if [ "${LINUX}" -eq 1 ]; then
if [ "${LINUX_TARGET}" = "linux-aarch64" ]; then
FFTW_EXTRAFLAGS+=" --with-slow-timer --enable-neon"
elif [ "${LINUX_TARGET}" = "linux-armhf" ]; then
FFTW_EXTRAFLAGS+=" --with-slow-timer"
elif [ "${LINUX_TARGET}" = "linux-riscv64" ]; then
FFTW_EXTRAFLAGS+=" --with-slow-timer"
fi
elif [ "${WASM}" -eq 1 ]; then
FFTW_EXTRAFLAGS+=" --with-slow-timer"
# FIXME macos-universal proper optimizations
# https://github.com/DISTRHO/PawPaw/issues/3
elif [ "${MACOS_UNIVERSAL}" -eq 0 ]; then
FFTW_EXTRAFLAGS+=" --enable-sse2"
fi
# debug builds are broken, as they override CFLAGS
if [ -n "${PAWPAW_DEBUG}" ] && [ "${PAWPAW_DEBUG}" -eq 1 ]; then
FFTW_EXTRAFLAGS+=" --disable-debug"
fi
download fftw "${FFTW_VERSION}" "${FFTW_URL}"
build_autoconf fftw "${FFTW_VERSION}" "${FFTW_EXTRAFLAGS}"
if [ -z "${PAWPAW_SKIP_TESTS}" ] || [ "${PAWPAW_SKIP_TESTS}" -eq 0 ]; then
run_make fftw "${FFTW_VERSION}" check
fi
fi # PAWPAW_SKIP_FFTW
# ---------------------------------------------------------------------------------------------------------------------
# fftwf
if [ -z "${PAWPAW_SKIP_FFTW}" ] || [ "${PAWPAW_SKIP_FFTW}" -eq 0 ]; then
# fftw is not compatible with LTO
if [ -z "${PAWPAW_SKIP_LTO}" ] || [ "${PAWPAW_SKIP_LTO}" -eq 0 ]; then
export EXTRA_CFLAGS="-fno-lto"
export EXTRA_LDFLAGS="-fno-lto"
fi
FFTWF_EXTRAFLAGS="${FFTW_EXTRAFLAGS} --enable-single"
if [ -z "${PAWPAW_NOSIMD}" ] || [ "${PAWPAW_NOSIMD}" -eq 0 ]; then
if [ "${LINUX}" -eq 1 ] && [ "${LINUX_TARGET}" = "linux-armhf" ]; then
FFTWF_EXTRAFLAGS+=" --enable-neon"
fi
fi
# debug builds are broken, as they override CFLAGS
if [ -n "${PAWPAW_DEBUG}" ] && [ "${PAWPAW_DEBUG}" -eq 1 ]; then
FFTWF_EXTRAFLAGS+=" --disable-debug"
fi
copy_download fftw fftwf "${FFTW_VERSION}"
build_autoconf fftwf "${FFTW_VERSION}" "${FFTWF_EXTRAFLAGS}"
if [ -z "${PAWPAW_SKIP_TESTS}" ] || [ "${PAWPAW_SKIP_TESTS}" -eq 0 ]; then
run_make fftwf "${FFTW_VERSION}" check
fi
fi # PAWPAW_SKIP_FFTW
# ---------------------------------------------------------------------------------------------------------------------
# pcre
if [ "${MACOS}" -eq 1 ] || [ -n "${TOOLCHAIN_PREFIX}" ]; then
download pcre "${PCRE_VERSION}" "${PCRE_URL}"
build_autoconf pcre "${PCRE_VERSION}"
fi
# ---------------------------------------------------------------------------------------------------------------------
# libffi
if [ "${LINUX}" -eq 1 ] || [ "${WIN32}" -eq 1 ]; then
LIBFFI_EXTRAFLAGS="--disable-multi-os-directory --disable-raw-api"
download libffi "${LIBFFI_VERSION}" "${LIBFFI_URL}"
build_autoconf libffi "${LIBFFI_VERSION}" "${LIBFFI_EXTRAFLAGS}"
fi
# ---------------------------------------------------------------------------------------------------------------------
# glib
if [ -z "${PAWPAW_SKIP_GLIB}" ] || [ "${PAWPAW_SKIP_GLIB}" -eq 0 ]; then
if [ "${MACOS}" -eq 1 ] || [ "${WASM}" -eq 1 ] || [ "${WIN32}" -eq 1 ]; then
GLIB_EXTRAFLAGS=""
GLIB_EXTRAFLAGS+=" --disable-rebuilds"
GLIB_EXTRAFLAGS+=" --disable-profile"
if [ "${WIN32}" -eq 1 ]; then
GLIB_EXTRAFLAGS+=" --with-threads=win32"
else
GLIB_EXTRAFLAGS+=" --with-threads=posix"
fi
if [ "${WASM}" -eq 1 ]; then
GLIB_EXTRAFLAGS+=" ac_cv_lib_socket_socket=no ac_cv_func_posix_getgrgid_r=no ac_cv_func_posix_getpwuid_r=no glib_cv_stack_grows=no glib_cv_uscore=no"
fi
export EXTRA_CFLAGS="-Wno-incompatible-function-pointer-types"
if [ "${MACOS}" -eq 1 ]; then
export EXTRA_LDFLAGS="-lresolv"
elif [ "${WIN32}" -eq 1 ]; then
export EXTRA_CFLAGS="${EXTRA_CFLAGS} -Wno-format -Wno-format-overflow"
fi
download glib ${GLIB_VERSION} "${GLIB_URL}" "${GLIB_TAR_EXT}"
if [ "${MACOS}" -eq 1 ]; then
patch_file glib ${GLIB_VERSION} "glib/gconvert.c" '/#error/g'
patch_file glib ${GLIB_VERSION} "glib/gatomic.c" 's/G_ATOMIC_ARM/__aarch64__/'
patch_file glib ${GLIB_VERSION} "glib/gatomic.c" 's/G_ATOMIC_X86_64/__SSE2__/'
elif [ "${WASM}" -eq 1 ]; then
patch_file glib ${GLIB_VERSION} "glib/gatomic.c" 's/G_ATOMIC_I486/_G_ATOMIC_NOT_I486/'
patch_file glib ${GLIB_VERSION} "glib/gatomic.c" 's/G_ATOMIC_X86_64/_G_ATOMIC_NOT_X86_64/'
fi
build_autoconfgen glib ${GLIB_VERSION} "${GLIB_EXTRAFLAGS}"
fi
fi # PAWPAW_SKIP_GLIB
# ---------------------------------------------------------------------------------------------------------------------
# liblo
LIBLO_EXTRAFLAGS="--enable-threads --disable-examples --disable-tools"
if [ -n "${PAWPAW_SKIP_TESTS}" ] && [ "${PAWPAW_SKIP_TESTS}" -eq 1 ]; then
LIBLO_EXTRAFLAGS+=" --disable-tests"
else
LIBLO_EXTRAFLAGS+=" --disable-network-tests"
fi
# auto-detection fails
if [ "${MACOS}" -eq 1 ]; then
LIBLO_EXTRAFLAGS+=" ac_cv_func_select=yes ac_cv_func_poll=yes ac_cv_func_setvbuf=yes"
if [ "${MACOS_UNIVERSAL}" -eq 1 ]; then
LIBLO_EXTRAFLAGS+=" ac_cv_c_bigendian=universal"
fi
# use of wrong macro, should be _WIN32
elif [ "${WIN32}" -eq 1 ]; then
export EXTRA_CFLAGS="-DWIN32"
fi
download liblo "${LIBLO_VERSION}" "${LIBLO_URL}"
build_autoconf liblo "${LIBLO_VERSION}" "${LIBLO_EXTRAFLAGS}"
# FIXME tests fail on macOS
if ([ -z "${PAWPAW_SKIP_TESTS}" ] || [ "${PAWPAW_SKIP_TESTS}" -eq 0 ]) && [ "${MACOS}" -eq 0 ]; then
run_make liblo "${LIBLO_VERSION}" check
fi
# ---------------------------------------------------------------------------------------------------------------------
# zix
if [ -z "${PAWPAW_SKIP_LV2}" ] || [ "${PAWPAW_SKIP_LV2}" -eq 0 ]; then
ZIX_EXTRAFLAGS=""
if [ "${MACOS}" -eq 1 ] && [ "${MACOS_10_15}" -eq 0 ]; then
# tests under macOS require >= 10.15
ZIX_EXTRAFLAGS+=" -Dtests=disabled -Dtests_cpp=disabled"
elif [ "${WASM}" -eq 1 ]; then
ZIX_EXTRAFLAGS+=" -Dtests=disabled -Dtests_cpp=disabled -Dthreads=disabled"
elif [ "${CROSS_COMPILING}" -eq 1 ] && [ "${LINUX}" -eq 0 ] && [ -z "${EXE_WRAPPER}" ]; then
ZIX_EXTRAFLAGS+=" -Dtests=disabled -Dtests_cpp=disabled"
fi
export EXTRA_CFLAGS="-fno-finite-math-only"
download zix "${ZIX_VERSION}" "${ZIX_URL}" "tar.xz"
build_meson zix "${ZIX_VERSION}" "-Dbenchmarks=disabled -Ddefault_library=static -Ddocs=disabled ${ZIX_EXTRAFLAGS}"
fi # PAWPAW_SKIP_LV2
# ---------------------------------------------------------------------------------------------------------------------
# serd
if [ -z "${PAWPAW_SKIP_LV2}" ] || [ "${PAWPAW_SKIP_LV2}" -eq 0 ]; then
if [ "${CROSS_COMPILING}" -eq 1 ] && [ "${LINUX}" -eq 0 ] && [ -z "${EXE_WRAPPER}" ]; then
SERD_EXTRAFLAGS="-Dtools=disabled"
fi
export EXTRA_CFLAGS="-fno-finite-math-only"
download serd "${SERD_VERSION}" "${SERD_URL}" "tar.xz"
build_meson serd "${SERD_VERSION}" "-Ddefault_library=static -Ddocs=disabled ${SERD_EXTRAFLAGS}"
fi # PAWPAW_SKIP_LV2
# ---------------------------------------------------------------------------------------------------------------------
# sord
if [ -z "${PAWPAW_SKIP_LV2}" ] || [ "${PAWPAW_SKIP_LV2}" -eq 0 ]; then
if [ "${CROSS_COMPILING}" -eq 1 ] && [ "${LINUX}" -eq 0 ] && [ -z "${EXE_WRAPPER}" ]; then
SORD_EXTRAFLAGS="-Dtools=disabled"
fi
download sord "${SORD_VERSION}" "${SORD_URL}" "tar.xz"
build_meson sord "${SORD_VERSION}" "-Ddefault_library=static -Ddocs=disabled ${SORD_EXTRAFLAGS}"
fi # PAWPAW_SKIP_LV2
# ---------------------------------------------------------------------------------------------------------------------
# lv2
if [ -z "${PAWPAW_SKIP_LV2}" ] || [ "${PAWPAW_SKIP_LV2}" -eq 0 ]; then
git_clone lv2 "${LV2_VERSION}" "${LV2_URL}"
build_meson lv2 "${LV2_VERSION}" "-Dlv2dir=${PAWPAW_PREFIX}/lib/lv2 -Dplugins=disabled"
fi # PAWPAW_SKIP_LV2
# ---------------------------------------------------------------------------------------------------------------------
# sratom
if [ -z "${PAWPAW_SKIP_LV2}" ] || [ "${PAWPAW_SKIP_LV2}" -eq 0 ]; then
download sratom "${SRATOM_VERSION}" "${SRATOM_URL}" "tar.xz"
build_meson sratom "${SRATOM_VERSION}" "-Ddefault_library=static -Ddocs=disabled"
fi # PAWPAW_SKIP_LV2
# ---------------------------------------------------------------------------------------------------------------------
# lilv
if [ -z "${PAWPAW_SKIP_LV2}" ] || [ "${PAWPAW_SKIP_LV2}" -eq 0 ]; then
if [ "${CROSS_COMPILING}" -eq 1 ] && [ "${LINUX}" -eq 0 ]; then
LILV_EXTRAFLAGS="-Dtests=disabled -Dtools=disabled"
fi
# Fix tests
export EXTRA_CXXFLAGS="-std=c++11"
download lilv "${LILV_VERSION}" "${LILV_URL}" "tar.xz"
build_meson lilv "${LILV_VERSION}" "-Ddefault_library=static -Dbindings_py=disabled -Ddocs=disabled ${LILV_EXTRAFLAGS}"
fi # PAWPAW_SKIP_LV2
# ---------------------------------------------------------------------------------------------------------------------
# lv2lint
if [ -z "${PAWPAW_SKIP_LV2}" ] || [ "${PAWPAW_SKIP_LV2}" -eq 0 ]; then
if [ "${LV2LINT_SUPPORTED}" -eq 1 ]; then
git_clone lv2lint "${LV2LINT_VERSION}" "${LV2LINT_URL}"
build_meson lv2lint "${LV2LINT_VERSION}"
# "-Donline-tests=true -Delf-tests=true"
fi
fi # PAWPAW_SKIP_LV2
# ---------------------------------------------------------------------------------------------------------------------
# kxstudio lv2 extensions
if [ -z "${PAWPAW_SKIP_LV2}" ] || [ "${PAWPAW_SKIP_LV2}" -eq 0 ]; then
git_clone kxstudio-lv2-extensions "${KXSTUDIO_LV2_EXTENSIONS_VERSION}" "${KXSTUDIO_LV2_EXTENSIONS_URL}"
build_make kxstudio-lv2-extensions "${KXSTUDIO_LV2_EXTENSIONS_VERSION}"
fi # PAWPAW_SKIP_LV2
# ---------------------------------------------------------------------------------------------------------------------
# MOD lv2 extensions
if [ -z "${PAWPAW_SKIP_LV2}" ] || [ "${PAWPAW_SKIP_LV2}" -eq 0 ]; then
git_clone mod-sdk "${MOD_SDK_VERSION}" "${MOD_SDK_URL}"
build_make mod-sdk "${MOD_SDK_VERSION}"
fi # PAWPAW_SKIP_LV2
# ---------------------------------------------------------------------------------------------------------------------
# fluidsynth
if [ -z "${PAWPAW_SKIP_FLUIDSYNTH}" ] || [ "${PAWPAW_SKIP_FLUIDSYNTH}" -eq 0 ]; then
FLUIDSYNTH_EXTRAFLAGS=""
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-floats=ON"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-alsa=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-aufile=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-coreaudio=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-coremidi=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-dbus=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-debug=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-fpe-check=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-framework=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-ipv6=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-jack=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-ladcca=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-ladspa=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-lash=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-midishare=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-oss=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-portaudio=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-profiling=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-pulseaudio=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-readline=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-trap-on-fpe=OFF"
git_clone fluidsynth "${FLUIDSYNTH_VERSION}" "${FLUIDSYNTH_URL}"
build_cmake fluidsynth "${FLUIDSYNTH_VERSION}" "${FLUIDSYNTH_EXTRAFLAGS}"
fi # PAWPAW_SKIP_FLUIDSYNTH
# ---------------------------------------------------------------------------------------------------------------------
# mxml
MXML_EXTRAFLAGS=""
MXML_EXTRAFLAGS+=" --with-archflags="
download mxml "${MXML_VERSION}" "${MXML_URL}"
build_autoconf mxml "${MXML_VERSION}" "${MXML_EXTRAFLAGS}"
# ---------------------------------------------------------------------------------------------------------------------
# carla (backend only)
if [ "${WASM}" -eq 0 ]; then
CARLA_EXTRAFLAGS="CAN_GENERATE_LV2_TTL=false"
CARLA_EXTRAFLAGS+=" EXTERNAL_PLUGINS=false"
CARLA_EXTRAFLAGS+=" HAVE_ALSA=false"
CARLA_EXTRAFLAGS+=" HAVE_JACK=false"
CARLA_EXTRAFLAGS+=" HAVE_PULSEAUDIO=false"
CARLA_EXTRAFLAGS+=" HAVE_DGL=false"
CARLA_EXTRAFLAGS+=" HAVE_HYLIA=false"
CARLA_EXTRAFLAGS+=" HAVE_X11=false"
CARLA_EXTRAFLAGS+=" HAVE_FFMPEG=false"
CARLA_EXTRAFLAGS+=" HAVE_FLUIDSYNTH=false"
CARLA_EXTRAFLAGS+=" HAVE_FRONTEND=false"
CARLA_EXTRAFLAGS+=" HAVE_LIBLO=false"
CARLA_EXTRAFLAGS+=" HAVE_LIBMAGIC=false"
CARLA_EXTRAFLAGS+=" HAVE_PYQT=false"
CARLA_EXTRAFLAGS+=" HAVE_QT=false"
CARLA_EXTRAFLAGS+=" HAVE_QT4=false"
CARLA_EXTRAFLAGS+=" HAVE_QT5=false"
CARLA_EXTRAFLAGS+=" HAVE_SDL=false"
CARLA_EXTRAFLAGS+=" HAVE_SNDFILE=false"
CARLA_EXTRAFLAGS+=" NOOPT=true"
CARLA_EXTRAFLAGS+=" USING_JUCE=false"
CARLA_EXTRAFLAGS+=" USING_JUCE_AUDIO_DEVICES=false"
CARLA_EXTRAFLAGS+=" USING_JUCE_GUI_EXTRA=false"
CARLA_EXTRAFLAGS+=" USING_RTAUDIO=false"
git_clone carla "${CARLA_VERSION}" "${CARLA_URL}"
build_make carla "${CARLA_VERSION}" "${CARLA_EXTRAFLAGS}"
fi # WASM
# ---------------------------------------------------------------------------------------------------------------------
# wine bootstrap (needed for cross-compilation)
if [ "${EXE_WRAPPER}" = "wine" ]; then
wineboot -u
fi
# ---------------------------------------------------------------------------------------------------------------------