Skip to content

Commit ea9e54d

Browse files
authored
Update php56 install-php-extensions
1 parent aebc4a9 commit ea9e54d

File tree

1 file changed

+153
-34
lines changed

1 file changed

+153
-34
lines changed

services/php56/extensions/install-php-extensions

+153-34
Original file line numberDiff line numberDiff line change
@@ -662,9 +662,11 @@ expandASpellDictionaries() {
662662
# PACKAGES_PERSISTENT_PRE the list of packages required at runtume that are already installed
663663
# PACKAGES_VOLATILE the list of packages required at compile time that must be installed
664664
# 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)
665+
# COMPILE_LIBS
665666
buildRequiredPackageLists() {
666667
buildRequiredPackageLists_persistent=''
667668
buildRequiredPackageLists_volatile=''
669+
COMPILE_LIBS=''
668670
case "$DISTRO" in
669671
alpine)
670672
apk update
@@ -844,6 +846,18 @@ buildRequiredPackageLists() {
844846
case "${IPE_GD_WITHOUTAVIF:-}" in
845847
1 | y* | Y*) ;;
846848
*)
849+
if ! isLibaomInstalled; then
850+
COMPILE_LIBS="$COMPILE_LIBS libaom"
851+
fi
852+
if ! isLibdav1dInstalled; then
853+
COMPILE_LIBS="$COMPILE_LIBS libdav1d"
854+
fi
855+
if ! isLibyuvInstalled; then
856+
COMPILE_LIBS="$COMPILE_LIBS libyuv"
857+
fi
858+
if ! isLibavifInstalled; then
859+
COMPILE_LIBS="$COMPILE_LIBS libavif"
860+
fi
847861
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++"
848862
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake nasm meson"
849863
;;
@@ -869,6 +883,18 @@ buildRequiredPackageLists() {
869883
case "${IPE_GD_WITHOUTAVIF:-}" in
870884
1 | y* | Y*) ;;
871885
*)
886+
if ! isLibaomInstalled; then
887+
COMPILE_LIBS="$COMPILE_LIBS libaom"
888+
fi
889+
if ! isLibdav1dInstalled; then
890+
COMPILE_LIBS="$COMPILE_LIBS libdav1d"
891+
fi
892+
if ! isLibyuvInstalled; then
893+
COMPILE_LIBS="$COMPILE_LIBS libyuv"
894+
fi
895+
if ! isLibavifInstalled; then
896+
COMPILE_LIBS="$COMPILE_LIBS libavif"
897+
fi
872898
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake nasm meson"
873899
;;
874900
esac
@@ -984,6 +1010,9 @@ buildRequiredPackageLists() {
9841010
;;
9851011
interbase@alpine)
9861012
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev ncurses-dev"
1013+
if ! isFirebirdInstalled; then
1014+
COMPILE_LIBS="$COMPILE_LIBS firebird"
1015+
fi
9871016
;;
9881017
interbase@debian)
9891018
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libfbclient2"
@@ -1159,6 +1188,20 @@ buildRequiredPackageLists() {
11591188
;;
11601189
pdo_firebird@alpine)
11611190
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev ncurses-dev"
1191+
if ! isFirebirdInstalled; then
1192+
COMPILE_LIBS="$COMPILE_LIBS firebird"
1193+
if test $PHP_MAJMIN_VERSION -ge 804; then
1194+
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++"
1195+
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib-dev"
1196+
if ! isLibTommathInstalled; then
1197+
COMPILE_LIBS="$COMPILE_LIBS libtommath"
1198+
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake"
1199+
fi
1200+
if ! isLibTomcryptInstalled; then
1201+
COMPILE_LIBS="$COMPILE_LIBS libtomcrypt"
1202+
fi
1203+
fi
1204+
fi
11621205
;;
11631206
pdo_firebird@debian)
11641207
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libfbclient2"
@@ -1175,6 +1218,20 @@ buildRequiredPackageLists() {
11751218
php_trie@alpine)
11761219
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++"
11771220
;;
1221+
phpy@alpine)
1222+
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent python3"
1223+
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile python3-dev"
1224+
;;
1225+
phpy@debian)
1226+
if test $DISTRO_VERSION_NUMBER -ge 12; then
1227+
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.11"
1228+
elif test $DISTRO_VERSION_NUMBER -ge 11; then
1229+
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.9"
1230+
else
1231+
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.7"
1232+
fi
1233+
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile python3-dev"
1234+
;;
11781235
pkcs11@alpine)
11791236
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent softhsm"
11801237
;;
@@ -2300,6 +2357,72 @@ installLibThai() {
23002357
cd - >/dev/null
23012358
}
23022359

