Skip to content

Commit 77e8dac

Browse files
authored
Update install-php-extensions
1 parent acb8bca commit 77e8dac

File tree

1 file changed

+73
-19
lines changed

1 file changed

+73
-19
lines changed

services/php/extensions/install-php-extensions

+73-19
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,10 @@ sortModulesToInstall() {
532532
if test $PHP_MAJMIN_VERSION -le 506; then
533533
checkRequiredModule event sockets
534534
fi
535+
# relay requires msgpack
536+
checkRequiredModule relay msgpack
537+
# relay requires igbinary
538+
checkRequiredModule relay igbinary
535539
# Some module installation may use sockets if available: move it before other modules
536540
if stringInList 'sockets' "$PHP_MODULES_TO_INSTALL"; then
537541
PHP_MODULES_TO_INSTALL="$(removeStringFromList 'sockets' "$PHP_MODULES_TO_INSTALL")"
@@ -744,7 +748,10 @@ buildRequiredPackageLists() {
744748
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libwebp"
745749
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libwebp-dev"
746750
if test $PHP_MAJMIN_VERSION -ge 801; then
747-
if isLibaomInstalled && isLibdav1dInstalled && isLibyuvInstalled && isLibavifInstalled; then
751+
if test $DISTRO_MAJMIN_VERSION -ge 315; then
752+
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libavif aom-libs libdav1d"
753+
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libavif-dev aom-dev dav1d-dev"
754+
elif isLibaomInstalled && isLibdav1dInstalled && isLibyuvInstalled && isLibavifInstalled; then
748755
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++"
749756
else
750757
case "${IPE_GD_WITHOUTAVIF:-}" in
@@ -1117,6 +1124,9 @@ buildRequiredPackageLists() {
11171124
esac
11181125
fi
11191126
;;
1127+
relay@alpine)
1128+
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent lz4-libs zstd-libs"
1129+
;;
11201130
simdjson@alpine)
11211131
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++"
11221132
;;
@@ -1615,7 +1625,7 @@ getModuleIniEntryType() {
16151625
#
16161626
# Arguments:
16171627
# $1: the name of the PHP extension
1618-
# $3: additional php.ini configuration (optional)
1628+
# $2: additional php.ini configuration (optional)
16191629
#
16201630
# Output:
16211631
# The contents of the ini file
@@ -2217,24 +2227,37 @@ EOF
22172227
elif test $PHP_MAJMIN_VERSION -le 800; then
22182228
docker-php-ext-configure gd --enable-gd --with-webp --with-jpeg --with-xpm --with-freetype
22192229
else
2220-
case "${IPE_GD_WITHOUTAVIF:-}" in
2221-
1 | y* | Y*) ;;
2222-
*)
2223-
if ! isLibaomInstalled; then
2224-
installLibaom
2225-
fi
2226-
if ! isLibdav1dInstalled; then
2227-
installLibdav1d
2228-
fi
2229-
if ! isLibyuvInstalled; then
2230-
installLibyuv
2231-
fi
2232-
if ! isLibavifInstalled; then
2233-
installLibavif
2230+
installBundledModule_tmp=0
2231+
case "$DISTRO" in
2232+
alpine)
2233+
if test $DISTRO_MAJMIN_VERSION -ge 315; then
2234+
installBundledModule_tmp=1
22342235
fi
22352236
;;
22362237
esac
2237-
if isLibaomInstalled && isLibdav1dInstalled && isLibyuvInstalled && isLibavifInstalled; then
2238+
if test $installBundledModule_tmp -eq 0; then
2239+
case "${IPE_GD_WITHOUTAVIF:-}" in
2240+
1 | y* | Y*) ;;
2241+
*)
2242+
if ! isLibaomInstalled; then
2243+
installLibaom
2244+
fi
2245+
if ! isLibdav1dInstalled; then
2246+
installLibdav1d
2247+
fi
2248+
if ! isLibyuvInstalled; then
2249+
installLibyuv
2250+
fi
2251+
if ! isLibavifInstalled; then
2252+
installLibavif
2253+
fi
2254+
;;
2255+
esac
2256+
if isLibaomInstalled && isLibdav1dInstalled && isLibyuvInstalled && isLibavifInstalled; then
2257+
installBundledModule_tmp=1
2258+
fi
2259+
fi
2260+
if test $installBundledModule_tmp -eq 1; then
22382261
docker-php-ext-configure gd --enable-gd --with-webp --with-jpeg --with-xpm --with-freetype --with-avif
22392262
else
22402263
docker-php-ext-configure gd --enable-gd --with-webp --with-jpeg --with-xpm --with-freetype
@@ -2615,7 +2638,7 @@ installRemoteModule() {
26152638
case "$DISTRO" in
26162639
alpine)
26172640
if ! test -e /usr/local/include/libgearman/gearman.h || ! test -e /usr/local/lib/libgearman.so; then
2618-
installRemoteModule_src="$(getPackageSource https://github.com/gearman/gearmand/releases/download/1.1.19.1/gearmand-1.1.19.1.tar.gz)"
2641+
installRemoteModule_src="$(getPackageSource https://github.com/gearman/gearmand/releases/download/1.1.20/gearmand-1.1.20.tar.gz)"
26192642
cd -- "$installRemoteModule_src"
26202643
./configure
26212644
make -j$(getProcessorCount) install-binPROGRAMS
@@ -2721,7 +2744,7 @@ installRemoteModule() {
27212744
if ! test -f /usr/local/lib/libionc.so || ! test -f /usr/local/include/ionc/ion.h; then
27222745
echo 'Installing ion-c... '
27232746
installRemoteModule_src="$(mktemp -p /tmp/src -d)"
2724-
git clone -q -c advice.detachedHead=false --depth 1 --branch v1.0.6 https://github.com/amzn/ion-c.git "$installRemoteModule_src/ion"
2747+
git clone -q -c advice.detachedHead=false --depth 1 --branch v1.1.0 https://github.com/amzn/ion-c.git "$installRemoteModule_src/ion"
27252748
(
27262749
cd "$installRemoteModule_src/ion"
27272750
git submodule init -q
@@ -3050,6 +3073,28 @@ installRemoteModule() {
30503073
addConfigureOption 'enable-redis-zstd' 'yes'
30513074
fi
30523075
;;
3076+
relay)
3077+
if test -z "$installRemoteModule_version"; then
3078+
installRemoteModule_version="$(curl -sSLf https://cachewerk.s3.amazonaws.com/relay/LATEST)"
3079+
installRemoteModule_version="${installRemoteModule_version#v}"
3080+
fi
3081+
case $(uname -m) in
3082+
aarch64 | arm64 | armv8)
3083+
installRemoteModule_hardware=aarch64
3084+
;;
3085+
*)
3086+
installRemoteModule_hardware=x86-64
3087+
;;
3088+
esac
3089+
printf 'Downloading relay v%s (%s)... ' "$installRemoteModule_version" "$installRemoteModule_hardware"
3090+
installRemoteModule_url="https://cachewerk.s3.amazonaws.com/relay/v${installRemoteModule_version}/relay-v${installRemoteModule_version}-php${PHP_MAJDOTMIN_VERSION}-${DISTRO}-${installRemoteModule_hardware}.tar.gz"
3091+
installRemoteModule_src="$(getPackageSource $installRemoteModule_url)"
3092+
echo 'done.'
3093+
cp -- "$installRemoteModule_src/relay-pkg.so" "$PHP_EXTDIR/relay.so"
3094+
sed -i "s/00000000-0000-0000-0000-000000000000/$(cat /proc/sys/kernel/random/uuid)/" "$PHP_EXTDIR/relay.so"
3095+
installRemoteModule_ini_extra="$(grep -vE '^[ \t]*extension[ \t]*=' $installRemoteModule_src/relay.ini)"
3096+
installRemoteModule_manuallyInstalled=1
3097+
;;
30533098
snappy)
30543099
if test -z "$installRemoteModule_path"; then
30553100
if test -z "$installRemoteModule_version"; then
@@ -3388,6 +3433,8 @@ installRemoteModule() {
33883433
installRemoteModule_version=2.6.1
33893434
elif test $PHP_MAJMIN_VERSION -le 701; then
33903435
installRemoteModule_version=2.9.8
3436+
elif test $PHP_MAJMIN_VERSION -le 704; then
3437+
installRemoteModule_version=3.1.6
33913438
fi
33923439
fi
33933440
;;
@@ -3512,6 +3559,13 @@ installRemoteModule() {
35123559
;;
35133560
esac
35143561
;;
3562+
zstd)
3563+
if test -z "$installRemoteModule_version"; then
3564+
if test $PHP_MAJMIN_VERSION -le 506; then
3565+
installRemoteModule_version=0.11.0
3566+
fi
3567+
fi
3568+
;;
35153569
esac
35163570
if test $installRemoteModule_manuallyInstalled -eq 0; then
35173571
if test -n "$installRemoteModule_path"; then

0 commit comments

Comments
 (0)