-
-
Notifications
You must be signed in to change notification settings - Fork 388
/
install-php-extensions
executable file
·5032 lines (4931 loc) · 188 KB
/
install-php-extensions
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
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/sh
# This script wraps docker-php-ext-install, properly configuring the system.
#
# Copyright (c) Michele Locati, 2018-2023
#
# Source: https://github.com/mlocati/docker-php-extension-installer
#
# License: MIT - see https://github.com/mlocati/docker-php-extension-installer/blob/master/LICENSE
# Let's set a sane environment
set -o errexit
set -o nounset
if test "${IPE_DEBUG:-}" = "1"; then
set -x
fi
if ! which docker-php-ext-configure >/dev/null || ! which docker-php-ext-enable >/dev/null || ! which docker-php-ext-install >/dev/null || ! which docker-php-source >/dev/null; then
printf 'The script %s is meant to be used with official Docker PHP Images - https://hub.docker.com/_/php\n' "$0" >&2
exit 1
fi
IPE_VERSION=master
StandWithUkraine() {
if test -t 1 && ! grep -Eq '^VERSION=.*jessie' /etc/os-release; then
printf '\e[37;44m#StandWith\e[30;43mUkraine\e[0m\n'
else
printf '#StandWithUkraine\n'
fi
}
if test "$IPE_VERSION" = master && test "${CI:-}" != true; then
cat <<EOF
#############################################################################################################
# #
# W A R N I N G ! ! ! #
# #
# You are using an unsupported method to get install-php-extensions! #
# #
# Please update the way you fetch it. Read the instructions at #
# https://github.com/mlocati/docker-php-extension-installer#usage #
# #
# For example, if you get this script by fetching #
# https://raw.githubusercontent.com/mlocati/docker-php-extension-installer/master/install-php-extensions #
# replace it with #
# https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions #
# #
# Sleeping for a while so you get bored of this and act ;) #
# #
#############################################################################################################
EOF
StandWithUkraine
sleep 10 || true
else
printf 'install-php-extensions v.%s\n' "$IPE_VERSION"
StandWithUkraine
fi
# Reset the Internal Field Separator
resetIFS() {
IFS='
'
}
# Set these variables:
# - DISTRO containing the distribution name (eg 'alpine', 'debian')
# - DISTRO_VERSION_NUMBER containing the distribution version (eg '3.14' for Alpine, 11 for Debian)
# - DISTRO_VERSION containing the distribution name and its version(eg '[email protected]', 'debian@11')
# - DISTRO_MAJMIN_VERSION always containing a number representing the distribution version (eg 314 for Alpine, 1100 for Debian)
setDistro() {
if ! test -r /etc/os-release; then
printf 'The file /etc/os-release is not readable\n' >&2
exit 1
fi
DISTRO="$(cat /etc/os-release | grep -E ^ID= | cut -d = -f 2)"
DISTRO_VERSION_NUMBER="$(cat /etc/os-release | grep -E ^VERSION_ID= | cut -d = -f 2 | cut -d '"' -f 2 | cut -d . -f 1,2)"
DISTRO_VERSION="$(printf '%s@%s' $DISTRO $DISTRO_VERSION_NUMBER)"
DISTRO_MAJMIN_VERSION="$(echo "$DISTRO_VERSION_NUMBER" | awk -F. '{print $1*100+$2}')"
}
# Set:
# - PHP_MAJMIN_VERSION: Major-Minor version, format MMmm (example 800 for PHP 8.0.1)
# - PHP_MAJDOTMIN_VERSION: Major-Minor version, format M.m (example 8.0 for PHP 8.0.1)
# - PHP_MAJMINPAT_VERSION: Major-Minor-Patch version, format MMmmpp (example 80001 for PHP 8.0.1) variables containing integers value
# - PHP_MAJDOTMINDOTPAT_VERSION: Major-Minor-Patch version, format M.m.p (example 8.0.1 for PHP 8.0.1)
# - PHP_THREADSAFE: 1 if PHP is thread-safe (TS), 0 if not thread-safe (NTS)
# - PHP_DEBUGBUILD: 1 if PHP is debug build (configured with "--enable-debug"), 0 otherwise
# - PHP_BITS: 32 if PHP is compiled for 32-bit, 64 if 64-bit
# - PHP_EXTDIR: the absolute path where the PHP extensions reside
setPHPVersionVariables() {
PHP_MAJDOTMINDOTPAT_VERSION="$(php-config --version)"
PHP_MAJMIN_VERSION=$(printf '%s' "$PHP_MAJDOTMINDOTPAT_VERSION" | awk -F. '{print $1*100+$2}')
PHP_MAJDOTMIN_VERSION=$(printf '%s' "$PHP_MAJDOTMINDOTPAT_VERSION" | cut -d. -f1-2)
PHP_MAJMINPAT_VERSION=$(printf '%s' "$PHP_MAJDOTMINDOTPAT_VERSION" | awk -F. '{print $1*10000+$2*100+$3}')
PHP_THREADSAFE=$(php -n -r 'echo ZEND_THREAD_SAFE ? 1 : 0;')
PHP_DEBUGBUILD=$(php -n -r 'echo ZEND_DEBUG_BUILD ? 1 : 0;')
PHP_BITS=$(php -n -r 'echo PHP_INT_SIZE * 8;')
PHP_EXTDIR="$(php -d display_errors=stderr -r 'echo realpath(ini_get("extension_dir"));')"
}
# Fix apt-get being very slow on Debian Jessie
# See https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1332440
fixMaxOpenFiles() {
fixMaxOpenFiles_cur=$(ulimit -n 2>/dev/null || echo 0)
if test "$fixMaxOpenFiles_cur" -gt 10000; then
ulimit -n 10000
fi
}
# Get the directory containing the compiled PHP extensions
#
# Output:
# The absolute path of the extensions dir
getPHPExtensionsDir() {
php -i | grep -E '^extension_dir' | head -n1 | tr -s '[:space:]*=>[:space:]*' '|' | cut -d'|' -f2
}
# Normalize the name of a PHP extension
#
# Arguments:
# $1: the name of the module to be normalized
#
# Output:
# The normalized module name
normalizePHPModuleName() {
normalizePHPModuleName_name="$1"
case "$normalizePHPModuleName_name" in
*A* | *B* | *C* | *D* | *E* | *F* | *G* | *H* | *I* | *J* | *K* | *L* | *M* | *N* | *O* | *P* | *Q* | *R* | *S* | *T* | *U* | *V* | *W* | *X* | *Y* | *Z*)
normalizePHPModuleName_name="$(LC_CTYPE=C printf '%s' "$normalizePHPModuleName_name" | tr '[:upper:]' '[:lower:]')"
;;
esac
case "$normalizePHPModuleName_name" in
datadog_trace)
normalizePHPModuleName_name=ddtrace
;;
ioncube | ioncube\ loader)
normalizePHPModuleName_name='ioncube_loader'
;;
pecl_http)
normalizePHPModuleName_name='http'
;;
zend\ opcache)
normalizePHPModuleName_name='opcache'
;;
libsodium)
if test $PHP_MAJMIN_VERSION -ge 700; then
normalizePHPModuleName_name='sodium'
fi
;;
sodium)
if test $PHP_MAJMIN_VERSION -lt 700; then
normalizePHPModuleName_name='libsodium'
fi
;;
*\ *)
printf '### WARNING Unrecognized module name: %s ###\n' "$1" >&2
;;
esac
printf '%s' "$normalizePHPModuleName_name"
}
# Get the PECL name of PHP extension
#
# Arguments:
# $1: the name of the extension
#
# Output:
# The PECL name of the extension
getPeclModuleName() {
normalizePHPModuleName_name="$1"
case "$normalizePHPModuleName_name" in
ddtrace)
normalizePHPModuleName_name=datadog_trace
;;
http)
normalizePHPModuleName_name=pecl_http
;;
sodium)
normalizePHPModuleName_name=libsodium
;;
esac
printf '%s' "$normalizePHPModuleName_name"
}
# Parse a package.xml (or package2.xml) file and extract the module name and version
#
# Arguments:
# $1: the patho to the XML file
#
# Set these variables:
# - EXTRACTPACKAGEVERSIONFROMXML_NAME
# - EXTRACTPACKAGEVERSIONFROMXML_VERSION
#
# Output:
# Nothing
#
# Return:
# 0 (true): if the string is in the list
# 1 (false): if the string is not in the list
extractPackageVersionFromXML() {
if ! test -f "$1"; then
printf 'Unable to find the file\n%s\n' >&2
return 1
fi
extractPackageVersionFromXML_code="$(
cat <<'EOT'
$doc = new DOMDocument();
if (!$doc->load($argv[1])) {
fwrite(STDERR, "Failed to load XML file\n");
exit(1);
}
set_error_handler(
static function($errno, $errstr) {
fwrite(STDERR, trim((string) $errstr) . "\n");
exit(1);
},
-1
);
$xpath = new DOMXpath($doc);
$xpath->registerNamespace('v20', 'http://pear.php.net/dtd/package-2.0');
$xpath->registerNamespace('v21', 'http://pear.php.net/dtd/package-2.1');
if ($xpath->query('/v20:package/v20:dependencies')->length === 1) {
$ns = 'v20:';
} elseif ($xpath->query('/v21:package/v21:dependencies')->length === 1) {
$ns = 'v21:';
} elseif ($xpath->query('/package')->length === 1) {
$ns = '';
} else {
fwrite(STDERR, "Unsupported namespace of the XML of package version details\n");
}
$nodes = $xpath->query("/{$ns}package/{$ns}name");
$name = trim((string) $nodes[0]->nodeValue);
if ($ns === '') {
$nodes = $xpath->query("/{$ns}package/{$ns}version");
} else {
$nodes = $xpath->query("/{$ns}package/{$ns}version/{$ns}release");
}
$version = trim((string) $nodes[0]->nodeValue);
echo "EXTRACTPACKAGEVERSIONFROMXML_NAME='{$name}'\n";
echo "EXTRACTPACKAGEVERSIONFROMXML_VERSION='{$version}'\n";
exit(0);
EOT
)"
extractPackageVersionFromXML_vars="$(php -n -d display_errors=stderr -r "$extractPackageVersionFromXML_code" "$1")"
if test -z "$extractPackageVersionFromXML_vars"; then
return 1
fi
eval "$extractPackageVersionFromXML_vars"
return 0
}
# Parse a module name (and optionally version) as received via command arguments, extracting the version and normalizing it
# Examples:
# xdebug-2.9.8
# xdebug-^2
# xdebug-^2.9
#
# Arguments:
# $1: the name of the module to be normalized
#
# Set these variables:
# - PROCESSED_PHP_MODULE_ARGUMENT
#
# Optionally set these variables:
# - PHP_WANTEDMODULEVERSION_<...> (where <...> is the normalized module name)
# - PHP_MODULESOURCECODEPATH_<...> (where <...> is the normalized module name)
#
# Output:
# Nothing
processPHPModuleArgument() {
processPHPModuleArgument_arg="$1"
case "$processPHPModuleArgument_arg" in
imagick)
if test $PHP_MAJMIN_VERSION -ge 804; then
processPHPModuleArgument_arg=imagick/imagick@65e27f2bc02e7e8f1bf64e26e359e42a1331fca1
elif test $PHP_MAJMIN_VERSION -ge 803; then
processPHPModuleArgument_arg=imagick/imagick@28f27044e435a2b203e32675e942eb8de620ee58
fi
;;
esac
# Convert GitHub short form to long url,
# for example: from
# php-memcached-dev/php-memcached@8f106564e6bb005ca6100b12ccc89000daafa9d8
# to
# https://codeload.github.com/php-memcached-dev/php-memcached/tar.gz/8f106564e6bb005ca6100b12ccc89000daafa9d8
processPHPModuleArgument_arg="$(printf '%s' "$processPHPModuleArgument_arg" | sed -E 's/^([a-zA-Z0-9_.\-]+\/[a-zA-Z0-9_.\-]+)@(.+$)/https:\/\/codeload.github.com\/\1\/tar.gz\/\2/')"
# Let's check if $processPHPModuleArgument_arg is an URL
if printf '%s' "$processPHPModuleArgument_arg" | grep -Eq '^https?://[^ ]+/[^ ]+$'; then
printf 'Downloading source from %s\n' "$processPHPModuleArgument_arg"
processPHPModuleArgument_arg="$(getPackageSource "$processPHPModuleArgument_arg")"
fi
# Let's check if $processPHPModuleArgument_arg the absolute path of an existing directory
if test "$processPHPModuleArgument_arg" != "${processPHPModuleArgument_arg#/}" && test -d "$processPHPModuleArgument_arg"; then
if test -f "$processPHPModuleArgument_arg/package2.xml"; then
printf 'Checking package2.xml of directory %s... ' "$processPHPModuleArgument_arg"
if ! extractPackageVersionFromXML "$processPHPModuleArgument_arg/package2.xml"; then
return 1
fi
elif test -f "$processPHPModuleArgument_arg/package.xml"; then
printf 'Checking package.xml of directory %s... ' "$processPHPModuleArgument_arg"
if ! extractPackageVersionFromXML "$processPHPModuleArgument_arg/package.xml"; then
return 1
fi
else
printf 'Unable to find the package.xml file in the directory\n%s\n' "$processPHPModuleArgument_arg"
return 1
fi
printf 'good (name: %s, version: %s)\n' "$EXTRACTPACKAGEVERSIONFROMXML_NAME" "$EXTRACTPACKAGEVERSIONFROMXML_VERSION"
PROCESSED_PHP_MODULE_ARGUMENT="$(normalizePHPModuleName "$EXTRACTPACKAGEVERSIONFROMXML_NAME")"
processPHPModuleArgument_version="$EXTRACTPACKAGEVERSIONFROMXML_VERSION"
if printf '%s' "$PROCESSED_PHP_MODULE_ARGUMENT" | grep -Eq '^[a-zA-Z0-9_]+$'; then
eval PHP_MODULESOURCECODEPATH_$PROCESSED_PHP_MODULE_ARGUMENT="$processPHPModuleArgument_arg"
else
printf 'Unable to parse the following module name:\n%s\n' "$PROCESSED_PHP_MODULE_ARGUMENT" >&2
exit 1
fi
else
PROCESSED_PHP_MODULE_ARGUMENT="${processPHPModuleArgument_arg%%-*}"
if test -n "$PROCESSED_PHP_MODULE_ARGUMENT" && test "$PROCESSED_PHP_MODULE_ARGUMENT" != "$processPHPModuleArgument_arg"; then
processPHPModuleArgument_version="${processPHPModuleArgument_arg#*-}"
else
processPHPModuleArgument_version=''
fi
PROCESSED_PHP_MODULE_ARGUMENT="$(normalizePHPModuleName "$PROCESSED_PHP_MODULE_ARGUMENT")"
fi
if test -n "$processPHPModuleArgument_version"; then
if printf '%s' "$PROCESSED_PHP_MODULE_ARGUMENT" | grep -Eq '^[a-zA-Z0-9_]+$'; then
eval PHP_WANTEDMODULEVERSION_$PROCESSED_PHP_MODULE_ARGUMENT="$processPHPModuleArgument_version"
elif printf '%s' "$PROCESSED_PHP_MODULE_ARGUMENT" | grep -Eq '^@[a-zA-Z0-9_]+$'; then
eval PHP_WANTEDMODULEVERSION__${PROCESSED_PHP_MODULE_ARGUMENT#@}="$processPHPModuleArgument_version"
else
printf 'Unable to parse the following module name:\n%s\n' "$PROCESSED_PHP_MODULE_ARGUMENT" >&2
fi
fi
}
# Get the wanted PHP module version, as specified in the command line arguments.
#
# Arguments:
# $1: the name of the module to be normalized
#
# Output:
# The wanted version (if any)
getWantedPHPModuleVersion() {
if printf '%s' "$1" | grep -Eq '^[a-zA-Z0-9_]+$'; then
eval printf '%s' "\${PHP_WANTEDMODULEVERSION_$1:-}"
elif printf '%s' "$1" | grep -Eq '^@[a-zA-Z0-9_]+$'; then
eval printf '%s' "\${PHP_WANTEDMODULEVERSION__${1#@}:-}"
fi
}
# Get source code path of a PHP module version, as specified in the command line arguments.
#
# Arguments:
# $1: the name of the module to be normalized
#
# Output:
# The wanted version (if any)
getModuleSourceCodePath() {
if printf '%s' "$1" | grep -Eq '^[a-zA-Z0-9_]+$'; then
eval printf '%s' "\${PHP_MODULESOURCECODEPATH_$1:-}"
fi
}
# Get the actual PHP module version, resolving it if it starts with '^'
#
# Arguments:
# $1: the name of the module
# $2: the wanted version (optional, if omitted we'll use getWantedPHPModuleVersion)
#
# Output:
# The version to be used
resolvePHPModuleVersion() {
resolvePHPModuleVersion_module="$1"
if test $# -lt 2; then
resolvePHPModuleVersion_raw="$(getWantedPHPModuleVersion "$installRemoteModule_module")"
else
resolvePHPModuleVersion_raw="$2"
fi
resolvePHPModuleVersion_afterCaret="${resolvePHPModuleVersion_raw#^}"
if test "$resolvePHPModuleVersion_raw" = "$resolvePHPModuleVersion_afterCaret"; then
printf '%s' "$resolvePHPModuleVersion_raw"
return
fi
case "$resolvePHPModuleVersion_afterCaret" in
?*@snapshot | ?*@devel | ?*@alpha | ?*@beta | ?*@stable)
resolvePHPModuleVersion_wantedStability="${resolvePHPModuleVersion_afterCaret##*@}"
resolvePHPModuleVersion_wantedVersion="${resolvePHPModuleVersion_afterCaret%@*}"
;;
*)
resolvePHPModuleVersion_wantedStability=''
resolvePHPModuleVersion_wantedVersion="$resolvePHPModuleVersion_afterCaret"
;;
esac
resolvePHPModuleVersion_peclModule="$(getPeclModuleName "$resolvePHPModuleVersion_module")"
resolvePHPModuleVersion_xml="$(curl -sSLf "http://pecl.php.net/rest/r/$resolvePHPModuleVersion_peclModule/allreleases.xml")"
# remove line endings, collapse spaces
resolvePHPModuleVersion_versions="$(printf '%s' "$resolvePHPModuleVersion_xml" | tr -s ' \t\r\n' ' ')"
# one line per release (eg <r><v>1.2.3</v><s>stable</s></r>)
resolvePHPModuleVersion_versions="$(printf '%s' "$resolvePHPModuleVersion_versions" | sed -r 's#<r#\n<r#g')"
if test -n "$resolvePHPModuleVersion_wantedStability"; then
# keep the lines with the wanted stability
resolvePHPModuleVersion_versions="$(printf '%s' "$resolvePHPModuleVersion_versions" | grep "<s>$resolvePHPModuleVersion_wantedStability</s>")"
fi
# remove everything's up to '<v>' (included)
resolvePHPModuleVersion_versions="$(printf '%s' "$resolvePHPModuleVersion_versions" | sed 's#^.*<v>##')"
# keep just the versions
resolvePHPModuleVersion_versions="$(printf '%s' "$resolvePHPModuleVersion_versions" | cut -d'<' -f1)"
resetIFS
for resolvePHPModuleVersion_version in $resolvePHPModuleVersion_versions; do
resolvePHPModuleVersion_suffix="${resolvePHPModuleVersion_version#$resolvePHPModuleVersion_wantedVersion}"
if test "$resolvePHPModuleVersion_version" != "${resolvePHPModuleVersion_version#$resolvePHPModuleVersion_wantedVersion.}"; then
# Example: looking for 1.0, found 1.0.1
printf '%s' "$resolvePHPModuleVersion_version"
return
fi
done
for resolvePHPModuleVersion_version in $resolvePHPModuleVersion_versions; do
resolvePHPModuleVersion_suffix="${resolvePHPModuleVersion_version#$resolvePHPModuleVersion_wantedVersion}"
if test "$resolvePHPModuleVersion_version" = "$resolvePHPModuleVersion_suffix"; then
continue
fi
if test -z "$resolvePHPModuleVersion_suffix"; then
# Example: looking for 1.0, found exactly it
printf '%s' "$resolvePHPModuleVersion_version"
return
fi
case "$resolvePHPModuleVersion_suffix" in
[0-9])
# Example: looking for 1.1, but this is 1.10
;;
*)
# Example: looking for 1.1, this is 1.1rc1
printf '%s' "$resolvePHPModuleVersion_version"
return
;;
esac
done
printf 'Unable to find a version of "%s" compatible with "%s"\nAvailable versions are:\n%s\n' "$resolvePHPModuleVersion_module" "$resolvePHPModuleVersion_raw" "$resolvePHPModuleVersion_versions" >&2
exit 1
}
# Get the actual version of a PECL pmodule, resolving 'latest', 'stable', 'beta', 'alpha', 'devel'.
#
# Arguments:
# $1: the module name as known on the PECL archive
# $2: the version to be resolved
# Output:
# $2 itself if $1 is not 'latest', 'stable', 'beta', 'alpha', or 'devel', the actual version otherwise
resolvePeclStabilityVersion() {
case "$2" in
latest | stable | beta | alpha | devel) ;;
*)
printf '%s' "$2"
return
;;
esac
resolvePeclStabilityVersion_peclModule="$(getPeclModuleName "$1")"
peclStabilityFlagToVersion_url="http://pecl.php.net/rest/r/$resolvePeclStabilityVersion_peclModule/$2.txt"
if ! peclStabilityFlagToVersion_result="$(curl -sSLf "$peclStabilityFlagToVersion_url")"; then
peclStabilityFlagToVersion_result=''
fi
if test -z "$peclStabilityFlagToVersion_result"; then
printf 'Failed to resolve the PECL package version "%s" of %s from %s\n' "$2" "$1" "$peclStabilityFlagToVersion_url" >&2
exit 1
fi
printf '%s' "$peclStabilityFlagToVersion_result"
}
# Set these variables:
# - PHP_PREINSTALLED_MODULES the normalized list of PHP modules installed before running this script
setPHPPreinstalledModules() {
PHP_PREINSTALLED_MODULES=''
IFS='
'
for getPHPInstalledModules_module in $(php -m); do
getPHPInstalledModules_moduleNormalized=''
case "$getPHPInstalledModules_module" in
\[PHP\ Modules\]) ;;
\[Zend\ Modules\])
break
;;
*)
getPHPInstalledModules_moduleNormalized="$(normalizePHPModuleName "$getPHPInstalledModules_module")"
if ! stringInList "$getPHPInstalledModules_moduleNormalized" "$PHP_PREINSTALLED_MODULES"; then
PHP_PREINSTALLED_MODULES="$PHP_PREINSTALLED_MODULES $getPHPInstalledModules_moduleNormalized"
fi
;;
esac
done
if command -v composer >/dev/null; then
PHP_PREINSTALLED_MODULES="$PHP_PREINSTALLED_MODULES @composer"
fi
resetIFS
PHP_PREINSTALLED_MODULES="${PHP_PREINSTALLED_MODULES# }"
}
# Get the handles of the modules to be installed
#
# Arguments:
# $@: all module handles
#
# Set:
# PHP_MODULES_TO_INSTALL
#
# Output:
# Nothing
processCommandArguments() {
processCommandArguments_endArgs=0
PHP_MODULES_TO_INSTALL=''
# Support deprecated flag IPE_FIX_CACERTS
case "${IPE_FIX_CACERTS:-}" in
1 | y* | Y*)
PHP_MODULES_TO_INSTALL="$PHP_MODULES_TO_INSTALL @fix_letsencrypt"
;;
esac
while :; do
if test $# -lt 1; then
break
fi
processCommandArguments_skip=0
if test $processCommandArguments_endArgs -eq 0; then
case "$1" in
--cleanup)
printf '### WARNING the %s option is deprecated (we always cleanup everything) ###\n' "$1" >&2
processCommandArguments_skip=1
;;
--)
processCommandArguments_skip=1
processCommandArguments_endArgs=1
;;
-*)
printf 'Unrecognized option: %s\n' "$1" >&2
exit 1
;;
esac
fi
if test $processCommandArguments_skip -eq 0; then
processPHPModuleArgument "$1"
processCommandArguments_name="$PROCESSED_PHP_MODULE_ARGUMENT"
if stringInList "$processCommandArguments_name" "$PHP_MODULES_TO_INSTALL"; then
printf '### WARNING Duplicated module name specified: %s ###\n' "$processCommandArguments_name" >&2
elif stringInList "$processCommandArguments_name" "$PHP_PREINSTALLED_MODULES"; then
printf '### WARNING Module already installed: %s ###\n' "$processCommandArguments_name" >&2
else
PHP_MODULES_TO_INSTALL="$PHP_MODULES_TO_INSTALL $processCommandArguments_name"
fi
fi
shift
done
PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL# }"
}
# Add a module that's required by another module
#
# Arguments:
# $1: module that requires another module
# $2: the required module
#
# Update:
# PHP_MODULES_TO_INSTALL
#
# Output:
# Nothing
checkRequiredModule() {
if ! stringInList "$1" "$PHP_MODULES_TO_INSTALL"; then
return
fi
if stringInList "$2" "$PHP_PREINSTALLED_MODULES"; then
return
fi
PHP_MODULES_TO_INSTALL="$(removeStringFromList "$1" "$PHP_MODULES_TO_INSTALL")"
if ! stringInList "$2" "$PHP_MODULES_TO_INSTALL"; then
PHP_MODULES_TO_INSTALL="$PHP_MODULES_TO_INSTALL $2"
PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL# }"
fi
PHP_MODULES_TO_INSTALL="$PHP_MODULES_TO_INSTALL $1"
}
# Sort the modules to be installed, in order to fix dependencies
#
# Update:
# PHP_MODULES_TO_INSTALL
#
# Output:
# Nothing
sortModulesToInstall() {
# apcu_bc requires apcu
checkRequiredModule 'apcu_bc' 'apcu'
# http requires propro (for PHP < 8) and raphf
if test $PHP_MAJMIN_VERSION -le 704; then
checkRequiredModule 'http' 'propro'
fi
checkRequiredModule 'http' 'raphf'
# event requires sockets (for PHP <= 5.6)
if test $PHP_MAJMIN_VERSION -le 506; then
checkRequiredModule event sockets
fi
# relay requires msgpack
checkRequiredModule relay msgpack
# relay requires igbinary
checkRequiredModule relay igbinary
# pq requires raphf
checkRequiredModule pq raphf
# phalcon up to v5.0.0beta3 requires psr
if test $PHP_MAJMINPAT_VERSION -lt 70401; then
checkRequiredModule phalcon psr
fi
# Some module installation may use sockets if available: move it before other modules
if stringInList 'sockets' "$PHP_MODULES_TO_INSTALL"; then
PHP_MODULES_TO_INSTALL="$(removeStringFromList 'sockets' "$PHP_MODULES_TO_INSTALL")"
PHP_MODULES_TO_INSTALL="sockets $PHP_MODULES_TO_INSTALL"
PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL% }"
fi
# Some module installation may use igbinary if available: move it before other modules
if stringInList 'igbinary' "$PHP_MODULES_TO_INSTALL"; then
PHP_MODULES_TO_INSTALL="$(removeStringFromList 'igbinary' "$PHP_MODULES_TO_INSTALL")"
PHP_MODULES_TO_INSTALL="igbinary $PHP_MODULES_TO_INSTALL"
PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL% }"
fi
# Some module installation may use msgpack if available: move it before other modules
if stringInList 'msgpack' "$PHP_MODULES_TO_INSTALL"; then
PHP_MODULES_TO_INSTALL="$(removeStringFromList 'msgpack' "$PHP_MODULES_TO_INSTALL")"
PHP_MODULES_TO_INSTALL="msgpack $PHP_MODULES_TO_INSTALL"
PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL% }"
fi
# Some module installation may use socket if available: move it before other modules
if stringInList 'socket' "$PHP_MODULES_TO_INSTALL"; then
PHP_MODULES_TO_INSTALL="$(removeStringFromList 'socket' "$PHP_MODULES_TO_INSTALL")"
PHP_MODULES_TO_INSTALL="socket $PHP_MODULES_TO_INSTALL"
PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL% }"
fi
# Some module installation may use apcu if available: move it before other modules
if stringInList 'apcu' "$PHP_MODULES_TO_INSTALL"; then
PHP_MODULES_TO_INSTALL="$(removeStringFromList 'apcu' "$PHP_MODULES_TO_INSTALL")"
PHP_MODULES_TO_INSTALL="apcu $PHP_MODULES_TO_INSTALL"
PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL% }"
fi
# Some module installation may use raphf if available: move it before other modules
if stringInList 'raphf' "$PHP_MODULES_TO_INSTALL"; then
PHP_MODULES_TO_INSTALL="$(removeStringFromList 'raphf' "$PHP_MODULES_TO_INSTALL")"
PHP_MODULES_TO_INSTALL="raphf $PHP_MODULES_TO_INSTALL"
PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL% }"
fi
# In any case, first of all, we need to install composer
if stringInList '@composer' "$PHP_MODULES_TO_INSTALL"; then
PHP_MODULES_TO_INSTALL="$(removeStringFromList '@composer' "$PHP_MODULES_TO_INSTALL")"
PHP_MODULES_TO_INSTALL="@composer $PHP_MODULES_TO_INSTALL"
PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL% }"
fi
}
# Expand the IPE_ASPELL_LANGUAGES environment variable into apk/apt package names
expandASpellDictionaries() {
expandASpellDictionaries_languages="${IPE_ASPELL_LANGUAGES:-en}"
expandASpellDictionaries_result=''
resetIFS
for expandASpellDictionaries_language in $expandASpellDictionaries_languages; do
expandASpellDictionaries_result="$expandASpellDictionaries_result aspell-$expandASpellDictionaries_language"
done
printf '%s' "${expandASpellDictionaries_result# }"
}
# Get the required APT/APK packages for a specific PHP version and for the list of module handles
#
# Arguments:
# $@: the PHP module handles
#
# Set:
# PACKAGES_PERSISTENT_NEW the list of packages required at runtume that must be installed
# PACKAGES_PERSISTENT_PRE the list of packages required at runtume that are already installed
# PACKAGES_VOLATILE the list of packages required at compile time that must be installed
# PACKAGES_PREVIOUS the list of packages (with their version) that are installed right now (calculated only on Debian and only if PACKAGES_PERSISTENT_NEW or PACKAGES_VOLATILE are not empty)
# COMPILE_LIBS
buildRequiredPackageLists() {
buildRequiredPackageLists_persistent=''
buildRequiredPackageLists_volatile=''
COMPILE_LIBS=''
case "$DISTRO" in
alpine)
apk update
;;
debian)
invokeAptGetUpdate
;;
esac
case "$DISTRO_VERSION" in
alpine@*)
if test $# -gt 1 || test "${1:-}" != '@composer'; then
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $PHPIZE_DEPS"
fi
if test -z "$(apk info 2>/dev/null | grep -E ^libssl)"; then
buildRequiredPackageLists_libssl="$(apk search | grep -E '^libssl[0-9]' | head -1 | cut -d- -f1)"
elif test -z "$(apk info 2>/dev/null | grep -E '^libressl.*-libtls')" && test -z "$(apk info 2>/dev/null | grep -E '^libressl.*-libssl')" && test -z "$(apk info 2>/dev/null | grep -E '^libretls-')"; then
buildRequiredPackageLists_libssl=$(apk search -q libressl*-libtls)
else
buildRequiredPackageLists_libssl=''
fi
if test $DISTRO_MAJMIN_VERSION -le 313; then
buildRequiredPackageLists_libssldev='libressl-dev'
else
buildRequiredPackageLists_libssldev='libretls-dev'
fi
buildRequiredPackageLists_icuPersistent=''
if test $DISTRO_MAJMIN_VERSION -ge 316; then
case "${IPE_ICU_EN_ONLY:-}" in
1 | y* | Y*) ;;
*)
buildRequiredPackageLists_icuPersistent='icu-data-full'
;;
esac
fi
;;
debian@9)
buildRequiredPackageLists_libssldev='libssl1.0-dev'
;;
debian@*)
buildRequiredPackageLists_libssldev='^libssl([0-9]+(\.[0-9]+)*)?-dev$'
;;
esac
if test $USE_PICKLE -gt 1; then
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile git"
fi
while :; do
if test $# -lt 1; then
break
fi
case "$1@$DISTRO" in
@composer@debian)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent unzip"
;;
amqp@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent rabbitmq-c"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile rabbitmq-c-dev"
;;
amqp@debian)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^librabbitmq[0-9]*$"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile librabbitmq-dev libssh-dev"
;;
bz2@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libbz2"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile bzip2-dev"
;;
bz2@debian)
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libbz2-dev"
;;
cassandra@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent cassandra-cpp-driver gmp"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cassandra-cpp-driver-dev gmp-dev"
;;
cmark@alpine)
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake"
;;
cmark@debian)
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake"
;;
ddtrace@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libgcc"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile curl-dev"
;;
ddtrace@debian)
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libcurl4-openssl-dev"
;;
dba@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent db"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile db-dev"
;;
dba@debian)
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile ^libdb5\.3-dev$"
if test $PHP_MAJMIN_VERSION -le 505; then
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile patch"
fi
;;
decimal@debian)
if test $DISTRO_MAJMIN_VERSION -lt 1200; then
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libmpdec[0-9]*$"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmpdec-dev"
fi
;;
ecma_intl@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent icu-libs $buildRequiredPackageLists_icuPersistent"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev libidn-dev"
;;
ecma_intl@debian)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libicu[0-9]+$"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libicu-dev"
;;
enchant@alpine)
if test $DISTRO_MAJMIN_VERSION -ge 312; then
if test $PHP_MAJMIN_VERSION -ge 800; then
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent enchant2"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile enchant2-dev"
else
# The system provides libenchant2, supported since PHP 8.0: we need to build libenchant1 on our own
if ! isLibenchant1Installed; then
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent glib aspell-libs libhunspell"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile glib-dev aspell-dev hunspell-dev"
COMPILE_LIBS="$COMPILE_LIBS libenchant1"
fi
fi
else
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent enchant"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile enchant-dev"
fi
;;
enchant@debian)
if test $DISTRO_VERSION_NUMBER -ge 11; then
if test $PHP_MAJMIN_VERSION -ge 800; then
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libenchant-2-2"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libenchant-2-dev"
else
if ! isLibenchant1Installed; then
# The system provides libenchant2, supported since PHP 8.0: we need to build libenchant1 on our own
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent aspell-en libhunspell-1.7-0"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libglib2.0-dev libaspell-dev libhunspell-dev"
COMPILE_LIBS="$COMPILE_LIBS libenchant1"
fi
fi
else
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libenchant1c2a"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libenchant-dev"
fi
;;
event@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libevent $buildRequiredPackageLists_libssl"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libevent-dev $buildRequiredPackageLists_libssldev"
;;
event@debian)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libevent[0-9\.\-]*$ ^libevent-openssl[0-9\.\-]*$ ^libevent-extra[0-9\.\-]*$ ^libevent-pthreads[0-9\.\-]*$"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libevent-dev $buildRequiredPackageLists_libssldev"
;;
ffi@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libffi"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libffi-dev"
;;
ffi@debian)
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libffi-dev"
;;
ftp@alpine)
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $buildRequiredPackageLists_libssldev"
;;
ftp@debian)
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $buildRequiredPackageLists_libssldev"
;;
gd@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent freetype libjpeg-turbo libpng libxpm"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile freetype-dev libjpeg-turbo-dev libpng-dev libxpm-dev"
if test $PHP_MAJMIN_VERSION -le 506; then
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libvpx"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libvpx-dev"
else
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libwebp"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libwebp-dev"
if test $PHP_MAJMIN_VERSION -ge 801; then
if test $DISTRO_MAJMIN_VERSION -ge 315; then
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libavif aom-libs libdav1d"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libavif-dev aom-dev dav1d-dev"
elif isLibaomInstalled && isLibdav1dInstalled && isLibyuvInstalled && isLibavifInstalled; then
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++"
else
case "${IPE_GD_WITHOUTAVIF:-}" in
1 | y* | Y*) ;;
*)
if ! isLibaomInstalled; then
COMPILE_LIBS="$COMPILE_LIBS libaom"
fi
if ! isLibdav1dInstalled; then
COMPILE_LIBS="$COMPILE_LIBS libdav1d"
fi
if ! isLibyuvInstalled; then
COMPILE_LIBS="$COMPILE_LIBS libyuv"
fi
if ! isLibavifInstalled; then
COMPILE_LIBS="$COMPILE_LIBS libavif"
fi
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake nasm meson"
;;
esac
fi
fi
fi
;;
gd@debian)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libfreetype6 libjpeg62-turbo ^libpng[0-9]+-[0-9]+$ libxpm4"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libfreetype6-dev libjpeg62-turbo-dev libpng-dev libxpm-dev"
if test $PHP_MAJMIN_VERSION -le 506; then
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libvpx[0-9]+$"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libvpx-dev"
else
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libwebp[0-9]+$"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libwebp-dev"
if test $PHP_MAJMIN_VERSION -ge 801; then
if test $DISTRO_VERSION_NUMBER -ge 12; then
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libavif[0-9]+$ ^libaom[0-9]+$ ^libdav1d[0-9]+$"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libavif-dev libaom-dev libdav1d-dev"
elif ! isLibaomInstalled || ! isLibdav1dInstalled || ! isLibyuvInstalled || ! isLibavifInstalled; then
case "${IPE_GD_WITHOUTAVIF:-}" in
1 | y* | Y*) ;;
*)
if ! isLibaomInstalled; then
COMPILE_LIBS="$COMPILE_LIBS libaom"
fi
if ! isLibdav1dInstalled; then
COMPILE_LIBS="$COMPILE_LIBS libdav1d"
fi
if ! isLibyuvInstalled; then
COMPILE_LIBS="$COMPILE_LIBS libyuv"
fi
if ! isLibavifInstalled; then
COMPILE_LIBS="$COMPILE_LIBS libavif"
fi
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake nasm meson"
;;
esac
fi
fi
fi
;;
gearman@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++ libuuid"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile boost-dev gperf libmemcached-dev libevent-dev util-linux-dev"
;;
gearman@debian)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libgearman[0-9]*$"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libgearman-dev"
;;
geoip@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent geoip"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile geoip-dev"
;;
geoip@debian)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libgeoip1[0-9]*$"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libgeoip-dev"
;;
geos@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent geos-dev"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile geos"
;;
geos@debian)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libgeos-c1(v[0-9]*)?$"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libgeos-dev"
;;
gettext@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libintl"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile gettext-dev"
;;
gmagick@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent graphicsmagick libgomp"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile graphicsmagick-dev libtool"
;;
gmagick@debian)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libgraphicsmagick(-q16-)?[0-9]*$"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libgraphicsmagick1-dev"
;;
gmp@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent gmp"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile gmp-dev"
;;
gmp@debian)
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libgmp-dev"
;;
gnupg@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent gpgme"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile gpgme-dev"
;;
gnupg@debian)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libgpgme[0-9]*$"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile ^libgpgme[0-9]*-dev$"
;;
grpc@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib-dev linux-headers"
;;
grpc@debian)
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev"
;;
http@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libevent"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib-dev curl-dev libevent-dev"
if test $PHP_MAJMIN_VERSION -le 506; then
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libidn"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libidn-dev"
else
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent icu-libs $buildRequiredPackageLists_icuPersistent libidn"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev libidn-dev"
fi
;;
http@debian)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libcurl3-gnutls ^libevent[0-9\.\-]*$"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev libgnutls28-dev libcurl4-gnutls-dev libevent-dev"
if test $PHP_MAJMIN_VERSION -le 506; then
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile ^libidn1[0-9+]-dev$"
else
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libicu[0-9]+$ ^libidn2-[0-9+]$"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libicu-dev ^libidn2-[0-9+]-dev$ ^libgcrypt[0-9]+-dev$"