2360+
isLibTommathInstalled() {
2361+
if test -f /usr/local/lib/libtommath.a && test -f /usr/local/include/tommath.h; then
2362+
return 0
2363+
fi
2364+
return 1
2365+
}
2366+
2367+
installLibTommath() {
2368+
printf 'Installing libtommath\n'
2369+
installLibTommath_src="$(getPackageSource https://github.com/libtom/libtommath/releases/download/v1.3.0/ltm-1.3.0.tar.xz)"
2370+
mkdir -p "$installLibTommath_src/build"
2371+
cd -- "$installLibTommath_src/build"
2372+
CFLAGS='-fPIC' cmake -DCMAKE_BUILD_TYPE=Release ..
2373+
make -j$(getProcessorCount)
2374+
make install
2375+
cd - >/dev/null
2376+
}
2377+
2378+
isLibTomcryptInstalled() {
2379+
if test -f /usr/local/lib/libtomcrypt.a && test -f /usr/local/include/tomcrypt.h; then
2380+
return 0
2381+
fi
2382+
return 1
2383+
}
2384+
2385+
installLibTomcrypt() {
2386+
printf 'Installing libtomcrypt\n'
2387+
installLibTomcrypt_src="$(getPackageSource https://github.com/libtom/libtomcrypt/releases/download/v1.18.2/crypt-1.18.2.tar.xz)"
2388+
cd -- "$installLibTomcrypt_src"
2389+
CFLAGS='-fPIC' make -j$(getProcessorCount)
2390+
make install
2391+
}
2392+
2393+
isFirebirdInstalled() {
2394+
if test -f /usr/lib/libfbclient.so && test -f /usr/include/ibase.h; then
2395+
return 0
2396+
fi
2397+
if test -d /tmp/src/firebird; then
2398+
return 0
2399+
fi
2400+
return 1
2401+
}
2402+
2403+
installFirebird() {
2404+
printf 'Installing firebird\n'
2405+
if test $PHP_MAJMIN_VERSION -ge 804; then
2406+
installFirebird_src="$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/v5.0.1/Firebird-5.0.1.1469-0-source.tar.xz)"
2407+
cd -- "$installFirebird_src"
2408+
./configure --enable-client-only
2409+
make -j$(getProcessorCount)
2410+
cp -Rd gen/Release/firebird/include/* /usr/include
2411+
cp -Rd gen/Release/firebird/lib/* /usr/lib
2412+
cd - >/dev/null
2413+
else
2414+
mv "$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/R2_5_9/Firebird-2.5.9.27139-0.tar.bz2)" /tmp/src/firebird
2415+
cd /tmp/src/firebird
2416+
# Patch rwlock.h (this has been fixed in later release of firebird 3.x)
2417+
sed -i '194s/.*/#if 0/' src/common/classes/rwlock.h
2418+
./configure --with-system-icu
2419+
# -j option can't be used: make targets must be compiled sequentially
2420+
make -s btyacc_binary gpre_boot libfbstatic libfbclient
2421+
cp gen/firebird/lib/libfbclient.so /usr/lib/
2422+
ln -s /usr/lib/libfbclient.so /usr/lib/libfbclient.so.2
2423+
cd - >/dev/null
2424+
fi
2425+
}
23032426
# Install Composer
23042427
installComposer() {
23052428
installComposer_version="$(getWantedPHPModuleVersion @composer)"
@@ -2472,6 +2595,31 @@ You may need to:
24722595
EOT
24732596
}
24742597

2598+
# Compile the libraries specified in the COMPILE_LIBS variable
2599+
compileLibs() {
2600+
if stringInList libaom "$COMPILE_LIBS"; then
2601+
installLibaom
2602+
fi
2603+
if stringInList libdav1d "$COMPILE_LIBS"; then
2604+
installLibdav1d
2605+
fi
2606+
if stringInList libyuv "$COMPILE_LIBS"; then
2607+
installLibyuv
2608+
fi
2609+
if stringInList libavif "$COMPILE_LIBS"; then
2610+
installLibavif
2611+
fi
2612+
if stringInList libtommath "$COMPILE_LIBS"; then
2613+
installLibTommath
2614+
fi
2615+
if stringInList libtomcrypt "$COMPILE_LIBS"; then
2616+
installLibTomcrypt
2617+
fi
2618+
if stringInList firebird "$COMPILE_LIBS"; then
2619+
installFirebird
2620+
fi
2621+
}
2622+
24752623
# Install a bundled PHP module given its handle
24762624
#
24772625
# Arguments:
@@ -2568,23 +2716,6 @@ EOF
25682716
;;
25692717
esac
25702718
if test $installBundledModule_tmp -eq 0; then
2571-
case "${IPE_GD_WITHOUTAVIF:-}" in
2572-
1 | y* | Y*) ;;
2573-
*)
2574-
if ! isLibaomInstalled; then
2575-
installLibaom
2576-
fi
2577-
if ! isLibdav1dInstalled; then
2578-
installLibdav1d
2579-
fi
2580-
if ! isLibyuvInstalled; then
2581-
installLibyuv
2582-
fi
2583-
if ! isLibavifInstalled; then
2584-
installLibavif
2585-
fi
2586-
;;
2587-
esac
25882719
if isLibaomInstalled && isLibdav1dInstalled && isLibyuvInstalled && isLibavifInstalled; then
25892720
installBundledModule_tmp=1
25902721
fi
@@ -2620,19 +2751,9 @@ EOF
26202751
interbase | pdo_firebird)
26212752
case "$DISTRO" in
26222753
alpine)
2623-
if ! test -d /tmp/src/firebird; then
2624-
mv "$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/R2_5_9/Firebird-2.5.9.27139-0.tar.bz2)" /tmp/src/firebird
2625-
cd /tmp/src/firebird
2626-
# Patch rwlock.h (this has been fixed in later release of firebird 3.x)
2627-
sed -i '194s/.*/#if 0/' src/common/classes/rwlock.h
2628-
./configure --with-system-icu
2629-
# -j option can't be used: make targets must be compiled sequentially
2630-
make -s btyacc_binary gpre_boot libfbstatic libfbclient
2631-
cp gen/firebird/lib/libfbclient.so /usr/lib/
2632-
ln -s /usr/lib/libfbclient.so /usr/lib/libfbclient.so.2
2633-
cd - >/dev/null
2754+
if test $PHP_MAJMIN_VERSION -lt 804; then
2755+
CFLAGS='-I/tmp/src/firebird/src/jrd -I/tmp/src/firebird/src/include -I/tmp/src/firebird/src/include/gen' docker-php-ext-configure $1
26342756
fi
2635-
CFLAGS='-I/tmp/src/firebird/src/jrd -I/tmp/src/firebird/src/include -I/tmp/src/firebird/src/include/gen' docker-php-ext-configure $1
26362757
;;
26372758
esac
26382759
;;
@@ -2869,7 +2990,7 @@ installRemoteModule() {
28692990
if test $(compareVersions "$(cmake --version | head -n1 | sed -E 's/^.* //')" '3.7') -lt 0; then
28702991
installRemoteModule_tmp=0.29.0
28712992
else
2872-
installRemoteModule_tmp=0.31.0
2993+
installRemoteModule_tmp=0.31.1
28732994
fi
28742995
cd "$(getPackageSource https://github.com/commonmark/cmark/archive/$installRemoteModule_tmp.tar.gz)"
28752996
make -s -j$(getProcessorCount) cmake_build
@@ -3080,10 +3201,6 @@ installRemoteModule() {
30803201
esac
30813202
fi
30823203
fi
3083-
if test -z "$installRemoteModule_version"; then
3084-
# https://github.com/grpc/grpc/issues/37178
3085-
installRemoteModule_version=1.64.1
3086-
fi
30873204
if test -z "$installRemoteModule_version" || test "$installRemoteModule_version" = 1.35.0; then
30883205
case "$DISTRO_VERSION" in
30893206
@@ -4833,6 +4950,8 @@ if test $USE_PICKLE -gt 1; then
48334950
buildPickle
48344951
fi
48354952

4953+
compileLibs
4954+
48364955
for PHP_MODULE_TO_INSTALL in $PHP_MODULES_TO_INSTALL; do
48374956
case "$PHP_MODULE_TO_INSTALL" in
48384957
@fix_letsencrypt)

0 commit comments

Comments
 (0)