diff --git a/php7/7.0.33/build/php/extensions/install-php-extensions b/php7/7.0.33/build/php/extensions/install-php-extensions index 59a1ea8b2..2ef98bb85 100644 --- a/php7/7.0.33/build/php/extensions/install-php-extensions +++ b/php7/7.0.33/build/php/extensions/install-php-extensions @@ -21,7 +21,7 @@ if ! which docker-php-ext-configure >/dev/null || ! which docker-php-ext-enable exit 1 fi -IPE_VERSION=2.2.14 +IPE_VERSION=2.7.27 StandWithUkraine() { if test -t 1 && ! grep -Eq '^VERSION=.*jessie' /etc/os-release; then @@ -273,6 +273,15 @@ EOT # 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 @@ -597,6 +606,10 @@ sortModulesToInstall() { 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")" @@ -662,9 +675,11 @@ expandASpellDictionaries() { # 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 @@ -781,8 +796,11 @@ buildRequiredPackageLists() { buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile enchant2-dev" else # The system provides libenchant2, supported since PHP 8.0: we need to build libenchant1 on our own - buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent glib aspell-libs libhunspell" - buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile glib-dev aspell-dev hunspell-dev" + 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" @@ -795,9 +813,12 @@ buildRequiredPackageLists() { buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libenchant-2-2" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libenchant-2-dev" else - # 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" + 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" @@ -844,6 +865,18 @@ buildRequiredPackageLists() { 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" ;; @@ -869,6 +902,18 @@ buildRequiredPackageLists() { 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 @@ -952,7 +997,7 @@ buildRequiredPackageLists() { 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$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libicu-dev ^libidn2-[0-9+]-dev$ ^libgcrypt[0-9]+-dev$" fi ;; imagick@alpine) @@ -984,6 +1029,9 @@ buildRequiredPackageLists() { ;; interbase@alpine) buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev ncurses-dev" + if ! isFirebirdInstalled; then + COMPILE_LIBS="$COMPILE_LIBS firebird" + fi ;; interbase@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libfbclient2" @@ -1159,6 +1207,20 @@ buildRequiredPackageLists() { ;; pdo_firebird@alpine) buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev ncurses-dev" + if ! isFirebirdInstalled; then + COMPILE_LIBS="$COMPILE_LIBS firebird" + if test $PHP_MAJMIN_VERSION -ge 804; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib-dev" + if ! isLibTommathInstalled; then + COMPILE_LIBS="$COMPILE_LIBS libtommath" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake" + fi + if ! isLibTomcryptInstalled; then + COMPILE_LIBS="$COMPILE_LIBS libtomcrypt" + fi + fi + fi ;; pdo_firebird@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libfbclient2" @@ -1175,6 +1237,20 @@ buildRequiredPackageLists() { php_trie@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" ;; + phpy@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent python3" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile python3-dev" + ;; + phpy@debian) + if test $DISTRO_VERSION_NUMBER -ge 12; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.11" + elif test $DISTRO_VERSION_NUMBER -ge 11; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.9" + else + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.7" + fi + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile python3-dev" + ;; pkcs11@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent softhsm" ;; @@ -1354,7 +1430,22 @@ buildRequiredPackageLists() { if test $PHP_MAJMIN_VERSION -ge 702; then buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent c-ares" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile c-ares-dev" + if test $PHP_MAJMIN_VERSION -ge 801; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent zstd-libs" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile sqlite-dev zstd-dev" + fi fi + case "${IPE_SWOOLE_WITHOUT_IOURING:-}" in + 1 | y* | Y*) ;; + *) + # iouring support in swoole 6 requires liburing 2.5+: available since Alpine 3.19 + # but with Alpine 3.19 we have a "invalid use of incomplete type 'const struct statx'" error + if test $DISTRO_MAJMIN_VERSION -ge 320; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent liburing" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile liburing-dev" + fi + ;; + esac ;; swoole@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libcurl3-gnutls libpq5" @@ -1362,9 +1453,23 @@ buildRequiredPackageLists() { if test $PHP_MAJMIN_VERSION -ge 702; then buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libc-ares2" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libc-ares-dev" + if test $PHP_MAJMIN_VERSION -ge 800; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libbrotli1" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev libbrotli-dev" + if test $PHP_MAJMIN_VERSION -ge 801; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libsqlite3-dev" + if test $DISTRO_VERSION_NUMBER -ge 11; then + # swoole 6 requires libzstd >= 1.4.0, but on debian 10 (buster) we have 1.3.8 + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libzstd[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libzstd-dev" + fi + fi + fi fi - if test $PHP_MAJMIN_VERSION -ge 800; then - buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev" + if test $DISTRO_VERSION_NUMBER -ge 13; then + # iouring support in swoole 6 requires liburing 2.5+: available since Debian Trixie (13) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent liburing2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile liburing-dev" fi ;; sybase_ct@alpine) @@ -1490,6 +1595,12 @@ buildRequiredPackageLists() { xmlrpc@debian) buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" ;; + xpass@alpine) + if ! isLibXCryptInstalled; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile linux-headers" + COMPILE_LIBS="$COMPILE_LIBS libxcrypt" + fi + ;; xsl@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libxslt" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxslt-dev libgcrypt-dev" @@ -1622,7 +1733,7 @@ expandPackagesToBeInstalled() { resetIFS ;; debian) - expandPackagesToBeInstalled_log="$(DEBIAN_FRONTEND=noninteractive apt-get install -sy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS $@ 2>&1 || printf '\nE: apt-get failed\n')" + expandPackagesToBeInstalled_log="$(apt-get install -sy --no-install-recommends $@ 2>&1 || printf '\nE: apt-get failed\n')" if test -n "$(printf '%s' "$expandPackagesToBeInstalled_log" | grep -E '^E:')"; then printf 'FAILED TO LIST THE WHOLE PACKAGE LIST FOR\n' >&2 printf '%s ' "$@" >&2 @@ -1891,7 +2002,7 @@ markPreinstalledPackagesAsUsed() { apk add $PACKAGES_PERSISTENT_PRE ;; debian) - DEBIAN_FRONTEND=noninteractive apt-mark manual $PACKAGES_PERSISTENT_PRE + apt-mark manual $PACKAGES_PERSISTENT_PRE ;; esac } @@ -1917,7 +2028,7 @@ installRequiredPackages() { done ;; debian) - DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS $PACKAGES_PERSISTENT_NEW $PACKAGES_VOLATILE + apt-get install -qqy --no-install-recommends $PACKAGES_PERSISTENT_NEW $PACKAGES_VOLATILE ;; esac } @@ -2099,12 +2210,12 @@ installMicrosoftSqlServerODBC() { fi printf -- '- installing the APT package\n' if test $PHP_MAJMIN_VERSION -le 703; then - DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS msodbcsql17 + ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends msodbcsql17 elif test $DISTRO_VERSION_NUMBER -ge 9 && test $DISTRO_VERSION_NUMBER -le 12; then # On Debian 9 to 12 we have both msodbcsql17 and msodbcsql18: let's install just one - DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS msodbcsql18 + ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends msodbcsql18 else - DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS '^msodbcsql[0-9]+$' + ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends '^msodbcsql[0-9]+$' fi ;; esac @@ -2128,17 +2239,7 @@ isLibaomInstalled() { # Install libaom installLibaom() { printf 'Installing libaom\n' - installLibaom_version=3.8.1 - case "$DISTRO_VERSION" in - debian@10) - case $(uname -m) in - aarch* | arm*) - #see https://bugs.chromium.org/p/aomedia/issues/detail?id=3543 - installLibaom_version=3.5.0 - ;; - esac - ;; - esac + installLibaom_version=3.10.0 installLibaom_dir="$(getPackageSource https://aomedia.googlesource.com/aom/+archive/v$installLibaom_version.tar.gz)" mkdir -- "$installLibaom_dir/my.build" cd -- "$installLibaom_dir/my.build" @@ -2293,6 +2394,108 @@ installLibThai() { cd - >/dev/null } +isLibTommathInstalled() { + if test -f /usr/local/lib/libtommath.a && test -f /usr/local/include/tommath.h; then + return 0 + fi + return 1 +} + +installLibTommath() { + printf 'Installing libtommath\n' + installLibTommath_src="$(getPackageSource https://github.com/libtom/libtommath/releases/download/v1.3.0/ltm-1.3.0.tar.xz)" + mkdir -p "$installLibTommath_src/build" + cd -- "$installLibTommath_src/build" + CFLAGS='-fPIC' cmake -DCMAKE_BUILD_TYPE=Release .. + make -j$(getProcessorCount) + make install + cd - >/dev/null +} + +isLibTomcryptInstalled() { + if test -f /usr/local/lib/libtomcrypt.a && test -f /usr/local/include/tomcrypt.h; then + return 0 + fi + return 1 +} + +installLibTomcrypt() { + printf 'Installing libtomcrypt\n' + installLibTomcrypt_src="$(getPackageSource https://github.com/libtom/libtomcrypt/releases/download/v1.18.2/crypt-1.18.2.tar.xz)" + cd -- "$installLibTomcrypt_src" + CFLAGS='-fPIC' make -j$(getProcessorCount) + make install +} + +isFirebirdInstalled() { + if test -f /usr/lib/libfbclient.so && test -f /usr/include/ibase.h; then + return 0 + fi + if test -d /tmp/src/firebird; then + return 0 + fi + return 1 +} + +installFirebird() { + printf 'Installing firebird\n' + if test $PHP_MAJMIN_VERSION -ge 804; then + installFirebird_src="$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/v5.0.2/Firebird-5.0.2.1613-0-source.tar.xz)" + cd -- "$installFirebird_src" + ./configure --enable-client-only + make -j$(getProcessorCount) + cp -Rd gen/Release/firebird/include/* /usr/include + cp -Rd gen/Release/firebird/lib/* /usr/lib + cd - >/dev/null + else + mv "$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/R2_5_9/Firebird-2.5.9.27139-0.tar.bz2)" /tmp/src/firebird + cd /tmp/src/firebird + # Patch rwlock.h (this has been fixed in later release of firebird 3.x) + sed -i '194s/.*/#if 0/' src/common/classes/rwlock.h + ./configure --with-system-icu + # -j option can't be used: make targets must be compiled sequentially + make -s btyacc_binary gpre_boot libfbstatic libfbclient + cp gen/firebird/lib/libfbclient.so /usr/lib/ + ln -s /usr/lib/libfbclient.so /usr/lib/libfbclient.so.2 + cd - >/dev/null + fi +} + +isLibXCryptInstalled() { + if ! test -f /usr/local/lib/libcrypt.so && ! test -f /usr/lib/libcrypt.so && ! test -f /usr/lib/x86_64*/libcrypt.so; then + return 1 + fi + return 0 +} + +installLibXCrypt() { + printf 'Installing libxcrypt\n' + installLibXCrypt_version=4.4.36 + installLibXCrypt_src="$(getPackageSource "https://github.com/besser82/libxcrypt/releases/download/v$installLibXCrypt_version/libxcrypt-$installLibXCrypt_version.tar.xz")" + cd -- "$installLibXCrypt_src" + ./configure --prefix /usr + make -j$(getProcessorCount) + make install + cd - >/dev/null +} + +isLibenchant1Installed() { + if test -f /usr/lib/libenchant.so || test -f /usr/local/lib/libenchant.so; then + return 0 + fi + return 1 +} + +installLibenchant1() { + printf 'Installing libenchant1\n' + installLibenchant1_src="$(getPackageSource https://github.com/rrthomas/enchant/releases/download/enchant-1-6-1/enchant-1.6.1.tar.gz)" + cd -- "$installLibenchant1_src" + ./configure + make -j$(getProcessorCount) + make install + cd - >/dev/null +} + # Install Composer installComposer() { installComposer_version="$(getWantedPHPModuleVersion @composer)" @@ -2342,30 +2545,41 @@ actuallyInstallComposer() { # Install ionCube Loader installIonCubeLoader() { + installIonCubeLoader_version='' + if test $PHP_MAJMIN_VERSION -lt 804; then + # For 14.4.0 we have a Segmentation Fault + installIonCubeLoader_version=14.0.0 + fi + installIonCubeLoader_versionForUrl='' + installIonCubeLoader_versionForMessage=latest + if test -n "$installIonCubeLoader_version"; then + installIonCubeLoader_versionForUrl="_$installIonCubeLoader_version" + installIonCubeLoader_versionForMessage="v$installIonCubeLoader_version" + fi # See https://www.ioncube.com/loaders.php case $PHP_BITS in 32) case $(uname -m) in aarch* | arm*) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_armv7l.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_armv7l$installIonCubeLoader_versionForUrl.tar.gz" ;; *) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86$installIonCubeLoader_versionForUrl.tar.gz" ;; esac ;; *) case $(uname -m) in aarch64 | arm64 | armv8) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_aarch64.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_aarch64$installIonCubeLoader_versionForUrl.tar.gz" ;; *) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64$installIonCubeLoader_versionForUrl.tar.gz" ;; esac ;; esac - printf 'Downloading ionCube Loader... ' + printf 'Downloading ionCube Loader (%s)... ' "$installIonCubeLoader_versionForMessage" installIonCubeLoader_dir="$(getPackageSource $installIonCubeLoader_url)" echo 'done.' installIonCubeLoader_so=$(php -r "printf('ioncube_loader_lin_%s.%s%s.so', PHP_MAJOR_VERSION, PHP_MINOR_VERSION, ZEND_THREAD_SAFE ? '_ts' : '');") @@ -2414,15 +2628,31 @@ installCargo() { if command -v cargo >/dev/null; then return fi - printf '# Installing cargo\n' - case "$DISTRO" in - alpine) - # see https://github.com/hyperledger/indy-vdr/issues/69#issuecomment-998104850 - export RUSTFLAGS='-C target-feature=-crt-static' - ;; - esac - curl https://sh.rustup.rs -sSf | sh -s -- -y -q + installCargo_cargoversion= + if ! test -f "$HOME/.cargo/env"; then + printf '# Installing cargo\n' + case "$DISTRO" in + alpine) + # see https://github.com/hyperledger/indy-vdr/issues/69#issuecomment-998104850 + export RUSTFLAGS='-C target-feature=-crt-static' + ;; + esac + curl https://sh.rustup.rs -sSf | sh -s -- -y -q + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -le 310; then + # With version 1.84.0 we have this error: + # Error relocating /root/.rustup/toolchains/stable-x86_64-unknown-linux-musl/bin/cargo: posix_spawn_file_actions_addchdir_np: symbol not found + # See https://github.com/rust-lang/rust/pull/131851#issue-2595663507 + installCargo_cargoversion=1.83.0 + fi + ;; + esac + fi . "$HOME/.cargo/env" + if test -n "$installCargo_cargoversion"; then + rustup default -- "$installCargo_cargoversion" + fi if test -z "${IPE_UNINSTALL_CARGO:-}"; then IPE_UNINSTALL_CARGO=y fi @@ -2430,14 +2660,20 @@ installCargo() { installNewRelic() { printf '# Installing newrelic\n' + # see https://docs.newrelic.com/docs/apm/agents/php-agent/getting-started/php-agent-compatibility-requirements/ + if test $PHP_MAJMIN_VERSION -le 701; then + installNewRelic_baseUrl=https://download.newrelic.com/php_agent/archive/10.21.0.11/ + else + installNewRelic_baseUrl=https://download.newrelic.com/php_agent/release/ + fi installNewRelic_search='\bnewrelic-php[0-9.]*-[0-9]+(\.[0-9]+)*-linux' case "$DISTRO" in alpine) installNewRelic_search="$installNewRelic_search-musl" ;; esac - installNewRelic_file="$(curl -sSLf -o- https://download.newrelic.com/php_agent/release/ | sed -E 's/<[^>]*>//g' | grep -Eo "$installNewRelic_search.tar.gz" | sort | head -1)" - installNewRelic_url="https://download.newrelic.com/php_agent/release/$installNewRelic_file" + installNewRelic_file="$(curl -sSLf -o- "$installNewRelic_baseUrl" | sed -E 's/<[^>]*>//g' | grep -Eo "$installNewRelic_search.tar.gz" | sort | head -1)" + installNewRelic_url="$installNewRelic_baseUrl$installNewRelic_file" installNewRelic_src="$(getPackageSource "$installNewRelic_url")" cd -- "$installNewRelic_src" NR_INSTALL_USE_CP_NOT_LN=1 NR_INSTALL_SILENT=1 ./newrelic-install install @@ -2446,6 +2682,12 @@ installNewRelic() { NR_INSTALL_USE_CP_NOT_LN=1 NR_INSTALL_SILENT=1 ./newrelic-install install_daemon ;; esac + case "${IPE_NEWRELIC_KEEPLOG:-}" in + 1 | y* | Y*) ;; + *) + rm -f /tmp/nrinstall-*.tar + ;; + esac cd - >/dev/null cat </dev/null - fi - ;; ftp) - docker-php-ext-configure ftp --with-openssl-dir=/usr + if test $PHP_MAJMIN_VERSION -ge 804; then + docker-php-ext-configure ftp --with-ftp-ssl=/usr + else + docker-php-ext-configure ftp --with-openssl-dir=/usr + fi ;; gd) if test $PHP_MAJMIN_VERSION -le 506; then @@ -2551,23 +2802,6 @@ EOF ;; esac if test $installBundledModule_tmp -eq 0; then - case "${IPE_GD_WITHOUTAVIF:-}" in - 1 | y* | Y*) ;; - *) - if ! isLibaomInstalled; then - installLibaom - fi - if ! isLibdav1dInstalled; then - installLibdav1d - fi - if ! isLibyuvInstalled; then - installLibyuv - fi - if ! isLibavifInstalled; then - installLibavif - fi - ;; - esac if isLibaomInstalled && isLibdav1dInstalled && isLibyuvInstalled && isLibavifInstalled; then installBundledModule_tmp=1 fi @@ -2592,7 +2826,7 @@ EOF debian@9) installBundledModule_tmp="$(pwd)" cd /tmp - apt-get download $IPE_APTGET_INSTALLOPTIONS libc-client2007e-dev + apt-get download libc-client2007e-dev dpkg -i --ignore-depends=libssl-dev libc-client2007e-dev* rm libc-client2007e-dev* cd "$installBundledModule_tmp" @@ -2603,19 +2837,9 @@ EOF interbase | pdo_firebird) case "$DISTRO" in alpine) - if ! test -d /tmp/src/firebird; then - mv "$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/R2_5_9/Firebird-2.5.9.27139-0.tar.bz2)" /tmp/src/firebird - cd /tmp/src/firebird - # Patch rwlock.h (this has been fixed in later release of firebird 3.x) - sed -i '194s/.*/#if 0/' src/common/classes/rwlock.h - ./configure --with-system-icu - # -j option can't be used: make targets must be compiled sequentially - make -s btyacc_binary gpre_boot libfbstatic libfbclient - cp gen/firebird/lib/libfbclient.so /usr/lib/ - ln -s /usr/lib/libfbclient.so /usr/lib/libfbclient.so.2 - cd - >/dev/null + if test $PHP_MAJMIN_VERSION -lt 804; then + 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 fi - 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 ;; esac ;; @@ -2824,7 +3048,7 @@ installRemoteModule() { installRemoteModule_distro=linux ;; esac - installRemoteModule_tmp2=$(php -r 'echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION;') + installRemoteModule_tmp2=$(php -r 'echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION . (ZEND_THREAD_SAFE ? "-zts" : "");') installRemoteModule_tmp="$(mktemp -p /tmp/src -d)" cd "$installRemoteModule_tmp" curl -sSLf --user-agent Docker https://blackfire.io/api/v1/releases/probe/php/$installRemoteModule_distro/$installRemoteModule_tmp1/$installRemoteModule_tmp2 | tar xz @@ -2852,7 +3076,7 @@ installRemoteModule() { if test $(compareVersions "$(cmake --version | head -n1 | sed -E 's/^.* //')" '3.7') -lt 0; then installRemoteModule_tmp=0.29.0 else - installRemoteModule_tmp=0.31.0 + installRemoteModule_tmp=0.31.1 fi cd "$(getPackageSource https://github.com/commonmark/cmark/archive/$installRemoteModule_tmp.tar.gz)" make -s -j$(getProcessorCount) cmake_build @@ -2882,6 +3106,16 @@ installRemoteModule() { if test $PHP_MAJMIN_VERSION -lt 700; then installRemoteModule_version=0.75.0 fi + if test -z "$installRemoteModule_version"; then + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -le 312; then + # cc is not supported due to a memcmp related bug + installRemoteModule_version=1.1.0 + fi + ;; + esac + fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" fi @@ -2919,6 +3153,13 @@ installRemoteModule() { installRemoteModule_version=alpha fi ;; + ev) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 800; then + installRemoteModule_version=1.1.5 + fi + fi + ;; event) installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 2.4.0) -ge 0; then @@ -2986,6 +3227,8 @@ installRemoteModule() { if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then installRemoteModule_version=1.1.2 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=2.1.3 fi fi case "$DISTRO" in @@ -3073,7 +3316,7 @@ installRemoteModule() { if ! test -e /usr/local/lib/libidnkit.so; then installRemoteModule_src="$(getPackageSource https://jprs.co.jp/idn/idnkit-2.3.tar.bz2)" cd -- "$installRemoteModule_src" - ./configure + CFLAGS=-Wno-incompatible-pointer-types ./configure make -j$(getProcessorCount) install cd - >/dev/null fi @@ -3108,14 +3351,14 @@ installRemoteModule() { if ! test -f /usr/local/lib/libionc.so || ! test -f /usr/local/include/ionc/ion.h; then echo 'Installing ion-c... ' installRemoteModule_src="$(mktemp -p /tmp/src -d)" - git clone -q -c advice.detachedHead=false --depth 1 --branch v1.1.2 https://github.com/amzn/ion-c.git "$installRemoteModule_src/ion" + git clone -q -c advice.detachedHead=false --depth 1 --branch v1.1.3 https://github.com/amzn/ion-c.git "$installRemoteModule_src/ion" ( cd "$installRemoteModule_src/ion" git submodule init -q git submodule update -q mkdir -p build cd build - cmake -DCMAKE_BUILD_TYPE=Release .. -Wno-dev + CFLAGS='-Wno-incompatible-pointer-types -Wno-stringop-overflow -Wno-discarded-qualifiers' cmake -DCMAKE_BUILD_TYPE=Release .. -Wno-dev make clean make -j$(getProcessorCount) install ) @@ -3267,6 +3510,8 @@ installRemoteModule() { installRemoteModule_version=1.11.1 elif test $PHP_MAJMIN_VERSION -le 703; then installRemoteModule_version=1.16.2 + elif test $PHP_MAJMIN_VERSION -le 800; then + installRemoteModule_version=1.20.1 fi fi if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 1.17.0) -ge 0; then @@ -3336,6 +3581,8 @@ installRemoteModule() { installRemoteModule_version=4.10.0 elif test $PHP_MAJMIN_VERSION -lt 801; then installRemoteModule_version=22.0.0 + elif test $PHP_MAJMIN_VERSION -lt 802; then + installRemoteModule_version=22.1.2 fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -3431,6 +3678,11 @@ installRemoteModule() { addConfigureOption enable-swoole-curl yes fi ;; + operator) + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=beta + fi + ;; parallel) if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 701; then @@ -3461,6 +3713,16 @@ installRemoteModule() { fi fi ;; + phalcon) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMINPAT_VERSION -lt 70401; then + installRemoteModule_version=4.1.2 + elif test $PHP_MAJMIN_VERSION -lt 800; then + installRemoteModule_version=5.4.0 + fi + fi + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' + ;; php_trie) if ! test -f /usr/local/include/hat-trie/include/tsl/htrie_map.h; then installRemoteModule_src="$(getPackageSource https://codeload.github.com/Tessil/hat-trie/tar.gz/v0.6.0)" @@ -3490,6 +3752,17 @@ installRemoteModule() { fi fi ;; + psr) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 506; then + installRemoteModule_version=0.5.1 + elif test $PHP_MAJMIN_VERSION -lt 700; then + installRemoteModule_version=0.6.1 + elif test $PHP_MAJMIN_VERSION -lt 703; then + installRemoteModule_version=1.1.0 + fi + fi + ;; pthreads) if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then @@ -3546,6 +3819,8 @@ installRemoteModule() { installRemoteModule_version=4.3.0 elif test $PHP_MAJMIN_VERSION -le 701; then installRemoteModule_version=5.3.7 + elif test $PHP_MAJMIN_VERSION -le 703; then + installRemoteModule_version=6.0.2 fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -3674,6 +3949,18 @@ installRemoteModule() { fi fi ;; + seaslog) + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' + ;; + smbclient) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.1.1 + elif test $PHP_MAJMIN_VERSION -le 703; then + installRemoteModule_version=1.1.2 + fi + fi + ;; snappy) if test -z "$installRemoteModule_path"; then if test -z "$installRemoteModule_version"; then @@ -3691,10 +3978,12 @@ installRemoteModule() { snuffleupagus) if test -z "$installRemoteModule_path"; then if test -z "$installRemoteModule_version"; then - if test $PHP_MAJMIN_VERSION -le 704; then + if test $PHP_MAJMIN_VERSION -le 800; then installRemoteModule_version=0.9.0 - else + elif test $PHP_MAJMIN_VERSION -le 801; then installRemoteModule_version=0.10.0 + else + installRemoteModule_version=0.11.0 fi fi installRemoteModule_src="$(getPackageSource https://codeload.github.com/jvoisin/snuffleupagus/tar.gz/v$installRemoteModule_version)" @@ -3738,7 +4027,7 @@ installRemoteModule() { spx) if test -z "$installRemoteModule_path"; then if test -z "$installRemoteModule_version"; then - installRemoteModule_version=v0.4.15 + installRemoteModule_version=v0.4.18 fi if test "${installRemoteModule_version%.*}" = "$installRemoteModule_version"; then installRemoteModule_displayVersion="$installRemoteModule_version" @@ -3811,6 +4100,21 @@ installRemoteModule() { elif test $PHP_BITS -eq 32; then # See https://github.com/swoole/swoole-src/issues/5198#issuecomment-1820162178 installRemoteModule_version="$(resolvePHPModuleVersion "$installRemoteModule_module" '^5.0')" + else + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -le 312; then + installRemoteModule_version=5.1.2 + fi + ;; + esac + fi + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 800; then + installRemoteModule_version=5.1.3 + else + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" stable)" + fi fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -3823,19 +4127,115 @@ installRemoteModule() { installRemoteModule_openssl=yes case "$DISTRO_VERSION" in alpine@3.7 | alpine@3.8) - if test -n "$installRemoteModule_version" && test $(compareVersions "$installRemoteModule_version" 4.6.0) -lt 0; then + if test $(compareVersions "$installRemoteModule_version" 4.6.0) -lt 0; then # see https://github.com/swoole/swoole-src/issues/3934 installRemoteModule_openssl=no fi ;; esac - if test $PHP_MAJMIN_VERSION -eq 803; then - # see https://github.com/swoole/docker-swoole/issues/45 - installRemoteModule_curl=no + if test $PHP_THREADSAFE -eq 1; then + installRemoteModule_zts=yes else - installRemoteModule_curl=yes + installRemoteModule_zts=no fi - if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 5.0.1) -ge 0; then + installRemoteModule_sqlite=yes + installRemoteModule_iouring=no + installRemoteModule_curl=yes + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -lt 317; then + # we need sqlite3 >= 3.7.7 + installRemoteModule_sqlite=no + fi + case "${IPE_SWOOLE_WITHOUT_IOURING:-}" in + 1 | y* | Y*) ;; + *) + # iouring support in swoole 6 requires liburing 2.5+: available since Alpine 3.19 + # but with Alpine 3.19 we have a "invalid use of incomplete type 'const struct statx'" error + if test $DISTRO_MAJMIN_VERSION -ge 320; then + installRemoteModule_iouring=yes + fi + ;; + esac + ;; + debian) + if test $PHP_MAJMIN_VERSION -ge 800; then + # see https://github.com/swoole/swoole-src/issues/5365 + installRemoteModule_curl=no + fi + if test $DISTRO_MAJMIN_VERSION -lt 1200; then + # we need sqlite3 >= 3.7.7 + installRemoteModule_sqlite=no + fi + case "${IPE_SWOOLE_WITHOUT_IOURING:-}" in + 1 | y* | Y*) ;; + *) + if test $DISTRO_VERSION_NUMBER -ge 13; then + # iouring support in swoole 6 requires liburing 2.5+: available since Debian Trixie (13) + installRemoteModule_iouring=yes + fi + ;; + esac + ;; + esac + installRemoteModule_zstd=yes + case "$DISTRO" in + debian) + if test $DISTRO_VERSION_NUMBER -lt 11; then + # swoole 6 requires libzstd >= 1.4.0, but on debian 10 (buster) we have 1.3.8 + installRemoteModule_zstd=no + fi + ;; + esac + if test $(compareVersions "$installRemoteModule_version" 6.0.0) -ge 0; then + # enable sockets support? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable curl support? + addConfigureOption enable-swoole-curl $installRemoteModule_curl + # enable cares support? + addConfigureOption enable-cares yes + # enable brotli support? + addConfigureOption enable-brotli yes + # enable zstd support? + addConfigureOption enable-zstd $installRemoteModule_zstd + # enable PostgreSQL database support? + addConfigureOption enable-swoole-pgsql yes + # enable ODBC database support? + addConfigureOption with-swoole-odbc no + # enable Oracle database support? + addConfigureOption with-swoole-oracle no + # enable Sqlite database support? + addConfigureOption enable-swoole-sqlite $installRemoteModule_sqlite + # enable swoole thread support (need php zts support)? + addConfigureOption enable-swoole-thread $installRemoteModule_zts + # enable iouring for file async support? + addConfigureOption enable-iouring $installRemoteModule_iouring + elif test $(compareVersions "$installRemoteModule_version" 5.1.0) -ge 0; then + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable curl support? + addConfigureOption enable-swoole-curl $installRemoteModule_curl + # enable cares support? + addConfigureOption enable-cares yes + # enable brotli support? + addConfigureOption enable-brotli yes + # enable PostgreSQL database support? + addConfigureOption enable-swoole-pgsql yes + # enable ODBC database support? + addConfigureOption with-swoole-odbc no + # enable Oracle database support? + addConfigureOption with-swoole-oracle no + # enable Sqlite database support? + addConfigureOption enable-swoole-sqlite $installRemoteModule_sqlite + elif test $(compareVersions "$installRemoteModule_version" 5.0.1) -ge 0; then # enable sockets supports? addConfigureOption enable-sockets $installRemoteModule_sockets # enable openssl support? @@ -4005,6 +4405,7 @@ installRemoteModule() { fi ;; tensor) + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 703; then installRemoteModule_version=2.2.3 @@ -4072,6 +4473,7 @@ installRemoteModule() { installRemoteModule_manuallyInstalled=1 ;; uopz) + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then installRemoteModule_version=2.0.7 @@ -4189,6 +4591,17 @@ installRemoteModule() { addConfigureOption enable-reader yes fi ;; + xmldiff) + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + if test -z "$installRemoteModule_version"; then + case "$DISTRO_VERSION" in + debian@8) + # The gcc version of Debian Jessie is too old => error: 'nullptr' was not declared in this scope + installRemoteModule_version=1.1.4 + ;; + esac + fi + ;; xmlrpc) if test -z "$installRemoteModule_version"; then installRemoteModule_version=beta @@ -4265,8 +4678,6 @@ installRemoteModule() { if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then installRemoteModule_version=0.5.0 - else - installRemoteModule_version=alpha fi fi installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -4521,23 +4932,18 @@ removeStringFromList() { } # Invoke apt-get update -# -# Set: -# IPE_APTGET_INSTALLOPTIONS invokeAptGetUpdate() { if test -n "${IPE_APTGETUPDATE_ALREADY:-}"; then - DEBIAN_FRONTEND=noninteractive apt-get update -q + apt-get update -q return fi - IPE_APTGET_INSTALLOPTIONS='' - invokeAptGetUpdate_fixdistro='' + IPE_APTGETUPDATE_ALREADY=y if grep -q 'VERSION="8 (jessie)"' /etc/os-release; then invokeAptGetUpdate_fixdistro=jessie elif grep -q 'VERSION="9 (stretch)"' /etc/os-release; then invokeAptGetUpdate_fixdistro=stretch else - IPE_APTGETUPDATE_ALREADY=y - DEBIAN_FRONTEND=noninteractive apt-get update -q + invokeAptGetUpdate return fi # See https://www.debian.org/distrib/archive.en.html for a list of mirrors @@ -4552,19 +4958,18 @@ invokeAptGetUpdate() { sed -ri "s;^(\s*deb\s+)http://security.debian.org/debian-security;\1$IPE_DEB_ARCHIVE_SECURITY;" /etc/apt/sources.list sed -ri "s;^(\s*deb\s+)http://security.debian.org;\1$IPE_DEB_ARCHIVE_SECURITY;" /etc/apt/sources.list invokeAptGetUpdate_tmp="$(mktemp)" - DEBIAN_FRONTEND=noninteractive apt-get update -q 2>"$invokeAptGetUpdate_tmp" + apt-get update -q 2>"$invokeAptGetUpdate_tmp" if test -s "$invokeAptGetUpdate_tmp"; then cat "$invokeAptGetUpdate_tmp" >&2 if grep -qE ' KEYEXPIRED [0-9]' "$invokeAptGetUpdate_tmp"; then - IPE_APTGET_INSTALLOPTIONS='-o APT::Get::AllowUnauthenticated=true' echo '############' >&2 echo '# WARNING! #' >&2 echo '############' >&2 echo 'apt packages will be installed without checking authenticity!' >&2 + printf 'APT::Get::AllowUnauthenticated "true";\n' >>/etc/apt/apt.conf.d/99unauthenticated fi fi rm "$invokeAptGetUpdate_tmp" - IPE_APTGETUPDATE_ALREADY=y } # Fix the Let's Encrypt CA certificates on old distros @@ -4595,7 +5000,7 @@ fixLetsEncrypt() { invokeAptGetUpdate fi printf -- '- installing newer ca-certificates package\n' - DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends ${IPE_APTGET_INSTALLOPTIONS:-} ca-certificates + apt-get install -qqy --no-install-recommends ca-certificates fi ;; *) @@ -4616,8 +5021,12 @@ fixLetsEncrypt() { # Cleanup everything at the end of the execution cleanup() { if test "${IPE_UNINSTALL_CARGO:-}" = y; then - . "$HOME/.cargo/env" - rustup self uninstall -y + if test -f "$HOME/.cargo/env"; then + . "$HOME/.cargo/env" + fi + if command -v rustup >/dev/null; then + rustup self uninstall -y + fi fi if test -n "$UNNEEDED_PACKAGE_LINKS"; then printf '### REMOVING UNNEEDED PACKAGE LINKS ###\n' @@ -4640,11 +5049,11 @@ cleanup() { debian) if test -n "$PACKAGES_VOLATILE"; then printf '### REMOVING UNNEEDED PACKAGES ###\n' - DEBIAN_FRONTEND=noninteractive apt-get remove --purge -y $PACKAGES_VOLATILE + apt-get remove --purge -y $PACKAGES_VOLATILE fi if test -n "$PACKAGES_PREVIOUS"; then printf '### RESTORING PREVIOUSLY INSTALLED PACKAGES ###\n' - DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends --no-upgrade $IPE_APTGET_INSTALLOPTIONS $PACKAGES_PREVIOUS + apt-get install -qqy --no-install-recommends --no-upgrade $PACKAGES_PREVIOUS fi ;; esac @@ -4669,6 +5078,8 @@ cleanup() { esac } +DEBIAN_FRONTEND=noninteractive +export DEBIAN_FRONTEND resetIFS mkdir -p /tmp/src mkdir -p /tmp/pickle.tmp @@ -4684,7 +5095,7 @@ esac setPHPVersionVariables setPHPPreinstalledModules case "$PHP_MAJMIN_VERSION" in - 505 | 506 | 700 | 701 | 702 | 703 | 704 | 800 | 801 | 802 | 803) ;; + 505 | 506 | 700 | 701 | 702 | 703 | 704 | 800 | 801 | 802 | 803 | 804) ;; *) printf "### ERROR: Unsupported PHP version: %s.%s ###\n" $((PHP_MAJMIN_VERSION / 100)) $((PHP_MAJMIN_VERSION % 100)) ;; @@ -4721,6 +5132,8 @@ if test $USE_PICKLE -gt 1; then buildPickle fi +compileLibs + for PHP_MODULE_TO_INSTALL in $PHP_MODULES_TO_INSTALL; do case "$PHP_MODULE_TO_INSTALL" in @fix_letsencrypt) diff --git a/php7/7.1.33/build/php/extensions/install-php-extensions b/php7/7.1.33/build/php/extensions/install-php-extensions index 59a1ea8b2..2ef98bb85 100644 --- a/php7/7.1.33/build/php/extensions/install-php-extensions +++ b/php7/7.1.33/build/php/extensions/install-php-extensions @@ -21,7 +21,7 @@ if ! which docker-php-ext-configure >/dev/null || ! which docker-php-ext-enable exit 1 fi -IPE_VERSION=2.2.14 +IPE_VERSION=2.7.27 StandWithUkraine() { if test -t 1 && ! grep -Eq '^VERSION=.*jessie' /etc/os-release; then @@ -273,6 +273,15 @@ EOT # 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 @@ -597,6 +606,10 @@ sortModulesToInstall() { 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")" @@ -662,9 +675,11 @@ expandASpellDictionaries() { # 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 @@ -781,8 +796,11 @@ buildRequiredPackageLists() { buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile enchant2-dev" else # The system provides libenchant2, supported since PHP 8.0: we need to build libenchant1 on our own - buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent glib aspell-libs libhunspell" - buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile glib-dev aspell-dev hunspell-dev" + 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" @@ -795,9 +813,12 @@ buildRequiredPackageLists() { buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libenchant-2-2" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libenchant-2-dev" else - # 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" + 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" @@ -844,6 +865,18 @@ buildRequiredPackageLists() { 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" ;; @@ -869,6 +902,18 @@ buildRequiredPackageLists() { 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 @@ -952,7 +997,7 @@ buildRequiredPackageLists() { 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$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libicu-dev ^libidn2-[0-9+]-dev$ ^libgcrypt[0-9]+-dev$" fi ;; imagick@alpine) @@ -984,6 +1029,9 @@ buildRequiredPackageLists() { ;; interbase@alpine) buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev ncurses-dev" + if ! isFirebirdInstalled; then + COMPILE_LIBS="$COMPILE_LIBS firebird" + fi ;; interbase@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libfbclient2" @@ -1159,6 +1207,20 @@ buildRequiredPackageLists() { ;; pdo_firebird@alpine) buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev ncurses-dev" + if ! isFirebirdInstalled; then + COMPILE_LIBS="$COMPILE_LIBS firebird" + if test $PHP_MAJMIN_VERSION -ge 804; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib-dev" + if ! isLibTommathInstalled; then + COMPILE_LIBS="$COMPILE_LIBS libtommath" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake" + fi + if ! isLibTomcryptInstalled; then + COMPILE_LIBS="$COMPILE_LIBS libtomcrypt" + fi + fi + fi ;; pdo_firebird@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libfbclient2" @@ -1175,6 +1237,20 @@ buildRequiredPackageLists() { php_trie@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" ;; + phpy@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent python3" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile python3-dev" + ;; + phpy@debian) + if test $DISTRO_VERSION_NUMBER -ge 12; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.11" + elif test $DISTRO_VERSION_NUMBER -ge 11; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.9" + else + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.7" + fi + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile python3-dev" + ;; pkcs11@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent softhsm" ;; @@ -1354,7 +1430,22 @@ buildRequiredPackageLists() { if test $PHP_MAJMIN_VERSION -ge 702; then buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent c-ares" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile c-ares-dev" + if test $PHP_MAJMIN_VERSION -ge 801; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent zstd-libs" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile sqlite-dev zstd-dev" + fi fi + case "${IPE_SWOOLE_WITHOUT_IOURING:-}" in + 1 | y* | Y*) ;; + *) + # iouring support in swoole 6 requires liburing 2.5+: available since Alpine 3.19 + # but with Alpine 3.19 we have a "invalid use of incomplete type 'const struct statx'" error + if test $DISTRO_MAJMIN_VERSION -ge 320; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent liburing" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile liburing-dev" + fi + ;; + esac ;; swoole@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libcurl3-gnutls libpq5" @@ -1362,9 +1453,23 @@ buildRequiredPackageLists() { if test $PHP_MAJMIN_VERSION -ge 702; then buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libc-ares2" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libc-ares-dev" + if test $PHP_MAJMIN_VERSION -ge 800; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libbrotli1" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev libbrotli-dev" + if test $PHP_MAJMIN_VERSION -ge 801; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libsqlite3-dev" + if test $DISTRO_VERSION_NUMBER -ge 11; then + # swoole 6 requires libzstd >= 1.4.0, but on debian 10 (buster) we have 1.3.8 + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libzstd[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libzstd-dev" + fi + fi + fi fi - if test $PHP_MAJMIN_VERSION -ge 800; then - buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev" + if test $DISTRO_VERSION_NUMBER -ge 13; then + # iouring support in swoole 6 requires liburing 2.5+: available since Debian Trixie (13) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent liburing2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile liburing-dev" fi ;; sybase_ct@alpine) @@ -1490,6 +1595,12 @@ buildRequiredPackageLists() { xmlrpc@debian) buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" ;; + xpass@alpine) + if ! isLibXCryptInstalled; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile linux-headers" + COMPILE_LIBS="$COMPILE_LIBS libxcrypt" + fi + ;; xsl@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libxslt" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxslt-dev libgcrypt-dev" @@ -1622,7 +1733,7 @@ expandPackagesToBeInstalled() { resetIFS ;; debian) - expandPackagesToBeInstalled_log="$(DEBIAN_FRONTEND=noninteractive apt-get install -sy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS $@ 2>&1 || printf '\nE: apt-get failed\n')" + expandPackagesToBeInstalled_log="$(apt-get install -sy --no-install-recommends $@ 2>&1 || printf '\nE: apt-get failed\n')" if test -n "$(printf '%s' "$expandPackagesToBeInstalled_log" | grep -E '^E:')"; then printf 'FAILED TO LIST THE WHOLE PACKAGE LIST FOR\n' >&2 printf '%s ' "$@" >&2 @@ -1891,7 +2002,7 @@ markPreinstalledPackagesAsUsed() { apk add $PACKAGES_PERSISTENT_PRE ;; debian) - DEBIAN_FRONTEND=noninteractive apt-mark manual $PACKAGES_PERSISTENT_PRE + apt-mark manual $PACKAGES_PERSISTENT_PRE ;; esac } @@ -1917,7 +2028,7 @@ installRequiredPackages() { done ;; debian) - DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS $PACKAGES_PERSISTENT_NEW $PACKAGES_VOLATILE + apt-get install -qqy --no-install-recommends $PACKAGES_PERSISTENT_NEW $PACKAGES_VOLATILE ;; esac } @@ -2099,12 +2210,12 @@ installMicrosoftSqlServerODBC() { fi printf -- '- installing the APT package\n' if test $PHP_MAJMIN_VERSION -le 703; then - DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS msodbcsql17 + ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends msodbcsql17 elif test $DISTRO_VERSION_NUMBER -ge 9 && test $DISTRO_VERSION_NUMBER -le 12; then # On Debian 9 to 12 we have both msodbcsql17 and msodbcsql18: let's install just one - DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS msodbcsql18 + ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends msodbcsql18 else - DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS '^msodbcsql[0-9]+$' + ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends '^msodbcsql[0-9]+$' fi ;; esac @@ -2128,17 +2239,7 @@ isLibaomInstalled() { # Install libaom installLibaom() { printf 'Installing libaom\n' - installLibaom_version=3.8.1 - case "$DISTRO_VERSION" in - debian@10) - case $(uname -m) in - aarch* | arm*) - #see https://bugs.chromium.org/p/aomedia/issues/detail?id=3543 - installLibaom_version=3.5.0 - ;; - esac - ;; - esac + installLibaom_version=3.10.0 installLibaom_dir="$(getPackageSource https://aomedia.googlesource.com/aom/+archive/v$installLibaom_version.tar.gz)" mkdir -- "$installLibaom_dir/my.build" cd -- "$installLibaom_dir/my.build" @@ -2293,6 +2394,108 @@ installLibThai() { cd - >/dev/null } +isLibTommathInstalled() { + if test -f /usr/local/lib/libtommath.a && test -f /usr/local/include/tommath.h; then + return 0 + fi + return 1 +} + +installLibTommath() { + printf 'Installing libtommath\n' + installLibTommath_src="$(getPackageSource https://github.com/libtom/libtommath/releases/download/v1.3.0/ltm-1.3.0.tar.xz)" + mkdir -p "$installLibTommath_src/build" + cd -- "$installLibTommath_src/build" + CFLAGS='-fPIC' cmake -DCMAKE_BUILD_TYPE=Release .. + make -j$(getProcessorCount) + make install + cd - >/dev/null +} + +isLibTomcryptInstalled() { + if test -f /usr/local/lib/libtomcrypt.a && test -f /usr/local/include/tomcrypt.h; then + return 0 + fi + return 1 +} + +installLibTomcrypt() { + printf 'Installing libtomcrypt\n' + installLibTomcrypt_src="$(getPackageSource https://github.com/libtom/libtomcrypt/releases/download/v1.18.2/crypt-1.18.2.tar.xz)" + cd -- "$installLibTomcrypt_src" + CFLAGS='-fPIC' make -j$(getProcessorCount) + make install +} + +isFirebirdInstalled() { + if test -f /usr/lib/libfbclient.so && test -f /usr/include/ibase.h; then + return 0 + fi + if test -d /tmp/src/firebird; then + return 0 + fi + return 1 +} + +installFirebird() { + printf 'Installing firebird\n' + if test $PHP_MAJMIN_VERSION -ge 804; then + installFirebird_src="$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/v5.0.2/Firebird-5.0.2.1613-0-source.tar.xz)" + cd -- "$installFirebird_src" + ./configure --enable-client-only + make -j$(getProcessorCount) + cp -Rd gen/Release/firebird/include/* /usr/include + cp -Rd gen/Release/firebird/lib/* /usr/lib + cd - >/dev/null + else + mv "$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/R2_5_9/Firebird-2.5.9.27139-0.tar.bz2)" /tmp/src/firebird + cd /tmp/src/firebird + # Patch rwlock.h (this has been fixed in later release of firebird 3.x) + sed -i '194s/.*/#if 0/' src/common/classes/rwlock.h + ./configure --with-system-icu + # -j option can't be used: make targets must be compiled sequentially + make -s btyacc_binary gpre_boot libfbstatic libfbclient + cp gen/firebird/lib/libfbclient.so /usr/lib/ + ln -s /usr/lib/libfbclient.so /usr/lib/libfbclient.so.2 + cd - >/dev/null + fi +} + +isLibXCryptInstalled() { + if ! test -f /usr/local/lib/libcrypt.so && ! test -f /usr/lib/libcrypt.so && ! test -f /usr/lib/x86_64*/libcrypt.so; then + return 1 + fi + return 0 +} + +installLibXCrypt() { + printf 'Installing libxcrypt\n' + installLibXCrypt_version=4.4.36 + installLibXCrypt_src="$(getPackageSource "https://github.com/besser82/libxcrypt/releases/download/v$installLibXCrypt_version/libxcrypt-$installLibXCrypt_version.tar.xz")" + cd -- "$installLibXCrypt_src" + ./configure --prefix /usr + make -j$(getProcessorCount) + make install + cd - >/dev/null +} + +isLibenchant1Installed() { + if test -f /usr/lib/libenchant.so || test -f /usr/local/lib/libenchant.so; then + return 0 + fi + return 1 +} + +installLibenchant1() { + printf 'Installing libenchant1\n' + installLibenchant1_src="$(getPackageSource https://github.com/rrthomas/enchant/releases/download/enchant-1-6-1/enchant-1.6.1.tar.gz)" + cd -- "$installLibenchant1_src" + ./configure + make -j$(getProcessorCount) + make install + cd - >/dev/null +} + # Install Composer installComposer() { installComposer_version="$(getWantedPHPModuleVersion @composer)" @@ -2342,30 +2545,41 @@ actuallyInstallComposer() { # Install ionCube Loader installIonCubeLoader() { + installIonCubeLoader_version='' + if test $PHP_MAJMIN_VERSION -lt 804; then + # For 14.4.0 we have a Segmentation Fault + installIonCubeLoader_version=14.0.0 + fi + installIonCubeLoader_versionForUrl='' + installIonCubeLoader_versionForMessage=latest + if test -n "$installIonCubeLoader_version"; then + installIonCubeLoader_versionForUrl="_$installIonCubeLoader_version" + installIonCubeLoader_versionForMessage="v$installIonCubeLoader_version" + fi # See https://www.ioncube.com/loaders.php case $PHP_BITS in 32) case $(uname -m) in aarch* | arm*) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_armv7l.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_armv7l$installIonCubeLoader_versionForUrl.tar.gz" ;; *) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86$installIonCubeLoader_versionForUrl.tar.gz" ;; esac ;; *) case $(uname -m) in aarch64 | arm64 | armv8) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_aarch64.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_aarch64$installIonCubeLoader_versionForUrl.tar.gz" ;; *) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64$installIonCubeLoader_versionForUrl.tar.gz" ;; esac ;; esac - printf 'Downloading ionCube Loader... ' + printf 'Downloading ionCube Loader (%s)... ' "$installIonCubeLoader_versionForMessage" installIonCubeLoader_dir="$(getPackageSource $installIonCubeLoader_url)" echo 'done.' installIonCubeLoader_so=$(php -r "printf('ioncube_loader_lin_%s.%s%s.so', PHP_MAJOR_VERSION, PHP_MINOR_VERSION, ZEND_THREAD_SAFE ? '_ts' : '');") @@ -2414,15 +2628,31 @@ installCargo() { if command -v cargo >/dev/null; then return fi - printf '# Installing cargo\n' - case "$DISTRO" in - alpine) - # see https://github.com/hyperledger/indy-vdr/issues/69#issuecomment-998104850 - export RUSTFLAGS='-C target-feature=-crt-static' - ;; - esac - curl https://sh.rustup.rs -sSf | sh -s -- -y -q + installCargo_cargoversion= + if ! test -f "$HOME/.cargo/env"; then + printf '# Installing cargo\n' + case "$DISTRO" in + alpine) + # see https://github.com/hyperledger/indy-vdr/issues/69#issuecomment-998104850 + export RUSTFLAGS='-C target-feature=-crt-static' + ;; + esac + curl https://sh.rustup.rs -sSf | sh -s -- -y -q + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -le 310; then + # With version 1.84.0 we have this error: + # Error relocating /root/.rustup/toolchains/stable-x86_64-unknown-linux-musl/bin/cargo: posix_spawn_file_actions_addchdir_np: symbol not found + # See https://github.com/rust-lang/rust/pull/131851#issue-2595663507 + installCargo_cargoversion=1.83.0 + fi + ;; + esac + fi . "$HOME/.cargo/env" + if test -n "$installCargo_cargoversion"; then + rustup default -- "$installCargo_cargoversion" + fi if test -z "${IPE_UNINSTALL_CARGO:-}"; then IPE_UNINSTALL_CARGO=y fi @@ -2430,14 +2660,20 @@ installCargo() { installNewRelic() { printf '# Installing newrelic\n' + # see https://docs.newrelic.com/docs/apm/agents/php-agent/getting-started/php-agent-compatibility-requirements/ + if test $PHP_MAJMIN_VERSION -le 701; then + installNewRelic_baseUrl=https://download.newrelic.com/php_agent/archive/10.21.0.11/ + else + installNewRelic_baseUrl=https://download.newrelic.com/php_agent/release/ + fi installNewRelic_search='\bnewrelic-php[0-9.]*-[0-9]+(\.[0-9]+)*-linux' case "$DISTRO" in alpine) installNewRelic_search="$installNewRelic_search-musl" ;; esac - installNewRelic_file="$(curl -sSLf -o- https://download.newrelic.com/php_agent/release/ | sed -E 's/<[^>]*>//g' | grep -Eo "$installNewRelic_search.tar.gz" | sort | head -1)" - installNewRelic_url="https://download.newrelic.com/php_agent/release/$installNewRelic_file" + installNewRelic_file="$(curl -sSLf -o- "$installNewRelic_baseUrl" | sed -E 's/<[^>]*>//g' | grep -Eo "$installNewRelic_search.tar.gz" | sort | head -1)" + installNewRelic_url="$installNewRelic_baseUrl$installNewRelic_file" installNewRelic_src="$(getPackageSource "$installNewRelic_url")" cd -- "$installNewRelic_src" NR_INSTALL_USE_CP_NOT_LN=1 NR_INSTALL_SILENT=1 ./newrelic-install install @@ -2446,6 +2682,12 @@ installNewRelic() { NR_INSTALL_USE_CP_NOT_LN=1 NR_INSTALL_SILENT=1 ./newrelic-install install_daemon ;; esac + case "${IPE_NEWRELIC_KEEPLOG:-}" in + 1 | y* | Y*) ;; + *) + rm -f /tmp/nrinstall-*.tar + ;; + esac cd - >/dev/null cat </dev/null - fi - ;; ftp) - docker-php-ext-configure ftp --with-openssl-dir=/usr + if test $PHP_MAJMIN_VERSION -ge 804; then + docker-php-ext-configure ftp --with-ftp-ssl=/usr + else + docker-php-ext-configure ftp --with-openssl-dir=/usr + fi ;; gd) if test $PHP_MAJMIN_VERSION -le 506; then @@ -2551,23 +2802,6 @@ EOF ;; esac if test $installBundledModule_tmp -eq 0; then - case "${IPE_GD_WITHOUTAVIF:-}" in - 1 | y* | Y*) ;; - *) - if ! isLibaomInstalled; then - installLibaom - fi - if ! isLibdav1dInstalled; then - installLibdav1d - fi - if ! isLibyuvInstalled; then - installLibyuv - fi - if ! isLibavifInstalled; then - installLibavif - fi - ;; - esac if isLibaomInstalled && isLibdav1dInstalled && isLibyuvInstalled && isLibavifInstalled; then installBundledModule_tmp=1 fi @@ -2592,7 +2826,7 @@ EOF debian@9) installBundledModule_tmp="$(pwd)" cd /tmp - apt-get download $IPE_APTGET_INSTALLOPTIONS libc-client2007e-dev + apt-get download libc-client2007e-dev dpkg -i --ignore-depends=libssl-dev libc-client2007e-dev* rm libc-client2007e-dev* cd "$installBundledModule_tmp" @@ -2603,19 +2837,9 @@ EOF interbase | pdo_firebird) case "$DISTRO" in alpine) - if ! test -d /tmp/src/firebird; then - mv "$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/R2_5_9/Firebird-2.5.9.27139-0.tar.bz2)" /tmp/src/firebird - cd /tmp/src/firebird - # Patch rwlock.h (this has been fixed in later release of firebird 3.x) - sed -i '194s/.*/#if 0/' src/common/classes/rwlock.h - ./configure --with-system-icu - # -j option can't be used: make targets must be compiled sequentially - make -s btyacc_binary gpre_boot libfbstatic libfbclient - cp gen/firebird/lib/libfbclient.so /usr/lib/ - ln -s /usr/lib/libfbclient.so /usr/lib/libfbclient.so.2 - cd - >/dev/null + if test $PHP_MAJMIN_VERSION -lt 804; then + 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 fi - 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 ;; esac ;; @@ -2824,7 +3048,7 @@ installRemoteModule() { installRemoteModule_distro=linux ;; esac - installRemoteModule_tmp2=$(php -r 'echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION;') + installRemoteModule_tmp2=$(php -r 'echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION . (ZEND_THREAD_SAFE ? "-zts" : "");') installRemoteModule_tmp="$(mktemp -p /tmp/src -d)" cd "$installRemoteModule_tmp" curl -sSLf --user-agent Docker https://blackfire.io/api/v1/releases/probe/php/$installRemoteModule_distro/$installRemoteModule_tmp1/$installRemoteModule_tmp2 | tar xz @@ -2852,7 +3076,7 @@ installRemoteModule() { if test $(compareVersions "$(cmake --version | head -n1 | sed -E 's/^.* //')" '3.7') -lt 0; then installRemoteModule_tmp=0.29.0 else - installRemoteModule_tmp=0.31.0 + installRemoteModule_tmp=0.31.1 fi cd "$(getPackageSource https://github.com/commonmark/cmark/archive/$installRemoteModule_tmp.tar.gz)" make -s -j$(getProcessorCount) cmake_build @@ -2882,6 +3106,16 @@ installRemoteModule() { if test $PHP_MAJMIN_VERSION -lt 700; then installRemoteModule_version=0.75.0 fi + if test -z "$installRemoteModule_version"; then + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -le 312; then + # cc is not supported due to a memcmp related bug + installRemoteModule_version=1.1.0 + fi + ;; + esac + fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" fi @@ -2919,6 +3153,13 @@ installRemoteModule() { installRemoteModule_version=alpha fi ;; + ev) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 800; then + installRemoteModule_version=1.1.5 + fi + fi + ;; event) installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 2.4.0) -ge 0; then @@ -2986,6 +3227,8 @@ installRemoteModule() { if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then installRemoteModule_version=1.1.2 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=2.1.3 fi fi case "$DISTRO" in @@ -3073,7 +3316,7 @@ installRemoteModule() { if ! test -e /usr/local/lib/libidnkit.so; then installRemoteModule_src="$(getPackageSource https://jprs.co.jp/idn/idnkit-2.3.tar.bz2)" cd -- "$installRemoteModule_src" - ./configure + CFLAGS=-Wno-incompatible-pointer-types ./configure make -j$(getProcessorCount) install cd - >/dev/null fi @@ -3108,14 +3351,14 @@ installRemoteModule() { if ! test -f /usr/local/lib/libionc.so || ! test -f /usr/local/include/ionc/ion.h; then echo 'Installing ion-c... ' installRemoteModule_src="$(mktemp -p /tmp/src -d)" - git clone -q -c advice.detachedHead=false --depth 1 --branch v1.1.2 https://github.com/amzn/ion-c.git "$installRemoteModule_src/ion" + git clone -q -c advice.detachedHead=false --depth 1 --branch v1.1.3 https://github.com/amzn/ion-c.git "$installRemoteModule_src/ion" ( cd "$installRemoteModule_src/ion" git submodule init -q git submodule update -q mkdir -p build cd build - cmake -DCMAKE_BUILD_TYPE=Release .. -Wno-dev + CFLAGS='-Wno-incompatible-pointer-types -Wno-stringop-overflow -Wno-discarded-qualifiers' cmake -DCMAKE_BUILD_TYPE=Release .. -Wno-dev make clean make -j$(getProcessorCount) install ) @@ -3267,6 +3510,8 @@ installRemoteModule() { installRemoteModule_version=1.11.1 elif test $PHP_MAJMIN_VERSION -le 703; then installRemoteModule_version=1.16.2 + elif test $PHP_MAJMIN_VERSION -le 800; then + installRemoteModule_version=1.20.1 fi fi if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 1.17.0) -ge 0; then @@ -3336,6 +3581,8 @@ installRemoteModule() { installRemoteModule_version=4.10.0 elif test $PHP_MAJMIN_VERSION -lt 801; then installRemoteModule_version=22.0.0 + elif test $PHP_MAJMIN_VERSION -lt 802; then + installRemoteModule_version=22.1.2 fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -3431,6 +3678,11 @@ installRemoteModule() { addConfigureOption enable-swoole-curl yes fi ;; + operator) + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=beta + fi + ;; parallel) if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 701; then @@ -3461,6 +3713,16 @@ installRemoteModule() { fi fi ;; + phalcon) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMINPAT_VERSION -lt 70401; then + installRemoteModule_version=4.1.2 + elif test $PHP_MAJMIN_VERSION -lt 800; then + installRemoteModule_version=5.4.0 + fi + fi + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' + ;; php_trie) if ! test -f /usr/local/include/hat-trie/include/tsl/htrie_map.h; then installRemoteModule_src="$(getPackageSource https://codeload.github.com/Tessil/hat-trie/tar.gz/v0.6.0)" @@ -3490,6 +3752,17 @@ installRemoteModule() { fi fi ;; + psr) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 506; then + installRemoteModule_version=0.5.1 + elif test $PHP_MAJMIN_VERSION -lt 700; then + installRemoteModule_version=0.6.1 + elif test $PHP_MAJMIN_VERSION -lt 703; then + installRemoteModule_version=1.1.0 + fi + fi + ;; pthreads) if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then @@ -3546,6 +3819,8 @@ installRemoteModule() { installRemoteModule_version=4.3.0 elif test $PHP_MAJMIN_VERSION -le 701; then installRemoteModule_version=5.3.7 + elif test $PHP_MAJMIN_VERSION -le 703; then + installRemoteModule_version=6.0.2 fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -3674,6 +3949,18 @@ installRemoteModule() { fi fi ;; + seaslog) + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' + ;; + smbclient) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.1.1 + elif test $PHP_MAJMIN_VERSION -le 703; then + installRemoteModule_version=1.1.2 + fi + fi + ;; snappy) if test -z "$installRemoteModule_path"; then if test -z "$installRemoteModule_version"; then @@ -3691,10 +3978,12 @@ installRemoteModule() { snuffleupagus) if test -z "$installRemoteModule_path"; then if test -z "$installRemoteModule_version"; then - if test $PHP_MAJMIN_VERSION -le 704; then + if test $PHP_MAJMIN_VERSION -le 800; then installRemoteModule_version=0.9.0 - else + elif test $PHP_MAJMIN_VERSION -le 801; then installRemoteModule_version=0.10.0 + else + installRemoteModule_version=0.11.0 fi fi installRemoteModule_src="$(getPackageSource https://codeload.github.com/jvoisin/snuffleupagus/tar.gz/v$installRemoteModule_version)" @@ -3738,7 +4027,7 @@ installRemoteModule() { spx) if test -z "$installRemoteModule_path"; then if test -z "$installRemoteModule_version"; then - installRemoteModule_version=v0.4.15 + installRemoteModule_version=v0.4.18 fi if test "${installRemoteModule_version%.*}" = "$installRemoteModule_version"; then installRemoteModule_displayVersion="$installRemoteModule_version" @@ -3811,6 +4100,21 @@ installRemoteModule() { elif test $PHP_BITS -eq 32; then # See https://github.com/swoole/swoole-src/issues/5198#issuecomment-1820162178 installRemoteModule_version="$(resolvePHPModuleVersion "$installRemoteModule_module" '^5.0')" + else + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -le 312; then + installRemoteModule_version=5.1.2 + fi + ;; + esac + fi + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 800; then + installRemoteModule_version=5.1.3 + else + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" stable)" + fi fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -3823,19 +4127,115 @@ installRemoteModule() { installRemoteModule_openssl=yes case "$DISTRO_VERSION" in alpine@3.7 | alpine@3.8) - if test -n "$installRemoteModule_version" && test $(compareVersions "$installRemoteModule_version" 4.6.0) -lt 0; then + if test $(compareVersions "$installRemoteModule_version" 4.6.0) -lt 0; then # see https://github.com/swoole/swoole-src/issues/3934 installRemoteModule_openssl=no fi ;; esac - if test $PHP_MAJMIN_VERSION -eq 803; then - # see https://github.com/swoole/docker-swoole/issues/45 - installRemoteModule_curl=no + if test $PHP_THREADSAFE -eq 1; then + installRemoteModule_zts=yes else - installRemoteModule_curl=yes + installRemoteModule_zts=no fi - if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 5.0.1) -ge 0; then + installRemoteModule_sqlite=yes + installRemoteModule_iouring=no + installRemoteModule_curl=yes + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -lt 317; then + # we need sqlite3 >= 3.7.7 + installRemoteModule_sqlite=no + fi + case "${IPE_SWOOLE_WITHOUT_IOURING:-}" in + 1 | y* | Y*) ;; + *) + # iouring support in swoole 6 requires liburing 2.5+: available since Alpine 3.19 + # but with Alpine 3.19 we have a "invalid use of incomplete type 'const struct statx'" error + if test $DISTRO_MAJMIN_VERSION -ge 320; then + installRemoteModule_iouring=yes + fi + ;; + esac + ;; + debian) + if test $PHP_MAJMIN_VERSION -ge 800; then + # see https://github.com/swoole/swoole-src/issues/5365 + installRemoteModule_curl=no + fi + if test $DISTRO_MAJMIN_VERSION -lt 1200; then + # we need sqlite3 >= 3.7.7 + installRemoteModule_sqlite=no + fi + case "${IPE_SWOOLE_WITHOUT_IOURING:-}" in + 1 | y* | Y*) ;; + *) + if test $DISTRO_VERSION_NUMBER -ge 13; then + # iouring support in swoole 6 requires liburing 2.5+: available since Debian Trixie (13) + installRemoteModule_iouring=yes + fi + ;; + esac + ;; + esac + installRemoteModule_zstd=yes + case "$DISTRO" in + debian) + if test $DISTRO_VERSION_NUMBER -lt 11; then + # swoole 6 requires libzstd >= 1.4.0, but on debian 10 (buster) we have 1.3.8 + installRemoteModule_zstd=no + fi + ;; + esac + if test $(compareVersions "$installRemoteModule_version" 6.0.0) -ge 0; then + # enable sockets support? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable curl support? + addConfigureOption enable-swoole-curl $installRemoteModule_curl + # enable cares support? + addConfigureOption enable-cares yes + # enable brotli support? + addConfigureOption enable-brotli yes + # enable zstd support? + addConfigureOption enable-zstd $installRemoteModule_zstd + # enable PostgreSQL database support? + addConfigureOption enable-swoole-pgsql yes + # enable ODBC database support? + addConfigureOption with-swoole-odbc no + # enable Oracle database support? + addConfigureOption with-swoole-oracle no + # enable Sqlite database support? + addConfigureOption enable-swoole-sqlite $installRemoteModule_sqlite + # enable swoole thread support (need php zts support)? + addConfigureOption enable-swoole-thread $installRemoteModule_zts + # enable iouring for file async support? + addConfigureOption enable-iouring $installRemoteModule_iouring + elif test $(compareVersions "$installRemoteModule_version" 5.1.0) -ge 0; then + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable curl support? + addConfigureOption enable-swoole-curl $installRemoteModule_curl + # enable cares support? + addConfigureOption enable-cares yes + # enable brotli support? + addConfigureOption enable-brotli yes + # enable PostgreSQL database support? + addConfigureOption enable-swoole-pgsql yes + # enable ODBC database support? + addConfigureOption with-swoole-odbc no + # enable Oracle database support? + addConfigureOption with-swoole-oracle no + # enable Sqlite database support? + addConfigureOption enable-swoole-sqlite $installRemoteModule_sqlite + elif test $(compareVersions "$installRemoteModule_version" 5.0.1) -ge 0; then # enable sockets supports? addConfigureOption enable-sockets $installRemoteModule_sockets # enable openssl support? @@ -4005,6 +4405,7 @@ installRemoteModule() { fi ;; tensor) + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 703; then installRemoteModule_version=2.2.3 @@ -4072,6 +4473,7 @@ installRemoteModule() { installRemoteModule_manuallyInstalled=1 ;; uopz) + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then installRemoteModule_version=2.0.7 @@ -4189,6 +4591,17 @@ installRemoteModule() { addConfigureOption enable-reader yes fi ;; + xmldiff) + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + if test -z "$installRemoteModule_version"; then + case "$DISTRO_VERSION" in + debian@8) + # The gcc version of Debian Jessie is too old => error: 'nullptr' was not declared in this scope + installRemoteModule_version=1.1.4 + ;; + esac + fi + ;; xmlrpc) if test -z "$installRemoteModule_version"; then installRemoteModule_version=beta @@ -4265,8 +4678,6 @@ installRemoteModule() { if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then installRemoteModule_version=0.5.0 - else - installRemoteModule_version=alpha fi fi installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -4521,23 +4932,18 @@ removeStringFromList() { } # Invoke apt-get update -# -# Set: -# IPE_APTGET_INSTALLOPTIONS invokeAptGetUpdate() { if test -n "${IPE_APTGETUPDATE_ALREADY:-}"; then - DEBIAN_FRONTEND=noninteractive apt-get update -q + apt-get update -q return fi - IPE_APTGET_INSTALLOPTIONS='' - invokeAptGetUpdate_fixdistro='' + IPE_APTGETUPDATE_ALREADY=y if grep -q 'VERSION="8 (jessie)"' /etc/os-release; then invokeAptGetUpdate_fixdistro=jessie elif grep -q 'VERSION="9 (stretch)"' /etc/os-release; then invokeAptGetUpdate_fixdistro=stretch else - IPE_APTGETUPDATE_ALREADY=y - DEBIAN_FRONTEND=noninteractive apt-get update -q + invokeAptGetUpdate return fi # See https://www.debian.org/distrib/archive.en.html for a list of mirrors @@ -4552,19 +4958,18 @@ invokeAptGetUpdate() { sed -ri "s;^(\s*deb\s+)http://security.debian.org/debian-security;\1$IPE_DEB_ARCHIVE_SECURITY;" /etc/apt/sources.list sed -ri "s;^(\s*deb\s+)http://security.debian.org;\1$IPE_DEB_ARCHIVE_SECURITY;" /etc/apt/sources.list invokeAptGetUpdate_tmp="$(mktemp)" - DEBIAN_FRONTEND=noninteractive apt-get update -q 2>"$invokeAptGetUpdate_tmp" + apt-get update -q 2>"$invokeAptGetUpdate_tmp" if test -s "$invokeAptGetUpdate_tmp"; then cat "$invokeAptGetUpdate_tmp" >&2 if grep -qE ' KEYEXPIRED [0-9]' "$invokeAptGetUpdate_tmp"; then - IPE_APTGET_INSTALLOPTIONS='-o APT::Get::AllowUnauthenticated=true' echo '############' >&2 echo '# WARNING! #' >&2 echo '############' >&2 echo 'apt packages will be installed without checking authenticity!' >&2 + printf 'APT::Get::AllowUnauthenticated "true";\n' >>/etc/apt/apt.conf.d/99unauthenticated fi fi rm "$invokeAptGetUpdate_tmp" - IPE_APTGETUPDATE_ALREADY=y } # Fix the Let's Encrypt CA certificates on old distros @@ -4595,7 +5000,7 @@ fixLetsEncrypt() { invokeAptGetUpdate fi printf -- '- installing newer ca-certificates package\n' - DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends ${IPE_APTGET_INSTALLOPTIONS:-} ca-certificates + apt-get install -qqy --no-install-recommends ca-certificates fi ;; *) @@ -4616,8 +5021,12 @@ fixLetsEncrypt() { # Cleanup everything at the end of the execution cleanup() { if test "${IPE_UNINSTALL_CARGO:-}" = y; then - . "$HOME/.cargo/env" - rustup self uninstall -y + if test -f "$HOME/.cargo/env"; then + . "$HOME/.cargo/env" + fi + if command -v rustup >/dev/null; then + rustup self uninstall -y + fi fi if test -n "$UNNEEDED_PACKAGE_LINKS"; then printf '### REMOVING UNNEEDED PACKAGE LINKS ###\n' @@ -4640,11 +5049,11 @@ cleanup() { debian) if test -n "$PACKAGES_VOLATILE"; then printf '### REMOVING UNNEEDED PACKAGES ###\n' - DEBIAN_FRONTEND=noninteractive apt-get remove --purge -y $PACKAGES_VOLATILE + apt-get remove --purge -y $PACKAGES_VOLATILE fi if test -n "$PACKAGES_PREVIOUS"; then printf '### RESTORING PREVIOUSLY INSTALLED PACKAGES ###\n' - DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends --no-upgrade $IPE_APTGET_INSTALLOPTIONS $PACKAGES_PREVIOUS + apt-get install -qqy --no-install-recommends --no-upgrade $PACKAGES_PREVIOUS fi ;; esac @@ -4669,6 +5078,8 @@ cleanup() { esac } +DEBIAN_FRONTEND=noninteractive +export DEBIAN_FRONTEND resetIFS mkdir -p /tmp/src mkdir -p /tmp/pickle.tmp @@ -4684,7 +5095,7 @@ esac setPHPVersionVariables setPHPPreinstalledModules case "$PHP_MAJMIN_VERSION" in - 505 | 506 | 700 | 701 | 702 | 703 | 704 | 800 | 801 | 802 | 803) ;; + 505 | 506 | 700 | 701 | 702 | 703 | 704 | 800 | 801 | 802 | 803 | 804) ;; *) printf "### ERROR: Unsupported PHP version: %s.%s ###\n" $((PHP_MAJMIN_VERSION / 100)) $((PHP_MAJMIN_VERSION % 100)) ;; @@ -4721,6 +5132,8 @@ if test $USE_PICKLE -gt 1; then buildPickle fi +compileLibs + for PHP_MODULE_TO_INSTALL in $PHP_MODULES_TO_INSTALL; do case "$PHP_MODULE_TO_INSTALL" in @fix_letsencrypt) diff --git a/php7/7.2.34/build/php/extensions/install-php-extensions b/php7/7.2.34/build/php/extensions/install-php-extensions index 59a1ea8b2..2ef98bb85 100644 --- a/php7/7.2.34/build/php/extensions/install-php-extensions +++ b/php7/7.2.34/build/php/extensions/install-php-extensions @@ -21,7 +21,7 @@ if ! which docker-php-ext-configure >/dev/null || ! which docker-php-ext-enable exit 1 fi -IPE_VERSION=2.2.14 +IPE_VERSION=2.7.27 StandWithUkraine() { if test -t 1 && ! grep -Eq '^VERSION=.*jessie' /etc/os-release; then @@ -273,6 +273,15 @@ EOT # 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 @@ -597,6 +606,10 @@ sortModulesToInstall() { 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")" @@ -662,9 +675,11 @@ expandASpellDictionaries() { # 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 @@ -781,8 +796,11 @@ buildRequiredPackageLists() { buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile enchant2-dev" else # The system provides libenchant2, supported since PHP 8.0: we need to build libenchant1 on our own - buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent glib aspell-libs libhunspell" - buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile glib-dev aspell-dev hunspell-dev" + 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" @@ -795,9 +813,12 @@ buildRequiredPackageLists() { buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libenchant-2-2" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libenchant-2-dev" else - # 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" + 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" @@ -844,6 +865,18 @@ buildRequiredPackageLists() { 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" ;; @@ -869,6 +902,18 @@ buildRequiredPackageLists() { 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 @@ -952,7 +997,7 @@ buildRequiredPackageLists() { 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$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libicu-dev ^libidn2-[0-9+]-dev$ ^libgcrypt[0-9]+-dev$" fi ;; imagick@alpine) @@ -984,6 +1029,9 @@ buildRequiredPackageLists() { ;; interbase@alpine) buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev ncurses-dev" + if ! isFirebirdInstalled; then + COMPILE_LIBS="$COMPILE_LIBS firebird" + fi ;; interbase@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libfbclient2" @@ -1159,6 +1207,20 @@ buildRequiredPackageLists() { ;; pdo_firebird@alpine) buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev ncurses-dev" + if ! isFirebirdInstalled; then + COMPILE_LIBS="$COMPILE_LIBS firebird" + if test $PHP_MAJMIN_VERSION -ge 804; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib-dev" + if ! isLibTommathInstalled; then + COMPILE_LIBS="$COMPILE_LIBS libtommath" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake" + fi + if ! isLibTomcryptInstalled; then + COMPILE_LIBS="$COMPILE_LIBS libtomcrypt" + fi + fi + fi ;; pdo_firebird@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libfbclient2" @@ -1175,6 +1237,20 @@ buildRequiredPackageLists() { php_trie@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" ;; + phpy@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent python3" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile python3-dev" + ;; + phpy@debian) + if test $DISTRO_VERSION_NUMBER -ge 12; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.11" + elif test $DISTRO_VERSION_NUMBER -ge 11; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.9" + else + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.7" + fi + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile python3-dev" + ;; pkcs11@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent softhsm" ;; @@ -1354,7 +1430,22 @@ buildRequiredPackageLists() { if test $PHP_MAJMIN_VERSION -ge 702; then buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent c-ares" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile c-ares-dev" + if test $PHP_MAJMIN_VERSION -ge 801; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent zstd-libs" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile sqlite-dev zstd-dev" + fi fi + case "${IPE_SWOOLE_WITHOUT_IOURING:-}" in + 1 | y* | Y*) ;; + *) + # iouring support in swoole 6 requires liburing 2.5+: available since Alpine 3.19 + # but with Alpine 3.19 we have a "invalid use of incomplete type 'const struct statx'" error + if test $DISTRO_MAJMIN_VERSION -ge 320; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent liburing" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile liburing-dev" + fi + ;; + esac ;; swoole@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libcurl3-gnutls libpq5" @@ -1362,9 +1453,23 @@ buildRequiredPackageLists() { if test $PHP_MAJMIN_VERSION -ge 702; then buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libc-ares2" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libc-ares-dev" + if test $PHP_MAJMIN_VERSION -ge 800; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libbrotli1" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev libbrotli-dev" + if test $PHP_MAJMIN_VERSION -ge 801; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libsqlite3-dev" + if test $DISTRO_VERSION_NUMBER -ge 11; then + # swoole 6 requires libzstd >= 1.4.0, but on debian 10 (buster) we have 1.3.8 + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libzstd[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libzstd-dev" + fi + fi + fi fi - if test $PHP_MAJMIN_VERSION -ge 800; then - buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev" + if test $DISTRO_VERSION_NUMBER -ge 13; then + # iouring support in swoole 6 requires liburing 2.5+: available since Debian Trixie (13) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent liburing2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile liburing-dev" fi ;; sybase_ct@alpine) @@ -1490,6 +1595,12 @@ buildRequiredPackageLists() { xmlrpc@debian) buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" ;; + xpass@alpine) + if ! isLibXCryptInstalled; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile linux-headers" + COMPILE_LIBS="$COMPILE_LIBS libxcrypt" + fi + ;; xsl@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libxslt" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxslt-dev libgcrypt-dev" @@ -1622,7 +1733,7 @@ expandPackagesToBeInstalled() { resetIFS ;; debian) - expandPackagesToBeInstalled_log="$(DEBIAN_FRONTEND=noninteractive apt-get install -sy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS $@ 2>&1 || printf '\nE: apt-get failed\n')" + expandPackagesToBeInstalled_log="$(apt-get install -sy --no-install-recommends $@ 2>&1 || printf '\nE: apt-get failed\n')" if test -n "$(printf '%s' "$expandPackagesToBeInstalled_log" | grep -E '^E:')"; then printf 'FAILED TO LIST THE WHOLE PACKAGE LIST FOR\n' >&2 printf '%s ' "$@" >&2 @@ -1891,7 +2002,7 @@ markPreinstalledPackagesAsUsed() { apk add $PACKAGES_PERSISTENT_PRE ;; debian) - DEBIAN_FRONTEND=noninteractive apt-mark manual $PACKAGES_PERSISTENT_PRE + apt-mark manual $PACKAGES_PERSISTENT_PRE ;; esac } @@ -1917,7 +2028,7 @@ installRequiredPackages() { done ;; debian) - DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS $PACKAGES_PERSISTENT_NEW $PACKAGES_VOLATILE + apt-get install -qqy --no-install-recommends $PACKAGES_PERSISTENT_NEW $PACKAGES_VOLATILE ;; esac } @@ -2099,12 +2210,12 @@ installMicrosoftSqlServerODBC() { fi printf -- '- installing the APT package\n' if test $PHP_MAJMIN_VERSION -le 703; then - DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS msodbcsql17 + ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends msodbcsql17 elif test $DISTRO_VERSION_NUMBER -ge 9 && test $DISTRO_VERSION_NUMBER -le 12; then # On Debian 9 to 12 we have both msodbcsql17 and msodbcsql18: let's install just one - DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS msodbcsql18 + ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends msodbcsql18 else - DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS '^msodbcsql[0-9]+$' + ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends '^msodbcsql[0-9]+$' fi ;; esac @@ -2128,17 +2239,7 @@ isLibaomInstalled() { # Install libaom installLibaom() { printf 'Installing libaom\n' - installLibaom_version=3.8.1 - case "$DISTRO_VERSION" in - debian@10) - case $(uname -m) in - aarch* | arm*) - #see https://bugs.chromium.org/p/aomedia/issues/detail?id=3543 - installLibaom_version=3.5.0 - ;; - esac - ;; - esac + installLibaom_version=3.10.0 installLibaom_dir="$(getPackageSource https://aomedia.googlesource.com/aom/+archive/v$installLibaom_version.tar.gz)" mkdir -- "$installLibaom_dir/my.build" cd -- "$installLibaom_dir/my.build" @@ -2293,6 +2394,108 @@ installLibThai() { cd - >/dev/null } +isLibTommathInstalled() { + if test -f /usr/local/lib/libtommath.a && test -f /usr/local/include/tommath.h; then + return 0 + fi + return 1 +} + +installLibTommath() { + printf 'Installing libtommath\n' + installLibTommath_src="$(getPackageSource https://github.com/libtom/libtommath/releases/download/v1.3.0/ltm-1.3.0.tar.xz)" + mkdir -p "$installLibTommath_src/build" + cd -- "$installLibTommath_src/build" + CFLAGS='-fPIC' cmake -DCMAKE_BUILD_TYPE=Release .. + make -j$(getProcessorCount) + make install + cd - >/dev/null +} + +isLibTomcryptInstalled() { + if test -f /usr/local/lib/libtomcrypt.a && test -f /usr/local/include/tomcrypt.h; then + return 0 + fi + return 1 +} + +installLibTomcrypt() { + printf 'Installing libtomcrypt\n' + installLibTomcrypt_src="$(getPackageSource https://github.com/libtom/libtomcrypt/releases/download/v1.18.2/crypt-1.18.2.tar.xz)" + cd -- "$installLibTomcrypt_src" + CFLAGS='-fPIC' make -j$(getProcessorCount) + make install +} + +isFirebirdInstalled() { + if test -f /usr/lib/libfbclient.so && test -f /usr/include/ibase.h; then + return 0 + fi + if test -d /tmp/src/firebird; then + return 0 + fi + return 1 +} + +installFirebird() { + printf 'Installing firebird\n' + if test $PHP_MAJMIN_VERSION -ge 804; then + installFirebird_src="$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/v5.0.2/Firebird-5.0.2.1613-0-source.tar.xz)" + cd -- "$installFirebird_src" + ./configure --enable-client-only + make -j$(getProcessorCount) + cp -Rd gen/Release/firebird/include/* /usr/include + cp -Rd gen/Release/firebird/lib/* /usr/lib + cd - >/dev/null + else + mv "$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/R2_5_9/Firebird-2.5.9.27139-0.tar.bz2)" /tmp/src/firebird + cd /tmp/src/firebird + # Patch rwlock.h (this has been fixed in later release of firebird 3.x) + sed -i '194s/.*/#if 0/' src/common/classes/rwlock.h + ./configure --with-system-icu + # -j option can't be used: make targets must be compiled sequentially + make -s btyacc_binary gpre_boot libfbstatic libfbclient + cp gen/firebird/lib/libfbclient.so /usr/lib/ + ln -s /usr/lib/libfbclient.so /usr/lib/libfbclient.so.2 + cd - >/dev/null + fi +} + +isLibXCryptInstalled() { + if ! test -f /usr/local/lib/libcrypt.so && ! test -f /usr/lib/libcrypt.so && ! test -f /usr/lib/x86_64*/libcrypt.so; then + return 1 + fi + return 0 +} + +installLibXCrypt() { + printf 'Installing libxcrypt\n' + installLibXCrypt_version=4.4.36 + installLibXCrypt_src="$(getPackageSource "https://github.com/besser82/libxcrypt/releases/download/v$installLibXCrypt_version/libxcrypt-$installLibXCrypt_version.tar.xz")" + cd -- "$installLibXCrypt_src" + ./configure --prefix /usr + make -j$(getProcessorCount) + make install + cd - >/dev/null +} + +isLibenchant1Installed() { + if test -f /usr/lib/libenchant.so || test -f /usr/local/lib/libenchant.so; then + return 0 + fi + return 1 +} + +installLibenchant1() { + printf 'Installing libenchant1\n' + installLibenchant1_src="$(getPackageSource https://github.com/rrthomas/enchant/releases/download/enchant-1-6-1/enchant-1.6.1.tar.gz)" + cd -- "$installLibenchant1_src" + ./configure + make -j$(getProcessorCount) + make install + cd - >/dev/null +} + # Install Composer installComposer() { installComposer_version="$(getWantedPHPModuleVersion @composer)" @@ -2342,30 +2545,41 @@ actuallyInstallComposer() { # Install ionCube Loader installIonCubeLoader() { + installIonCubeLoader_version='' + if test $PHP_MAJMIN_VERSION -lt 804; then + # For 14.4.0 we have a Segmentation Fault + installIonCubeLoader_version=14.0.0 + fi + installIonCubeLoader_versionForUrl='' + installIonCubeLoader_versionForMessage=latest + if test -n "$installIonCubeLoader_version"; then + installIonCubeLoader_versionForUrl="_$installIonCubeLoader_version" + installIonCubeLoader_versionForMessage="v$installIonCubeLoader_version" + fi # See https://www.ioncube.com/loaders.php case $PHP_BITS in 32) case $(uname -m) in aarch* | arm*) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_armv7l.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_armv7l$installIonCubeLoader_versionForUrl.tar.gz" ;; *) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86$installIonCubeLoader_versionForUrl.tar.gz" ;; esac ;; *) case $(uname -m) in aarch64 | arm64 | armv8) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_aarch64.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_aarch64$installIonCubeLoader_versionForUrl.tar.gz" ;; *) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64$installIonCubeLoader_versionForUrl.tar.gz" ;; esac ;; esac - printf 'Downloading ionCube Loader... ' + printf 'Downloading ionCube Loader (%s)... ' "$installIonCubeLoader_versionForMessage" installIonCubeLoader_dir="$(getPackageSource $installIonCubeLoader_url)" echo 'done.' installIonCubeLoader_so=$(php -r "printf('ioncube_loader_lin_%s.%s%s.so', PHP_MAJOR_VERSION, PHP_MINOR_VERSION, ZEND_THREAD_SAFE ? '_ts' : '');") @@ -2414,15 +2628,31 @@ installCargo() { if command -v cargo >/dev/null; then return fi - printf '# Installing cargo\n' - case "$DISTRO" in - alpine) - # see https://github.com/hyperledger/indy-vdr/issues/69#issuecomment-998104850 - export RUSTFLAGS='-C target-feature=-crt-static' - ;; - esac - curl https://sh.rustup.rs -sSf | sh -s -- -y -q + installCargo_cargoversion= + if ! test -f "$HOME/.cargo/env"; then + printf '# Installing cargo\n' + case "$DISTRO" in + alpine) + # see https://github.com/hyperledger/indy-vdr/issues/69#issuecomment-998104850 + export RUSTFLAGS='-C target-feature=-crt-static' + ;; + esac + curl https://sh.rustup.rs -sSf | sh -s -- -y -q + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -le 310; then + # With version 1.84.0 we have this error: + # Error relocating /root/.rustup/toolchains/stable-x86_64-unknown-linux-musl/bin/cargo: posix_spawn_file_actions_addchdir_np: symbol not found + # See https://github.com/rust-lang/rust/pull/131851#issue-2595663507 + installCargo_cargoversion=1.83.0 + fi + ;; + esac + fi . "$HOME/.cargo/env" + if test -n "$installCargo_cargoversion"; then + rustup default -- "$installCargo_cargoversion" + fi if test -z "${IPE_UNINSTALL_CARGO:-}"; then IPE_UNINSTALL_CARGO=y fi @@ -2430,14 +2660,20 @@ installCargo() { installNewRelic() { printf '# Installing newrelic\n' + # see https://docs.newrelic.com/docs/apm/agents/php-agent/getting-started/php-agent-compatibility-requirements/ + if test $PHP_MAJMIN_VERSION -le 701; then + installNewRelic_baseUrl=https://download.newrelic.com/php_agent/archive/10.21.0.11/ + else + installNewRelic_baseUrl=https://download.newrelic.com/php_agent/release/ + fi installNewRelic_search='\bnewrelic-php[0-9.]*-[0-9]+(\.[0-9]+)*-linux' case "$DISTRO" in alpine) installNewRelic_search="$installNewRelic_search-musl" ;; esac - installNewRelic_file="$(curl -sSLf -o- https://download.newrelic.com/php_agent/release/ | sed -E 's/<[^>]*>//g' | grep -Eo "$installNewRelic_search.tar.gz" | sort | head -1)" - installNewRelic_url="https://download.newrelic.com/php_agent/release/$installNewRelic_file" + installNewRelic_file="$(curl -sSLf -o- "$installNewRelic_baseUrl" | sed -E 's/<[^>]*>//g' | grep -Eo "$installNewRelic_search.tar.gz" | sort | head -1)" + installNewRelic_url="$installNewRelic_baseUrl$installNewRelic_file" installNewRelic_src="$(getPackageSource "$installNewRelic_url")" cd -- "$installNewRelic_src" NR_INSTALL_USE_CP_NOT_LN=1 NR_INSTALL_SILENT=1 ./newrelic-install install @@ -2446,6 +2682,12 @@ installNewRelic() { NR_INSTALL_USE_CP_NOT_LN=1 NR_INSTALL_SILENT=1 ./newrelic-install install_daemon ;; esac + case "${IPE_NEWRELIC_KEEPLOG:-}" in + 1 | y* | Y*) ;; + *) + rm -f /tmp/nrinstall-*.tar + ;; + esac cd - >/dev/null cat </dev/null - fi - ;; ftp) - docker-php-ext-configure ftp --with-openssl-dir=/usr + if test $PHP_MAJMIN_VERSION -ge 804; then + docker-php-ext-configure ftp --with-ftp-ssl=/usr + else + docker-php-ext-configure ftp --with-openssl-dir=/usr + fi ;; gd) if test $PHP_MAJMIN_VERSION -le 506; then @@ -2551,23 +2802,6 @@ EOF ;; esac if test $installBundledModule_tmp -eq 0; then - case "${IPE_GD_WITHOUTAVIF:-}" in - 1 | y* | Y*) ;; - *) - if ! isLibaomInstalled; then - installLibaom - fi - if ! isLibdav1dInstalled; then - installLibdav1d - fi - if ! isLibyuvInstalled; then - installLibyuv - fi - if ! isLibavifInstalled; then - installLibavif - fi - ;; - esac if isLibaomInstalled && isLibdav1dInstalled && isLibyuvInstalled && isLibavifInstalled; then installBundledModule_tmp=1 fi @@ -2592,7 +2826,7 @@ EOF debian@9) installBundledModule_tmp="$(pwd)" cd /tmp - apt-get download $IPE_APTGET_INSTALLOPTIONS libc-client2007e-dev + apt-get download libc-client2007e-dev dpkg -i --ignore-depends=libssl-dev libc-client2007e-dev* rm libc-client2007e-dev* cd "$installBundledModule_tmp" @@ -2603,19 +2837,9 @@ EOF interbase | pdo_firebird) case "$DISTRO" in alpine) - if ! test -d /tmp/src/firebird; then - mv "$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/R2_5_9/Firebird-2.5.9.27139-0.tar.bz2)" /tmp/src/firebird - cd /tmp/src/firebird - # Patch rwlock.h (this has been fixed in later release of firebird 3.x) - sed -i '194s/.*/#if 0/' src/common/classes/rwlock.h - ./configure --with-system-icu - # -j option can't be used: make targets must be compiled sequentially - make -s btyacc_binary gpre_boot libfbstatic libfbclient - cp gen/firebird/lib/libfbclient.so /usr/lib/ - ln -s /usr/lib/libfbclient.so /usr/lib/libfbclient.so.2 - cd - >/dev/null + if test $PHP_MAJMIN_VERSION -lt 804; then + 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 fi - 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 ;; esac ;; @@ -2824,7 +3048,7 @@ installRemoteModule() { installRemoteModule_distro=linux ;; esac - installRemoteModule_tmp2=$(php -r 'echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION;') + installRemoteModule_tmp2=$(php -r 'echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION . (ZEND_THREAD_SAFE ? "-zts" : "");') installRemoteModule_tmp="$(mktemp -p /tmp/src -d)" cd "$installRemoteModule_tmp" curl -sSLf --user-agent Docker https://blackfire.io/api/v1/releases/probe/php/$installRemoteModule_distro/$installRemoteModule_tmp1/$installRemoteModule_tmp2 | tar xz @@ -2852,7 +3076,7 @@ installRemoteModule() { if test $(compareVersions "$(cmake --version | head -n1 | sed -E 's/^.* //')" '3.7') -lt 0; then installRemoteModule_tmp=0.29.0 else - installRemoteModule_tmp=0.31.0 + installRemoteModule_tmp=0.31.1 fi cd "$(getPackageSource https://github.com/commonmark/cmark/archive/$installRemoteModule_tmp.tar.gz)" make -s -j$(getProcessorCount) cmake_build @@ -2882,6 +3106,16 @@ installRemoteModule() { if test $PHP_MAJMIN_VERSION -lt 700; then installRemoteModule_version=0.75.0 fi + if test -z "$installRemoteModule_version"; then + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -le 312; then + # cc is not supported due to a memcmp related bug + installRemoteModule_version=1.1.0 + fi + ;; + esac + fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" fi @@ -2919,6 +3153,13 @@ installRemoteModule() { installRemoteModule_version=alpha fi ;; + ev) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 800; then + installRemoteModule_version=1.1.5 + fi + fi + ;; event) installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 2.4.0) -ge 0; then @@ -2986,6 +3227,8 @@ installRemoteModule() { if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then installRemoteModule_version=1.1.2 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=2.1.3 fi fi case "$DISTRO" in @@ -3073,7 +3316,7 @@ installRemoteModule() { if ! test -e /usr/local/lib/libidnkit.so; then installRemoteModule_src="$(getPackageSource https://jprs.co.jp/idn/idnkit-2.3.tar.bz2)" cd -- "$installRemoteModule_src" - ./configure + CFLAGS=-Wno-incompatible-pointer-types ./configure make -j$(getProcessorCount) install cd - >/dev/null fi @@ -3108,14 +3351,14 @@ installRemoteModule() { if ! test -f /usr/local/lib/libionc.so || ! test -f /usr/local/include/ionc/ion.h; then echo 'Installing ion-c... ' installRemoteModule_src="$(mktemp -p /tmp/src -d)" - git clone -q -c advice.detachedHead=false --depth 1 --branch v1.1.2 https://github.com/amzn/ion-c.git "$installRemoteModule_src/ion" + git clone -q -c advice.detachedHead=false --depth 1 --branch v1.1.3 https://github.com/amzn/ion-c.git "$installRemoteModule_src/ion" ( cd "$installRemoteModule_src/ion" git submodule init -q git submodule update -q mkdir -p build cd build - cmake -DCMAKE_BUILD_TYPE=Release .. -Wno-dev + CFLAGS='-Wno-incompatible-pointer-types -Wno-stringop-overflow -Wno-discarded-qualifiers' cmake -DCMAKE_BUILD_TYPE=Release .. -Wno-dev make clean make -j$(getProcessorCount) install ) @@ -3267,6 +3510,8 @@ installRemoteModule() { installRemoteModule_version=1.11.1 elif test $PHP_MAJMIN_VERSION -le 703; then installRemoteModule_version=1.16.2 + elif test $PHP_MAJMIN_VERSION -le 800; then + installRemoteModule_version=1.20.1 fi fi if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 1.17.0) -ge 0; then @@ -3336,6 +3581,8 @@ installRemoteModule() { installRemoteModule_version=4.10.0 elif test $PHP_MAJMIN_VERSION -lt 801; then installRemoteModule_version=22.0.0 + elif test $PHP_MAJMIN_VERSION -lt 802; then + installRemoteModule_version=22.1.2 fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -3431,6 +3678,11 @@ installRemoteModule() { addConfigureOption enable-swoole-curl yes fi ;; + operator) + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=beta + fi + ;; parallel) if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 701; then @@ -3461,6 +3713,16 @@ installRemoteModule() { fi fi ;; + phalcon) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMINPAT_VERSION -lt 70401; then + installRemoteModule_version=4.1.2 + elif test $PHP_MAJMIN_VERSION -lt 800; then + installRemoteModule_version=5.4.0 + fi + fi + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' + ;; php_trie) if ! test -f /usr/local/include/hat-trie/include/tsl/htrie_map.h; then installRemoteModule_src="$(getPackageSource https://codeload.github.com/Tessil/hat-trie/tar.gz/v0.6.0)" @@ -3490,6 +3752,17 @@ installRemoteModule() { fi fi ;; + psr) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 506; then + installRemoteModule_version=0.5.1 + elif test $PHP_MAJMIN_VERSION -lt 700; then + installRemoteModule_version=0.6.1 + elif test $PHP_MAJMIN_VERSION -lt 703; then + installRemoteModule_version=1.1.0 + fi + fi + ;; pthreads) if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then @@ -3546,6 +3819,8 @@ installRemoteModule() { installRemoteModule_version=4.3.0 elif test $PHP_MAJMIN_VERSION -le 701; then installRemoteModule_version=5.3.7 + elif test $PHP_MAJMIN_VERSION -le 703; then + installRemoteModule_version=6.0.2 fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -3674,6 +3949,18 @@ installRemoteModule() { fi fi ;; + seaslog) + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' + ;; + smbclient) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.1.1 + elif test $PHP_MAJMIN_VERSION -le 703; then + installRemoteModule_version=1.1.2 + fi + fi + ;; snappy) if test -z "$installRemoteModule_path"; then if test -z "$installRemoteModule_version"; then @@ -3691,10 +3978,12 @@ installRemoteModule() { snuffleupagus) if test -z "$installRemoteModule_path"; then if test -z "$installRemoteModule_version"; then - if test $PHP_MAJMIN_VERSION -le 704; then + if test $PHP_MAJMIN_VERSION -le 800; then installRemoteModule_version=0.9.0 - else + elif test $PHP_MAJMIN_VERSION -le 801; then installRemoteModule_version=0.10.0 + else + installRemoteModule_version=0.11.0 fi fi installRemoteModule_src="$(getPackageSource https://codeload.github.com/jvoisin/snuffleupagus/tar.gz/v$installRemoteModule_version)" @@ -3738,7 +4027,7 @@ installRemoteModule() { spx) if test -z "$installRemoteModule_path"; then if test -z "$installRemoteModule_version"; then - installRemoteModule_version=v0.4.15 + installRemoteModule_version=v0.4.18 fi if test "${installRemoteModule_version%.*}" = "$installRemoteModule_version"; then installRemoteModule_displayVersion="$installRemoteModule_version" @@ -3811,6 +4100,21 @@ installRemoteModule() { elif test $PHP_BITS -eq 32; then # See https://github.com/swoole/swoole-src/issues/5198#issuecomment-1820162178 installRemoteModule_version="$(resolvePHPModuleVersion "$installRemoteModule_module" '^5.0')" + else + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -le 312; then + installRemoteModule_version=5.1.2 + fi + ;; + esac + fi + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 800; then + installRemoteModule_version=5.1.3 + else + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" stable)" + fi fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -3823,19 +4127,115 @@ installRemoteModule() { installRemoteModule_openssl=yes case "$DISTRO_VERSION" in alpine@3.7 | alpine@3.8) - if test -n "$installRemoteModule_version" && test $(compareVersions "$installRemoteModule_version" 4.6.0) -lt 0; then + if test $(compareVersions "$installRemoteModule_version" 4.6.0) -lt 0; then # see https://github.com/swoole/swoole-src/issues/3934 installRemoteModule_openssl=no fi ;; esac - if test $PHP_MAJMIN_VERSION -eq 803; then - # see https://github.com/swoole/docker-swoole/issues/45 - installRemoteModule_curl=no + if test $PHP_THREADSAFE -eq 1; then + installRemoteModule_zts=yes else - installRemoteModule_curl=yes + installRemoteModule_zts=no fi - if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 5.0.1) -ge 0; then + installRemoteModule_sqlite=yes + installRemoteModule_iouring=no + installRemoteModule_curl=yes + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -lt 317; then + # we need sqlite3 >= 3.7.7 + installRemoteModule_sqlite=no + fi + case "${IPE_SWOOLE_WITHOUT_IOURING:-}" in + 1 | y* | Y*) ;; + *) + # iouring support in swoole 6 requires liburing 2.5+: available since Alpine 3.19 + # but with Alpine 3.19 we have a "invalid use of incomplete type 'const struct statx'" error + if test $DISTRO_MAJMIN_VERSION -ge 320; then + installRemoteModule_iouring=yes + fi + ;; + esac + ;; + debian) + if test $PHP_MAJMIN_VERSION -ge 800; then + # see https://github.com/swoole/swoole-src/issues/5365 + installRemoteModule_curl=no + fi + if test $DISTRO_MAJMIN_VERSION -lt 1200; then + # we need sqlite3 >= 3.7.7 + installRemoteModule_sqlite=no + fi + case "${IPE_SWOOLE_WITHOUT_IOURING:-}" in + 1 | y* | Y*) ;; + *) + if test $DISTRO_VERSION_NUMBER -ge 13; then + # iouring support in swoole 6 requires liburing 2.5+: available since Debian Trixie (13) + installRemoteModule_iouring=yes + fi + ;; + esac + ;; + esac + installRemoteModule_zstd=yes + case "$DISTRO" in + debian) + if test $DISTRO_VERSION_NUMBER -lt 11; then + # swoole 6 requires libzstd >= 1.4.0, but on debian 10 (buster) we have 1.3.8 + installRemoteModule_zstd=no + fi + ;; + esac + if test $(compareVersions "$installRemoteModule_version" 6.0.0) -ge 0; then + # enable sockets support? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable curl support? + addConfigureOption enable-swoole-curl $installRemoteModule_curl + # enable cares support? + addConfigureOption enable-cares yes + # enable brotli support? + addConfigureOption enable-brotli yes + # enable zstd support? + addConfigureOption enable-zstd $installRemoteModule_zstd + # enable PostgreSQL database support? + addConfigureOption enable-swoole-pgsql yes + # enable ODBC database support? + addConfigureOption with-swoole-odbc no + # enable Oracle database support? + addConfigureOption with-swoole-oracle no + # enable Sqlite database support? + addConfigureOption enable-swoole-sqlite $installRemoteModule_sqlite + # enable swoole thread support (need php zts support)? + addConfigureOption enable-swoole-thread $installRemoteModule_zts + # enable iouring for file async support? + addConfigureOption enable-iouring $installRemoteModule_iouring + elif test $(compareVersions "$installRemoteModule_version" 5.1.0) -ge 0; then + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable curl support? + addConfigureOption enable-swoole-curl $installRemoteModule_curl + # enable cares support? + addConfigureOption enable-cares yes + # enable brotli support? + addConfigureOption enable-brotli yes + # enable PostgreSQL database support? + addConfigureOption enable-swoole-pgsql yes + # enable ODBC database support? + addConfigureOption with-swoole-odbc no + # enable Oracle database support? + addConfigureOption with-swoole-oracle no + # enable Sqlite database support? + addConfigureOption enable-swoole-sqlite $installRemoteModule_sqlite + elif test $(compareVersions "$installRemoteModule_version" 5.0.1) -ge 0; then # enable sockets supports? addConfigureOption enable-sockets $installRemoteModule_sockets # enable openssl support? @@ -4005,6 +4405,7 @@ installRemoteModule() { fi ;; tensor) + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 703; then installRemoteModule_version=2.2.3 @@ -4072,6 +4473,7 @@ installRemoteModule() { installRemoteModule_manuallyInstalled=1 ;; uopz) + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then installRemoteModule_version=2.0.7 @@ -4189,6 +4591,17 @@ installRemoteModule() { addConfigureOption enable-reader yes fi ;; + xmldiff) + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + if test -z "$installRemoteModule_version"; then + case "$DISTRO_VERSION" in + debian@8) + # The gcc version of Debian Jessie is too old => error: 'nullptr' was not declared in this scope + installRemoteModule_version=1.1.4 + ;; + esac + fi + ;; xmlrpc) if test -z "$installRemoteModule_version"; then installRemoteModule_version=beta @@ -4265,8 +4678,6 @@ installRemoteModule() { if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then installRemoteModule_version=0.5.0 - else - installRemoteModule_version=alpha fi fi installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -4521,23 +4932,18 @@ removeStringFromList() { } # Invoke apt-get update -# -# Set: -# IPE_APTGET_INSTALLOPTIONS invokeAptGetUpdate() { if test -n "${IPE_APTGETUPDATE_ALREADY:-}"; then - DEBIAN_FRONTEND=noninteractive apt-get update -q + apt-get update -q return fi - IPE_APTGET_INSTALLOPTIONS='' - invokeAptGetUpdate_fixdistro='' + IPE_APTGETUPDATE_ALREADY=y if grep -q 'VERSION="8 (jessie)"' /etc/os-release; then invokeAptGetUpdate_fixdistro=jessie elif grep -q 'VERSION="9 (stretch)"' /etc/os-release; then invokeAptGetUpdate_fixdistro=stretch else - IPE_APTGETUPDATE_ALREADY=y - DEBIAN_FRONTEND=noninteractive apt-get update -q + invokeAptGetUpdate return fi # See https://www.debian.org/distrib/archive.en.html for a list of mirrors @@ -4552,19 +4958,18 @@ invokeAptGetUpdate() { sed -ri "s;^(\s*deb\s+)http://security.debian.org/debian-security;\1$IPE_DEB_ARCHIVE_SECURITY;" /etc/apt/sources.list sed -ri "s;^(\s*deb\s+)http://security.debian.org;\1$IPE_DEB_ARCHIVE_SECURITY;" /etc/apt/sources.list invokeAptGetUpdate_tmp="$(mktemp)" - DEBIAN_FRONTEND=noninteractive apt-get update -q 2>"$invokeAptGetUpdate_tmp" + apt-get update -q 2>"$invokeAptGetUpdate_tmp" if test -s "$invokeAptGetUpdate_tmp"; then cat "$invokeAptGetUpdate_tmp" >&2 if grep -qE ' KEYEXPIRED [0-9]' "$invokeAptGetUpdate_tmp"; then - IPE_APTGET_INSTALLOPTIONS='-o APT::Get::AllowUnauthenticated=true' echo '############' >&2 echo '# WARNING! #' >&2 echo '############' >&2 echo 'apt packages will be installed without checking authenticity!' >&2 + printf 'APT::Get::AllowUnauthenticated "true";\n' >>/etc/apt/apt.conf.d/99unauthenticated fi fi rm "$invokeAptGetUpdate_tmp" - IPE_APTGETUPDATE_ALREADY=y } # Fix the Let's Encrypt CA certificates on old distros @@ -4595,7 +5000,7 @@ fixLetsEncrypt() { invokeAptGetUpdate fi printf -- '- installing newer ca-certificates package\n' - DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends ${IPE_APTGET_INSTALLOPTIONS:-} ca-certificates + apt-get install -qqy --no-install-recommends ca-certificates fi ;; *) @@ -4616,8 +5021,12 @@ fixLetsEncrypt() { # Cleanup everything at the end of the execution cleanup() { if test "${IPE_UNINSTALL_CARGO:-}" = y; then - . "$HOME/.cargo/env" - rustup self uninstall -y + if test -f "$HOME/.cargo/env"; then + . "$HOME/.cargo/env" + fi + if command -v rustup >/dev/null; then + rustup self uninstall -y + fi fi if test -n "$UNNEEDED_PACKAGE_LINKS"; then printf '### REMOVING UNNEEDED PACKAGE LINKS ###\n' @@ -4640,11 +5049,11 @@ cleanup() { debian) if test -n "$PACKAGES_VOLATILE"; then printf '### REMOVING UNNEEDED PACKAGES ###\n' - DEBIAN_FRONTEND=noninteractive apt-get remove --purge -y $PACKAGES_VOLATILE + apt-get remove --purge -y $PACKAGES_VOLATILE fi if test -n "$PACKAGES_PREVIOUS"; then printf '### RESTORING PREVIOUSLY INSTALLED PACKAGES ###\n' - DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends --no-upgrade $IPE_APTGET_INSTALLOPTIONS $PACKAGES_PREVIOUS + apt-get install -qqy --no-install-recommends --no-upgrade $PACKAGES_PREVIOUS fi ;; esac @@ -4669,6 +5078,8 @@ cleanup() { esac } +DEBIAN_FRONTEND=noninteractive +export DEBIAN_FRONTEND resetIFS mkdir -p /tmp/src mkdir -p /tmp/pickle.tmp @@ -4684,7 +5095,7 @@ esac setPHPVersionVariables setPHPPreinstalledModules case "$PHP_MAJMIN_VERSION" in - 505 | 506 | 700 | 701 | 702 | 703 | 704 | 800 | 801 | 802 | 803) ;; + 505 | 506 | 700 | 701 | 702 | 703 | 704 | 800 | 801 | 802 | 803 | 804) ;; *) printf "### ERROR: Unsupported PHP version: %s.%s ###\n" $((PHP_MAJMIN_VERSION / 100)) $((PHP_MAJMIN_VERSION % 100)) ;; @@ -4721,6 +5132,8 @@ if test $USE_PICKLE -gt 1; then buildPickle fi +compileLibs + for PHP_MODULE_TO_INSTALL in $PHP_MODULES_TO_INSTALL; do case "$PHP_MODULE_TO_INSTALL" in @fix_letsencrypt) diff --git a/php7/7.3.33/build/php/extensions/install-php-extensions b/php7/7.3.33/build/php/extensions/install-php-extensions index 59a1ea8b2..2ef98bb85 100644 --- a/php7/7.3.33/build/php/extensions/install-php-extensions +++ b/php7/7.3.33/build/php/extensions/install-php-extensions @@ -21,7 +21,7 @@ if ! which docker-php-ext-configure >/dev/null || ! which docker-php-ext-enable exit 1 fi -IPE_VERSION=2.2.14 +IPE_VERSION=2.7.27 StandWithUkraine() { if test -t 1 && ! grep -Eq '^VERSION=.*jessie' /etc/os-release; then @@ -273,6 +273,15 @@ EOT # 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 @@ -597,6 +606,10 @@ sortModulesToInstall() { 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")" @@ -662,9 +675,11 @@ expandASpellDictionaries() { # 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 @@ -781,8 +796,11 @@ buildRequiredPackageLists() { buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile enchant2-dev" else # The system provides libenchant2, supported since PHP 8.0: we need to build libenchant1 on our own - buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent glib aspell-libs libhunspell" - buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile glib-dev aspell-dev hunspell-dev" + 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" @@ -795,9 +813,12 @@ buildRequiredPackageLists() { buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libenchant-2-2" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libenchant-2-dev" else - # 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" + 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" @@ -844,6 +865,18 @@ buildRequiredPackageLists() { 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" ;; @@ -869,6 +902,18 @@ buildRequiredPackageLists() { 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 @@ -952,7 +997,7 @@ buildRequiredPackageLists() { 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$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libicu-dev ^libidn2-[0-9+]-dev$ ^libgcrypt[0-9]+-dev$" fi ;; imagick@alpine) @@ -984,6 +1029,9 @@ buildRequiredPackageLists() { ;; interbase@alpine) buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev ncurses-dev" + if ! isFirebirdInstalled; then + COMPILE_LIBS="$COMPILE_LIBS firebird" + fi ;; interbase@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libfbclient2" @@ -1159,6 +1207,20 @@ buildRequiredPackageLists() { ;; pdo_firebird@alpine) buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev ncurses-dev" + if ! isFirebirdInstalled; then + COMPILE_LIBS="$COMPILE_LIBS firebird" + if test $PHP_MAJMIN_VERSION -ge 804; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib-dev" + if ! isLibTommathInstalled; then + COMPILE_LIBS="$COMPILE_LIBS libtommath" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake" + fi + if ! isLibTomcryptInstalled; then + COMPILE_LIBS="$COMPILE_LIBS libtomcrypt" + fi + fi + fi ;; pdo_firebird@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libfbclient2" @@ -1175,6 +1237,20 @@ buildRequiredPackageLists() { php_trie@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" ;; + phpy@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent python3" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile python3-dev" + ;; + phpy@debian) + if test $DISTRO_VERSION_NUMBER -ge 12; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.11" + elif test $DISTRO_VERSION_NUMBER -ge 11; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.9" + else + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.7" + fi + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile python3-dev" + ;; pkcs11@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent softhsm" ;; @@ -1354,7 +1430,22 @@ buildRequiredPackageLists() { if test $PHP_MAJMIN_VERSION -ge 702; then buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent c-ares" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile c-ares-dev" + if test $PHP_MAJMIN_VERSION -ge 801; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent zstd-libs" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile sqlite-dev zstd-dev" + fi fi + case "${IPE_SWOOLE_WITHOUT_IOURING:-}" in + 1 | y* | Y*) ;; + *) + # iouring support in swoole 6 requires liburing 2.5+: available since Alpine 3.19 + # but with Alpine 3.19 we have a "invalid use of incomplete type 'const struct statx'" error + if test $DISTRO_MAJMIN_VERSION -ge 320; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent liburing" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile liburing-dev" + fi + ;; + esac ;; swoole@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libcurl3-gnutls libpq5" @@ -1362,9 +1453,23 @@ buildRequiredPackageLists() { if test $PHP_MAJMIN_VERSION -ge 702; then buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libc-ares2" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libc-ares-dev" + if test $PHP_MAJMIN_VERSION -ge 800; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libbrotli1" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev libbrotli-dev" + if test $PHP_MAJMIN_VERSION -ge 801; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libsqlite3-dev" + if test $DISTRO_VERSION_NUMBER -ge 11; then + # swoole 6 requires libzstd >= 1.4.0, but on debian 10 (buster) we have 1.3.8 + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libzstd[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libzstd-dev" + fi + fi + fi fi - if test $PHP_MAJMIN_VERSION -ge 800; then - buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev" + if test $DISTRO_VERSION_NUMBER -ge 13; then + # iouring support in swoole 6 requires liburing 2.5+: available since Debian Trixie (13) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent liburing2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile liburing-dev" fi ;; sybase_ct@alpine) @@ -1490,6 +1595,12 @@ buildRequiredPackageLists() { xmlrpc@debian) buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" ;; + xpass@alpine) + if ! isLibXCryptInstalled; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile linux-headers" + COMPILE_LIBS="$COMPILE_LIBS libxcrypt" + fi + ;; xsl@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libxslt" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxslt-dev libgcrypt-dev" @@ -1622,7 +1733,7 @@ expandPackagesToBeInstalled() { resetIFS ;; debian) - expandPackagesToBeInstalled_log="$(DEBIAN_FRONTEND=noninteractive apt-get install -sy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS $@ 2>&1 || printf '\nE: apt-get failed\n')" + expandPackagesToBeInstalled_log="$(apt-get install -sy --no-install-recommends $@ 2>&1 || printf '\nE: apt-get failed\n')" if test -n "$(printf '%s' "$expandPackagesToBeInstalled_log" | grep -E '^E:')"; then printf 'FAILED TO LIST THE WHOLE PACKAGE LIST FOR\n' >&2 printf '%s ' "$@" >&2 @@ -1891,7 +2002,7 @@ markPreinstalledPackagesAsUsed() { apk add $PACKAGES_PERSISTENT_PRE ;; debian) - DEBIAN_FRONTEND=noninteractive apt-mark manual $PACKAGES_PERSISTENT_PRE + apt-mark manual $PACKAGES_PERSISTENT_PRE ;; esac } @@ -1917,7 +2028,7 @@ installRequiredPackages() { done ;; debian) - DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS $PACKAGES_PERSISTENT_NEW $PACKAGES_VOLATILE + apt-get install -qqy --no-install-recommends $PACKAGES_PERSISTENT_NEW $PACKAGES_VOLATILE ;; esac } @@ -2099,12 +2210,12 @@ installMicrosoftSqlServerODBC() { fi printf -- '- installing the APT package\n' if test $PHP_MAJMIN_VERSION -le 703; then - DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS msodbcsql17 + ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends msodbcsql17 elif test $DISTRO_VERSION_NUMBER -ge 9 && test $DISTRO_VERSION_NUMBER -le 12; then # On Debian 9 to 12 we have both msodbcsql17 and msodbcsql18: let's install just one - DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS msodbcsql18 + ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends msodbcsql18 else - DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS '^msodbcsql[0-9]+$' + ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends '^msodbcsql[0-9]+$' fi ;; esac @@ -2128,17 +2239,7 @@ isLibaomInstalled() { # Install libaom installLibaom() { printf 'Installing libaom\n' - installLibaom_version=3.8.1 - case "$DISTRO_VERSION" in - debian@10) - case $(uname -m) in - aarch* | arm*) - #see https://bugs.chromium.org/p/aomedia/issues/detail?id=3543 - installLibaom_version=3.5.0 - ;; - esac - ;; - esac + installLibaom_version=3.10.0 installLibaom_dir="$(getPackageSource https://aomedia.googlesource.com/aom/+archive/v$installLibaom_version.tar.gz)" mkdir -- "$installLibaom_dir/my.build" cd -- "$installLibaom_dir/my.build" @@ -2293,6 +2394,108 @@ installLibThai() { cd - >/dev/null } +isLibTommathInstalled() { + if test -f /usr/local/lib/libtommath.a && test -f /usr/local/include/tommath.h; then + return 0 + fi + return 1 +} + +installLibTommath() { + printf 'Installing libtommath\n' + installLibTommath_src="$(getPackageSource https://github.com/libtom/libtommath/releases/download/v1.3.0/ltm-1.3.0.tar.xz)" + mkdir -p "$installLibTommath_src/build" + cd -- "$installLibTommath_src/build" + CFLAGS='-fPIC' cmake -DCMAKE_BUILD_TYPE=Release .. + make -j$(getProcessorCount) + make install + cd - >/dev/null +} + +isLibTomcryptInstalled() { + if test -f /usr/local/lib/libtomcrypt.a && test -f /usr/local/include/tomcrypt.h; then + return 0 + fi + return 1 +} + +installLibTomcrypt() { + printf 'Installing libtomcrypt\n' + installLibTomcrypt_src="$(getPackageSource https://github.com/libtom/libtomcrypt/releases/download/v1.18.2/crypt-1.18.2.tar.xz)" + cd -- "$installLibTomcrypt_src" + CFLAGS='-fPIC' make -j$(getProcessorCount) + make install +} + +isFirebirdInstalled() { + if test -f /usr/lib/libfbclient.so && test -f /usr/include/ibase.h; then + return 0 + fi + if test -d /tmp/src/firebird; then + return 0 + fi + return 1 +} + +installFirebird() { + printf 'Installing firebird\n' + if test $PHP_MAJMIN_VERSION -ge 804; then + installFirebird_src="$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/v5.0.2/Firebird-5.0.2.1613-0-source.tar.xz)" + cd -- "$installFirebird_src" + ./configure --enable-client-only + make -j$(getProcessorCount) + cp -Rd gen/Release/firebird/include/* /usr/include + cp -Rd gen/Release/firebird/lib/* /usr/lib + cd - >/dev/null + else + mv "$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/R2_5_9/Firebird-2.5.9.27139-0.tar.bz2)" /tmp/src/firebird + cd /tmp/src/firebird + # Patch rwlock.h (this has been fixed in later release of firebird 3.x) + sed -i '194s/.*/#if 0/' src/common/classes/rwlock.h + ./configure --with-system-icu + # -j option can't be used: make targets must be compiled sequentially + make -s btyacc_binary gpre_boot libfbstatic libfbclient + cp gen/firebird/lib/libfbclient.so /usr/lib/ + ln -s /usr/lib/libfbclient.so /usr/lib/libfbclient.so.2 + cd - >/dev/null + fi +} + +isLibXCryptInstalled() { + if ! test -f /usr/local/lib/libcrypt.so && ! test -f /usr/lib/libcrypt.so && ! test -f /usr/lib/x86_64*/libcrypt.so; then + return 1 + fi + return 0 +} + +installLibXCrypt() { + printf 'Installing libxcrypt\n' + installLibXCrypt_version=4.4.36 + installLibXCrypt_src="$(getPackageSource "https://github.com/besser82/libxcrypt/releases/download/v$installLibXCrypt_version/libxcrypt-$installLibXCrypt_version.tar.xz")" + cd -- "$installLibXCrypt_src" + ./configure --prefix /usr + make -j$(getProcessorCount) + make install + cd - >/dev/null +} + +isLibenchant1Installed() { + if test -f /usr/lib/libenchant.so || test -f /usr/local/lib/libenchant.so; then + return 0 + fi + return 1 +} + +installLibenchant1() { + printf 'Installing libenchant1\n' + installLibenchant1_src="$(getPackageSource https://github.com/rrthomas/enchant/releases/download/enchant-1-6-1/enchant-1.6.1.tar.gz)" + cd -- "$installLibenchant1_src" + ./configure + make -j$(getProcessorCount) + make install + cd - >/dev/null +} + # Install Composer installComposer() { installComposer_version="$(getWantedPHPModuleVersion @composer)" @@ -2342,30 +2545,41 @@ actuallyInstallComposer() { # Install ionCube Loader installIonCubeLoader() { + installIonCubeLoader_version='' + if test $PHP_MAJMIN_VERSION -lt 804; then + # For 14.4.0 we have a Segmentation Fault + installIonCubeLoader_version=14.0.0 + fi + installIonCubeLoader_versionForUrl='' + installIonCubeLoader_versionForMessage=latest + if test -n "$installIonCubeLoader_version"; then + installIonCubeLoader_versionForUrl="_$installIonCubeLoader_version" + installIonCubeLoader_versionForMessage="v$installIonCubeLoader_version" + fi # See https://www.ioncube.com/loaders.php case $PHP_BITS in 32) case $(uname -m) in aarch* | arm*) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_armv7l.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_armv7l$installIonCubeLoader_versionForUrl.tar.gz" ;; *) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86$installIonCubeLoader_versionForUrl.tar.gz" ;; esac ;; *) case $(uname -m) in aarch64 | arm64 | armv8) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_aarch64.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_aarch64$installIonCubeLoader_versionForUrl.tar.gz" ;; *) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64$installIonCubeLoader_versionForUrl.tar.gz" ;; esac ;; esac - printf 'Downloading ionCube Loader... ' + printf 'Downloading ionCube Loader (%s)... ' "$installIonCubeLoader_versionForMessage" installIonCubeLoader_dir="$(getPackageSource $installIonCubeLoader_url)" echo 'done.' installIonCubeLoader_so=$(php -r "printf('ioncube_loader_lin_%s.%s%s.so', PHP_MAJOR_VERSION, PHP_MINOR_VERSION, ZEND_THREAD_SAFE ? '_ts' : '');") @@ -2414,15 +2628,31 @@ installCargo() { if command -v cargo >/dev/null; then return fi - printf '# Installing cargo\n' - case "$DISTRO" in - alpine) - # see https://github.com/hyperledger/indy-vdr/issues/69#issuecomment-998104850 - export RUSTFLAGS='-C target-feature=-crt-static' - ;; - esac - curl https://sh.rustup.rs -sSf | sh -s -- -y -q + installCargo_cargoversion= + if ! test -f "$HOME/.cargo/env"; then + printf '# Installing cargo\n' + case "$DISTRO" in + alpine) + # see https://github.com/hyperledger/indy-vdr/issues/69#issuecomment-998104850 + export RUSTFLAGS='-C target-feature=-crt-static' + ;; + esac + curl https://sh.rustup.rs -sSf | sh -s -- -y -q + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -le 310; then + # With version 1.84.0 we have this error: + # Error relocating /root/.rustup/toolchains/stable-x86_64-unknown-linux-musl/bin/cargo: posix_spawn_file_actions_addchdir_np: symbol not found + # See https://github.com/rust-lang/rust/pull/131851#issue-2595663507 + installCargo_cargoversion=1.83.0 + fi + ;; + esac + fi . "$HOME/.cargo/env" + if test -n "$installCargo_cargoversion"; then + rustup default -- "$installCargo_cargoversion" + fi if test -z "${IPE_UNINSTALL_CARGO:-}"; then IPE_UNINSTALL_CARGO=y fi @@ -2430,14 +2660,20 @@ installCargo() { installNewRelic() { printf '# Installing newrelic\n' + # see https://docs.newrelic.com/docs/apm/agents/php-agent/getting-started/php-agent-compatibility-requirements/ + if test $PHP_MAJMIN_VERSION -le 701; then + installNewRelic_baseUrl=https://download.newrelic.com/php_agent/archive/10.21.0.11/ + else + installNewRelic_baseUrl=https://download.newrelic.com/php_agent/release/ + fi installNewRelic_search='\bnewrelic-php[0-9.]*-[0-9]+(\.[0-9]+)*-linux' case "$DISTRO" in alpine) installNewRelic_search="$installNewRelic_search-musl" ;; esac - installNewRelic_file="$(curl -sSLf -o- https://download.newrelic.com/php_agent/release/ | sed -E 's/<[^>]*>//g' | grep -Eo "$installNewRelic_search.tar.gz" | sort | head -1)" - installNewRelic_url="https://download.newrelic.com/php_agent/release/$installNewRelic_file" + installNewRelic_file="$(curl -sSLf -o- "$installNewRelic_baseUrl" | sed -E 's/<[^>]*>//g' | grep -Eo "$installNewRelic_search.tar.gz" | sort | head -1)" + installNewRelic_url="$installNewRelic_baseUrl$installNewRelic_file" installNewRelic_src="$(getPackageSource "$installNewRelic_url")" cd -- "$installNewRelic_src" NR_INSTALL_USE_CP_NOT_LN=1 NR_INSTALL_SILENT=1 ./newrelic-install install @@ -2446,6 +2682,12 @@ installNewRelic() { NR_INSTALL_USE_CP_NOT_LN=1 NR_INSTALL_SILENT=1 ./newrelic-install install_daemon ;; esac + case "${IPE_NEWRELIC_KEEPLOG:-}" in + 1 | y* | Y*) ;; + *) + rm -f /tmp/nrinstall-*.tar + ;; + esac cd - >/dev/null cat </dev/null - fi - ;; ftp) - docker-php-ext-configure ftp --with-openssl-dir=/usr + if test $PHP_MAJMIN_VERSION -ge 804; then + docker-php-ext-configure ftp --with-ftp-ssl=/usr + else + docker-php-ext-configure ftp --with-openssl-dir=/usr + fi ;; gd) if test $PHP_MAJMIN_VERSION -le 506; then @@ -2551,23 +2802,6 @@ EOF ;; esac if test $installBundledModule_tmp -eq 0; then - case "${IPE_GD_WITHOUTAVIF:-}" in - 1 | y* | Y*) ;; - *) - if ! isLibaomInstalled; then - installLibaom - fi - if ! isLibdav1dInstalled; then - installLibdav1d - fi - if ! isLibyuvInstalled; then - installLibyuv - fi - if ! isLibavifInstalled; then - installLibavif - fi - ;; - esac if isLibaomInstalled && isLibdav1dInstalled && isLibyuvInstalled && isLibavifInstalled; then installBundledModule_tmp=1 fi @@ -2592,7 +2826,7 @@ EOF debian@9) installBundledModule_tmp="$(pwd)" cd /tmp - apt-get download $IPE_APTGET_INSTALLOPTIONS libc-client2007e-dev + apt-get download libc-client2007e-dev dpkg -i --ignore-depends=libssl-dev libc-client2007e-dev* rm libc-client2007e-dev* cd "$installBundledModule_tmp" @@ -2603,19 +2837,9 @@ EOF interbase | pdo_firebird) case "$DISTRO" in alpine) - if ! test -d /tmp/src/firebird; then - mv "$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/R2_5_9/Firebird-2.5.9.27139-0.tar.bz2)" /tmp/src/firebird - cd /tmp/src/firebird - # Patch rwlock.h (this has been fixed in later release of firebird 3.x) - sed -i '194s/.*/#if 0/' src/common/classes/rwlock.h - ./configure --with-system-icu - # -j option can't be used: make targets must be compiled sequentially - make -s btyacc_binary gpre_boot libfbstatic libfbclient - cp gen/firebird/lib/libfbclient.so /usr/lib/ - ln -s /usr/lib/libfbclient.so /usr/lib/libfbclient.so.2 - cd - >/dev/null + if test $PHP_MAJMIN_VERSION -lt 804; then + 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 fi - 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 ;; esac ;; @@ -2824,7 +3048,7 @@ installRemoteModule() { installRemoteModule_distro=linux ;; esac - installRemoteModule_tmp2=$(php -r 'echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION;') + installRemoteModule_tmp2=$(php -r 'echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION . (ZEND_THREAD_SAFE ? "-zts" : "");') installRemoteModule_tmp="$(mktemp -p /tmp/src -d)" cd "$installRemoteModule_tmp" curl -sSLf --user-agent Docker https://blackfire.io/api/v1/releases/probe/php/$installRemoteModule_distro/$installRemoteModule_tmp1/$installRemoteModule_tmp2 | tar xz @@ -2852,7 +3076,7 @@ installRemoteModule() { if test $(compareVersions "$(cmake --version | head -n1 | sed -E 's/^.* //')" '3.7') -lt 0; then installRemoteModule_tmp=0.29.0 else - installRemoteModule_tmp=0.31.0 + installRemoteModule_tmp=0.31.1 fi cd "$(getPackageSource https://github.com/commonmark/cmark/archive/$installRemoteModule_tmp.tar.gz)" make -s -j$(getProcessorCount) cmake_build @@ -2882,6 +3106,16 @@ installRemoteModule() { if test $PHP_MAJMIN_VERSION -lt 700; then installRemoteModule_version=0.75.0 fi + if test -z "$installRemoteModule_version"; then + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -le 312; then + # cc is not supported due to a memcmp related bug + installRemoteModule_version=1.1.0 + fi + ;; + esac + fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" fi @@ -2919,6 +3153,13 @@ installRemoteModule() { installRemoteModule_version=alpha fi ;; + ev) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 800; then + installRemoteModule_version=1.1.5 + fi + fi + ;; event) installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 2.4.0) -ge 0; then @@ -2986,6 +3227,8 @@ installRemoteModule() { if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then installRemoteModule_version=1.1.2 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=2.1.3 fi fi case "$DISTRO" in @@ -3073,7 +3316,7 @@ installRemoteModule() { if ! test -e /usr/local/lib/libidnkit.so; then installRemoteModule_src="$(getPackageSource https://jprs.co.jp/idn/idnkit-2.3.tar.bz2)" cd -- "$installRemoteModule_src" - ./configure + CFLAGS=-Wno-incompatible-pointer-types ./configure make -j$(getProcessorCount) install cd - >/dev/null fi @@ -3108,14 +3351,14 @@ installRemoteModule() { if ! test -f /usr/local/lib/libionc.so || ! test -f /usr/local/include/ionc/ion.h; then echo 'Installing ion-c... ' installRemoteModule_src="$(mktemp -p /tmp/src -d)" - git clone -q -c advice.detachedHead=false --depth 1 --branch v1.1.2 https://github.com/amzn/ion-c.git "$installRemoteModule_src/ion" + git clone -q -c advice.detachedHead=false --depth 1 --branch v1.1.3 https://github.com/amzn/ion-c.git "$installRemoteModule_src/ion" ( cd "$installRemoteModule_src/ion" git submodule init -q git submodule update -q mkdir -p build cd build - cmake -DCMAKE_BUILD_TYPE=Release .. -Wno-dev + CFLAGS='-Wno-incompatible-pointer-types -Wno-stringop-overflow -Wno-discarded-qualifiers' cmake -DCMAKE_BUILD_TYPE=Release .. -Wno-dev make clean make -j$(getProcessorCount) install ) @@ -3267,6 +3510,8 @@ installRemoteModule() { installRemoteModule_version=1.11.1 elif test $PHP_MAJMIN_VERSION -le 703; then installRemoteModule_version=1.16.2 + elif test $PHP_MAJMIN_VERSION -le 800; then + installRemoteModule_version=1.20.1 fi fi if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 1.17.0) -ge 0; then @@ -3336,6 +3581,8 @@ installRemoteModule() { installRemoteModule_version=4.10.0 elif test $PHP_MAJMIN_VERSION -lt 801; then installRemoteModule_version=22.0.0 + elif test $PHP_MAJMIN_VERSION -lt 802; then + installRemoteModule_version=22.1.2 fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -3431,6 +3678,11 @@ installRemoteModule() { addConfigureOption enable-swoole-curl yes fi ;; + operator) + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=beta + fi + ;; parallel) if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 701; then @@ -3461,6 +3713,16 @@ installRemoteModule() { fi fi ;; + phalcon) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMINPAT_VERSION -lt 70401; then + installRemoteModule_version=4.1.2 + elif test $PHP_MAJMIN_VERSION -lt 800; then + installRemoteModule_version=5.4.0 + fi + fi + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' + ;; php_trie) if ! test -f /usr/local/include/hat-trie/include/tsl/htrie_map.h; then installRemoteModule_src="$(getPackageSource https://codeload.github.com/Tessil/hat-trie/tar.gz/v0.6.0)" @@ -3490,6 +3752,17 @@ installRemoteModule() { fi fi ;; + psr) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 506; then + installRemoteModule_version=0.5.1 + elif test $PHP_MAJMIN_VERSION -lt 700; then + installRemoteModule_version=0.6.1 + elif test $PHP_MAJMIN_VERSION -lt 703; then + installRemoteModule_version=1.1.0 + fi + fi + ;; pthreads) if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then @@ -3546,6 +3819,8 @@ installRemoteModule() { installRemoteModule_version=4.3.0 elif test $PHP_MAJMIN_VERSION -le 701; then installRemoteModule_version=5.3.7 + elif test $PHP_MAJMIN_VERSION -le 703; then + installRemoteModule_version=6.0.2 fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -3674,6 +3949,18 @@ installRemoteModule() { fi fi ;; + seaslog) + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' + ;; + smbclient) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.1.1 + elif test $PHP_MAJMIN_VERSION -le 703; then + installRemoteModule_version=1.1.2 + fi + fi + ;; snappy) if test -z "$installRemoteModule_path"; then if test -z "$installRemoteModule_version"; then @@ -3691,10 +3978,12 @@ installRemoteModule() { snuffleupagus) if test -z "$installRemoteModule_path"; then if test -z "$installRemoteModule_version"; then - if test $PHP_MAJMIN_VERSION -le 704; then + if test $PHP_MAJMIN_VERSION -le 800; then installRemoteModule_version=0.9.0 - else + elif test $PHP_MAJMIN_VERSION -le 801; then installRemoteModule_version=0.10.0 + else + installRemoteModule_version=0.11.0 fi fi installRemoteModule_src="$(getPackageSource https://codeload.github.com/jvoisin/snuffleupagus/tar.gz/v$installRemoteModule_version)" @@ -3738,7 +4027,7 @@ installRemoteModule() { spx) if test -z "$installRemoteModule_path"; then if test -z "$installRemoteModule_version"; then - installRemoteModule_version=v0.4.15 + installRemoteModule_version=v0.4.18 fi if test "${installRemoteModule_version%.*}" = "$installRemoteModule_version"; then installRemoteModule_displayVersion="$installRemoteModule_version" @@ -3811,6 +4100,21 @@ installRemoteModule() { elif test $PHP_BITS -eq 32; then # See https://github.com/swoole/swoole-src/issues/5198#issuecomment-1820162178 installRemoteModule_version="$(resolvePHPModuleVersion "$installRemoteModule_module" '^5.0')" + else + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -le 312; then + installRemoteModule_version=5.1.2 + fi + ;; + esac + fi + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 800; then + installRemoteModule_version=5.1.3 + else + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" stable)" + fi fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -3823,19 +4127,115 @@ installRemoteModule() { installRemoteModule_openssl=yes case "$DISTRO_VERSION" in alpine@3.7 | alpine@3.8) - if test -n "$installRemoteModule_version" && test $(compareVersions "$installRemoteModule_version" 4.6.0) -lt 0; then + if test $(compareVersions "$installRemoteModule_version" 4.6.0) -lt 0; then # see https://github.com/swoole/swoole-src/issues/3934 installRemoteModule_openssl=no fi ;; esac - if test $PHP_MAJMIN_VERSION -eq 803; then - # see https://github.com/swoole/docker-swoole/issues/45 - installRemoteModule_curl=no + if test $PHP_THREADSAFE -eq 1; then + installRemoteModule_zts=yes else - installRemoteModule_curl=yes + installRemoteModule_zts=no fi - if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 5.0.1) -ge 0; then + installRemoteModule_sqlite=yes + installRemoteModule_iouring=no + installRemoteModule_curl=yes + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -lt 317; then + # we need sqlite3 >= 3.7.7 + installRemoteModule_sqlite=no + fi + case "${IPE_SWOOLE_WITHOUT_IOURING:-}" in + 1 | y* | Y*) ;; + *) + # iouring support in swoole 6 requires liburing 2.5+: available since Alpine 3.19 + # but with Alpine 3.19 we have a "invalid use of incomplete type 'const struct statx'" error + if test $DISTRO_MAJMIN_VERSION -ge 320; then + installRemoteModule_iouring=yes + fi + ;; + esac + ;; + debian) + if test $PHP_MAJMIN_VERSION -ge 800; then + # see https://github.com/swoole/swoole-src/issues/5365 + installRemoteModule_curl=no + fi + if test $DISTRO_MAJMIN_VERSION -lt 1200; then + # we need sqlite3 >= 3.7.7 + installRemoteModule_sqlite=no + fi + case "${IPE_SWOOLE_WITHOUT_IOURING:-}" in + 1 | y* | Y*) ;; + *) + if test $DISTRO_VERSION_NUMBER -ge 13; then + # iouring support in swoole 6 requires liburing 2.5+: available since Debian Trixie (13) + installRemoteModule_iouring=yes + fi + ;; + esac + ;; + esac + installRemoteModule_zstd=yes + case "$DISTRO" in + debian) + if test $DISTRO_VERSION_NUMBER -lt 11; then + # swoole 6 requires libzstd >= 1.4.0, but on debian 10 (buster) we have 1.3.8 + installRemoteModule_zstd=no + fi + ;; + esac + if test $(compareVersions "$installRemoteModule_version" 6.0.0) -ge 0; then + # enable sockets support? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable curl support? + addConfigureOption enable-swoole-curl $installRemoteModule_curl + # enable cares support? + addConfigureOption enable-cares yes + # enable brotli support? + addConfigureOption enable-brotli yes + # enable zstd support? + addConfigureOption enable-zstd $installRemoteModule_zstd + # enable PostgreSQL database support? + addConfigureOption enable-swoole-pgsql yes + # enable ODBC database support? + addConfigureOption with-swoole-odbc no + # enable Oracle database support? + addConfigureOption with-swoole-oracle no + # enable Sqlite database support? + addConfigureOption enable-swoole-sqlite $installRemoteModule_sqlite + # enable swoole thread support (need php zts support)? + addConfigureOption enable-swoole-thread $installRemoteModule_zts + # enable iouring for file async support? + addConfigureOption enable-iouring $installRemoteModule_iouring + elif test $(compareVersions "$installRemoteModule_version" 5.1.0) -ge 0; then + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable curl support? + addConfigureOption enable-swoole-curl $installRemoteModule_curl + # enable cares support? + addConfigureOption enable-cares yes + # enable brotli support? + addConfigureOption enable-brotli yes + # enable PostgreSQL database support? + addConfigureOption enable-swoole-pgsql yes + # enable ODBC database support? + addConfigureOption with-swoole-odbc no + # enable Oracle database support? + addConfigureOption with-swoole-oracle no + # enable Sqlite database support? + addConfigureOption enable-swoole-sqlite $installRemoteModule_sqlite + elif test $(compareVersions "$installRemoteModule_version" 5.0.1) -ge 0; then # enable sockets supports? addConfigureOption enable-sockets $installRemoteModule_sockets # enable openssl support? @@ -4005,6 +4405,7 @@ installRemoteModule() { fi ;; tensor) + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 703; then installRemoteModule_version=2.2.3 @@ -4072,6 +4473,7 @@ installRemoteModule() { installRemoteModule_manuallyInstalled=1 ;; uopz) + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then installRemoteModule_version=2.0.7 @@ -4189,6 +4591,17 @@ installRemoteModule() { addConfigureOption enable-reader yes fi ;; + xmldiff) + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + if test -z "$installRemoteModule_version"; then + case "$DISTRO_VERSION" in + debian@8) + # The gcc version of Debian Jessie is too old => error: 'nullptr' was not declared in this scope + installRemoteModule_version=1.1.4 + ;; + esac + fi + ;; xmlrpc) if test -z "$installRemoteModule_version"; then installRemoteModule_version=beta @@ -4265,8 +4678,6 @@ installRemoteModule() { if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then installRemoteModule_version=0.5.0 - else - installRemoteModule_version=alpha fi fi installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -4521,23 +4932,18 @@ removeStringFromList() { } # Invoke apt-get update -# -# Set: -# IPE_APTGET_INSTALLOPTIONS invokeAptGetUpdate() { if test -n "${IPE_APTGETUPDATE_ALREADY:-}"; then - DEBIAN_FRONTEND=noninteractive apt-get update -q + apt-get update -q return fi - IPE_APTGET_INSTALLOPTIONS='' - invokeAptGetUpdate_fixdistro='' + IPE_APTGETUPDATE_ALREADY=y if grep -q 'VERSION="8 (jessie)"' /etc/os-release; then invokeAptGetUpdate_fixdistro=jessie elif grep -q 'VERSION="9 (stretch)"' /etc/os-release; then invokeAptGetUpdate_fixdistro=stretch else - IPE_APTGETUPDATE_ALREADY=y - DEBIAN_FRONTEND=noninteractive apt-get update -q + invokeAptGetUpdate return fi # See https://www.debian.org/distrib/archive.en.html for a list of mirrors @@ -4552,19 +4958,18 @@ invokeAptGetUpdate() { sed -ri "s;^(\s*deb\s+)http://security.debian.org/debian-security;\1$IPE_DEB_ARCHIVE_SECURITY;" /etc/apt/sources.list sed -ri "s;^(\s*deb\s+)http://security.debian.org;\1$IPE_DEB_ARCHIVE_SECURITY;" /etc/apt/sources.list invokeAptGetUpdate_tmp="$(mktemp)" - DEBIAN_FRONTEND=noninteractive apt-get update -q 2>"$invokeAptGetUpdate_tmp" + apt-get update -q 2>"$invokeAptGetUpdate_tmp" if test -s "$invokeAptGetUpdate_tmp"; then cat "$invokeAptGetUpdate_tmp" >&2 if grep -qE ' KEYEXPIRED [0-9]' "$invokeAptGetUpdate_tmp"; then - IPE_APTGET_INSTALLOPTIONS='-o APT::Get::AllowUnauthenticated=true' echo '############' >&2 echo '# WARNING! #' >&2 echo '############' >&2 echo 'apt packages will be installed without checking authenticity!' >&2 + printf 'APT::Get::AllowUnauthenticated "true";\n' >>/etc/apt/apt.conf.d/99unauthenticated fi fi rm "$invokeAptGetUpdate_tmp" - IPE_APTGETUPDATE_ALREADY=y } # Fix the Let's Encrypt CA certificates on old distros @@ -4595,7 +5000,7 @@ fixLetsEncrypt() { invokeAptGetUpdate fi printf -- '- installing newer ca-certificates package\n' - DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends ${IPE_APTGET_INSTALLOPTIONS:-} ca-certificates + apt-get install -qqy --no-install-recommends ca-certificates fi ;; *) @@ -4616,8 +5021,12 @@ fixLetsEncrypt() { # Cleanup everything at the end of the execution cleanup() { if test "${IPE_UNINSTALL_CARGO:-}" = y; then - . "$HOME/.cargo/env" - rustup self uninstall -y + if test -f "$HOME/.cargo/env"; then + . "$HOME/.cargo/env" + fi + if command -v rustup >/dev/null; then + rustup self uninstall -y + fi fi if test -n "$UNNEEDED_PACKAGE_LINKS"; then printf '### REMOVING UNNEEDED PACKAGE LINKS ###\n' @@ -4640,11 +5049,11 @@ cleanup() { debian) if test -n "$PACKAGES_VOLATILE"; then printf '### REMOVING UNNEEDED PACKAGES ###\n' - DEBIAN_FRONTEND=noninteractive apt-get remove --purge -y $PACKAGES_VOLATILE + apt-get remove --purge -y $PACKAGES_VOLATILE fi if test -n "$PACKAGES_PREVIOUS"; then printf '### RESTORING PREVIOUSLY INSTALLED PACKAGES ###\n' - DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends --no-upgrade $IPE_APTGET_INSTALLOPTIONS $PACKAGES_PREVIOUS + apt-get install -qqy --no-install-recommends --no-upgrade $PACKAGES_PREVIOUS fi ;; esac @@ -4669,6 +5078,8 @@ cleanup() { esac } +DEBIAN_FRONTEND=noninteractive +export DEBIAN_FRONTEND resetIFS mkdir -p /tmp/src mkdir -p /tmp/pickle.tmp @@ -4684,7 +5095,7 @@ esac setPHPVersionVariables setPHPPreinstalledModules case "$PHP_MAJMIN_VERSION" in - 505 | 506 | 700 | 701 | 702 | 703 | 704 | 800 | 801 | 802 | 803) ;; + 505 | 506 | 700 | 701 | 702 | 703 | 704 | 800 | 801 | 802 | 803 | 804) ;; *) printf "### ERROR: Unsupported PHP version: %s.%s ###\n" $((PHP_MAJMIN_VERSION / 100)) $((PHP_MAJMIN_VERSION % 100)) ;; @@ -4721,6 +5132,8 @@ if test $USE_PICKLE -gt 1; then buildPickle fi +compileLibs + for PHP_MODULE_TO_INSTALL in $PHP_MODULES_TO_INSTALL; do case "$PHP_MODULE_TO_INSTALL" in @fix_letsencrypt) diff --git a/php7/7.4.33/build/php/extensions/install-php-extensions b/php7/7.4.33/build/php/extensions/install-php-extensions index 59a1ea8b2..2ef98bb85 100644 --- a/php7/7.4.33/build/php/extensions/install-php-extensions +++ b/php7/7.4.33/build/php/extensions/install-php-extensions @@ -21,7 +21,7 @@ if ! which docker-php-ext-configure >/dev/null || ! which docker-php-ext-enable exit 1 fi -IPE_VERSION=2.2.14 +IPE_VERSION=2.7.27 StandWithUkraine() { if test -t 1 && ! grep -Eq '^VERSION=.*jessie' /etc/os-release; then @@ -273,6 +273,15 @@ EOT # 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 @@ -597,6 +606,10 @@ sortModulesToInstall() { 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")" @@ -662,9 +675,11 @@ expandASpellDictionaries() { # 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 @@ -781,8 +796,11 @@ buildRequiredPackageLists() { buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile enchant2-dev" else # The system provides libenchant2, supported since PHP 8.0: we need to build libenchant1 on our own - buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent glib aspell-libs libhunspell" - buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile glib-dev aspell-dev hunspell-dev" + 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" @@ -795,9 +813,12 @@ buildRequiredPackageLists() { buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libenchant-2-2" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libenchant-2-dev" else - # 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" + 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" @@ -844,6 +865,18 @@ buildRequiredPackageLists() { 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" ;; @@ -869,6 +902,18 @@ buildRequiredPackageLists() { 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 @@ -952,7 +997,7 @@ buildRequiredPackageLists() { 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$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libicu-dev ^libidn2-[0-9+]-dev$ ^libgcrypt[0-9]+-dev$" fi ;; imagick@alpine) @@ -984,6 +1029,9 @@ buildRequiredPackageLists() { ;; interbase@alpine) buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev ncurses-dev" + if ! isFirebirdInstalled; then + COMPILE_LIBS="$COMPILE_LIBS firebird" + fi ;; interbase@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libfbclient2" @@ -1159,6 +1207,20 @@ buildRequiredPackageLists() { ;; pdo_firebird@alpine) buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev ncurses-dev" + if ! isFirebirdInstalled; then + COMPILE_LIBS="$COMPILE_LIBS firebird" + if test $PHP_MAJMIN_VERSION -ge 804; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib-dev" + if ! isLibTommathInstalled; then + COMPILE_LIBS="$COMPILE_LIBS libtommath" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake" + fi + if ! isLibTomcryptInstalled; then + COMPILE_LIBS="$COMPILE_LIBS libtomcrypt" + fi + fi + fi ;; pdo_firebird@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libfbclient2" @@ -1175,6 +1237,20 @@ buildRequiredPackageLists() { php_trie@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" ;; + phpy@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent python3" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile python3-dev" + ;; + phpy@debian) + if test $DISTRO_VERSION_NUMBER -ge 12; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.11" + elif test $DISTRO_VERSION_NUMBER -ge 11; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.9" + else + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.7" + fi + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile python3-dev" + ;; pkcs11@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent softhsm" ;; @@ -1354,7 +1430,22 @@ buildRequiredPackageLists() { if test $PHP_MAJMIN_VERSION -ge 702; then buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent c-ares" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile c-ares-dev" + if test $PHP_MAJMIN_VERSION -ge 801; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent zstd-libs" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile sqlite-dev zstd-dev" + fi fi + case "${IPE_SWOOLE_WITHOUT_IOURING:-}" in + 1 | y* | Y*) ;; + *) + # iouring support in swoole 6 requires liburing 2.5+: available since Alpine 3.19 + # but with Alpine 3.19 we have a "invalid use of incomplete type 'const struct statx'" error + if test $DISTRO_MAJMIN_VERSION -ge 320; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent liburing" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile liburing-dev" + fi + ;; + esac ;; swoole@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libcurl3-gnutls libpq5" @@ -1362,9 +1453,23 @@ buildRequiredPackageLists() { if test $PHP_MAJMIN_VERSION -ge 702; then buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libc-ares2" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libc-ares-dev" + if test $PHP_MAJMIN_VERSION -ge 800; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libbrotli1" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev libbrotli-dev" + if test $PHP_MAJMIN_VERSION -ge 801; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libsqlite3-dev" + if test $DISTRO_VERSION_NUMBER -ge 11; then + # swoole 6 requires libzstd >= 1.4.0, but on debian 10 (buster) we have 1.3.8 + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libzstd[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libzstd-dev" + fi + fi + fi fi - if test $PHP_MAJMIN_VERSION -ge 800; then - buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev" + if test $DISTRO_VERSION_NUMBER -ge 13; then + # iouring support in swoole 6 requires liburing 2.5+: available since Debian Trixie (13) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent liburing2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile liburing-dev" fi ;; sybase_ct@alpine) @@ -1490,6 +1595,12 @@ buildRequiredPackageLists() { xmlrpc@debian) buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" ;; + xpass@alpine) + if ! isLibXCryptInstalled; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile linux-headers" + COMPILE_LIBS="$COMPILE_LIBS libxcrypt" + fi + ;; xsl@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libxslt" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxslt-dev libgcrypt-dev" @@ -1622,7 +1733,7 @@ expandPackagesToBeInstalled() { resetIFS ;; debian) - expandPackagesToBeInstalled_log="$(DEBIAN_FRONTEND=noninteractive apt-get install -sy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS $@ 2>&1 || printf '\nE: apt-get failed\n')" + expandPackagesToBeInstalled_log="$(apt-get install -sy --no-install-recommends $@ 2>&1 || printf '\nE: apt-get failed\n')" if test -n "$(printf '%s' "$expandPackagesToBeInstalled_log" | grep -E '^E:')"; then printf 'FAILED TO LIST THE WHOLE PACKAGE LIST FOR\n' >&2 printf '%s ' "$@" >&2 @@ -1891,7 +2002,7 @@ markPreinstalledPackagesAsUsed() { apk add $PACKAGES_PERSISTENT_PRE ;; debian) - DEBIAN_FRONTEND=noninteractive apt-mark manual $PACKAGES_PERSISTENT_PRE + apt-mark manual $PACKAGES_PERSISTENT_PRE ;; esac } @@ -1917,7 +2028,7 @@ installRequiredPackages() { done ;; debian) - DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS $PACKAGES_PERSISTENT_NEW $PACKAGES_VOLATILE + apt-get install -qqy --no-install-recommends $PACKAGES_PERSISTENT_NEW $PACKAGES_VOLATILE ;; esac } @@ -2099,12 +2210,12 @@ installMicrosoftSqlServerODBC() { fi printf -- '- installing the APT package\n' if test $PHP_MAJMIN_VERSION -le 703; then - DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS msodbcsql17 + ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends msodbcsql17 elif test $DISTRO_VERSION_NUMBER -ge 9 && test $DISTRO_VERSION_NUMBER -le 12; then # On Debian 9 to 12 we have both msodbcsql17 and msodbcsql18: let's install just one - DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS msodbcsql18 + ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends msodbcsql18 else - DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS '^msodbcsql[0-9]+$' + ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends '^msodbcsql[0-9]+$' fi ;; esac @@ -2128,17 +2239,7 @@ isLibaomInstalled() { # Install libaom installLibaom() { printf 'Installing libaom\n' - installLibaom_version=3.8.1 - case "$DISTRO_VERSION" in - debian@10) - case $(uname -m) in - aarch* | arm*) - #see https://bugs.chromium.org/p/aomedia/issues/detail?id=3543 - installLibaom_version=3.5.0 - ;; - esac - ;; - esac + installLibaom_version=3.10.0 installLibaom_dir="$(getPackageSource https://aomedia.googlesource.com/aom/+archive/v$installLibaom_version.tar.gz)" mkdir -- "$installLibaom_dir/my.build" cd -- "$installLibaom_dir/my.build" @@ -2293,6 +2394,108 @@ installLibThai() { cd - >/dev/null } +isLibTommathInstalled() { + if test -f /usr/local/lib/libtommath.a && test -f /usr/local/include/tommath.h; then + return 0 + fi + return 1 +} + +installLibTommath() { + printf 'Installing libtommath\n' + installLibTommath_src="$(getPackageSource https://github.com/libtom/libtommath/releases/download/v1.3.0/ltm-1.3.0.tar.xz)" + mkdir -p "$installLibTommath_src/build" + cd -- "$installLibTommath_src/build" + CFLAGS='-fPIC' cmake -DCMAKE_BUILD_TYPE=Release .. + make -j$(getProcessorCount) + make install + cd - >/dev/null +} + +isLibTomcryptInstalled() { + if test -f /usr/local/lib/libtomcrypt.a && test -f /usr/local/include/tomcrypt.h; then + return 0 + fi + return 1 +} + +installLibTomcrypt() { + printf 'Installing libtomcrypt\n' + installLibTomcrypt_src="$(getPackageSource https://github.com/libtom/libtomcrypt/releases/download/v1.18.2/crypt-1.18.2.tar.xz)" + cd -- "$installLibTomcrypt_src" + CFLAGS='-fPIC' make -j$(getProcessorCount) + make install +} + +isFirebirdInstalled() { + if test -f /usr/lib/libfbclient.so && test -f /usr/include/ibase.h; then + return 0 + fi + if test -d /tmp/src/firebird; then + return 0 + fi + return 1 +} + +installFirebird() { + printf 'Installing firebird\n' + if test $PHP_MAJMIN_VERSION -ge 804; then + installFirebird_src="$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/v5.0.2/Firebird-5.0.2.1613-0-source.tar.xz)" + cd -- "$installFirebird_src" + ./configure --enable-client-only + make -j$(getProcessorCount) + cp -Rd gen/Release/firebird/include/* /usr/include + cp -Rd gen/Release/firebird/lib/* /usr/lib + cd - >/dev/null + else + mv "$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/R2_5_9/Firebird-2.5.9.27139-0.tar.bz2)" /tmp/src/firebird + cd /tmp/src/firebird + # Patch rwlock.h (this has been fixed in later release of firebird 3.x) + sed -i '194s/.*/#if 0/' src/common/classes/rwlock.h + ./configure --with-system-icu + # -j option can't be used: make targets must be compiled sequentially + make -s btyacc_binary gpre_boot libfbstatic libfbclient + cp gen/firebird/lib/libfbclient.so /usr/lib/ + ln -s /usr/lib/libfbclient.so /usr/lib/libfbclient.so.2 + cd - >/dev/null + fi +} + +isLibXCryptInstalled() { + if ! test -f /usr/local/lib/libcrypt.so && ! test -f /usr/lib/libcrypt.so && ! test -f /usr/lib/x86_64*/libcrypt.so; then + return 1 + fi + return 0 +} + +installLibXCrypt() { + printf 'Installing libxcrypt\n' + installLibXCrypt_version=4.4.36 + installLibXCrypt_src="$(getPackageSource "https://github.com/besser82/libxcrypt/releases/download/v$installLibXCrypt_version/libxcrypt-$installLibXCrypt_version.tar.xz")" + cd -- "$installLibXCrypt_src" + ./configure --prefix /usr + make -j$(getProcessorCount) + make install + cd - >/dev/null +} + +isLibenchant1Installed() { + if test -f /usr/lib/libenchant.so || test -f /usr/local/lib/libenchant.so; then + return 0 + fi + return 1 +} + +installLibenchant1() { + printf 'Installing libenchant1\n' + installLibenchant1_src="$(getPackageSource https://github.com/rrthomas/enchant/releases/download/enchant-1-6-1/enchant-1.6.1.tar.gz)" + cd -- "$installLibenchant1_src" + ./configure + make -j$(getProcessorCount) + make install + cd - >/dev/null +} + # Install Composer installComposer() { installComposer_version="$(getWantedPHPModuleVersion @composer)" @@ -2342,30 +2545,41 @@ actuallyInstallComposer() { # Install ionCube Loader installIonCubeLoader() { + installIonCubeLoader_version='' + if test $PHP_MAJMIN_VERSION -lt 804; then + # For 14.4.0 we have a Segmentation Fault + installIonCubeLoader_version=14.0.0 + fi + installIonCubeLoader_versionForUrl='' + installIonCubeLoader_versionForMessage=latest + if test -n "$installIonCubeLoader_version"; then + installIonCubeLoader_versionForUrl="_$installIonCubeLoader_version" + installIonCubeLoader_versionForMessage="v$installIonCubeLoader_version" + fi # See https://www.ioncube.com/loaders.php case $PHP_BITS in 32) case $(uname -m) in aarch* | arm*) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_armv7l.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_armv7l$installIonCubeLoader_versionForUrl.tar.gz" ;; *) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86$installIonCubeLoader_versionForUrl.tar.gz" ;; esac ;; *) case $(uname -m) in aarch64 | arm64 | armv8) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_aarch64.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_aarch64$installIonCubeLoader_versionForUrl.tar.gz" ;; *) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64$installIonCubeLoader_versionForUrl.tar.gz" ;; esac ;; esac - printf 'Downloading ionCube Loader... ' + printf 'Downloading ionCube Loader (%s)... ' "$installIonCubeLoader_versionForMessage" installIonCubeLoader_dir="$(getPackageSource $installIonCubeLoader_url)" echo 'done.' installIonCubeLoader_so=$(php -r "printf('ioncube_loader_lin_%s.%s%s.so', PHP_MAJOR_VERSION, PHP_MINOR_VERSION, ZEND_THREAD_SAFE ? '_ts' : '');") @@ -2414,15 +2628,31 @@ installCargo() { if command -v cargo >/dev/null; then return fi - printf '# Installing cargo\n' - case "$DISTRO" in - alpine) - # see https://github.com/hyperledger/indy-vdr/issues/69#issuecomment-998104850 - export RUSTFLAGS='-C target-feature=-crt-static' - ;; - esac - curl https://sh.rustup.rs -sSf | sh -s -- -y -q + installCargo_cargoversion= + if ! test -f "$HOME/.cargo/env"; then + printf '# Installing cargo\n' + case "$DISTRO" in + alpine) + # see https://github.com/hyperledger/indy-vdr/issues/69#issuecomment-998104850 + export RUSTFLAGS='-C target-feature=-crt-static' + ;; + esac + curl https://sh.rustup.rs -sSf | sh -s -- -y -q + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -le 310; then + # With version 1.84.0 we have this error: + # Error relocating /root/.rustup/toolchains/stable-x86_64-unknown-linux-musl/bin/cargo: posix_spawn_file_actions_addchdir_np: symbol not found + # See https://github.com/rust-lang/rust/pull/131851#issue-2595663507 + installCargo_cargoversion=1.83.0 + fi + ;; + esac + fi . "$HOME/.cargo/env" + if test -n "$installCargo_cargoversion"; then + rustup default -- "$installCargo_cargoversion" + fi if test -z "${IPE_UNINSTALL_CARGO:-}"; then IPE_UNINSTALL_CARGO=y fi @@ -2430,14 +2660,20 @@ installCargo() { installNewRelic() { printf '# Installing newrelic\n' + # see https://docs.newrelic.com/docs/apm/agents/php-agent/getting-started/php-agent-compatibility-requirements/ + if test $PHP_MAJMIN_VERSION -le 701; then + installNewRelic_baseUrl=https://download.newrelic.com/php_agent/archive/10.21.0.11/ + else + installNewRelic_baseUrl=https://download.newrelic.com/php_agent/release/ + fi installNewRelic_search='\bnewrelic-php[0-9.]*-[0-9]+(\.[0-9]+)*-linux' case "$DISTRO" in alpine) installNewRelic_search="$installNewRelic_search-musl" ;; esac - installNewRelic_file="$(curl -sSLf -o- https://download.newrelic.com/php_agent/release/ | sed -E 's/<[^>]*>//g' | grep -Eo "$installNewRelic_search.tar.gz" | sort | head -1)" - installNewRelic_url="https://download.newrelic.com/php_agent/release/$installNewRelic_file" + installNewRelic_file="$(curl -sSLf -o- "$installNewRelic_baseUrl" | sed -E 's/<[^>]*>//g' | grep -Eo "$installNewRelic_search.tar.gz" | sort | head -1)" + installNewRelic_url="$installNewRelic_baseUrl$installNewRelic_file" installNewRelic_src="$(getPackageSource "$installNewRelic_url")" cd -- "$installNewRelic_src" NR_INSTALL_USE_CP_NOT_LN=1 NR_INSTALL_SILENT=1 ./newrelic-install install @@ -2446,6 +2682,12 @@ installNewRelic() { NR_INSTALL_USE_CP_NOT_LN=1 NR_INSTALL_SILENT=1 ./newrelic-install install_daemon ;; esac + case "${IPE_NEWRELIC_KEEPLOG:-}" in + 1 | y* | Y*) ;; + *) + rm -f /tmp/nrinstall-*.tar + ;; + esac cd - >/dev/null cat </dev/null - fi - ;; ftp) - docker-php-ext-configure ftp --with-openssl-dir=/usr + if test $PHP_MAJMIN_VERSION -ge 804; then + docker-php-ext-configure ftp --with-ftp-ssl=/usr + else + docker-php-ext-configure ftp --with-openssl-dir=/usr + fi ;; gd) if test $PHP_MAJMIN_VERSION -le 506; then @@ -2551,23 +2802,6 @@ EOF ;; esac if test $installBundledModule_tmp -eq 0; then - case "${IPE_GD_WITHOUTAVIF:-}" in - 1 | y* | Y*) ;; - *) - if ! isLibaomInstalled; then - installLibaom - fi - if ! isLibdav1dInstalled; then - installLibdav1d - fi - if ! isLibyuvInstalled; then - installLibyuv - fi - if ! isLibavifInstalled; then - installLibavif - fi - ;; - esac if isLibaomInstalled && isLibdav1dInstalled && isLibyuvInstalled && isLibavifInstalled; then installBundledModule_tmp=1 fi @@ -2592,7 +2826,7 @@ EOF debian@9) installBundledModule_tmp="$(pwd)" cd /tmp - apt-get download $IPE_APTGET_INSTALLOPTIONS libc-client2007e-dev + apt-get download libc-client2007e-dev dpkg -i --ignore-depends=libssl-dev libc-client2007e-dev* rm libc-client2007e-dev* cd "$installBundledModule_tmp" @@ -2603,19 +2837,9 @@ EOF interbase | pdo_firebird) case "$DISTRO" in alpine) - if ! test -d /tmp/src/firebird; then - mv "$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/R2_5_9/Firebird-2.5.9.27139-0.tar.bz2)" /tmp/src/firebird - cd /tmp/src/firebird - # Patch rwlock.h (this has been fixed in later release of firebird 3.x) - sed -i '194s/.*/#if 0/' src/common/classes/rwlock.h - ./configure --with-system-icu - # -j option can't be used: make targets must be compiled sequentially - make -s btyacc_binary gpre_boot libfbstatic libfbclient - cp gen/firebird/lib/libfbclient.so /usr/lib/ - ln -s /usr/lib/libfbclient.so /usr/lib/libfbclient.so.2 - cd - >/dev/null + if test $PHP_MAJMIN_VERSION -lt 804; then + 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 fi - 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 ;; esac ;; @@ -2824,7 +3048,7 @@ installRemoteModule() { installRemoteModule_distro=linux ;; esac - installRemoteModule_tmp2=$(php -r 'echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION;') + installRemoteModule_tmp2=$(php -r 'echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION . (ZEND_THREAD_SAFE ? "-zts" : "");') installRemoteModule_tmp="$(mktemp -p /tmp/src -d)" cd "$installRemoteModule_tmp" curl -sSLf --user-agent Docker https://blackfire.io/api/v1/releases/probe/php/$installRemoteModule_distro/$installRemoteModule_tmp1/$installRemoteModule_tmp2 | tar xz @@ -2852,7 +3076,7 @@ installRemoteModule() { if test $(compareVersions "$(cmake --version | head -n1 | sed -E 's/^.* //')" '3.7') -lt 0; then installRemoteModule_tmp=0.29.0 else - installRemoteModule_tmp=0.31.0 + installRemoteModule_tmp=0.31.1 fi cd "$(getPackageSource https://github.com/commonmark/cmark/archive/$installRemoteModule_tmp.tar.gz)" make -s -j$(getProcessorCount) cmake_build @@ -2882,6 +3106,16 @@ installRemoteModule() { if test $PHP_MAJMIN_VERSION -lt 700; then installRemoteModule_version=0.75.0 fi + if test -z "$installRemoteModule_version"; then + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -le 312; then + # cc is not supported due to a memcmp related bug + installRemoteModule_version=1.1.0 + fi + ;; + esac + fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" fi @@ -2919,6 +3153,13 @@ installRemoteModule() { installRemoteModule_version=alpha fi ;; + ev) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 800; then + installRemoteModule_version=1.1.5 + fi + fi + ;; event) installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 2.4.0) -ge 0; then @@ -2986,6 +3227,8 @@ installRemoteModule() { if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then installRemoteModule_version=1.1.2 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=2.1.3 fi fi case "$DISTRO" in @@ -3073,7 +3316,7 @@ installRemoteModule() { if ! test -e /usr/local/lib/libidnkit.so; then installRemoteModule_src="$(getPackageSource https://jprs.co.jp/idn/idnkit-2.3.tar.bz2)" cd -- "$installRemoteModule_src" - ./configure + CFLAGS=-Wno-incompatible-pointer-types ./configure make -j$(getProcessorCount) install cd - >/dev/null fi @@ -3108,14 +3351,14 @@ installRemoteModule() { if ! test -f /usr/local/lib/libionc.so || ! test -f /usr/local/include/ionc/ion.h; then echo 'Installing ion-c... ' installRemoteModule_src="$(mktemp -p /tmp/src -d)" - git clone -q -c advice.detachedHead=false --depth 1 --branch v1.1.2 https://github.com/amzn/ion-c.git "$installRemoteModule_src/ion" + git clone -q -c advice.detachedHead=false --depth 1 --branch v1.1.3 https://github.com/amzn/ion-c.git "$installRemoteModule_src/ion" ( cd "$installRemoteModule_src/ion" git submodule init -q git submodule update -q mkdir -p build cd build - cmake -DCMAKE_BUILD_TYPE=Release .. -Wno-dev + CFLAGS='-Wno-incompatible-pointer-types -Wno-stringop-overflow -Wno-discarded-qualifiers' cmake -DCMAKE_BUILD_TYPE=Release .. -Wno-dev make clean make -j$(getProcessorCount) install ) @@ -3267,6 +3510,8 @@ installRemoteModule() { installRemoteModule_version=1.11.1 elif test $PHP_MAJMIN_VERSION -le 703; then installRemoteModule_version=1.16.2 + elif test $PHP_MAJMIN_VERSION -le 800; then + installRemoteModule_version=1.20.1 fi fi if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 1.17.0) -ge 0; then @@ -3336,6 +3581,8 @@ installRemoteModule() { installRemoteModule_version=4.10.0 elif test $PHP_MAJMIN_VERSION -lt 801; then installRemoteModule_version=22.0.0 + elif test $PHP_MAJMIN_VERSION -lt 802; then + installRemoteModule_version=22.1.2 fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -3431,6 +3678,11 @@ installRemoteModule() { addConfigureOption enable-swoole-curl yes fi ;; + operator) + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=beta + fi + ;; parallel) if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 701; then @@ -3461,6 +3713,16 @@ installRemoteModule() { fi fi ;; + phalcon) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMINPAT_VERSION -lt 70401; then + installRemoteModule_version=4.1.2 + elif test $PHP_MAJMIN_VERSION -lt 800; then + installRemoteModule_version=5.4.0 + fi + fi + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' + ;; php_trie) if ! test -f /usr/local/include/hat-trie/include/tsl/htrie_map.h; then installRemoteModule_src="$(getPackageSource https://codeload.github.com/Tessil/hat-trie/tar.gz/v0.6.0)" @@ -3490,6 +3752,17 @@ installRemoteModule() { fi fi ;; + psr) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 506; then + installRemoteModule_version=0.5.1 + elif test $PHP_MAJMIN_VERSION -lt 700; then + installRemoteModule_version=0.6.1 + elif test $PHP_MAJMIN_VERSION -lt 703; then + installRemoteModule_version=1.1.0 + fi + fi + ;; pthreads) if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then @@ -3546,6 +3819,8 @@ installRemoteModule() { installRemoteModule_version=4.3.0 elif test $PHP_MAJMIN_VERSION -le 701; then installRemoteModule_version=5.3.7 + elif test $PHP_MAJMIN_VERSION -le 703; then + installRemoteModule_version=6.0.2 fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -3674,6 +3949,18 @@ installRemoteModule() { fi fi ;; + seaslog) + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' + ;; + smbclient) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.1.1 + elif test $PHP_MAJMIN_VERSION -le 703; then + installRemoteModule_version=1.1.2 + fi + fi + ;; snappy) if test -z "$installRemoteModule_path"; then if test -z "$installRemoteModule_version"; then @@ -3691,10 +3978,12 @@ installRemoteModule() { snuffleupagus) if test -z "$installRemoteModule_path"; then if test -z "$installRemoteModule_version"; then - if test $PHP_MAJMIN_VERSION -le 704; then + if test $PHP_MAJMIN_VERSION -le 800; then installRemoteModule_version=0.9.0 - else + elif test $PHP_MAJMIN_VERSION -le 801; then installRemoteModule_version=0.10.0 + else + installRemoteModule_version=0.11.0 fi fi installRemoteModule_src="$(getPackageSource https://codeload.github.com/jvoisin/snuffleupagus/tar.gz/v$installRemoteModule_version)" @@ -3738,7 +4027,7 @@ installRemoteModule() { spx) if test -z "$installRemoteModule_path"; then if test -z "$installRemoteModule_version"; then - installRemoteModule_version=v0.4.15 + installRemoteModule_version=v0.4.18 fi if test "${installRemoteModule_version%.*}" = "$installRemoteModule_version"; then installRemoteModule_displayVersion="$installRemoteModule_version" @@ -3811,6 +4100,21 @@ installRemoteModule() { elif test $PHP_BITS -eq 32; then # See https://github.com/swoole/swoole-src/issues/5198#issuecomment-1820162178 installRemoteModule_version="$(resolvePHPModuleVersion "$installRemoteModule_module" '^5.0')" + else + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -le 312; then + installRemoteModule_version=5.1.2 + fi + ;; + esac + fi + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 800; then + installRemoteModule_version=5.1.3 + else + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" stable)" + fi fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -3823,19 +4127,115 @@ installRemoteModule() { installRemoteModule_openssl=yes case "$DISTRO_VERSION" in alpine@3.7 | alpine@3.8) - if test -n "$installRemoteModule_version" && test $(compareVersions "$installRemoteModule_version" 4.6.0) -lt 0; then + if test $(compareVersions "$installRemoteModule_version" 4.6.0) -lt 0; then # see https://github.com/swoole/swoole-src/issues/3934 installRemoteModule_openssl=no fi ;; esac - if test $PHP_MAJMIN_VERSION -eq 803; then - # see https://github.com/swoole/docker-swoole/issues/45 - installRemoteModule_curl=no + if test $PHP_THREADSAFE -eq 1; then + installRemoteModule_zts=yes else - installRemoteModule_curl=yes + installRemoteModule_zts=no fi - if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 5.0.1) -ge 0; then + installRemoteModule_sqlite=yes + installRemoteModule_iouring=no + installRemoteModule_curl=yes + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -lt 317; then + # we need sqlite3 >= 3.7.7 + installRemoteModule_sqlite=no + fi + case "${IPE_SWOOLE_WITHOUT_IOURING:-}" in + 1 | y* | Y*) ;; + *) + # iouring support in swoole 6 requires liburing 2.5+: available since Alpine 3.19 + # but with Alpine 3.19 we have a "invalid use of incomplete type 'const struct statx'" error + if test $DISTRO_MAJMIN_VERSION -ge 320; then + installRemoteModule_iouring=yes + fi + ;; + esac + ;; + debian) + if test $PHP_MAJMIN_VERSION -ge 800; then + # see https://github.com/swoole/swoole-src/issues/5365 + installRemoteModule_curl=no + fi + if test $DISTRO_MAJMIN_VERSION -lt 1200; then + # we need sqlite3 >= 3.7.7 + installRemoteModule_sqlite=no + fi + case "${IPE_SWOOLE_WITHOUT_IOURING:-}" in + 1 | y* | Y*) ;; + *) + if test $DISTRO_VERSION_NUMBER -ge 13; then + # iouring support in swoole 6 requires liburing 2.5+: available since Debian Trixie (13) + installRemoteModule_iouring=yes + fi + ;; + esac + ;; + esac + installRemoteModule_zstd=yes + case "$DISTRO" in + debian) + if test $DISTRO_VERSION_NUMBER -lt 11; then + # swoole 6 requires libzstd >= 1.4.0, but on debian 10 (buster) we have 1.3.8 + installRemoteModule_zstd=no + fi + ;; + esac + if test $(compareVersions "$installRemoteModule_version" 6.0.0) -ge 0; then + # enable sockets support? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable curl support? + addConfigureOption enable-swoole-curl $installRemoteModule_curl + # enable cares support? + addConfigureOption enable-cares yes + # enable brotli support? + addConfigureOption enable-brotli yes + # enable zstd support? + addConfigureOption enable-zstd $installRemoteModule_zstd + # enable PostgreSQL database support? + addConfigureOption enable-swoole-pgsql yes + # enable ODBC database support? + addConfigureOption with-swoole-odbc no + # enable Oracle database support? + addConfigureOption with-swoole-oracle no + # enable Sqlite database support? + addConfigureOption enable-swoole-sqlite $installRemoteModule_sqlite + # enable swoole thread support (need php zts support)? + addConfigureOption enable-swoole-thread $installRemoteModule_zts + # enable iouring for file async support? + addConfigureOption enable-iouring $installRemoteModule_iouring + elif test $(compareVersions "$installRemoteModule_version" 5.1.0) -ge 0; then + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable curl support? + addConfigureOption enable-swoole-curl $installRemoteModule_curl + # enable cares support? + addConfigureOption enable-cares yes + # enable brotli support? + addConfigureOption enable-brotli yes + # enable PostgreSQL database support? + addConfigureOption enable-swoole-pgsql yes + # enable ODBC database support? + addConfigureOption with-swoole-odbc no + # enable Oracle database support? + addConfigureOption with-swoole-oracle no + # enable Sqlite database support? + addConfigureOption enable-swoole-sqlite $installRemoteModule_sqlite + elif test $(compareVersions "$installRemoteModule_version" 5.0.1) -ge 0; then # enable sockets supports? addConfigureOption enable-sockets $installRemoteModule_sockets # enable openssl support? @@ -4005,6 +4405,7 @@ installRemoteModule() { fi ;; tensor) + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 703; then installRemoteModule_version=2.2.3 @@ -4072,6 +4473,7 @@ installRemoteModule() { installRemoteModule_manuallyInstalled=1 ;; uopz) + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then installRemoteModule_version=2.0.7 @@ -4189,6 +4591,17 @@ installRemoteModule() { addConfigureOption enable-reader yes fi ;; + xmldiff) + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + if test -z "$installRemoteModule_version"; then + case "$DISTRO_VERSION" in + debian@8) + # The gcc version of Debian Jessie is too old => error: 'nullptr' was not declared in this scope + installRemoteModule_version=1.1.4 + ;; + esac + fi + ;; xmlrpc) if test -z "$installRemoteModule_version"; then installRemoteModule_version=beta @@ -4265,8 +4678,6 @@ installRemoteModule() { if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then installRemoteModule_version=0.5.0 - else - installRemoteModule_version=alpha fi fi installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -4521,23 +4932,18 @@ removeStringFromList() { } # Invoke apt-get update -# -# Set: -# IPE_APTGET_INSTALLOPTIONS invokeAptGetUpdate() { if test -n "${IPE_APTGETUPDATE_ALREADY:-}"; then - DEBIAN_FRONTEND=noninteractive apt-get update -q + apt-get update -q return fi - IPE_APTGET_INSTALLOPTIONS='' - invokeAptGetUpdate_fixdistro='' + IPE_APTGETUPDATE_ALREADY=y if grep -q 'VERSION="8 (jessie)"' /etc/os-release; then invokeAptGetUpdate_fixdistro=jessie elif grep -q 'VERSION="9 (stretch)"' /etc/os-release; then invokeAptGetUpdate_fixdistro=stretch else - IPE_APTGETUPDATE_ALREADY=y - DEBIAN_FRONTEND=noninteractive apt-get update -q + invokeAptGetUpdate return fi # See https://www.debian.org/distrib/archive.en.html for a list of mirrors @@ -4552,19 +4958,18 @@ invokeAptGetUpdate() { sed -ri "s;^(\s*deb\s+)http://security.debian.org/debian-security;\1$IPE_DEB_ARCHIVE_SECURITY;" /etc/apt/sources.list sed -ri "s;^(\s*deb\s+)http://security.debian.org;\1$IPE_DEB_ARCHIVE_SECURITY;" /etc/apt/sources.list invokeAptGetUpdate_tmp="$(mktemp)" - DEBIAN_FRONTEND=noninteractive apt-get update -q 2>"$invokeAptGetUpdate_tmp" + apt-get update -q 2>"$invokeAptGetUpdate_tmp" if test -s "$invokeAptGetUpdate_tmp"; then cat "$invokeAptGetUpdate_tmp" >&2 if grep -qE ' KEYEXPIRED [0-9]' "$invokeAptGetUpdate_tmp"; then - IPE_APTGET_INSTALLOPTIONS='-o APT::Get::AllowUnauthenticated=true' echo '############' >&2 echo '# WARNING! #' >&2 echo '############' >&2 echo 'apt packages will be installed without checking authenticity!' >&2 + printf 'APT::Get::AllowUnauthenticated "true";\n' >>/etc/apt/apt.conf.d/99unauthenticated fi fi rm "$invokeAptGetUpdate_tmp" - IPE_APTGETUPDATE_ALREADY=y } # Fix the Let's Encrypt CA certificates on old distros @@ -4595,7 +5000,7 @@ fixLetsEncrypt() { invokeAptGetUpdate fi printf -- '- installing newer ca-certificates package\n' - DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends ${IPE_APTGET_INSTALLOPTIONS:-} ca-certificates + apt-get install -qqy --no-install-recommends ca-certificates fi ;; *) @@ -4616,8 +5021,12 @@ fixLetsEncrypt() { # Cleanup everything at the end of the execution cleanup() { if test "${IPE_UNINSTALL_CARGO:-}" = y; then - . "$HOME/.cargo/env" - rustup self uninstall -y + if test -f "$HOME/.cargo/env"; then + . "$HOME/.cargo/env" + fi + if command -v rustup >/dev/null; then + rustup self uninstall -y + fi fi if test -n "$UNNEEDED_PACKAGE_LINKS"; then printf '### REMOVING UNNEEDED PACKAGE LINKS ###\n' @@ -4640,11 +5049,11 @@ cleanup() { debian) if test -n "$PACKAGES_VOLATILE"; then printf '### REMOVING UNNEEDED PACKAGES ###\n' - DEBIAN_FRONTEND=noninteractive apt-get remove --purge -y $PACKAGES_VOLATILE + apt-get remove --purge -y $PACKAGES_VOLATILE fi if test -n "$PACKAGES_PREVIOUS"; then printf '### RESTORING PREVIOUSLY INSTALLED PACKAGES ###\n' - DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends --no-upgrade $IPE_APTGET_INSTALLOPTIONS $PACKAGES_PREVIOUS + apt-get install -qqy --no-install-recommends --no-upgrade $PACKAGES_PREVIOUS fi ;; esac @@ -4669,6 +5078,8 @@ cleanup() { esac } +DEBIAN_FRONTEND=noninteractive +export DEBIAN_FRONTEND resetIFS mkdir -p /tmp/src mkdir -p /tmp/pickle.tmp @@ -4684,7 +5095,7 @@ esac setPHPVersionVariables setPHPPreinstalledModules case "$PHP_MAJMIN_VERSION" in - 505 | 506 | 700 | 701 | 702 | 703 | 704 | 800 | 801 | 802 | 803) ;; + 505 | 506 | 700 | 701 | 702 | 703 | 704 | 800 | 801 | 802 | 803 | 804) ;; *) printf "### ERROR: Unsupported PHP version: %s.%s ###\n" $((PHP_MAJMIN_VERSION / 100)) $((PHP_MAJMIN_VERSION % 100)) ;; @@ -4721,6 +5132,8 @@ if test $USE_PICKLE -gt 1; then buildPickle fi +compileLibs + for PHP_MODULE_TO_INSTALL in $PHP_MODULES_TO_INSTALL; do case "$PHP_MODULE_TO_INSTALL" in @fix_letsencrypt) diff --git a/php8/8.0.30/build/php/extensions/install-php-extensions b/php8/8.0.30/build/php/extensions/install-php-extensions index 59a1ea8b2..2ef98bb85 100644 --- a/php8/8.0.30/build/php/extensions/install-php-extensions +++ b/php8/8.0.30/build/php/extensions/install-php-extensions @@ -21,7 +21,7 @@ if ! which docker-php-ext-configure >/dev/null || ! which docker-php-ext-enable exit 1 fi -IPE_VERSION=2.2.14 +IPE_VERSION=2.7.27 StandWithUkraine() { if test -t 1 && ! grep -Eq '^VERSION=.*jessie' /etc/os-release; then @@ -273,6 +273,15 @@ EOT # 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 @@ -597,6 +606,10 @@ sortModulesToInstall() { 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")" @@ -662,9 +675,11 @@ expandASpellDictionaries() { # 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 @@ -781,8 +796,11 @@ buildRequiredPackageLists() { buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile enchant2-dev" else # The system provides libenchant2, supported since PHP 8.0: we need to build libenchant1 on our own - buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent glib aspell-libs libhunspell" - buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile glib-dev aspell-dev hunspell-dev" + 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" @@ -795,9 +813,12 @@ buildRequiredPackageLists() { buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libenchant-2-2" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libenchant-2-dev" else - # 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" + 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" @@ -844,6 +865,18 @@ buildRequiredPackageLists() { 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" ;; @@ -869,6 +902,18 @@ buildRequiredPackageLists() { 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 @@ -952,7 +997,7 @@ buildRequiredPackageLists() { 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$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libicu-dev ^libidn2-[0-9+]-dev$ ^libgcrypt[0-9]+-dev$" fi ;; imagick@alpine) @@ -984,6 +1029,9 @@ buildRequiredPackageLists() { ;; interbase@alpine) buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev ncurses-dev" + if ! isFirebirdInstalled; then + COMPILE_LIBS="$COMPILE_LIBS firebird" + fi ;; interbase@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libfbclient2" @@ -1159,6 +1207,20 @@ buildRequiredPackageLists() { ;; pdo_firebird@alpine) buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev ncurses-dev" + if ! isFirebirdInstalled; then + COMPILE_LIBS="$COMPILE_LIBS firebird" + if test $PHP_MAJMIN_VERSION -ge 804; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib-dev" + if ! isLibTommathInstalled; then + COMPILE_LIBS="$COMPILE_LIBS libtommath" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake" + fi + if ! isLibTomcryptInstalled; then + COMPILE_LIBS="$COMPILE_LIBS libtomcrypt" + fi + fi + fi ;; pdo_firebird@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libfbclient2" @@ -1175,6 +1237,20 @@ buildRequiredPackageLists() { php_trie@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" ;; + phpy@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent python3" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile python3-dev" + ;; + phpy@debian) + if test $DISTRO_VERSION_NUMBER -ge 12; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.11" + elif test $DISTRO_VERSION_NUMBER -ge 11; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.9" + else + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.7" + fi + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile python3-dev" + ;; pkcs11@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent softhsm" ;; @@ -1354,7 +1430,22 @@ buildRequiredPackageLists() { if test $PHP_MAJMIN_VERSION -ge 702; then buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent c-ares" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile c-ares-dev" + if test $PHP_MAJMIN_VERSION -ge 801; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent zstd-libs" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile sqlite-dev zstd-dev" + fi fi + case "${IPE_SWOOLE_WITHOUT_IOURING:-}" in + 1 | y* | Y*) ;; + *) + # iouring support in swoole 6 requires liburing 2.5+: available since Alpine 3.19 + # but with Alpine 3.19 we have a "invalid use of incomplete type 'const struct statx'" error + if test $DISTRO_MAJMIN_VERSION -ge 320; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent liburing" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile liburing-dev" + fi + ;; + esac ;; swoole@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libcurl3-gnutls libpq5" @@ -1362,9 +1453,23 @@ buildRequiredPackageLists() { if test $PHP_MAJMIN_VERSION -ge 702; then buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libc-ares2" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libc-ares-dev" + if test $PHP_MAJMIN_VERSION -ge 800; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libbrotli1" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev libbrotli-dev" + if test $PHP_MAJMIN_VERSION -ge 801; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libsqlite3-dev" + if test $DISTRO_VERSION_NUMBER -ge 11; then + # swoole 6 requires libzstd >= 1.4.0, but on debian 10 (buster) we have 1.3.8 + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libzstd[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libzstd-dev" + fi + fi + fi fi - if test $PHP_MAJMIN_VERSION -ge 800; then - buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev" + if test $DISTRO_VERSION_NUMBER -ge 13; then + # iouring support in swoole 6 requires liburing 2.5+: available since Debian Trixie (13) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent liburing2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile liburing-dev" fi ;; sybase_ct@alpine) @@ -1490,6 +1595,12 @@ buildRequiredPackageLists() { xmlrpc@debian) buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" ;; + xpass@alpine) + if ! isLibXCryptInstalled; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile linux-headers" + COMPILE_LIBS="$COMPILE_LIBS libxcrypt" + fi + ;; xsl@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libxslt" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxslt-dev libgcrypt-dev" @@ -1622,7 +1733,7 @@ expandPackagesToBeInstalled() { resetIFS ;; debian) - expandPackagesToBeInstalled_log="$(DEBIAN_FRONTEND=noninteractive apt-get install -sy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS $@ 2>&1 || printf '\nE: apt-get failed\n')" + expandPackagesToBeInstalled_log="$(apt-get install -sy --no-install-recommends $@ 2>&1 || printf '\nE: apt-get failed\n')" if test -n "$(printf '%s' "$expandPackagesToBeInstalled_log" | grep -E '^E:')"; then printf 'FAILED TO LIST THE WHOLE PACKAGE LIST FOR\n' >&2 printf '%s ' "$@" >&2 @@ -1891,7 +2002,7 @@ markPreinstalledPackagesAsUsed() { apk add $PACKAGES_PERSISTENT_PRE ;; debian) - DEBIAN_FRONTEND=noninteractive apt-mark manual $PACKAGES_PERSISTENT_PRE + apt-mark manual $PACKAGES_PERSISTENT_PRE ;; esac } @@ -1917,7 +2028,7 @@ installRequiredPackages() { done ;; debian) - DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS $PACKAGES_PERSISTENT_NEW $PACKAGES_VOLATILE + apt-get install -qqy --no-install-recommends $PACKAGES_PERSISTENT_NEW $PACKAGES_VOLATILE ;; esac } @@ -2099,12 +2210,12 @@ installMicrosoftSqlServerODBC() { fi printf -- '- installing the APT package\n' if test $PHP_MAJMIN_VERSION -le 703; then - DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS msodbcsql17 + ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends msodbcsql17 elif test $DISTRO_VERSION_NUMBER -ge 9 && test $DISTRO_VERSION_NUMBER -le 12; then # On Debian 9 to 12 we have both msodbcsql17 and msodbcsql18: let's install just one - DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS msodbcsql18 + ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends msodbcsql18 else - DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS '^msodbcsql[0-9]+$' + ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends '^msodbcsql[0-9]+$' fi ;; esac @@ -2128,17 +2239,7 @@ isLibaomInstalled() { # Install libaom installLibaom() { printf 'Installing libaom\n' - installLibaom_version=3.8.1 - case "$DISTRO_VERSION" in - debian@10) - case $(uname -m) in - aarch* | arm*) - #see https://bugs.chromium.org/p/aomedia/issues/detail?id=3543 - installLibaom_version=3.5.0 - ;; - esac - ;; - esac + installLibaom_version=3.10.0 installLibaom_dir="$(getPackageSource https://aomedia.googlesource.com/aom/+archive/v$installLibaom_version.tar.gz)" mkdir -- "$installLibaom_dir/my.build" cd -- "$installLibaom_dir/my.build" @@ -2293,6 +2394,108 @@ installLibThai() { cd - >/dev/null } +isLibTommathInstalled() { + if test -f /usr/local/lib/libtommath.a && test -f /usr/local/include/tommath.h; then + return 0 + fi + return 1 +} + +installLibTommath() { + printf 'Installing libtommath\n' + installLibTommath_src="$(getPackageSource https://github.com/libtom/libtommath/releases/download/v1.3.0/ltm-1.3.0.tar.xz)" + mkdir -p "$installLibTommath_src/build" + cd -- "$installLibTommath_src/build" + CFLAGS='-fPIC' cmake -DCMAKE_BUILD_TYPE=Release .. + make -j$(getProcessorCount) + make install + cd - >/dev/null +} + +isLibTomcryptInstalled() { + if test -f /usr/local/lib/libtomcrypt.a && test -f /usr/local/include/tomcrypt.h; then + return 0 + fi + return 1 +} + +installLibTomcrypt() { + printf 'Installing libtomcrypt\n' + installLibTomcrypt_src="$(getPackageSource https://github.com/libtom/libtomcrypt/releases/download/v1.18.2/crypt-1.18.2.tar.xz)" + cd -- "$installLibTomcrypt_src" + CFLAGS='-fPIC' make -j$(getProcessorCount) + make install +} + +isFirebirdInstalled() { + if test -f /usr/lib/libfbclient.so && test -f /usr/include/ibase.h; then + return 0 + fi + if test -d /tmp/src/firebird; then + return 0 + fi + return 1 +} + +installFirebird() { + printf 'Installing firebird\n' + if test $PHP_MAJMIN_VERSION -ge 804; then + installFirebird_src="$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/v5.0.2/Firebird-5.0.2.1613-0-source.tar.xz)" + cd -- "$installFirebird_src" + ./configure --enable-client-only + make -j$(getProcessorCount) + cp -Rd gen/Release/firebird/include/* /usr/include + cp -Rd gen/Release/firebird/lib/* /usr/lib + cd - >/dev/null + else + mv "$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/R2_5_9/Firebird-2.5.9.27139-0.tar.bz2)" /tmp/src/firebird + cd /tmp/src/firebird + # Patch rwlock.h (this has been fixed in later release of firebird 3.x) + sed -i '194s/.*/#if 0/' src/common/classes/rwlock.h + ./configure --with-system-icu + # -j option can't be used: make targets must be compiled sequentially + make -s btyacc_binary gpre_boot libfbstatic libfbclient + cp gen/firebird/lib/libfbclient.so /usr/lib/ + ln -s /usr/lib/libfbclient.so /usr/lib/libfbclient.so.2 + cd - >/dev/null + fi +} + +isLibXCryptInstalled() { + if ! test -f /usr/local/lib/libcrypt.so && ! test -f /usr/lib/libcrypt.so && ! test -f /usr/lib/x86_64*/libcrypt.so; then + return 1 + fi + return 0 +} + +installLibXCrypt() { + printf 'Installing libxcrypt\n' + installLibXCrypt_version=4.4.36 + installLibXCrypt_src="$(getPackageSource "https://github.com/besser82/libxcrypt/releases/download/v$installLibXCrypt_version/libxcrypt-$installLibXCrypt_version.tar.xz")" + cd -- "$installLibXCrypt_src" + ./configure --prefix /usr + make -j$(getProcessorCount) + make install + cd - >/dev/null +} + +isLibenchant1Installed() { + if test -f /usr/lib/libenchant.so || test -f /usr/local/lib/libenchant.so; then + return 0 + fi + return 1 +} + +installLibenchant1() { + printf 'Installing libenchant1\n' + installLibenchant1_src="$(getPackageSource https://github.com/rrthomas/enchant/releases/download/enchant-1-6-1/enchant-1.6.1.tar.gz)" + cd -- "$installLibenchant1_src" + ./configure + make -j$(getProcessorCount) + make install + cd - >/dev/null +} + # Install Composer installComposer() { installComposer_version="$(getWantedPHPModuleVersion @composer)" @@ -2342,30 +2545,41 @@ actuallyInstallComposer() { # Install ionCube Loader installIonCubeLoader() { + installIonCubeLoader_version='' + if test $PHP_MAJMIN_VERSION -lt 804; then + # For 14.4.0 we have a Segmentation Fault + installIonCubeLoader_version=14.0.0 + fi + installIonCubeLoader_versionForUrl='' + installIonCubeLoader_versionForMessage=latest + if test -n "$installIonCubeLoader_version"; then + installIonCubeLoader_versionForUrl="_$installIonCubeLoader_version" + installIonCubeLoader_versionForMessage="v$installIonCubeLoader_version" + fi # See https://www.ioncube.com/loaders.php case $PHP_BITS in 32) case $(uname -m) in aarch* | arm*) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_armv7l.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_armv7l$installIonCubeLoader_versionForUrl.tar.gz" ;; *) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86$installIonCubeLoader_versionForUrl.tar.gz" ;; esac ;; *) case $(uname -m) in aarch64 | arm64 | armv8) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_aarch64.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_aarch64$installIonCubeLoader_versionForUrl.tar.gz" ;; *) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64$installIonCubeLoader_versionForUrl.tar.gz" ;; esac ;; esac - printf 'Downloading ionCube Loader... ' + printf 'Downloading ionCube Loader (%s)... ' "$installIonCubeLoader_versionForMessage" installIonCubeLoader_dir="$(getPackageSource $installIonCubeLoader_url)" echo 'done.' installIonCubeLoader_so=$(php -r "printf('ioncube_loader_lin_%s.%s%s.so', PHP_MAJOR_VERSION, PHP_MINOR_VERSION, ZEND_THREAD_SAFE ? '_ts' : '');") @@ -2414,15 +2628,31 @@ installCargo() { if command -v cargo >/dev/null; then return fi - printf '# Installing cargo\n' - case "$DISTRO" in - alpine) - # see https://github.com/hyperledger/indy-vdr/issues/69#issuecomment-998104850 - export RUSTFLAGS='-C target-feature=-crt-static' - ;; - esac - curl https://sh.rustup.rs -sSf | sh -s -- -y -q + installCargo_cargoversion= + if ! test -f "$HOME/.cargo/env"; then + printf '# Installing cargo\n' + case "$DISTRO" in + alpine) + # see https://github.com/hyperledger/indy-vdr/issues/69#issuecomment-998104850 + export RUSTFLAGS='-C target-feature=-crt-static' + ;; + esac + curl https://sh.rustup.rs -sSf | sh -s -- -y -q + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -le 310; then + # With version 1.84.0 we have this error: + # Error relocating /root/.rustup/toolchains/stable-x86_64-unknown-linux-musl/bin/cargo: posix_spawn_file_actions_addchdir_np: symbol not found + # See https://github.com/rust-lang/rust/pull/131851#issue-2595663507 + installCargo_cargoversion=1.83.0 + fi + ;; + esac + fi . "$HOME/.cargo/env" + if test -n "$installCargo_cargoversion"; then + rustup default -- "$installCargo_cargoversion" + fi if test -z "${IPE_UNINSTALL_CARGO:-}"; then IPE_UNINSTALL_CARGO=y fi @@ -2430,14 +2660,20 @@ installCargo() { installNewRelic() { printf '# Installing newrelic\n' + # see https://docs.newrelic.com/docs/apm/agents/php-agent/getting-started/php-agent-compatibility-requirements/ + if test $PHP_MAJMIN_VERSION -le 701; then + installNewRelic_baseUrl=https://download.newrelic.com/php_agent/archive/10.21.0.11/ + else + installNewRelic_baseUrl=https://download.newrelic.com/php_agent/release/ + fi installNewRelic_search='\bnewrelic-php[0-9.]*-[0-9]+(\.[0-9]+)*-linux' case "$DISTRO" in alpine) installNewRelic_search="$installNewRelic_search-musl" ;; esac - installNewRelic_file="$(curl -sSLf -o- https://download.newrelic.com/php_agent/release/ | sed -E 's/<[^>]*>//g' | grep -Eo "$installNewRelic_search.tar.gz" | sort | head -1)" - installNewRelic_url="https://download.newrelic.com/php_agent/release/$installNewRelic_file" + installNewRelic_file="$(curl -sSLf -o- "$installNewRelic_baseUrl" | sed -E 's/<[^>]*>//g' | grep -Eo "$installNewRelic_search.tar.gz" | sort | head -1)" + installNewRelic_url="$installNewRelic_baseUrl$installNewRelic_file" installNewRelic_src="$(getPackageSource "$installNewRelic_url")" cd -- "$installNewRelic_src" NR_INSTALL_USE_CP_NOT_LN=1 NR_INSTALL_SILENT=1 ./newrelic-install install @@ -2446,6 +2682,12 @@ installNewRelic() { NR_INSTALL_USE_CP_NOT_LN=1 NR_INSTALL_SILENT=1 ./newrelic-install install_daemon ;; esac + case "${IPE_NEWRELIC_KEEPLOG:-}" in + 1 | y* | Y*) ;; + *) + rm -f /tmp/nrinstall-*.tar + ;; + esac cd - >/dev/null cat </dev/null - fi - ;; ftp) - docker-php-ext-configure ftp --with-openssl-dir=/usr + if test $PHP_MAJMIN_VERSION -ge 804; then + docker-php-ext-configure ftp --with-ftp-ssl=/usr + else + docker-php-ext-configure ftp --with-openssl-dir=/usr + fi ;; gd) if test $PHP_MAJMIN_VERSION -le 506; then @@ -2551,23 +2802,6 @@ EOF ;; esac if test $installBundledModule_tmp -eq 0; then - case "${IPE_GD_WITHOUTAVIF:-}" in - 1 | y* | Y*) ;; - *) - if ! isLibaomInstalled; then - installLibaom - fi - if ! isLibdav1dInstalled; then - installLibdav1d - fi - if ! isLibyuvInstalled; then - installLibyuv - fi - if ! isLibavifInstalled; then - installLibavif - fi - ;; - esac if isLibaomInstalled && isLibdav1dInstalled && isLibyuvInstalled && isLibavifInstalled; then installBundledModule_tmp=1 fi @@ -2592,7 +2826,7 @@ EOF debian@9) installBundledModule_tmp="$(pwd)" cd /tmp - apt-get download $IPE_APTGET_INSTALLOPTIONS libc-client2007e-dev + apt-get download libc-client2007e-dev dpkg -i --ignore-depends=libssl-dev libc-client2007e-dev* rm libc-client2007e-dev* cd "$installBundledModule_tmp" @@ -2603,19 +2837,9 @@ EOF interbase | pdo_firebird) case "$DISTRO" in alpine) - if ! test -d /tmp/src/firebird; then - mv "$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/R2_5_9/Firebird-2.5.9.27139-0.tar.bz2)" /tmp/src/firebird - cd /tmp/src/firebird - # Patch rwlock.h (this has been fixed in later release of firebird 3.x) - sed -i '194s/.*/#if 0/' src/common/classes/rwlock.h - ./configure --with-system-icu - # -j option can't be used: make targets must be compiled sequentially - make -s btyacc_binary gpre_boot libfbstatic libfbclient - cp gen/firebird/lib/libfbclient.so /usr/lib/ - ln -s /usr/lib/libfbclient.so /usr/lib/libfbclient.so.2 - cd - >/dev/null + if test $PHP_MAJMIN_VERSION -lt 804; then + 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 fi - 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 ;; esac ;; @@ -2824,7 +3048,7 @@ installRemoteModule() { installRemoteModule_distro=linux ;; esac - installRemoteModule_tmp2=$(php -r 'echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION;') + installRemoteModule_tmp2=$(php -r 'echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION . (ZEND_THREAD_SAFE ? "-zts" : "");') installRemoteModule_tmp="$(mktemp -p /tmp/src -d)" cd "$installRemoteModule_tmp" curl -sSLf --user-agent Docker https://blackfire.io/api/v1/releases/probe/php/$installRemoteModule_distro/$installRemoteModule_tmp1/$installRemoteModule_tmp2 | tar xz @@ -2852,7 +3076,7 @@ installRemoteModule() { if test $(compareVersions "$(cmake --version | head -n1 | sed -E 's/^.* //')" '3.7') -lt 0; then installRemoteModule_tmp=0.29.0 else - installRemoteModule_tmp=0.31.0 + installRemoteModule_tmp=0.31.1 fi cd "$(getPackageSource https://github.com/commonmark/cmark/archive/$installRemoteModule_tmp.tar.gz)" make -s -j$(getProcessorCount) cmake_build @@ -2882,6 +3106,16 @@ installRemoteModule() { if test $PHP_MAJMIN_VERSION -lt 700; then installRemoteModule_version=0.75.0 fi + if test -z "$installRemoteModule_version"; then + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -le 312; then + # cc is not supported due to a memcmp related bug + installRemoteModule_version=1.1.0 + fi + ;; + esac + fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" fi @@ -2919,6 +3153,13 @@ installRemoteModule() { installRemoteModule_version=alpha fi ;; + ev) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 800; then + installRemoteModule_version=1.1.5 + fi + fi + ;; event) installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 2.4.0) -ge 0; then @@ -2986,6 +3227,8 @@ installRemoteModule() { if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then installRemoteModule_version=1.1.2 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=2.1.3 fi fi case "$DISTRO" in @@ -3073,7 +3316,7 @@ installRemoteModule() { if ! test -e /usr/local/lib/libidnkit.so; then installRemoteModule_src="$(getPackageSource https://jprs.co.jp/idn/idnkit-2.3.tar.bz2)" cd -- "$installRemoteModule_src" - ./configure + CFLAGS=-Wno-incompatible-pointer-types ./configure make -j$(getProcessorCount) install cd - >/dev/null fi @@ -3108,14 +3351,14 @@ installRemoteModule() { if ! test -f /usr/local/lib/libionc.so || ! test -f /usr/local/include/ionc/ion.h; then echo 'Installing ion-c... ' installRemoteModule_src="$(mktemp -p /tmp/src -d)" - git clone -q -c advice.detachedHead=false --depth 1 --branch v1.1.2 https://github.com/amzn/ion-c.git "$installRemoteModule_src/ion" + git clone -q -c advice.detachedHead=false --depth 1 --branch v1.1.3 https://github.com/amzn/ion-c.git "$installRemoteModule_src/ion" ( cd "$installRemoteModule_src/ion" git submodule init -q git submodule update -q mkdir -p build cd build - cmake -DCMAKE_BUILD_TYPE=Release .. -Wno-dev + CFLAGS='-Wno-incompatible-pointer-types -Wno-stringop-overflow -Wno-discarded-qualifiers' cmake -DCMAKE_BUILD_TYPE=Release .. -Wno-dev make clean make -j$(getProcessorCount) install ) @@ -3267,6 +3510,8 @@ installRemoteModule() { installRemoteModule_version=1.11.1 elif test $PHP_MAJMIN_VERSION -le 703; then installRemoteModule_version=1.16.2 + elif test $PHP_MAJMIN_VERSION -le 800; then + installRemoteModule_version=1.20.1 fi fi if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 1.17.0) -ge 0; then @@ -3336,6 +3581,8 @@ installRemoteModule() { installRemoteModule_version=4.10.0 elif test $PHP_MAJMIN_VERSION -lt 801; then installRemoteModule_version=22.0.0 + elif test $PHP_MAJMIN_VERSION -lt 802; then + installRemoteModule_version=22.1.2 fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -3431,6 +3678,11 @@ installRemoteModule() { addConfigureOption enable-swoole-curl yes fi ;; + operator) + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=beta + fi + ;; parallel) if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 701; then @@ -3461,6 +3713,16 @@ installRemoteModule() { fi fi ;; + phalcon) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMINPAT_VERSION -lt 70401; then + installRemoteModule_version=4.1.2 + elif test $PHP_MAJMIN_VERSION -lt 800; then + installRemoteModule_version=5.4.0 + fi + fi + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' + ;; php_trie) if ! test -f /usr/local/include/hat-trie/include/tsl/htrie_map.h; then installRemoteModule_src="$(getPackageSource https://codeload.github.com/Tessil/hat-trie/tar.gz/v0.6.0)" @@ -3490,6 +3752,17 @@ installRemoteModule() { fi fi ;; + psr) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 506; then + installRemoteModule_version=0.5.1 + elif test $PHP_MAJMIN_VERSION -lt 700; then + installRemoteModule_version=0.6.1 + elif test $PHP_MAJMIN_VERSION -lt 703; then + installRemoteModule_version=1.1.0 + fi + fi + ;; pthreads) if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then @@ -3546,6 +3819,8 @@ installRemoteModule() { installRemoteModule_version=4.3.0 elif test $PHP_MAJMIN_VERSION -le 701; then installRemoteModule_version=5.3.7 + elif test $PHP_MAJMIN_VERSION -le 703; then + installRemoteModule_version=6.0.2 fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -3674,6 +3949,18 @@ installRemoteModule() { fi fi ;; + seaslog) + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' + ;; + smbclient) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.1.1 + elif test $PHP_MAJMIN_VERSION -le 703; then + installRemoteModule_version=1.1.2 + fi + fi + ;; snappy) if test -z "$installRemoteModule_path"; then if test -z "$installRemoteModule_version"; then @@ -3691,10 +3978,12 @@ installRemoteModule() { snuffleupagus) if test -z "$installRemoteModule_path"; then if test -z "$installRemoteModule_version"; then - if test $PHP_MAJMIN_VERSION -le 704; then + if test $PHP_MAJMIN_VERSION -le 800; then installRemoteModule_version=0.9.0 - else + elif test $PHP_MAJMIN_VERSION -le 801; then installRemoteModule_version=0.10.0 + else + installRemoteModule_version=0.11.0 fi fi installRemoteModule_src="$(getPackageSource https://codeload.github.com/jvoisin/snuffleupagus/tar.gz/v$installRemoteModule_version)" @@ -3738,7 +4027,7 @@ installRemoteModule() { spx) if test -z "$installRemoteModule_path"; then if test -z "$installRemoteModule_version"; then - installRemoteModule_version=v0.4.15 + installRemoteModule_version=v0.4.18 fi if test "${installRemoteModule_version%.*}" = "$installRemoteModule_version"; then installRemoteModule_displayVersion="$installRemoteModule_version" @@ -3811,6 +4100,21 @@ installRemoteModule() { elif test $PHP_BITS -eq 32; then # See https://github.com/swoole/swoole-src/issues/5198#issuecomment-1820162178 installRemoteModule_version="$(resolvePHPModuleVersion "$installRemoteModule_module" '^5.0')" + else + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -le 312; then + installRemoteModule_version=5.1.2 + fi + ;; + esac + fi + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 800; then + installRemoteModule_version=5.1.3 + else + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" stable)" + fi fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -3823,19 +4127,115 @@ installRemoteModule() { installRemoteModule_openssl=yes case "$DISTRO_VERSION" in alpine@3.7 | alpine@3.8) - if test -n "$installRemoteModule_version" && test $(compareVersions "$installRemoteModule_version" 4.6.0) -lt 0; then + if test $(compareVersions "$installRemoteModule_version" 4.6.0) -lt 0; then # see https://github.com/swoole/swoole-src/issues/3934 installRemoteModule_openssl=no fi ;; esac - if test $PHP_MAJMIN_VERSION -eq 803; then - # see https://github.com/swoole/docker-swoole/issues/45 - installRemoteModule_curl=no + if test $PHP_THREADSAFE -eq 1; then + installRemoteModule_zts=yes else - installRemoteModule_curl=yes + installRemoteModule_zts=no fi - if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 5.0.1) -ge 0; then + installRemoteModule_sqlite=yes + installRemoteModule_iouring=no + installRemoteModule_curl=yes + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -lt 317; then + # we need sqlite3 >= 3.7.7 + installRemoteModule_sqlite=no + fi + case "${IPE_SWOOLE_WITHOUT_IOURING:-}" in + 1 | y* | Y*) ;; + *) + # iouring support in swoole 6 requires liburing 2.5+: available since Alpine 3.19 + # but with Alpine 3.19 we have a "invalid use of incomplete type 'const struct statx'" error + if test $DISTRO_MAJMIN_VERSION -ge 320; then + installRemoteModule_iouring=yes + fi + ;; + esac + ;; + debian) + if test $PHP_MAJMIN_VERSION -ge 800; then + # see https://github.com/swoole/swoole-src/issues/5365 + installRemoteModule_curl=no + fi + if test $DISTRO_MAJMIN_VERSION -lt 1200; then + # we need sqlite3 >= 3.7.7 + installRemoteModule_sqlite=no + fi + case "${IPE_SWOOLE_WITHOUT_IOURING:-}" in + 1 | y* | Y*) ;; + *) + if test $DISTRO_VERSION_NUMBER -ge 13; then + # iouring support in swoole 6 requires liburing 2.5+: available since Debian Trixie (13) + installRemoteModule_iouring=yes + fi + ;; + esac + ;; + esac + installRemoteModule_zstd=yes + case "$DISTRO" in + debian) + if test $DISTRO_VERSION_NUMBER -lt 11; then + # swoole 6 requires libzstd >= 1.4.0, but on debian 10 (buster) we have 1.3.8 + installRemoteModule_zstd=no + fi + ;; + esac + if test $(compareVersions "$installRemoteModule_version" 6.0.0) -ge 0; then + # enable sockets support? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable curl support? + addConfigureOption enable-swoole-curl $installRemoteModule_curl + # enable cares support? + addConfigureOption enable-cares yes + # enable brotli support? + addConfigureOption enable-brotli yes + # enable zstd support? + addConfigureOption enable-zstd $installRemoteModule_zstd + # enable PostgreSQL database support? + addConfigureOption enable-swoole-pgsql yes + # enable ODBC database support? + addConfigureOption with-swoole-odbc no + # enable Oracle database support? + addConfigureOption with-swoole-oracle no + # enable Sqlite database support? + addConfigureOption enable-swoole-sqlite $installRemoteModule_sqlite + # enable swoole thread support (need php zts support)? + addConfigureOption enable-swoole-thread $installRemoteModule_zts + # enable iouring for file async support? + addConfigureOption enable-iouring $installRemoteModule_iouring + elif test $(compareVersions "$installRemoteModule_version" 5.1.0) -ge 0; then + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable curl support? + addConfigureOption enable-swoole-curl $installRemoteModule_curl + # enable cares support? + addConfigureOption enable-cares yes + # enable brotli support? + addConfigureOption enable-brotli yes + # enable PostgreSQL database support? + addConfigureOption enable-swoole-pgsql yes + # enable ODBC database support? + addConfigureOption with-swoole-odbc no + # enable Oracle database support? + addConfigureOption with-swoole-oracle no + # enable Sqlite database support? + addConfigureOption enable-swoole-sqlite $installRemoteModule_sqlite + elif test $(compareVersions "$installRemoteModule_version" 5.0.1) -ge 0; then # enable sockets supports? addConfigureOption enable-sockets $installRemoteModule_sockets # enable openssl support? @@ -4005,6 +4405,7 @@ installRemoteModule() { fi ;; tensor) + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 703; then installRemoteModule_version=2.2.3 @@ -4072,6 +4473,7 @@ installRemoteModule() { installRemoteModule_manuallyInstalled=1 ;; uopz) + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then installRemoteModule_version=2.0.7 @@ -4189,6 +4591,17 @@ installRemoteModule() { addConfigureOption enable-reader yes fi ;; + xmldiff) + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + if test -z "$installRemoteModule_version"; then + case "$DISTRO_VERSION" in + debian@8) + # The gcc version of Debian Jessie is too old => error: 'nullptr' was not declared in this scope + installRemoteModule_version=1.1.4 + ;; + esac + fi + ;; xmlrpc) if test -z "$installRemoteModule_version"; then installRemoteModule_version=beta @@ -4265,8 +4678,6 @@ installRemoteModule() { if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then installRemoteModule_version=0.5.0 - else - installRemoteModule_version=alpha fi fi installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -4521,23 +4932,18 @@ removeStringFromList() { } # Invoke apt-get update -# -# Set: -# IPE_APTGET_INSTALLOPTIONS invokeAptGetUpdate() { if test -n "${IPE_APTGETUPDATE_ALREADY:-}"; then - DEBIAN_FRONTEND=noninteractive apt-get update -q + apt-get update -q return fi - IPE_APTGET_INSTALLOPTIONS='' - invokeAptGetUpdate_fixdistro='' + IPE_APTGETUPDATE_ALREADY=y if grep -q 'VERSION="8 (jessie)"' /etc/os-release; then invokeAptGetUpdate_fixdistro=jessie elif grep -q 'VERSION="9 (stretch)"' /etc/os-release; then invokeAptGetUpdate_fixdistro=stretch else - IPE_APTGETUPDATE_ALREADY=y - DEBIAN_FRONTEND=noninteractive apt-get update -q + invokeAptGetUpdate return fi # See https://www.debian.org/distrib/archive.en.html for a list of mirrors @@ -4552,19 +4958,18 @@ invokeAptGetUpdate() { sed -ri "s;^(\s*deb\s+)http://security.debian.org/debian-security;\1$IPE_DEB_ARCHIVE_SECURITY;" /etc/apt/sources.list sed -ri "s;^(\s*deb\s+)http://security.debian.org;\1$IPE_DEB_ARCHIVE_SECURITY;" /etc/apt/sources.list invokeAptGetUpdate_tmp="$(mktemp)" - DEBIAN_FRONTEND=noninteractive apt-get update -q 2>"$invokeAptGetUpdate_tmp" + apt-get update -q 2>"$invokeAptGetUpdate_tmp" if test -s "$invokeAptGetUpdate_tmp"; then cat "$invokeAptGetUpdate_tmp" >&2 if grep -qE ' KEYEXPIRED [0-9]' "$invokeAptGetUpdate_tmp"; then - IPE_APTGET_INSTALLOPTIONS='-o APT::Get::AllowUnauthenticated=true' echo '############' >&2 echo '# WARNING! #' >&2 echo '############' >&2 echo 'apt packages will be installed without checking authenticity!' >&2 + printf 'APT::Get::AllowUnauthenticated "true";\n' >>/etc/apt/apt.conf.d/99unauthenticated fi fi rm "$invokeAptGetUpdate_tmp" - IPE_APTGETUPDATE_ALREADY=y } # Fix the Let's Encrypt CA certificates on old distros @@ -4595,7 +5000,7 @@ fixLetsEncrypt() { invokeAptGetUpdate fi printf -- '- installing newer ca-certificates package\n' - DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends ${IPE_APTGET_INSTALLOPTIONS:-} ca-certificates + apt-get install -qqy --no-install-recommends ca-certificates fi ;; *) @@ -4616,8 +5021,12 @@ fixLetsEncrypt() { # Cleanup everything at the end of the execution cleanup() { if test "${IPE_UNINSTALL_CARGO:-}" = y; then - . "$HOME/.cargo/env" - rustup self uninstall -y + if test -f "$HOME/.cargo/env"; then + . "$HOME/.cargo/env" + fi + if command -v rustup >/dev/null; then + rustup self uninstall -y + fi fi if test -n "$UNNEEDED_PACKAGE_LINKS"; then printf '### REMOVING UNNEEDED PACKAGE LINKS ###\n' @@ -4640,11 +5049,11 @@ cleanup() { debian) if test -n "$PACKAGES_VOLATILE"; then printf '### REMOVING UNNEEDED PACKAGES ###\n' - DEBIAN_FRONTEND=noninteractive apt-get remove --purge -y $PACKAGES_VOLATILE + apt-get remove --purge -y $PACKAGES_VOLATILE fi if test -n "$PACKAGES_PREVIOUS"; then printf '### RESTORING PREVIOUSLY INSTALLED PACKAGES ###\n' - DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends --no-upgrade $IPE_APTGET_INSTALLOPTIONS $PACKAGES_PREVIOUS + apt-get install -qqy --no-install-recommends --no-upgrade $PACKAGES_PREVIOUS fi ;; esac @@ -4669,6 +5078,8 @@ cleanup() { esac } +DEBIAN_FRONTEND=noninteractive +export DEBIAN_FRONTEND resetIFS mkdir -p /tmp/src mkdir -p /tmp/pickle.tmp @@ -4684,7 +5095,7 @@ esac setPHPVersionVariables setPHPPreinstalledModules case "$PHP_MAJMIN_VERSION" in - 505 | 506 | 700 | 701 | 702 | 703 | 704 | 800 | 801 | 802 | 803) ;; + 505 | 506 | 700 | 701 | 702 | 703 | 704 | 800 | 801 | 802 | 803 | 804) ;; *) printf "### ERROR: Unsupported PHP version: %s.%s ###\n" $((PHP_MAJMIN_VERSION / 100)) $((PHP_MAJMIN_VERSION % 100)) ;; @@ -4721,6 +5132,8 @@ if test $USE_PICKLE -gt 1; then buildPickle fi +compileLibs + for PHP_MODULE_TO_INSTALL in $PHP_MODULES_TO_INSTALL; do case "$PHP_MODULE_TO_INSTALL" in @fix_letsencrypt) diff --git a/php8/8.1.31/build/php/extensions/install-php-extensions b/php8/8.1.31/build/php/extensions/install-php-extensions index 59a1ea8b2..2ef98bb85 100644 --- a/php8/8.1.31/build/php/extensions/install-php-extensions +++ b/php8/8.1.31/build/php/extensions/install-php-extensions @@ -21,7 +21,7 @@ if ! which docker-php-ext-configure >/dev/null || ! which docker-php-ext-enable exit 1 fi -IPE_VERSION=2.2.14 +IPE_VERSION=2.7.27 StandWithUkraine() { if test -t 1 && ! grep -Eq '^VERSION=.*jessie' /etc/os-release; then @@ -273,6 +273,15 @@ EOT # 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 @@ -597,6 +606,10 @@ sortModulesToInstall() { 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")" @@ -662,9 +675,11 @@ expandASpellDictionaries() { # 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 @@ -781,8 +796,11 @@ buildRequiredPackageLists() { buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile enchant2-dev" else # The system provides libenchant2, supported since PHP 8.0: we need to build libenchant1 on our own - buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent glib aspell-libs libhunspell" - buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile glib-dev aspell-dev hunspell-dev" + 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" @@ -795,9 +813,12 @@ buildRequiredPackageLists() { buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libenchant-2-2" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libenchant-2-dev" else - # 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" + 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" @@ -844,6 +865,18 @@ buildRequiredPackageLists() { 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" ;; @@ -869,6 +902,18 @@ buildRequiredPackageLists() { 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 @@ -952,7 +997,7 @@ buildRequiredPackageLists() { 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$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libicu-dev ^libidn2-[0-9+]-dev$ ^libgcrypt[0-9]+-dev$" fi ;; imagick@alpine) @@ -984,6 +1029,9 @@ buildRequiredPackageLists() { ;; interbase@alpine) buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev ncurses-dev" + if ! isFirebirdInstalled; then + COMPILE_LIBS="$COMPILE_LIBS firebird" + fi ;; interbase@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libfbclient2" @@ -1159,6 +1207,20 @@ buildRequiredPackageLists() { ;; pdo_firebird@alpine) buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev ncurses-dev" + if ! isFirebirdInstalled; then + COMPILE_LIBS="$COMPILE_LIBS firebird" + if test $PHP_MAJMIN_VERSION -ge 804; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib-dev" + if ! isLibTommathInstalled; then + COMPILE_LIBS="$COMPILE_LIBS libtommath" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake" + fi + if ! isLibTomcryptInstalled; then + COMPILE_LIBS="$COMPILE_LIBS libtomcrypt" + fi + fi + fi ;; pdo_firebird@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libfbclient2" @@ -1175,6 +1237,20 @@ buildRequiredPackageLists() { php_trie@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" ;; + phpy@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent python3" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile python3-dev" + ;; + phpy@debian) + if test $DISTRO_VERSION_NUMBER -ge 12; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.11" + elif test $DISTRO_VERSION_NUMBER -ge 11; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.9" + else + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.7" + fi + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile python3-dev" + ;; pkcs11@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent softhsm" ;; @@ -1354,7 +1430,22 @@ buildRequiredPackageLists() { if test $PHP_MAJMIN_VERSION -ge 702; then buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent c-ares" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile c-ares-dev" + if test $PHP_MAJMIN_VERSION -ge 801; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent zstd-libs" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile sqlite-dev zstd-dev" + fi fi + case "${IPE_SWOOLE_WITHOUT_IOURING:-}" in + 1 | y* | Y*) ;; + *) + # iouring support in swoole 6 requires liburing 2.5+: available since Alpine 3.19 + # but with Alpine 3.19 we have a "invalid use of incomplete type 'const struct statx'" error + if test $DISTRO_MAJMIN_VERSION -ge 320; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent liburing" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile liburing-dev" + fi + ;; + esac ;; swoole@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libcurl3-gnutls libpq5" @@ -1362,9 +1453,23 @@ buildRequiredPackageLists() { if test $PHP_MAJMIN_VERSION -ge 702; then buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libc-ares2" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libc-ares-dev" + if test $PHP_MAJMIN_VERSION -ge 800; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libbrotli1" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev libbrotli-dev" + if test $PHP_MAJMIN_VERSION -ge 801; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libsqlite3-dev" + if test $DISTRO_VERSION_NUMBER -ge 11; then + # swoole 6 requires libzstd >= 1.4.0, but on debian 10 (buster) we have 1.3.8 + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libzstd[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libzstd-dev" + fi + fi + fi fi - if test $PHP_MAJMIN_VERSION -ge 800; then - buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev" + if test $DISTRO_VERSION_NUMBER -ge 13; then + # iouring support in swoole 6 requires liburing 2.5+: available since Debian Trixie (13) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent liburing2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile liburing-dev" fi ;; sybase_ct@alpine) @@ -1490,6 +1595,12 @@ buildRequiredPackageLists() { xmlrpc@debian) buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" ;; + xpass@alpine) + if ! isLibXCryptInstalled; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile linux-headers" + COMPILE_LIBS="$COMPILE_LIBS libxcrypt" + fi + ;; xsl@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libxslt" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxslt-dev libgcrypt-dev" @@ -1622,7 +1733,7 @@ expandPackagesToBeInstalled() { resetIFS ;; debian) - expandPackagesToBeInstalled_log="$(DEBIAN_FRONTEND=noninteractive apt-get install -sy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS $@ 2>&1 || printf '\nE: apt-get failed\n')" + expandPackagesToBeInstalled_log="$(apt-get install -sy --no-install-recommends $@ 2>&1 || printf '\nE: apt-get failed\n')" if test -n "$(printf '%s' "$expandPackagesToBeInstalled_log" | grep -E '^E:')"; then printf 'FAILED TO LIST THE WHOLE PACKAGE LIST FOR\n' >&2 printf '%s ' "$@" >&2 @@ -1891,7 +2002,7 @@ markPreinstalledPackagesAsUsed() { apk add $PACKAGES_PERSISTENT_PRE ;; debian) - DEBIAN_FRONTEND=noninteractive apt-mark manual $PACKAGES_PERSISTENT_PRE + apt-mark manual $PACKAGES_PERSISTENT_PRE ;; esac } @@ -1917,7 +2028,7 @@ installRequiredPackages() { done ;; debian) - DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS $PACKAGES_PERSISTENT_NEW $PACKAGES_VOLATILE + apt-get install -qqy --no-install-recommends $PACKAGES_PERSISTENT_NEW $PACKAGES_VOLATILE ;; esac } @@ -2099,12 +2210,12 @@ installMicrosoftSqlServerODBC() { fi printf -- '- installing the APT package\n' if test $PHP_MAJMIN_VERSION -le 703; then - DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS msodbcsql17 + ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends msodbcsql17 elif test $DISTRO_VERSION_NUMBER -ge 9 && test $DISTRO_VERSION_NUMBER -le 12; then # On Debian 9 to 12 we have both msodbcsql17 and msodbcsql18: let's install just one - DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS msodbcsql18 + ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends msodbcsql18 else - DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS '^msodbcsql[0-9]+$' + ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends '^msodbcsql[0-9]+$' fi ;; esac @@ -2128,17 +2239,7 @@ isLibaomInstalled() { # Install libaom installLibaom() { printf 'Installing libaom\n' - installLibaom_version=3.8.1 - case "$DISTRO_VERSION" in - debian@10) - case $(uname -m) in - aarch* | arm*) - #see https://bugs.chromium.org/p/aomedia/issues/detail?id=3543 - installLibaom_version=3.5.0 - ;; - esac - ;; - esac + installLibaom_version=3.10.0 installLibaom_dir="$(getPackageSource https://aomedia.googlesource.com/aom/+archive/v$installLibaom_version.tar.gz)" mkdir -- "$installLibaom_dir/my.build" cd -- "$installLibaom_dir/my.build" @@ -2293,6 +2394,108 @@ installLibThai() { cd - >/dev/null } +isLibTommathInstalled() { + if test -f /usr/local/lib/libtommath.a && test -f /usr/local/include/tommath.h; then + return 0 + fi + return 1 +} + +installLibTommath() { + printf 'Installing libtommath\n' + installLibTommath_src="$(getPackageSource https://github.com/libtom/libtommath/releases/download/v1.3.0/ltm-1.3.0.tar.xz)" + mkdir -p "$installLibTommath_src/build" + cd -- "$installLibTommath_src/build" + CFLAGS='-fPIC' cmake -DCMAKE_BUILD_TYPE=Release .. + make -j$(getProcessorCount) + make install + cd - >/dev/null +} + +isLibTomcryptInstalled() { + if test -f /usr/local/lib/libtomcrypt.a && test -f /usr/local/include/tomcrypt.h; then + return 0 + fi + return 1 +} + +installLibTomcrypt() { + printf 'Installing libtomcrypt\n' + installLibTomcrypt_src="$(getPackageSource https://github.com/libtom/libtomcrypt/releases/download/v1.18.2/crypt-1.18.2.tar.xz)" + cd -- "$installLibTomcrypt_src" + CFLAGS='-fPIC' make -j$(getProcessorCount) + make install +} + +isFirebirdInstalled() { + if test -f /usr/lib/libfbclient.so && test -f /usr/include/ibase.h; then + return 0 + fi + if test -d /tmp/src/firebird; then + return 0 + fi + return 1 +} + +installFirebird() { + printf 'Installing firebird\n' + if test $PHP_MAJMIN_VERSION -ge 804; then + installFirebird_src="$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/v5.0.2/Firebird-5.0.2.1613-0-source.tar.xz)" + cd -- "$installFirebird_src" + ./configure --enable-client-only + make -j$(getProcessorCount) + cp -Rd gen/Release/firebird/include/* /usr/include + cp -Rd gen/Release/firebird/lib/* /usr/lib + cd - >/dev/null + else + mv "$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/R2_5_9/Firebird-2.5.9.27139-0.tar.bz2)" /tmp/src/firebird + cd /tmp/src/firebird + # Patch rwlock.h (this has been fixed in later release of firebird 3.x) + sed -i '194s/.*/#if 0/' src/common/classes/rwlock.h + ./configure --with-system-icu + # -j option can't be used: make targets must be compiled sequentially + make -s btyacc_binary gpre_boot libfbstatic libfbclient + cp gen/firebird/lib/libfbclient.so /usr/lib/ + ln -s /usr/lib/libfbclient.so /usr/lib/libfbclient.so.2 + cd - >/dev/null + fi +} + +isLibXCryptInstalled() { + if ! test -f /usr/local/lib/libcrypt.so && ! test -f /usr/lib/libcrypt.so && ! test -f /usr/lib/x86_64*/libcrypt.so; then + return 1 + fi + return 0 +} + +installLibXCrypt() { + printf 'Installing libxcrypt\n' + installLibXCrypt_version=4.4.36 + installLibXCrypt_src="$(getPackageSource "https://github.com/besser82/libxcrypt/releases/download/v$installLibXCrypt_version/libxcrypt-$installLibXCrypt_version.tar.xz")" + cd -- "$installLibXCrypt_src" + ./configure --prefix /usr + make -j$(getProcessorCount) + make install + cd - >/dev/null +} + +isLibenchant1Installed() { + if test -f /usr/lib/libenchant.so || test -f /usr/local/lib/libenchant.so; then + return 0 + fi + return 1 +} + +installLibenchant1() { + printf 'Installing libenchant1\n' + installLibenchant1_src="$(getPackageSource https://github.com/rrthomas/enchant/releases/download/enchant-1-6-1/enchant-1.6.1.tar.gz)" + cd -- "$installLibenchant1_src" + ./configure + make -j$(getProcessorCount) + make install + cd - >/dev/null +} + # Install Composer installComposer() { installComposer_version="$(getWantedPHPModuleVersion @composer)" @@ -2342,30 +2545,41 @@ actuallyInstallComposer() { # Install ionCube Loader installIonCubeLoader() { + installIonCubeLoader_version='' + if test $PHP_MAJMIN_VERSION -lt 804; then + # For 14.4.0 we have a Segmentation Fault + installIonCubeLoader_version=14.0.0 + fi + installIonCubeLoader_versionForUrl='' + installIonCubeLoader_versionForMessage=latest + if test -n "$installIonCubeLoader_version"; then + installIonCubeLoader_versionForUrl="_$installIonCubeLoader_version" + installIonCubeLoader_versionForMessage="v$installIonCubeLoader_version" + fi # See https://www.ioncube.com/loaders.php case $PHP_BITS in 32) case $(uname -m) in aarch* | arm*) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_armv7l.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_armv7l$installIonCubeLoader_versionForUrl.tar.gz" ;; *) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86$installIonCubeLoader_versionForUrl.tar.gz" ;; esac ;; *) case $(uname -m) in aarch64 | arm64 | armv8) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_aarch64.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_aarch64$installIonCubeLoader_versionForUrl.tar.gz" ;; *) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64$installIonCubeLoader_versionForUrl.tar.gz" ;; esac ;; esac - printf 'Downloading ionCube Loader... ' + printf 'Downloading ionCube Loader (%s)... ' "$installIonCubeLoader_versionForMessage" installIonCubeLoader_dir="$(getPackageSource $installIonCubeLoader_url)" echo 'done.' installIonCubeLoader_so=$(php -r "printf('ioncube_loader_lin_%s.%s%s.so', PHP_MAJOR_VERSION, PHP_MINOR_VERSION, ZEND_THREAD_SAFE ? '_ts' : '');") @@ -2414,15 +2628,31 @@ installCargo() { if command -v cargo >/dev/null; then return fi - printf '# Installing cargo\n' - case "$DISTRO" in - alpine) - # see https://github.com/hyperledger/indy-vdr/issues/69#issuecomment-998104850 - export RUSTFLAGS='-C target-feature=-crt-static' - ;; - esac - curl https://sh.rustup.rs -sSf | sh -s -- -y -q + installCargo_cargoversion= + if ! test -f "$HOME/.cargo/env"; then + printf '# Installing cargo\n' + case "$DISTRO" in + alpine) + # see https://github.com/hyperledger/indy-vdr/issues/69#issuecomment-998104850 + export RUSTFLAGS='-C target-feature=-crt-static' + ;; + esac + curl https://sh.rustup.rs -sSf | sh -s -- -y -q + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -le 310; then + # With version 1.84.0 we have this error: + # Error relocating /root/.rustup/toolchains/stable-x86_64-unknown-linux-musl/bin/cargo: posix_spawn_file_actions_addchdir_np: symbol not found + # See https://github.com/rust-lang/rust/pull/131851#issue-2595663507 + installCargo_cargoversion=1.83.0 + fi + ;; + esac + fi . "$HOME/.cargo/env" + if test -n "$installCargo_cargoversion"; then + rustup default -- "$installCargo_cargoversion" + fi if test -z "${IPE_UNINSTALL_CARGO:-}"; then IPE_UNINSTALL_CARGO=y fi @@ -2430,14 +2660,20 @@ installCargo() { installNewRelic() { printf '# Installing newrelic\n' + # see https://docs.newrelic.com/docs/apm/agents/php-agent/getting-started/php-agent-compatibility-requirements/ + if test $PHP_MAJMIN_VERSION -le 701; then + installNewRelic_baseUrl=https://download.newrelic.com/php_agent/archive/10.21.0.11/ + else + installNewRelic_baseUrl=https://download.newrelic.com/php_agent/release/ + fi installNewRelic_search='\bnewrelic-php[0-9.]*-[0-9]+(\.[0-9]+)*-linux' case "$DISTRO" in alpine) installNewRelic_search="$installNewRelic_search-musl" ;; esac - installNewRelic_file="$(curl -sSLf -o- https://download.newrelic.com/php_agent/release/ | sed -E 's/<[^>]*>//g' | grep -Eo "$installNewRelic_search.tar.gz" | sort | head -1)" - installNewRelic_url="https://download.newrelic.com/php_agent/release/$installNewRelic_file" + installNewRelic_file="$(curl -sSLf -o- "$installNewRelic_baseUrl" | sed -E 's/<[^>]*>//g' | grep -Eo "$installNewRelic_search.tar.gz" | sort | head -1)" + installNewRelic_url="$installNewRelic_baseUrl$installNewRelic_file" installNewRelic_src="$(getPackageSource "$installNewRelic_url")" cd -- "$installNewRelic_src" NR_INSTALL_USE_CP_NOT_LN=1 NR_INSTALL_SILENT=1 ./newrelic-install install @@ -2446,6 +2682,12 @@ installNewRelic() { NR_INSTALL_USE_CP_NOT_LN=1 NR_INSTALL_SILENT=1 ./newrelic-install install_daemon ;; esac + case "${IPE_NEWRELIC_KEEPLOG:-}" in + 1 | y* | Y*) ;; + *) + rm -f /tmp/nrinstall-*.tar + ;; + esac cd - >/dev/null cat </dev/null - fi - ;; ftp) - docker-php-ext-configure ftp --with-openssl-dir=/usr + if test $PHP_MAJMIN_VERSION -ge 804; then + docker-php-ext-configure ftp --with-ftp-ssl=/usr + else + docker-php-ext-configure ftp --with-openssl-dir=/usr + fi ;; gd) if test $PHP_MAJMIN_VERSION -le 506; then @@ -2551,23 +2802,6 @@ EOF ;; esac if test $installBundledModule_tmp -eq 0; then - case "${IPE_GD_WITHOUTAVIF:-}" in - 1 | y* | Y*) ;; - *) - if ! isLibaomInstalled; then - installLibaom - fi - if ! isLibdav1dInstalled; then - installLibdav1d - fi - if ! isLibyuvInstalled; then - installLibyuv - fi - if ! isLibavifInstalled; then - installLibavif - fi - ;; - esac if isLibaomInstalled && isLibdav1dInstalled && isLibyuvInstalled && isLibavifInstalled; then installBundledModule_tmp=1 fi @@ -2592,7 +2826,7 @@ EOF debian@9) installBundledModule_tmp="$(pwd)" cd /tmp - apt-get download $IPE_APTGET_INSTALLOPTIONS libc-client2007e-dev + apt-get download libc-client2007e-dev dpkg -i --ignore-depends=libssl-dev libc-client2007e-dev* rm libc-client2007e-dev* cd "$installBundledModule_tmp" @@ -2603,19 +2837,9 @@ EOF interbase | pdo_firebird) case "$DISTRO" in alpine) - if ! test -d /tmp/src/firebird; then - mv "$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/R2_5_9/Firebird-2.5.9.27139-0.tar.bz2)" /tmp/src/firebird - cd /tmp/src/firebird - # Patch rwlock.h (this has been fixed in later release of firebird 3.x) - sed -i '194s/.*/#if 0/' src/common/classes/rwlock.h - ./configure --with-system-icu - # -j option can't be used: make targets must be compiled sequentially - make -s btyacc_binary gpre_boot libfbstatic libfbclient - cp gen/firebird/lib/libfbclient.so /usr/lib/ - ln -s /usr/lib/libfbclient.so /usr/lib/libfbclient.so.2 - cd - >/dev/null + if test $PHP_MAJMIN_VERSION -lt 804; then + 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 fi - 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 ;; esac ;; @@ -2824,7 +3048,7 @@ installRemoteModule() { installRemoteModule_distro=linux ;; esac - installRemoteModule_tmp2=$(php -r 'echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION;') + installRemoteModule_tmp2=$(php -r 'echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION . (ZEND_THREAD_SAFE ? "-zts" : "");') installRemoteModule_tmp="$(mktemp -p /tmp/src -d)" cd "$installRemoteModule_tmp" curl -sSLf --user-agent Docker https://blackfire.io/api/v1/releases/probe/php/$installRemoteModule_distro/$installRemoteModule_tmp1/$installRemoteModule_tmp2 | tar xz @@ -2852,7 +3076,7 @@ installRemoteModule() { if test $(compareVersions "$(cmake --version | head -n1 | sed -E 's/^.* //')" '3.7') -lt 0; then installRemoteModule_tmp=0.29.0 else - installRemoteModule_tmp=0.31.0 + installRemoteModule_tmp=0.31.1 fi cd "$(getPackageSource https://github.com/commonmark/cmark/archive/$installRemoteModule_tmp.tar.gz)" make -s -j$(getProcessorCount) cmake_build @@ -2882,6 +3106,16 @@ installRemoteModule() { if test $PHP_MAJMIN_VERSION -lt 700; then installRemoteModule_version=0.75.0 fi + if test -z "$installRemoteModule_version"; then + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -le 312; then + # cc is not supported due to a memcmp related bug + installRemoteModule_version=1.1.0 + fi + ;; + esac + fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" fi @@ -2919,6 +3153,13 @@ installRemoteModule() { installRemoteModule_version=alpha fi ;; + ev) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 800; then + installRemoteModule_version=1.1.5 + fi + fi + ;; event) installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 2.4.0) -ge 0; then @@ -2986,6 +3227,8 @@ installRemoteModule() { if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then installRemoteModule_version=1.1.2 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=2.1.3 fi fi case "$DISTRO" in @@ -3073,7 +3316,7 @@ installRemoteModule() { if ! test -e /usr/local/lib/libidnkit.so; then installRemoteModule_src="$(getPackageSource https://jprs.co.jp/idn/idnkit-2.3.tar.bz2)" cd -- "$installRemoteModule_src" - ./configure + CFLAGS=-Wno-incompatible-pointer-types ./configure make -j$(getProcessorCount) install cd - >/dev/null fi @@ -3108,14 +3351,14 @@ installRemoteModule() { if ! test -f /usr/local/lib/libionc.so || ! test -f /usr/local/include/ionc/ion.h; then echo 'Installing ion-c... ' installRemoteModule_src="$(mktemp -p /tmp/src -d)" - git clone -q -c advice.detachedHead=false --depth 1 --branch v1.1.2 https://github.com/amzn/ion-c.git "$installRemoteModule_src/ion" + git clone -q -c advice.detachedHead=false --depth 1 --branch v1.1.3 https://github.com/amzn/ion-c.git "$installRemoteModule_src/ion" ( cd "$installRemoteModule_src/ion" git submodule init -q git submodule update -q mkdir -p build cd build - cmake -DCMAKE_BUILD_TYPE=Release .. -Wno-dev + CFLAGS='-Wno-incompatible-pointer-types -Wno-stringop-overflow -Wno-discarded-qualifiers' cmake -DCMAKE_BUILD_TYPE=Release .. -Wno-dev make clean make -j$(getProcessorCount) install ) @@ -3267,6 +3510,8 @@ installRemoteModule() { installRemoteModule_version=1.11.1 elif test $PHP_MAJMIN_VERSION -le 703; then installRemoteModule_version=1.16.2 + elif test $PHP_MAJMIN_VERSION -le 800; then + installRemoteModule_version=1.20.1 fi fi if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 1.17.0) -ge 0; then @@ -3336,6 +3581,8 @@ installRemoteModule() { installRemoteModule_version=4.10.0 elif test $PHP_MAJMIN_VERSION -lt 801; then installRemoteModule_version=22.0.0 + elif test $PHP_MAJMIN_VERSION -lt 802; then + installRemoteModule_version=22.1.2 fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -3431,6 +3678,11 @@ installRemoteModule() { addConfigureOption enable-swoole-curl yes fi ;; + operator) + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=beta + fi + ;; parallel) if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 701; then @@ -3461,6 +3713,16 @@ installRemoteModule() { fi fi ;; + phalcon) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMINPAT_VERSION -lt 70401; then + installRemoteModule_version=4.1.2 + elif test $PHP_MAJMIN_VERSION -lt 800; then + installRemoteModule_version=5.4.0 + fi + fi + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' + ;; php_trie) if ! test -f /usr/local/include/hat-trie/include/tsl/htrie_map.h; then installRemoteModule_src="$(getPackageSource https://codeload.github.com/Tessil/hat-trie/tar.gz/v0.6.0)" @@ -3490,6 +3752,17 @@ installRemoteModule() { fi fi ;; + psr) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 506; then + installRemoteModule_version=0.5.1 + elif test $PHP_MAJMIN_VERSION -lt 700; then + installRemoteModule_version=0.6.1 + elif test $PHP_MAJMIN_VERSION -lt 703; then + installRemoteModule_version=1.1.0 + fi + fi + ;; pthreads) if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then @@ -3546,6 +3819,8 @@ installRemoteModule() { installRemoteModule_version=4.3.0 elif test $PHP_MAJMIN_VERSION -le 701; then installRemoteModule_version=5.3.7 + elif test $PHP_MAJMIN_VERSION -le 703; then + installRemoteModule_version=6.0.2 fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -3674,6 +3949,18 @@ installRemoteModule() { fi fi ;; + seaslog) + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' + ;; + smbclient) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.1.1 + elif test $PHP_MAJMIN_VERSION -le 703; then + installRemoteModule_version=1.1.2 + fi + fi + ;; snappy) if test -z "$installRemoteModule_path"; then if test -z "$installRemoteModule_version"; then @@ -3691,10 +3978,12 @@ installRemoteModule() { snuffleupagus) if test -z "$installRemoteModule_path"; then if test -z "$installRemoteModule_version"; then - if test $PHP_MAJMIN_VERSION -le 704; then + if test $PHP_MAJMIN_VERSION -le 800; then installRemoteModule_version=0.9.0 - else + elif test $PHP_MAJMIN_VERSION -le 801; then installRemoteModule_version=0.10.0 + else + installRemoteModule_version=0.11.0 fi fi installRemoteModule_src="$(getPackageSource https://codeload.github.com/jvoisin/snuffleupagus/tar.gz/v$installRemoteModule_version)" @@ -3738,7 +4027,7 @@ installRemoteModule() { spx) if test -z "$installRemoteModule_path"; then if test -z "$installRemoteModule_version"; then - installRemoteModule_version=v0.4.15 + installRemoteModule_version=v0.4.18 fi if test "${installRemoteModule_version%.*}" = "$installRemoteModule_version"; then installRemoteModule_displayVersion="$installRemoteModule_version" @@ -3811,6 +4100,21 @@ installRemoteModule() { elif test $PHP_BITS -eq 32; then # See https://github.com/swoole/swoole-src/issues/5198#issuecomment-1820162178 installRemoteModule_version="$(resolvePHPModuleVersion "$installRemoteModule_module" '^5.0')" + else + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -le 312; then + installRemoteModule_version=5.1.2 + fi + ;; + esac + fi + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 800; then + installRemoteModule_version=5.1.3 + else + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" stable)" + fi fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -3823,19 +4127,115 @@ installRemoteModule() { installRemoteModule_openssl=yes case "$DISTRO_VERSION" in alpine@3.7 | alpine@3.8) - if test -n "$installRemoteModule_version" && test $(compareVersions "$installRemoteModule_version" 4.6.0) -lt 0; then + if test $(compareVersions "$installRemoteModule_version" 4.6.0) -lt 0; then # see https://github.com/swoole/swoole-src/issues/3934 installRemoteModule_openssl=no fi ;; esac - if test $PHP_MAJMIN_VERSION -eq 803; then - # see https://github.com/swoole/docker-swoole/issues/45 - installRemoteModule_curl=no + if test $PHP_THREADSAFE -eq 1; then + installRemoteModule_zts=yes else - installRemoteModule_curl=yes + installRemoteModule_zts=no fi - if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 5.0.1) -ge 0; then + installRemoteModule_sqlite=yes + installRemoteModule_iouring=no + installRemoteModule_curl=yes + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -lt 317; then + # we need sqlite3 >= 3.7.7 + installRemoteModule_sqlite=no + fi + case "${IPE_SWOOLE_WITHOUT_IOURING:-}" in + 1 | y* | Y*) ;; + *) + # iouring support in swoole 6 requires liburing 2.5+: available since Alpine 3.19 + # but with Alpine 3.19 we have a "invalid use of incomplete type 'const struct statx'" error + if test $DISTRO_MAJMIN_VERSION -ge 320; then + installRemoteModule_iouring=yes + fi + ;; + esac + ;; + debian) + if test $PHP_MAJMIN_VERSION -ge 800; then + # see https://github.com/swoole/swoole-src/issues/5365 + installRemoteModule_curl=no + fi + if test $DISTRO_MAJMIN_VERSION -lt 1200; then + # we need sqlite3 >= 3.7.7 + installRemoteModule_sqlite=no + fi + case "${IPE_SWOOLE_WITHOUT_IOURING:-}" in + 1 | y* | Y*) ;; + *) + if test $DISTRO_VERSION_NUMBER -ge 13; then + # iouring support in swoole 6 requires liburing 2.5+: available since Debian Trixie (13) + installRemoteModule_iouring=yes + fi + ;; + esac + ;; + esac + installRemoteModule_zstd=yes + case "$DISTRO" in + debian) + if test $DISTRO_VERSION_NUMBER -lt 11; then + # swoole 6 requires libzstd >= 1.4.0, but on debian 10 (buster) we have 1.3.8 + installRemoteModule_zstd=no + fi + ;; + esac + if test $(compareVersions "$installRemoteModule_version" 6.0.0) -ge 0; then + # enable sockets support? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable curl support? + addConfigureOption enable-swoole-curl $installRemoteModule_curl + # enable cares support? + addConfigureOption enable-cares yes + # enable brotli support? + addConfigureOption enable-brotli yes + # enable zstd support? + addConfigureOption enable-zstd $installRemoteModule_zstd + # enable PostgreSQL database support? + addConfigureOption enable-swoole-pgsql yes + # enable ODBC database support? + addConfigureOption with-swoole-odbc no + # enable Oracle database support? + addConfigureOption with-swoole-oracle no + # enable Sqlite database support? + addConfigureOption enable-swoole-sqlite $installRemoteModule_sqlite + # enable swoole thread support (need php zts support)? + addConfigureOption enable-swoole-thread $installRemoteModule_zts + # enable iouring for file async support? + addConfigureOption enable-iouring $installRemoteModule_iouring + elif test $(compareVersions "$installRemoteModule_version" 5.1.0) -ge 0; then + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable curl support? + addConfigureOption enable-swoole-curl $installRemoteModule_curl + # enable cares support? + addConfigureOption enable-cares yes + # enable brotli support? + addConfigureOption enable-brotli yes + # enable PostgreSQL database support? + addConfigureOption enable-swoole-pgsql yes + # enable ODBC database support? + addConfigureOption with-swoole-odbc no + # enable Oracle database support? + addConfigureOption with-swoole-oracle no + # enable Sqlite database support? + addConfigureOption enable-swoole-sqlite $installRemoteModule_sqlite + elif test $(compareVersions "$installRemoteModule_version" 5.0.1) -ge 0; then # enable sockets supports? addConfigureOption enable-sockets $installRemoteModule_sockets # enable openssl support? @@ -4005,6 +4405,7 @@ installRemoteModule() { fi ;; tensor) + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 703; then installRemoteModule_version=2.2.3 @@ -4072,6 +4473,7 @@ installRemoteModule() { installRemoteModule_manuallyInstalled=1 ;; uopz) + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then installRemoteModule_version=2.0.7 @@ -4189,6 +4591,17 @@ installRemoteModule() { addConfigureOption enable-reader yes fi ;; + xmldiff) + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + if test -z "$installRemoteModule_version"; then + case "$DISTRO_VERSION" in + debian@8) + # The gcc version of Debian Jessie is too old => error: 'nullptr' was not declared in this scope + installRemoteModule_version=1.1.4 + ;; + esac + fi + ;; xmlrpc) if test -z "$installRemoteModule_version"; then installRemoteModule_version=beta @@ -4265,8 +4678,6 @@ installRemoteModule() { if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then installRemoteModule_version=0.5.0 - else - installRemoteModule_version=alpha fi fi installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -4521,23 +4932,18 @@ removeStringFromList() { } # Invoke apt-get update -# -# Set: -# IPE_APTGET_INSTALLOPTIONS invokeAptGetUpdate() { if test -n "${IPE_APTGETUPDATE_ALREADY:-}"; then - DEBIAN_FRONTEND=noninteractive apt-get update -q + apt-get update -q return fi - IPE_APTGET_INSTALLOPTIONS='' - invokeAptGetUpdate_fixdistro='' + IPE_APTGETUPDATE_ALREADY=y if grep -q 'VERSION="8 (jessie)"' /etc/os-release; then invokeAptGetUpdate_fixdistro=jessie elif grep -q 'VERSION="9 (stretch)"' /etc/os-release; then invokeAptGetUpdate_fixdistro=stretch else - IPE_APTGETUPDATE_ALREADY=y - DEBIAN_FRONTEND=noninteractive apt-get update -q + invokeAptGetUpdate return fi # See https://www.debian.org/distrib/archive.en.html for a list of mirrors @@ -4552,19 +4958,18 @@ invokeAptGetUpdate() { sed -ri "s;^(\s*deb\s+)http://security.debian.org/debian-security;\1$IPE_DEB_ARCHIVE_SECURITY;" /etc/apt/sources.list sed -ri "s;^(\s*deb\s+)http://security.debian.org;\1$IPE_DEB_ARCHIVE_SECURITY;" /etc/apt/sources.list invokeAptGetUpdate_tmp="$(mktemp)" - DEBIAN_FRONTEND=noninteractive apt-get update -q 2>"$invokeAptGetUpdate_tmp" + apt-get update -q 2>"$invokeAptGetUpdate_tmp" if test -s "$invokeAptGetUpdate_tmp"; then cat "$invokeAptGetUpdate_tmp" >&2 if grep -qE ' KEYEXPIRED [0-9]' "$invokeAptGetUpdate_tmp"; then - IPE_APTGET_INSTALLOPTIONS='-o APT::Get::AllowUnauthenticated=true' echo '############' >&2 echo '# WARNING! #' >&2 echo '############' >&2 echo 'apt packages will be installed without checking authenticity!' >&2 + printf 'APT::Get::AllowUnauthenticated "true";\n' >>/etc/apt/apt.conf.d/99unauthenticated fi fi rm "$invokeAptGetUpdate_tmp" - IPE_APTGETUPDATE_ALREADY=y } # Fix the Let's Encrypt CA certificates on old distros @@ -4595,7 +5000,7 @@ fixLetsEncrypt() { invokeAptGetUpdate fi printf -- '- installing newer ca-certificates package\n' - DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends ${IPE_APTGET_INSTALLOPTIONS:-} ca-certificates + apt-get install -qqy --no-install-recommends ca-certificates fi ;; *) @@ -4616,8 +5021,12 @@ fixLetsEncrypt() { # Cleanup everything at the end of the execution cleanup() { if test "${IPE_UNINSTALL_CARGO:-}" = y; then - . "$HOME/.cargo/env" - rustup self uninstall -y + if test -f "$HOME/.cargo/env"; then + . "$HOME/.cargo/env" + fi + if command -v rustup >/dev/null; then + rustup self uninstall -y + fi fi if test -n "$UNNEEDED_PACKAGE_LINKS"; then printf '### REMOVING UNNEEDED PACKAGE LINKS ###\n' @@ -4640,11 +5049,11 @@ cleanup() { debian) if test -n "$PACKAGES_VOLATILE"; then printf '### REMOVING UNNEEDED PACKAGES ###\n' - DEBIAN_FRONTEND=noninteractive apt-get remove --purge -y $PACKAGES_VOLATILE + apt-get remove --purge -y $PACKAGES_VOLATILE fi if test -n "$PACKAGES_PREVIOUS"; then printf '### RESTORING PREVIOUSLY INSTALLED PACKAGES ###\n' - DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends --no-upgrade $IPE_APTGET_INSTALLOPTIONS $PACKAGES_PREVIOUS + apt-get install -qqy --no-install-recommends --no-upgrade $PACKAGES_PREVIOUS fi ;; esac @@ -4669,6 +5078,8 @@ cleanup() { esac } +DEBIAN_FRONTEND=noninteractive +export DEBIAN_FRONTEND resetIFS mkdir -p /tmp/src mkdir -p /tmp/pickle.tmp @@ -4684,7 +5095,7 @@ esac setPHPVersionVariables setPHPPreinstalledModules case "$PHP_MAJMIN_VERSION" in - 505 | 506 | 700 | 701 | 702 | 703 | 704 | 800 | 801 | 802 | 803) ;; + 505 | 506 | 700 | 701 | 702 | 703 | 704 | 800 | 801 | 802 | 803 | 804) ;; *) printf "### ERROR: Unsupported PHP version: %s.%s ###\n" $((PHP_MAJMIN_VERSION / 100)) $((PHP_MAJMIN_VERSION % 100)) ;; @@ -4721,6 +5132,8 @@ if test $USE_PICKLE -gt 1; then buildPickle fi +compileLibs + for PHP_MODULE_TO_INSTALL in $PHP_MODULES_TO_INSTALL; do case "$PHP_MODULE_TO_INSTALL" in @fix_letsencrypt) diff --git a/php8/8.2.27/build/php/extensions/install-php-extensions b/php8/8.2.27/build/php/extensions/install-php-extensions index 59a1ea8b2..2ef98bb85 100644 --- a/php8/8.2.27/build/php/extensions/install-php-extensions +++ b/php8/8.2.27/build/php/extensions/install-php-extensions @@ -21,7 +21,7 @@ if ! which docker-php-ext-configure >/dev/null || ! which docker-php-ext-enable exit 1 fi -IPE_VERSION=2.2.14 +IPE_VERSION=2.7.27 StandWithUkraine() { if test -t 1 && ! grep -Eq '^VERSION=.*jessie' /etc/os-release; then @@ -273,6 +273,15 @@ EOT # 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 @@ -597,6 +606,10 @@ sortModulesToInstall() { 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")" @@ -662,9 +675,11 @@ expandASpellDictionaries() { # 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 @@ -781,8 +796,11 @@ buildRequiredPackageLists() { buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile enchant2-dev" else # The system provides libenchant2, supported since PHP 8.0: we need to build libenchant1 on our own - buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent glib aspell-libs libhunspell" - buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile glib-dev aspell-dev hunspell-dev" + 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" @@ -795,9 +813,12 @@ buildRequiredPackageLists() { buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libenchant-2-2" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libenchant-2-dev" else - # 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" + 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" @@ -844,6 +865,18 @@ buildRequiredPackageLists() { 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" ;; @@ -869,6 +902,18 @@ buildRequiredPackageLists() { 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 @@ -952,7 +997,7 @@ buildRequiredPackageLists() { 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$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libicu-dev ^libidn2-[0-9+]-dev$ ^libgcrypt[0-9]+-dev$" fi ;; imagick@alpine) @@ -984,6 +1029,9 @@ buildRequiredPackageLists() { ;; interbase@alpine) buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev ncurses-dev" + if ! isFirebirdInstalled; then + COMPILE_LIBS="$COMPILE_LIBS firebird" + fi ;; interbase@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libfbclient2" @@ -1159,6 +1207,20 @@ buildRequiredPackageLists() { ;; pdo_firebird@alpine) buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev ncurses-dev" + if ! isFirebirdInstalled; then + COMPILE_LIBS="$COMPILE_LIBS firebird" + if test $PHP_MAJMIN_VERSION -ge 804; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib-dev" + if ! isLibTommathInstalled; then + COMPILE_LIBS="$COMPILE_LIBS libtommath" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake" + fi + if ! isLibTomcryptInstalled; then + COMPILE_LIBS="$COMPILE_LIBS libtomcrypt" + fi + fi + fi ;; pdo_firebird@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libfbclient2" @@ -1175,6 +1237,20 @@ buildRequiredPackageLists() { php_trie@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" ;; + phpy@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent python3" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile python3-dev" + ;; + phpy@debian) + if test $DISTRO_VERSION_NUMBER -ge 12; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.11" + elif test $DISTRO_VERSION_NUMBER -ge 11; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.9" + else + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.7" + fi + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile python3-dev" + ;; pkcs11@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent softhsm" ;; @@ -1354,7 +1430,22 @@ buildRequiredPackageLists() { if test $PHP_MAJMIN_VERSION -ge 702; then buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent c-ares" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile c-ares-dev" + if test $PHP_MAJMIN_VERSION -ge 801; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent zstd-libs" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile sqlite-dev zstd-dev" + fi fi + case "${IPE_SWOOLE_WITHOUT_IOURING:-}" in + 1 | y* | Y*) ;; + *) + # iouring support in swoole 6 requires liburing 2.5+: available since Alpine 3.19 + # but with Alpine 3.19 we have a "invalid use of incomplete type 'const struct statx'" error + if test $DISTRO_MAJMIN_VERSION -ge 320; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent liburing" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile liburing-dev" + fi + ;; + esac ;; swoole@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libcurl3-gnutls libpq5" @@ -1362,9 +1453,23 @@ buildRequiredPackageLists() { if test $PHP_MAJMIN_VERSION -ge 702; then buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libc-ares2" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libc-ares-dev" + if test $PHP_MAJMIN_VERSION -ge 800; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libbrotli1" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev libbrotli-dev" + if test $PHP_MAJMIN_VERSION -ge 801; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libsqlite3-dev" + if test $DISTRO_VERSION_NUMBER -ge 11; then + # swoole 6 requires libzstd >= 1.4.0, but on debian 10 (buster) we have 1.3.8 + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libzstd[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libzstd-dev" + fi + fi + fi fi - if test $PHP_MAJMIN_VERSION -ge 800; then - buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev" + if test $DISTRO_VERSION_NUMBER -ge 13; then + # iouring support in swoole 6 requires liburing 2.5+: available since Debian Trixie (13) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent liburing2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile liburing-dev" fi ;; sybase_ct@alpine) @@ -1490,6 +1595,12 @@ buildRequiredPackageLists() { xmlrpc@debian) buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" ;; + xpass@alpine) + if ! isLibXCryptInstalled; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile linux-headers" + COMPILE_LIBS="$COMPILE_LIBS libxcrypt" + fi + ;; xsl@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libxslt" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxslt-dev libgcrypt-dev" @@ -1622,7 +1733,7 @@ expandPackagesToBeInstalled() { resetIFS ;; debian) - expandPackagesToBeInstalled_log="$(DEBIAN_FRONTEND=noninteractive apt-get install -sy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS $@ 2>&1 || printf '\nE: apt-get failed\n')" + expandPackagesToBeInstalled_log="$(apt-get install -sy --no-install-recommends $@ 2>&1 || printf '\nE: apt-get failed\n')" if test -n "$(printf '%s' "$expandPackagesToBeInstalled_log" | grep -E '^E:')"; then printf 'FAILED TO LIST THE WHOLE PACKAGE LIST FOR\n' >&2 printf '%s ' "$@" >&2 @@ -1891,7 +2002,7 @@ markPreinstalledPackagesAsUsed() { apk add $PACKAGES_PERSISTENT_PRE ;; debian) - DEBIAN_FRONTEND=noninteractive apt-mark manual $PACKAGES_PERSISTENT_PRE + apt-mark manual $PACKAGES_PERSISTENT_PRE ;; esac } @@ -1917,7 +2028,7 @@ installRequiredPackages() { done ;; debian) - DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS $PACKAGES_PERSISTENT_NEW $PACKAGES_VOLATILE + apt-get install -qqy --no-install-recommends $PACKAGES_PERSISTENT_NEW $PACKAGES_VOLATILE ;; esac } @@ -2099,12 +2210,12 @@ installMicrosoftSqlServerODBC() { fi printf -- '- installing the APT package\n' if test $PHP_MAJMIN_VERSION -le 703; then - DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS msodbcsql17 + ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends msodbcsql17 elif test $DISTRO_VERSION_NUMBER -ge 9 && test $DISTRO_VERSION_NUMBER -le 12; then # On Debian 9 to 12 we have both msodbcsql17 and msodbcsql18: let's install just one - DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS msodbcsql18 + ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends msodbcsql18 else - DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS '^msodbcsql[0-9]+$' + ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends '^msodbcsql[0-9]+$' fi ;; esac @@ -2128,17 +2239,7 @@ isLibaomInstalled() { # Install libaom installLibaom() { printf 'Installing libaom\n' - installLibaom_version=3.8.1 - case "$DISTRO_VERSION" in - debian@10) - case $(uname -m) in - aarch* | arm*) - #see https://bugs.chromium.org/p/aomedia/issues/detail?id=3543 - installLibaom_version=3.5.0 - ;; - esac - ;; - esac + installLibaom_version=3.10.0 installLibaom_dir="$(getPackageSource https://aomedia.googlesource.com/aom/+archive/v$installLibaom_version.tar.gz)" mkdir -- "$installLibaom_dir/my.build" cd -- "$installLibaom_dir/my.build" @@ -2293,6 +2394,108 @@ installLibThai() { cd - >/dev/null } +isLibTommathInstalled() { + if test -f /usr/local/lib/libtommath.a && test -f /usr/local/include/tommath.h; then + return 0 + fi + return 1 +} + +installLibTommath() { + printf 'Installing libtommath\n' + installLibTommath_src="$(getPackageSource https://github.com/libtom/libtommath/releases/download/v1.3.0/ltm-1.3.0.tar.xz)" + mkdir -p "$installLibTommath_src/build" + cd -- "$installLibTommath_src/build" + CFLAGS='-fPIC' cmake -DCMAKE_BUILD_TYPE=Release .. + make -j$(getProcessorCount) + make install + cd - >/dev/null +} + +isLibTomcryptInstalled() { + if test -f /usr/local/lib/libtomcrypt.a && test -f /usr/local/include/tomcrypt.h; then + return 0 + fi + return 1 +} + +installLibTomcrypt() { + printf 'Installing libtomcrypt\n' + installLibTomcrypt_src="$(getPackageSource https://github.com/libtom/libtomcrypt/releases/download/v1.18.2/crypt-1.18.2.tar.xz)" + cd -- "$installLibTomcrypt_src" + CFLAGS='-fPIC' make -j$(getProcessorCount) + make install +} + +isFirebirdInstalled() { + if test -f /usr/lib/libfbclient.so && test -f /usr/include/ibase.h; then + return 0 + fi + if test -d /tmp/src/firebird; then + return 0 + fi + return 1 +} + +installFirebird() { + printf 'Installing firebird\n' + if test $PHP_MAJMIN_VERSION -ge 804; then + installFirebird_src="$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/v5.0.2/Firebird-5.0.2.1613-0-source.tar.xz)" + cd -- "$installFirebird_src" + ./configure --enable-client-only + make -j$(getProcessorCount) + cp -Rd gen/Release/firebird/include/* /usr/include + cp -Rd gen/Release/firebird/lib/* /usr/lib + cd - >/dev/null + else + mv "$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/R2_5_9/Firebird-2.5.9.27139-0.tar.bz2)" /tmp/src/firebird + cd /tmp/src/firebird + # Patch rwlock.h (this has been fixed in later release of firebird 3.x) + sed -i '194s/.*/#if 0/' src/common/classes/rwlock.h + ./configure --with-system-icu + # -j option can't be used: make targets must be compiled sequentially + make -s btyacc_binary gpre_boot libfbstatic libfbclient + cp gen/firebird/lib/libfbclient.so /usr/lib/ + ln -s /usr/lib/libfbclient.so /usr/lib/libfbclient.so.2 + cd - >/dev/null + fi +} + +isLibXCryptInstalled() { + if ! test -f /usr/local/lib/libcrypt.so && ! test -f /usr/lib/libcrypt.so && ! test -f /usr/lib/x86_64*/libcrypt.so; then + return 1 + fi + return 0 +} + +installLibXCrypt() { + printf 'Installing libxcrypt\n' + installLibXCrypt_version=4.4.36 + installLibXCrypt_src="$(getPackageSource "https://github.com/besser82/libxcrypt/releases/download/v$installLibXCrypt_version/libxcrypt-$installLibXCrypt_version.tar.xz")" + cd -- "$installLibXCrypt_src" + ./configure --prefix /usr + make -j$(getProcessorCount) + make install + cd - >/dev/null +} + +isLibenchant1Installed() { + if test -f /usr/lib/libenchant.so || test -f /usr/local/lib/libenchant.so; then + return 0 + fi + return 1 +} + +installLibenchant1() { + printf 'Installing libenchant1\n' + installLibenchant1_src="$(getPackageSource https://github.com/rrthomas/enchant/releases/download/enchant-1-6-1/enchant-1.6.1.tar.gz)" + cd -- "$installLibenchant1_src" + ./configure + make -j$(getProcessorCount) + make install + cd - >/dev/null +} + # Install Composer installComposer() { installComposer_version="$(getWantedPHPModuleVersion @composer)" @@ -2342,30 +2545,41 @@ actuallyInstallComposer() { # Install ionCube Loader installIonCubeLoader() { + installIonCubeLoader_version='' + if test $PHP_MAJMIN_VERSION -lt 804; then + # For 14.4.0 we have a Segmentation Fault + installIonCubeLoader_version=14.0.0 + fi + installIonCubeLoader_versionForUrl='' + installIonCubeLoader_versionForMessage=latest + if test -n "$installIonCubeLoader_version"; then + installIonCubeLoader_versionForUrl="_$installIonCubeLoader_version" + installIonCubeLoader_versionForMessage="v$installIonCubeLoader_version" + fi # See https://www.ioncube.com/loaders.php case $PHP_BITS in 32) case $(uname -m) in aarch* | arm*) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_armv7l.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_armv7l$installIonCubeLoader_versionForUrl.tar.gz" ;; *) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86$installIonCubeLoader_versionForUrl.tar.gz" ;; esac ;; *) case $(uname -m) in aarch64 | arm64 | armv8) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_aarch64.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_aarch64$installIonCubeLoader_versionForUrl.tar.gz" ;; *) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64$installIonCubeLoader_versionForUrl.tar.gz" ;; esac ;; esac - printf 'Downloading ionCube Loader... ' + printf 'Downloading ionCube Loader (%s)... ' "$installIonCubeLoader_versionForMessage" installIonCubeLoader_dir="$(getPackageSource $installIonCubeLoader_url)" echo 'done.' installIonCubeLoader_so=$(php -r "printf('ioncube_loader_lin_%s.%s%s.so', PHP_MAJOR_VERSION, PHP_MINOR_VERSION, ZEND_THREAD_SAFE ? '_ts' : '');") @@ -2414,15 +2628,31 @@ installCargo() { if command -v cargo >/dev/null; then return fi - printf '# Installing cargo\n' - case "$DISTRO" in - alpine) - # see https://github.com/hyperledger/indy-vdr/issues/69#issuecomment-998104850 - export RUSTFLAGS='-C target-feature=-crt-static' - ;; - esac - curl https://sh.rustup.rs -sSf | sh -s -- -y -q + installCargo_cargoversion= + if ! test -f "$HOME/.cargo/env"; then + printf '# Installing cargo\n' + case "$DISTRO" in + alpine) + # see https://github.com/hyperledger/indy-vdr/issues/69#issuecomment-998104850 + export RUSTFLAGS='-C target-feature=-crt-static' + ;; + esac + curl https://sh.rustup.rs -sSf | sh -s -- -y -q + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -le 310; then + # With version 1.84.0 we have this error: + # Error relocating /root/.rustup/toolchains/stable-x86_64-unknown-linux-musl/bin/cargo: posix_spawn_file_actions_addchdir_np: symbol not found + # See https://github.com/rust-lang/rust/pull/131851#issue-2595663507 + installCargo_cargoversion=1.83.0 + fi + ;; + esac + fi . "$HOME/.cargo/env" + if test -n "$installCargo_cargoversion"; then + rustup default -- "$installCargo_cargoversion" + fi if test -z "${IPE_UNINSTALL_CARGO:-}"; then IPE_UNINSTALL_CARGO=y fi @@ -2430,14 +2660,20 @@ installCargo() { installNewRelic() { printf '# Installing newrelic\n' + # see https://docs.newrelic.com/docs/apm/agents/php-agent/getting-started/php-agent-compatibility-requirements/ + if test $PHP_MAJMIN_VERSION -le 701; then + installNewRelic_baseUrl=https://download.newrelic.com/php_agent/archive/10.21.0.11/ + else + installNewRelic_baseUrl=https://download.newrelic.com/php_agent/release/ + fi installNewRelic_search='\bnewrelic-php[0-9.]*-[0-9]+(\.[0-9]+)*-linux' case "$DISTRO" in alpine) installNewRelic_search="$installNewRelic_search-musl" ;; esac - installNewRelic_file="$(curl -sSLf -o- https://download.newrelic.com/php_agent/release/ | sed -E 's/<[^>]*>//g' | grep -Eo "$installNewRelic_search.tar.gz" | sort | head -1)" - installNewRelic_url="https://download.newrelic.com/php_agent/release/$installNewRelic_file" + installNewRelic_file="$(curl -sSLf -o- "$installNewRelic_baseUrl" | sed -E 's/<[^>]*>//g' | grep -Eo "$installNewRelic_search.tar.gz" | sort | head -1)" + installNewRelic_url="$installNewRelic_baseUrl$installNewRelic_file" installNewRelic_src="$(getPackageSource "$installNewRelic_url")" cd -- "$installNewRelic_src" NR_INSTALL_USE_CP_NOT_LN=1 NR_INSTALL_SILENT=1 ./newrelic-install install @@ -2446,6 +2682,12 @@ installNewRelic() { NR_INSTALL_USE_CP_NOT_LN=1 NR_INSTALL_SILENT=1 ./newrelic-install install_daemon ;; esac + case "${IPE_NEWRELIC_KEEPLOG:-}" in + 1 | y* | Y*) ;; + *) + rm -f /tmp/nrinstall-*.tar + ;; + esac cd - >/dev/null cat </dev/null - fi - ;; ftp) - docker-php-ext-configure ftp --with-openssl-dir=/usr + if test $PHP_MAJMIN_VERSION -ge 804; then + docker-php-ext-configure ftp --with-ftp-ssl=/usr + else + docker-php-ext-configure ftp --with-openssl-dir=/usr + fi ;; gd) if test $PHP_MAJMIN_VERSION -le 506; then @@ -2551,23 +2802,6 @@ EOF ;; esac if test $installBundledModule_tmp -eq 0; then - case "${IPE_GD_WITHOUTAVIF:-}" in - 1 | y* | Y*) ;; - *) - if ! isLibaomInstalled; then - installLibaom - fi - if ! isLibdav1dInstalled; then - installLibdav1d - fi - if ! isLibyuvInstalled; then - installLibyuv - fi - if ! isLibavifInstalled; then - installLibavif - fi - ;; - esac if isLibaomInstalled && isLibdav1dInstalled && isLibyuvInstalled && isLibavifInstalled; then installBundledModule_tmp=1 fi @@ -2592,7 +2826,7 @@ EOF debian@9) installBundledModule_tmp="$(pwd)" cd /tmp - apt-get download $IPE_APTGET_INSTALLOPTIONS libc-client2007e-dev + apt-get download libc-client2007e-dev dpkg -i --ignore-depends=libssl-dev libc-client2007e-dev* rm libc-client2007e-dev* cd "$installBundledModule_tmp" @@ -2603,19 +2837,9 @@ EOF interbase | pdo_firebird) case "$DISTRO" in alpine) - if ! test -d /tmp/src/firebird; then - mv "$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/R2_5_9/Firebird-2.5.9.27139-0.tar.bz2)" /tmp/src/firebird - cd /tmp/src/firebird - # Patch rwlock.h (this has been fixed in later release of firebird 3.x) - sed -i '194s/.*/#if 0/' src/common/classes/rwlock.h - ./configure --with-system-icu - # -j option can't be used: make targets must be compiled sequentially - make -s btyacc_binary gpre_boot libfbstatic libfbclient - cp gen/firebird/lib/libfbclient.so /usr/lib/ - ln -s /usr/lib/libfbclient.so /usr/lib/libfbclient.so.2 - cd - >/dev/null + if test $PHP_MAJMIN_VERSION -lt 804; then + 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 fi - 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 ;; esac ;; @@ -2824,7 +3048,7 @@ installRemoteModule() { installRemoteModule_distro=linux ;; esac - installRemoteModule_tmp2=$(php -r 'echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION;') + installRemoteModule_tmp2=$(php -r 'echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION . (ZEND_THREAD_SAFE ? "-zts" : "");') installRemoteModule_tmp="$(mktemp -p /tmp/src -d)" cd "$installRemoteModule_tmp" curl -sSLf --user-agent Docker https://blackfire.io/api/v1/releases/probe/php/$installRemoteModule_distro/$installRemoteModule_tmp1/$installRemoteModule_tmp2 | tar xz @@ -2852,7 +3076,7 @@ installRemoteModule() { if test $(compareVersions "$(cmake --version | head -n1 | sed -E 's/^.* //')" '3.7') -lt 0; then installRemoteModule_tmp=0.29.0 else - installRemoteModule_tmp=0.31.0 + installRemoteModule_tmp=0.31.1 fi cd "$(getPackageSource https://github.com/commonmark/cmark/archive/$installRemoteModule_tmp.tar.gz)" make -s -j$(getProcessorCount) cmake_build @@ -2882,6 +3106,16 @@ installRemoteModule() { if test $PHP_MAJMIN_VERSION -lt 700; then installRemoteModule_version=0.75.0 fi + if test -z "$installRemoteModule_version"; then + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -le 312; then + # cc is not supported due to a memcmp related bug + installRemoteModule_version=1.1.0 + fi + ;; + esac + fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" fi @@ -2919,6 +3153,13 @@ installRemoteModule() { installRemoteModule_version=alpha fi ;; + ev) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 800; then + installRemoteModule_version=1.1.5 + fi + fi + ;; event) installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 2.4.0) -ge 0; then @@ -2986,6 +3227,8 @@ installRemoteModule() { if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then installRemoteModule_version=1.1.2 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=2.1.3 fi fi case "$DISTRO" in @@ -3073,7 +3316,7 @@ installRemoteModule() { if ! test -e /usr/local/lib/libidnkit.so; then installRemoteModule_src="$(getPackageSource https://jprs.co.jp/idn/idnkit-2.3.tar.bz2)" cd -- "$installRemoteModule_src" - ./configure + CFLAGS=-Wno-incompatible-pointer-types ./configure make -j$(getProcessorCount) install cd - >/dev/null fi @@ -3108,14 +3351,14 @@ installRemoteModule() { if ! test -f /usr/local/lib/libionc.so || ! test -f /usr/local/include/ionc/ion.h; then echo 'Installing ion-c... ' installRemoteModule_src="$(mktemp -p /tmp/src -d)" - git clone -q -c advice.detachedHead=false --depth 1 --branch v1.1.2 https://github.com/amzn/ion-c.git "$installRemoteModule_src/ion" + git clone -q -c advice.detachedHead=false --depth 1 --branch v1.1.3 https://github.com/amzn/ion-c.git "$installRemoteModule_src/ion" ( cd "$installRemoteModule_src/ion" git submodule init -q git submodule update -q mkdir -p build cd build - cmake -DCMAKE_BUILD_TYPE=Release .. -Wno-dev + CFLAGS='-Wno-incompatible-pointer-types -Wno-stringop-overflow -Wno-discarded-qualifiers' cmake -DCMAKE_BUILD_TYPE=Release .. -Wno-dev make clean make -j$(getProcessorCount) install ) @@ -3267,6 +3510,8 @@ installRemoteModule() { installRemoteModule_version=1.11.1 elif test $PHP_MAJMIN_VERSION -le 703; then installRemoteModule_version=1.16.2 + elif test $PHP_MAJMIN_VERSION -le 800; then + installRemoteModule_version=1.20.1 fi fi if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 1.17.0) -ge 0; then @@ -3336,6 +3581,8 @@ installRemoteModule() { installRemoteModule_version=4.10.0 elif test $PHP_MAJMIN_VERSION -lt 801; then installRemoteModule_version=22.0.0 + elif test $PHP_MAJMIN_VERSION -lt 802; then + installRemoteModule_version=22.1.2 fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -3431,6 +3678,11 @@ installRemoteModule() { addConfigureOption enable-swoole-curl yes fi ;; + operator) + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=beta + fi + ;; parallel) if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 701; then @@ -3461,6 +3713,16 @@ installRemoteModule() { fi fi ;; + phalcon) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMINPAT_VERSION -lt 70401; then + installRemoteModule_version=4.1.2 + elif test $PHP_MAJMIN_VERSION -lt 800; then + installRemoteModule_version=5.4.0 + fi + fi + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' + ;; php_trie) if ! test -f /usr/local/include/hat-trie/include/tsl/htrie_map.h; then installRemoteModule_src="$(getPackageSource https://codeload.github.com/Tessil/hat-trie/tar.gz/v0.6.0)" @@ -3490,6 +3752,17 @@ installRemoteModule() { fi fi ;; + psr) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 506; then + installRemoteModule_version=0.5.1 + elif test $PHP_MAJMIN_VERSION -lt 700; then + installRemoteModule_version=0.6.1 + elif test $PHP_MAJMIN_VERSION -lt 703; then + installRemoteModule_version=1.1.0 + fi + fi + ;; pthreads) if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then @@ -3546,6 +3819,8 @@ installRemoteModule() { installRemoteModule_version=4.3.0 elif test $PHP_MAJMIN_VERSION -le 701; then installRemoteModule_version=5.3.7 + elif test $PHP_MAJMIN_VERSION -le 703; then + installRemoteModule_version=6.0.2 fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -3674,6 +3949,18 @@ installRemoteModule() { fi fi ;; + seaslog) + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' + ;; + smbclient) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.1.1 + elif test $PHP_MAJMIN_VERSION -le 703; then + installRemoteModule_version=1.1.2 + fi + fi + ;; snappy) if test -z "$installRemoteModule_path"; then if test -z "$installRemoteModule_version"; then @@ -3691,10 +3978,12 @@ installRemoteModule() { snuffleupagus) if test -z "$installRemoteModule_path"; then if test -z "$installRemoteModule_version"; then - if test $PHP_MAJMIN_VERSION -le 704; then + if test $PHP_MAJMIN_VERSION -le 800; then installRemoteModule_version=0.9.0 - else + elif test $PHP_MAJMIN_VERSION -le 801; then installRemoteModule_version=0.10.0 + else + installRemoteModule_version=0.11.0 fi fi installRemoteModule_src="$(getPackageSource https://codeload.github.com/jvoisin/snuffleupagus/tar.gz/v$installRemoteModule_version)" @@ -3738,7 +4027,7 @@ installRemoteModule() { spx) if test -z "$installRemoteModule_path"; then if test -z "$installRemoteModule_version"; then - installRemoteModule_version=v0.4.15 + installRemoteModule_version=v0.4.18 fi if test "${installRemoteModule_version%.*}" = "$installRemoteModule_version"; then installRemoteModule_displayVersion="$installRemoteModule_version" @@ -3811,6 +4100,21 @@ installRemoteModule() { elif test $PHP_BITS -eq 32; then # See https://github.com/swoole/swoole-src/issues/5198#issuecomment-1820162178 installRemoteModule_version="$(resolvePHPModuleVersion "$installRemoteModule_module" '^5.0')" + else + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -le 312; then + installRemoteModule_version=5.1.2 + fi + ;; + esac + fi + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 800; then + installRemoteModule_version=5.1.3 + else + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" stable)" + fi fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -3823,19 +4127,115 @@ installRemoteModule() { installRemoteModule_openssl=yes case "$DISTRO_VERSION" in alpine@3.7 | alpine@3.8) - if test -n "$installRemoteModule_version" && test $(compareVersions "$installRemoteModule_version" 4.6.0) -lt 0; then + if test $(compareVersions "$installRemoteModule_version" 4.6.0) -lt 0; then # see https://github.com/swoole/swoole-src/issues/3934 installRemoteModule_openssl=no fi ;; esac - if test $PHP_MAJMIN_VERSION -eq 803; then - # see https://github.com/swoole/docker-swoole/issues/45 - installRemoteModule_curl=no + if test $PHP_THREADSAFE -eq 1; then + installRemoteModule_zts=yes else - installRemoteModule_curl=yes + installRemoteModule_zts=no fi - if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 5.0.1) -ge 0; then + installRemoteModule_sqlite=yes + installRemoteModule_iouring=no + installRemoteModule_curl=yes + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -lt 317; then + # we need sqlite3 >= 3.7.7 + installRemoteModule_sqlite=no + fi + case "${IPE_SWOOLE_WITHOUT_IOURING:-}" in + 1 | y* | Y*) ;; + *) + # iouring support in swoole 6 requires liburing 2.5+: available since Alpine 3.19 + # but with Alpine 3.19 we have a "invalid use of incomplete type 'const struct statx'" error + if test $DISTRO_MAJMIN_VERSION -ge 320; then + installRemoteModule_iouring=yes + fi + ;; + esac + ;; + debian) + if test $PHP_MAJMIN_VERSION -ge 800; then + # see https://github.com/swoole/swoole-src/issues/5365 + installRemoteModule_curl=no + fi + if test $DISTRO_MAJMIN_VERSION -lt 1200; then + # we need sqlite3 >= 3.7.7 + installRemoteModule_sqlite=no + fi + case "${IPE_SWOOLE_WITHOUT_IOURING:-}" in + 1 | y* | Y*) ;; + *) + if test $DISTRO_VERSION_NUMBER -ge 13; then + # iouring support in swoole 6 requires liburing 2.5+: available since Debian Trixie (13) + installRemoteModule_iouring=yes + fi + ;; + esac + ;; + esac + installRemoteModule_zstd=yes + case "$DISTRO" in + debian) + if test $DISTRO_VERSION_NUMBER -lt 11; then + # swoole 6 requires libzstd >= 1.4.0, but on debian 10 (buster) we have 1.3.8 + installRemoteModule_zstd=no + fi + ;; + esac + if test $(compareVersions "$installRemoteModule_version" 6.0.0) -ge 0; then + # enable sockets support? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable curl support? + addConfigureOption enable-swoole-curl $installRemoteModule_curl + # enable cares support? + addConfigureOption enable-cares yes + # enable brotli support? + addConfigureOption enable-brotli yes + # enable zstd support? + addConfigureOption enable-zstd $installRemoteModule_zstd + # enable PostgreSQL database support? + addConfigureOption enable-swoole-pgsql yes + # enable ODBC database support? + addConfigureOption with-swoole-odbc no + # enable Oracle database support? + addConfigureOption with-swoole-oracle no + # enable Sqlite database support? + addConfigureOption enable-swoole-sqlite $installRemoteModule_sqlite + # enable swoole thread support (need php zts support)? + addConfigureOption enable-swoole-thread $installRemoteModule_zts + # enable iouring for file async support? + addConfigureOption enable-iouring $installRemoteModule_iouring + elif test $(compareVersions "$installRemoteModule_version" 5.1.0) -ge 0; then + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable curl support? + addConfigureOption enable-swoole-curl $installRemoteModule_curl + # enable cares support? + addConfigureOption enable-cares yes + # enable brotli support? + addConfigureOption enable-brotli yes + # enable PostgreSQL database support? + addConfigureOption enable-swoole-pgsql yes + # enable ODBC database support? + addConfigureOption with-swoole-odbc no + # enable Oracle database support? + addConfigureOption with-swoole-oracle no + # enable Sqlite database support? + addConfigureOption enable-swoole-sqlite $installRemoteModule_sqlite + elif test $(compareVersions "$installRemoteModule_version" 5.0.1) -ge 0; then # enable sockets supports? addConfigureOption enable-sockets $installRemoteModule_sockets # enable openssl support? @@ -4005,6 +4405,7 @@ installRemoteModule() { fi ;; tensor) + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 703; then installRemoteModule_version=2.2.3 @@ -4072,6 +4473,7 @@ installRemoteModule() { installRemoteModule_manuallyInstalled=1 ;; uopz) + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then installRemoteModule_version=2.0.7 @@ -4189,6 +4591,17 @@ installRemoteModule() { addConfigureOption enable-reader yes fi ;; + xmldiff) + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + if test -z "$installRemoteModule_version"; then + case "$DISTRO_VERSION" in + debian@8) + # The gcc version of Debian Jessie is too old => error: 'nullptr' was not declared in this scope + installRemoteModule_version=1.1.4 + ;; + esac + fi + ;; xmlrpc) if test -z "$installRemoteModule_version"; then installRemoteModule_version=beta @@ -4265,8 +4678,6 @@ installRemoteModule() { if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then installRemoteModule_version=0.5.0 - else - installRemoteModule_version=alpha fi fi installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -4521,23 +4932,18 @@ removeStringFromList() { } # Invoke apt-get update -# -# Set: -# IPE_APTGET_INSTALLOPTIONS invokeAptGetUpdate() { if test -n "${IPE_APTGETUPDATE_ALREADY:-}"; then - DEBIAN_FRONTEND=noninteractive apt-get update -q + apt-get update -q return fi - IPE_APTGET_INSTALLOPTIONS='' - invokeAptGetUpdate_fixdistro='' + IPE_APTGETUPDATE_ALREADY=y if grep -q 'VERSION="8 (jessie)"' /etc/os-release; then invokeAptGetUpdate_fixdistro=jessie elif grep -q 'VERSION="9 (stretch)"' /etc/os-release; then invokeAptGetUpdate_fixdistro=stretch else - IPE_APTGETUPDATE_ALREADY=y - DEBIAN_FRONTEND=noninteractive apt-get update -q + invokeAptGetUpdate return fi # See https://www.debian.org/distrib/archive.en.html for a list of mirrors @@ -4552,19 +4958,18 @@ invokeAptGetUpdate() { sed -ri "s;^(\s*deb\s+)http://security.debian.org/debian-security;\1$IPE_DEB_ARCHIVE_SECURITY;" /etc/apt/sources.list sed -ri "s;^(\s*deb\s+)http://security.debian.org;\1$IPE_DEB_ARCHIVE_SECURITY;" /etc/apt/sources.list invokeAptGetUpdate_tmp="$(mktemp)" - DEBIAN_FRONTEND=noninteractive apt-get update -q 2>"$invokeAptGetUpdate_tmp" + apt-get update -q 2>"$invokeAptGetUpdate_tmp" if test -s "$invokeAptGetUpdate_tmp"; then cat "$invokeAptGetUpdate_tmp" >&2 if grep -qE ' KEYEXPIRED [0-9]' "$invokeAptGetUpdate_tmp"; then - IPE_APTGET_INSTALLOPTIONS='-o APT::Get::AllowUnauthenticated=true' echo '############' >&2 echo '# WARNING! #' >&2 echo '############' >&2 echo 'apt packages will be installed without checking authenticity!' >&2 + printf 'APT::Get::AllowUnauthenticated "true";\n' >>/etc/apt/apt.conf.d/99unauthenticated fi fi rm "$invokeAptGetUpdate_tmp" - IPE_APTGETUPDATE_ALREADY=y } # Fix the Let's Encrypt CA certificates on old distros @@ -4595,7 +5000,7 @@ fixLetsEncrypt() { invokeAptGetUpdate fi printf -- '- installing newer ca-certificates package\n' - DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends ${IPE_APTGET_INSTALLOPTIONS:-} ca-certificates + apt-get install -qqy --no-install-recommends ca-certificates fi ;; *) @@ -4616,8 +5021,12 @@ fixLetsEncrypt() { # Cleanup everything at the end of the execution cleanup() { if test "${IPE_UNINSTALL_CARGO:-}" = y; then - . "$HOME/.cargo/env" - rustup self uninstall -y + if test -f "$HOME/.cargo/env"; then + . "$HOME/.cargo/env" + fi + if command -v rustup >/dev/null; then + rustup self uninstall -y + fi fi if test -n "$UNNEEDED_PACKAGE_LINKS"; then printf '### REMOVING UNNEEDED PACKAGE LINKS ###\n' @@ -4640,11 +5049,11 @@ cleanup() { debian) if test -n "$PACKAGES_VOLATILE"; then printf '### REMOVING UNNEEDED PACKAGES ###\n' - DEBIAN_FRONTEND=noninteractive apt-get remove --purge -y $PACKAGES_VOLATILE + apt-get remove --purge -y $PACKAGES_VOLATILE fi if test -n "$PACKAGES_PREVIOUS"; then printf '### RESTORING PREVIOUSLY INSTALLED PACKAGES ###\n' - DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends --no-upgrade $IPE_APTGET_INSTALLOPTIONS $PACKAGES_PREVIOUS + apt-get install -qqy --no-install-recommends --no-upgrade $PACKAGES_PREVIOUS fi ;; esac @@ -4669,6 +5078,8 @@ cleanup() { esac } +DEBIAN_FRONTEND=noninteractive +export DEBIAN_FRONTEND resetIFS mkdir -p /tmp/src mkdir -p /tmp/pickle.tmp @@ -4684,7 +5095,7 @@ esac setPHPVersionVariables setPHPPreinstalledModules case "$PHP_MAJMIN_VERSION" in - 505 | 506 | 700 | 701 | 702 | 703 | 704 | 800 | 801 | 802 | 803) ;; + 505 | 506 | 700 | 701 | 702 | 703 | 704 | 800 | 801 | 802 | 803 | 804) ;; *) printf "### ERROR: Unsupported PHP version: %s.%s ###\n" $((PHP_MAJMIN_VERSION / 100)) $((PHP_MAJMIN_VERSION % 100)) ;; @@ -4721,6 +5132,8 @@ if test $USE_PICKLE -gt 1; then buildPickle fi +compileLibs + for PHP_MODULE_TO_INSTALL in $PHP_MODULES_TO_INSTALL; do case "$PHP_MODULE_TO_INSTALL" in @fix_letsencrypt) diff --git a/php8/8.3.16/build/php/extensions/install-php-extensions b/php8/8.3.16/build/php/extensions/install-php-extensions index 59a1ea8b2..2ef98bb85 100644 --- a/php8/8.3.16/build/php/extensions/install-php-extensions +++ b/php8/8.3.16/build/php/extensions/install-php-extensions @@ -21,7 +21,7 @@ if ! which docker-php-ext-configure >/dev/null || ! which docker-php-ext-enable exit 1 fi -IPE_VERSION=2.2.14 +IPE_VERSION=2.7.27 StandWithUkraine() { if test -t 1 && ! grep -Eq '^VERSION=.*jessie' /etc/os-release; then @@ -273,6 +273,15 @@ EOT # 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 @@ -597,6 +606,10 @@ sortModulesToInstall() { 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")" @@ -662,9 +675,11 @@ expandASpellDictionaries() { # 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 @@ -781,8 +796,11 @@ buildRequiredPackageLists() { buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile enchant2-dev" else # The system provides libenchant2, supported since PHP 8.0: we need to build libenchant1 on our own - buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent glib aspell-libs libhunspell" - buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile glib-dev aspell-dev hunspell-dev" + 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" @@ -795,9 +813,12 @@ buildRequiredPackageLists() { buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libenchant-2-2" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libenchant-2-dev" else - # 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" + 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" @@ -844,6 +865,18 @@ buildRequiredPackageLists() { 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" ;; @@ -869,6 +902,18 @@ buildRequiredPackageLists() { 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 @@ -952,7 +997,7 @@ buildRequiredPackageLists() { 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$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libicu-dev ^libidn2-[0-9+]-dev$ ^libgcrypt[0-9]+-dev$" fi ;; imagick@alpine) @@ -984,6 +1029,9 @@ buildRequiredPackageLists() { ;; interbase@alpine) buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev ncurses-dev" + if ! isFirebirdInstalled; then + COMPILE_LIBS="$COMPILE_LIBS firebird" + fi ;; interbase@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libfbclient2" @@ -1159,6 +1207,20 @@ buildRequiredPackageLists() { ;; pdo_firebird@alpine) buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev ncurses-dev" + if ! isFirebirdInstalled; then + COMPILE_LIBS="$COMPILE_LIBS firebird" + if test $PHP_MAJMIN_VERSION -ge 804; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib-dev" + if ! isLibTommathInstalled; then + COMPILE_LIBS="$COMPILE_LIBS libtommath" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake" + fi + if ! isLibTomcryptInstalled; then + COMPILE_LIBS="$COMPILE_LIBS libtomcrypt" + fi + fi + fi ;; pdo_firebird@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libfbclient2" @@ -1175,6 +1237,20 @@ buildRequiredPackageLists() { php_trie@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" ;; + phpy@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent python3" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile python3-dev" + ;; + phpy@debian) + if test $DISTRO_VERSION_NUMBER -ge 12; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.11" + elif test $DISTRO_VERSION_NUMBER -ge 11; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.9" + else + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.7" + fi + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile python3-dev" + ;; pkcs11@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent softhsm" ;; @@ -1354,7 +1430,22 @@ buildRequiredPackageLists() { if test $PHP_MAJMIN_VERSION -ge 702; then buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent c-ares" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile c-ares-dev" + if test $PHP_MAJMIN_VERSION -ge 801; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent zstd-libs" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile sqlite-dev zstd-dev" + fi fi + case "${IPE_SWOOLE_WITHOUT_IOURING:-}" in + 1 | y* | Y*) ;; + *) + # iouring support in swoole 6 requires liburing 2.5+: available since Alpine 3.19 + # but with Alpine 3.19 we have a "invalid use of incomplete type 'const struct statx'" error + if test $DISTRO_MAJMIN_VERSION -ge 320; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent liburing" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile liburing-dev" + fi + ;; + esac ;; swoole@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libcurl3-gnutls libpq5" @@ -1362,9 +1453,23 @@ buildRequiredPackageLists() { if test $PHP_MAJMIN_VERSION -ge 702; then buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libc-ares2" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libc-ares-dev" + if test $PHP_MAJMIN_VERSION -ge 800; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libbrotli1" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev libbrotli-dev" + if test $PHP_MAJMIN_VERSION -ge 801; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libsqlite3-dev" + if test $DISTRO_VERSION_NUMBER -ge 11; then + # swoole 6 requires libzstd >= 1.4.0, but on debian 10 (buster) we have 1.3.8 + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libzstd[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libzstd-dev" + fi + fi + fi fi - if test $PHP_MAJMIN_VERSION -ge 800; then - buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev" + if test $DISTRO_VERSION_NUMBER -ge 13; then + # iouring support in swoole 6 requires liburing 2.5+: available since Debian Trixie (13) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent liburing2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile liburing-dev" fi ;; sybase_ct@alpine) @@ -1490,6 +1595,12 @@ buildRequiredPackageLists() { xmlrpc@debian) buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" ;; + xpass@alpine) + if ! isLibXCryptInstalled; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile linux-headers" + COMPILE_LIBS="$COMPILE_LIBS libxcrypt" + fi + ;; xsl@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libxslt" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxslt-dev libgcrypt-dev" @@ -1622,7 +1733,7 @@ expandPackagesToBeInstalled() { resetIFS ;; debian) - expandPackagesToBeInstalled_log="$(DEBIAN_FRONTEND=noninteractive apt-get install -sy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS $@ 2>&1 || printf '\nE: apt-get failed\n')" + expandPackagesToBeInstalled_log="$(apt-get install -sy --no-install-recommends $@ 2>&1 || printf '\nE: apt-get failed\n')" if test -n "$(printf '%s' "$expandPackagesToBeInstalled_log" | grep -E '^E:')"; then printf 'FAILED TO LIST THE WHOLE PACKAGE LIST FOR\n' >&2 printf '%s ' "$@" >&2 @@ -1891,7 +2002,7 @@ markPreinstalledPackagesAsUsed() { apk add $PACKAGES_PERSISTENT_PRE ;; debian) - DEBIAN_FRONTEND=noninteractive apt-mark manual $PACKAGES_PERSISTENT_PRE + apt-mark manual $PACKAGES_PERSISTENT_PRE ;; esac } @@ -1917,7 +2028,7 @@ installRequiredPackages() { done ;; debian) - DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS $PACKAGES_PERSISTENT_NEW $PACKAGES_VOLATILE + apt-get install -qqy --no-install-recommends $PACKAGES_PERSISTENT_NEW $PACKAGES_VOLATILE ;; esac } @@ -2099,12 +2210,12 @@ installMicrosoftSqlServerODBC() { fi printf -- '- installing the APT package\n' if test $PHP_MAJMIN_VERSION -le 703; then - DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS msodbcsql17 + ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends msodbcsql17 elif test $DISTRO_VERSION_NUMBER -ge 9 && test $DISTRO_VERSION_NUMBER -le 12; then # On Debian 9 to 12 we have both msodbcsql17 and msodbcsql18: let's install just one - DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS msodbcsql18 + ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends msodbcsql18 else - DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS '^msodbcsql[0-9]+$' + ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends '^msodbcsql[0-9]+$' fi ;; esac @@ -2128,17 +2239,7 @@ isLibaomInstalled() { # Install libaom installLibaom() { printf 'Installing libaom\n' - installLibaom_version=3.8.1 - case "$DISTRO_VERSION" in - debian@10) - case $(uname -m) in - aarch* | arm*) - #see https://bugs.chromium.org/p/aomedia/issues/detail?id=3543 - installLibaom_version=3.5.0 - ;; - esac - ;; - esac + installLibaom_version=3.10.0 installLibaom_dir="$(getPackageSource https://aomedia.googlesource.com/aom/+archive/v$installLibaom_version.tar.gz)" mkdir -- "$installLibaom_dir/my.build" cd -- "$installLibaom_dir/my.build" @@ -2293,6 +2394,108 @@ installLibThai() { cd - >/dev/null } +isLibTommathInstalled() { + if test -f /usr/local/lib/libtommath.a && test -f /usr/local/include/tommath.h; then + return 0 + fi + return 1 +} + +installLibTommath() { + printf 'Installing libtommath\n' + installLibTommath_src="$(getPackageSource https://github.com/libtom/libtommath/releases/download/v1.3.0/ltm-1.3.0.tar.xz)" + mkdir -p "$installLibTommath_src/build" + cd -- "$installLibTommath_src/build" + CFLAGS='-fPIC' cmake -DCMAKE_BUILD_TYPE=Release .. + make -j$(getProcessorCount) + make install + cd - >/dev/null +} + +isLibTomcryptInstalled() { + if test -f /usr/local/lib/libtomcrypt.a && test -f /usr/local/include/tomcrypt.h; then + return 0 + fi + return 1 +} + +installLibTomcrypt() { + printf 'Installing libtomcrypt\n' + installLibTomcrypt_src="$(getPackageSource https://github.com/libtom/libtomcrypt/releases/download/v1.18.2/crypt-1.18.2.tar.xz)" + cd -- "$installLibTomcrypt_src" + CFLAGS='-fPIC' make -j$(getProcessorCount) + make install +} + +isFirebirdInstalled() { + if test -f /usr/lib/libfbclient.so && test -f /usr/include/ibase.h; then + return 0 + fi + if test -d /tmp/src/firebird; then + return 0 + fi + return 1 +} + +installFirebird() { + printf 'Installing firebird\n' + if test $PHP_MAJMIN_VERSION -ge 804; then + installFirebird_src="$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/v5.0.2/Firebird-5.0.2.1613-0-source.tar.xz)" + cd -- "$installFirebird_src" + ./configure --enable-client-only + make -j$(getProcessorCount) + cp -Rd gen/Release/firebird/include/* /usr/include + cp -Rd gen/Release/firebird/lib/* /usr/lib + cd - >/dev/null + else + mv "$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/R2_5_9/Firebird-2.5.9.27139-0.tar.bz2)" /tmp/src/firebird + cd /tmp/src/firebird + # Patch rwlock.h (this has been fixed in later release of firebird 3.x) + sed -i '194s/.*/#if 0/' src/common/classes/rwlock.h + ./configure --with-system-icu + # -j option can't be used: make targets must be compiled sequentially + make -s btyacc_binary gpre_boot libfbstatic libfbclient + cp gen/firebird/lib/libfbclient.so /usr/lib/ + ln -s /usr/lib/libfbclient.so /usr/lib/libfbclient.so.2 + cd - >/dev/null + fi +} + +isLibXCryptInstalled() { + if ! test -f /usr/local/lib/libcrypt.so && ! test -f /usr/lib/libcrypt.so && ! test -f /usr/lib/x86_64*/libcrypt.so; then + return 1 + fi + return 0 +} + +installLibXCrypt() { + printf 'Installing libxcrypt\n' + installLibXCrypt_version=4.4.36 + installLibXCrypt_src="$(getPackageSource "https://github.com/besser82/libxcrypt/releases/download/v$installLibXCrypt_version/libxcrypt-$installLibXCrypt_version.tar.xz")" + cd -- "$installLibXCrypt_src" + ./configure --prefix /usr + make -j$(getProcessorCount) + make install + cd - >/dev/null +} + +isLibenchant1Installed() { + if test -f /usr/lib/libenchant.so || test -f /usr/local/lib/libenchant.so; then + return 0 + fi + return 1 +} + +installLibenchant1() { + printf 'Installing libenchant1\n' + installLibenchant1_src="$(getPackageSource https://github.com/rrthomas/enchant/releases/download/enchant-1-6-1/enchant-1.6.1.tar.gz)" + cd -- "$installLibenchant1_src" + ./configure + make -j$(getProcessorCount) + make install + cd - >/dev/null +} + # Install Composer installComposer() { installComposer_version="$(getWantedPHPModuleVersion @composer)" @@ -2342,30 +2545,41 @@ actuallyInstallComposer() { # Install ionCube Loader installIonCubeLoader() { + installIonCubeLoader_version='' + if test $PHP_MAJMIN_VERSION -lt 804; then + # For 14.4.0 we have a Segmentation Fault + installIonCubeLoader_version=14.0.0 + fi + installIonCubeLoader_versionForUrl='' + installIonCubeLoader_versionForMessage=latest + if test -n "$installIonCubeLoader_version"; then + installIonCubeLoader_versionForUrl="_$installIonCubeLoader_version" + installIonCubeLoader_versionForMessage="v$installIonCubeLoader_version" + fi # See https://www.ioncube.com/loaders.php case $PHP_BITS in 32) case $(uname -m) in aarch* | arm*) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_armv7l.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_armv7l$installIonCubeLoader_versionForUrl.tar.gz" ;; *) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86$installIonCubeLoader_versionForUrl.tar.gz" ;; esac ;; *) case $(uname -m) in aarch64 | arm64 | armv8) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_aarch64.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_aarch64$installIonCubeLoader_versionForUrl.tar.gz" ;; *) - installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz" + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64$installIonCubeLoader_versionForUrl.tar.gz" ;; esac ;; esac - printf 'Downloading ionCube Loader... ' + printf 'Downloading ionCube Loader (%s)... ' "$installIonCubeLoader_versionForMessage" installIonCubeLoader_dir="$(getPackageSource $installIonCubeLoader_url)" echo 'done.' installIonCubeLoader_so=$(php -r "printf('ioncube_loader_lin_%s.%s%s.so', PHP_MAJOR_VERSION, PHP_MINOR_VERSION, ZEND_THREAD_SAFE ? '_ts' : '');") @@ -2414,15 +2628,31 @@ installCargo() { if command -v cargo >/dev/null; then return fi - printf '# Installing cargo\n' - case "$DISTRO" in - alpine) - # see https://github.com/hyperledger/indy-vdr/issues/69#issuecomment-998104850 - export RUSTFLAGS='-C target-feature=-crt-static' - ;; - esac - curl https://sh.rustup.rs -sSf | sh -s -- -y -q + installCargo_cargoversion= + if ! test -f "$HOME/.cargo/env"; then + printf '# Installing cargo\n' + case "$DISTRO" in + alpine) + # see https://github.com/hyperledger/indy-vdr/issues/69#issuecomment-998104850 + export RUSTFLAGS='-C target-feature=-crt-static' + ;; + esac + curl https://sh.rustup.rs -sSf | sh -s -- -y -q + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -le 310; then + # With version 1.84.0 we have this error: + # Error relocating /root/.rustup/toolchains/stable-x86_64-unknown-linux-musl/bin/cargo: posix_spawn_file_actions_addchdir_np: symbol not found + # See https://github.com/rust-lang/rust/pull/131851#issue-2595663507 + installCargo_cargoversion=1.83.0 + fi + ;; + esac + fi . "$HOME/.cargo/env" + if test -n "$installCargo_cargoversion"; then + rustup default -- "$installCargo_cargoversion" + fi if test -z "${IPE_UNINSTALL_CARGO:-}"; then IPE_UNINSTALL_CARGO=y fi @@ -2430,14 +2660,20 @@ installCargo() { installNewRelic() { printf '# Installing newrelic\n' + # see https://docs.newrelic.com/docs/apm/agents/php-agent/getting-started/php-agent-compatibility-requirements/ + if test $PHP_MAJMIN_VERSION -le 701; then + installNewRelic_baseUrl=https://download.newrelic.com/php_agent/archive/10.21.0.11/ + else + installNewRelic_baseUrl=https://download.newrelic.com/php_agent/release/ + fi installNewRelic_search='\bnewrelic-php[0-9.]*-[0-9]+(\.[0-9]+)*-linux' case "$DISTRO" in alpine) installNewRelic_search="$installNewRelic_search-musl" ;; esac - installNewRelic_file="$(curl -sSLf -o- https://download.newrelic.com/php_agent/release/ | sed -E 's/<[^>]*>//g' | grep -Eo "$installNewRelic_search.tar.gz" | sort | head -1)" - installNewRelic_url="https://download.newrelic.com/php_agent/release/$installNewRelic_file" + installNewRelic_file="$(curl -sSLf -o- "$installNewRelic_baseUrl" | sed -E 's/<[^>]*>//g' | grep -Eo "$installNewRelic_search.tar.gz" | sort | head -1)" + installNewRelic_url="$installNewRelic_baseUrl$installNewRelic_file" installNewRelic_src="$(getPackageSource "$installNewRelic_url")" cd -- "$installNewRelic_src" NR_INSTALL_USE_CP_NOT_LN=1 NR_INSTALL_SILENT=1 ./newrelic-install install @@ -2446,6 +2682,12 @@ installNewRelic() { NR_INSTALL_USE_CP_NOT_LN=1 NR_INSTALL_SILENT=1 ./newrelic-install install_daemon ;; esac + case "${IPE_NEWRELIC_KEEPLOG:-}" in + 1 | y* | Y*) ;; + *) + rm -f /tmp/nrinstall-*.tar + ;; + esac cd - >/dev/null cat </dev/null - fi - ;; ftp) - docker-php-ext-configure ftp --with-openssl-dir=/usr + if test $PHP_MAJMIN_VERSION -ge 804; then + docker-php-ext-configure ftp --with-ftp-ssl=/usr + else + docker-php-ext-configure ftp --with-openssl-dir=/usr + fi ;; gd) if test $PHP_MAJMIN_VERSION -le 506; then @@ -2551,23 +2802,6 @@ EOF ;; esac if test $installBundledModule_tmp -eq 0; then - case "${IPE_GD_WITHOUTAVIF:-}" in - 1 | y* | Y*) ;; - *) - if ! isLibaomInstalled; then - installLibaom - fi - if ! isLibdav1dInstalled; then - installLibdav1d - fi - if ! isLibyuvInstalled; then - installLibyuv - fi - if ! isLibavifInstalled; then - installLibavif - fi - ;; - esac if isLibaomInstalled && isLibdav1dInstalled && isLibyuvInstalled && isLibavifInstalled; then installBundledModule_tmp=1 fi @@ -2592,7 +2826,7 @@ EOF debian@9) installBundledModule_tmp="$(pwd)" cd /tmp - apt-get download $IPE_APTGET_INSTALLOPTIONS libc-client2007e-dev + apt-get download libc-client2007e-dev dpkg -i --ignore-depends=libssl-dev libc-client2007e-dev* rm libc-client2007e-dev* cd "$installBundledModule_tmp" @@ -2603,19 +2837,9 @@ EOF interbase | pdo_firebird) case "$DISTRO" in alpine) - if ! test -d /tmp/src/firebird; then - mv "$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/R2_5_9/Firebird-2.5.9.27139-0.tar.bz2)" /tmp/src/firebird - cd /tmp/src/firebird - # Patch rwlock.h (this has been fixed in later release of firebird 3.x) - sed -i '194s/.*/#if 0/' src/common/classes/rwlock.h - ./configure --with-system-icu - # -j option can't be used: make targets must be compiled sequentially - make -s btyacc_binary gpre_boot libfbstatic libfbclient - cp gen/firebird/lib/libfbclient.so /usr/lib/ - ln -s /usr/lib/libfbclient.so /usr/lib/libfbclient.so.2 - cd - >/dev/null + if test $PHP_MAJMIN_VERSION -lt 804; then + 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 fi - 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 ;; esac ;; @@ -2824,7 +3048,7 @@ installRemoteModule() { installRemoteModule_distro=linux ;; esac - installRemoteModule_tmp2=$(php -r 'echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION;') + installRemoteModule_tmp2=$(php -r 'echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION . (ZEND_THREAD_SAFE ? "-zts" : "");') installRemoteModule_tmp="$(mktemp -p /tmp/src -d)" cd "$installRemoteModule_tmp" curl -sSLf --user-agent Docker https://blackfire.io/api/v1/releases/probe/php/$installRemoteModule_distro/$installRemoteModule_tmp1/$installRemoteModule_tmp2 | tar xz @@ -2852,7 +3076,7 @@ installRemoteModule() { if test $(compareVersions "$(cmake --version | head -n1 | sed -E 's/^.* //')" '3.7') -lt 0; then installRemoteModule_tmp=0.29.0 else - installRemoteModule_tmp=0.31.0 + installRemoteModule_tmp=0.31.1 fi cd "$(getPackageSource https://github.com/commonmark/cmark/archive/$installRemoteModule_tmp.tar.gz)" make -s -j$(getProcessorCount) cmake_build @@ -2882,6 +3106,16 @@ installRemoteModule() { if test $PHP_MAJMIN_VERSION -lt 700; then installRemoteModule_version=0.75.0 fi + if test -z "$installRemoteModule_version"; then + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -le 312; then + # cc is not supported due to a memcmp related bug + installRemoteModule_version=1.1.0 + fi + ;; + esac + fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" fi @@ -2919,6 +3153,13 @@ installRemoteModule() { installRemoteModule_version=alpha fi ;; + ev) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 800; then + installRemoteModule_version=1.1.5 + fi + fi + ;; event) installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 2.4.0) -ge 0; then @@ -2986,6 +3227,8 @@ installRemoteModule() { if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then installRemoteModule_version=1.1.2 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=2.1.3 fi fi case "$DISTRO" in @@ -3073,7 +3316,7 @@ installRemoteModule() { if ! test -e /usr/local/lib/libidnkit.so; then installRemoteModule_src="$(getPackageSource https://jprs.co.jp/idn/idnkit-2.3.tar.bz2)" cd -- "$installRemoteModule_src" - ./configure + CFLAGS=-Wno-incompatible-pointer-types ./configure make -j$(getProcessorCount) install cd - >/dev/null fi @@ -3108,14 +3351,14 @@ installRemoteModule() { if ! test -f /usr/local/lib/libionc.so || ! test -f /usr/local/include/ionc/ion.h; then echo 'Installing ion-c... ' installRemoteModule_src="$(mktemp -p /tmp/src -d)" - git clone -q -c advice.detachedHead=false --depth 1 --branch v1.1.2 https://github.com/amzn/ion-c.git "$installRemoteModule_src/ion" + git clone -q -c advice.detachedHead=false --depth 1 --branch v1.1.3 https://github.com/amzn/ion-c.git "$installRemoteModule_src/ion" ( cd "$installRemoteModule_src/ion" git submodule init -q git submodule update -q mkdir -p build cd build - cmake -DCMAKE_BUILD_TYPE=Release .. -Wno-dev + CFLAGS='-Wno-incompatible-pointer-types -Wno-stringop-overflow -Wno-discarded-qualifiers' cmake -DCMAKE_BUILD_TYPE=Release .. -Wno-dev make clean make -j$(getProcessorCount) install ) @@ -3267,6 +3510,8 @@ installRemoteModule() { installRemoteModule_version=1.11.1 elif test $PHP_MAJMIN_VERSION -le 703; then installRemoteModule_version=1.16.2 + elif test $PHP_MAJMIN_VERSION -le 800; then + installRemoteModule_version=1.20.1 fi fi if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 1.17.0) -ge 0; then @@ -3336,6 +3581,8 @@ installRemoteModule() { installRemoteModule_version=4.10.0 elif test $PHP_MAJMIN_VERSION -lt 801; then installRemoteModule_version=22.0.0 + elif test $PHP_MAJMIN_VERSION -lt 802; then + installRemoteModule_version=22.1.2 fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -3431,6 +3678,11 @@ installRemoteModule() { addConfigureOption enable-swoole-curl yes fi ;; + operator) + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=beta + fi + ;; parallel) if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 701; then @@ -3461,6 +3713,16 @@ installRemoteModule() { fi fi ;; + phalcon) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMINPAT_VERSION -lt 70401; then + installRemoteModule_version=4.1.2 + elif test $PHP_MAJMIN_VERSION -lt 800; then + installRemoteModule_version=5.4.0 + fi + fi + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' + ;; php_trie) if ! test -f /usr/local/include/hat-trie/include/tsl/htrie_map.h; then installRemoteModule_src="$(getPackageSource https://codeload.github.com/Tessil/hat-trie/tar.gz/v0.6.0)" @@ -3490,6 +3752,17 @@ installRemoteModule() { fi fi ;; + psr) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 506; then + installRemoteModule_version=0.5.1 + elif test $PHP_MAJMIN_VERSION -lt 700; then + installRemoteModule_version=0.6.1 + elif test $PHP_MAJMIN_VERSION -lt 703; then + installRemoteModule_version=1.1.0 + fi + fi + ;; pthreads) if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then @@ -3546,6 +3819,8 @@ installRemoteModule() { installRemoteModule_version=4.3.0 elif test $PHP_MAJMIN_VERSION -le 701; then installRemoteModule_version=5.3.7 + elif test $PHP_MAJMIN_VERSION -le 703; then + installRemoteModule_version=6.0.2 fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -3674,6 +3949,18 @@ installRemoteModule() { fi fi ;; + seaslog) + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' + ;; + smbclient) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.1.1 + elif test $PHP_MAJMIN_VERSION -le 703; then + installRemoteModule_version=1.1.2 + fi + fi + ;; snappy) if test -z "$installRemoteModule_path"; then if test -z "$installRemoteModule_version"; then @@ -3691,10 +3978,12 @@ installRemoteModule() { snuffleupagus) if test -z "$installRemoteModule_path"; then if test -z "$installRemoteModule_version"; then - if test $PHP_MAJMIN_VERSION -le 704; then + if test $PHP_MAJMIN_VERSION -le 800; then installRemoteModule_version=0.9.0 - else + elif test $PHP_MAJMIN_VERSION -le 801; then installRemoteModule_version=0.10.0 + else + installRemoteModule_version=0.11.0 fi fi installRemoteModule_src="$(getPackageSource https://codeload.github.com/jvoisin/snuffleupagus/tar.gz/v$installRemoteModule_version)" @@ -3738,7 +4027,7 @@ installRemoteModule() { spx) if test -z "$installRemoteModule_path"; then if test -z "$installRemoteModule_version"; then - installRemoteModule_version=v0.4.15 + installRemoteModule_version=v0.4.18 fi if test "${installRemoteModule_version%.*}" = "$installRemoteModule_version"; then installRemoteModule_displayVersion="$installRemoteModule_version" @@ -3811,6 +4100,21 @@ installRemoteModule() { elif test $PHP_BITS -eq 32; then # See https://github.com/swoole/swoole-src/issues/5198#issuecomment-1820162178 installRemoteModule_version="$(resolvePHPModuleVersion "$installRemoteModule_module" '^5.0')" + else + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -le 312; then + installRemoteModule_version=5.1.2 + fi + ;; + esac + fi + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 800; then + installRemoteModule_version=5.1.3 + else + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" stable)" + fi fi else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -3823,19 +4127,115 @@ installRemoteModule() { installRemoteModule_openssl=yes case "$DISTRO_VERSION" in alpine@3.7 | alpine@3.8) - if test -n "$installRemoteModule_version" && test $(compareVersions "$installRemoteModule_version" 4.6.0) -lt 0; then + if test $(compareVersions "$installRemoteModule_version" 4.6.0) -lt 0; then # see https://github.com/swoole/swoole-src/issues/3934 installRemoteModule_openssl=no fi ;; esac - if test $PHP_MAJMIN_VERSION -eq 803; then - # see https://github.com/swoole/docker-swoole/issues/45 - installRemoteModule_curl=no + if test $PHP_THREADSAFE -eq 1; then + installRemoteModule_zts=yes else - installRemoteModule_curl=yes + installRemoteModule_zts=no fi - if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 5.0.1) -ge 0; then + installRemoteModule_sqlite=yes + installRemoteModule_iouring=no + installRemoteModule_curl=yes + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -lt 317; then + # we need sqlite3 >= 3.7.7 + installRemoteModule_sqlite=no + fi + case "${IPE_SWOOLE_WITHOUT_IOURING:-}" in + 1 | y* | Y*) ;; + *) + # iouring support in swoole 6 requires liburing 2.5+: available since Alpine 3.19 + # but with Alpine 3.19 we have a "invalid use of incomplete type 'const struct statx'" error + if test $DISTRO_MAJMIN_VERSION -ge 320; then + installRemoteModule_iouring=yes + fi + ;; + esac + ;; + debian) + if test $PHP_MAJMIN_VERSION -ge 800; then + # see https://github.com/swoole/swoole-src/issues/5365 + installRemoteModule_curl=no + fi + if test $DISTRO_MAJMIN_VERSION -lt 1200; then + # we need sqlite3 >= 3.7.7 + installRemoteModule_sqlite=no + fi + case "${IPE_SWOOLE_WITHOUT_IOURING:-}" in + 1 | y* | Y*) ;; + *) + if test $DISTRO_VERSION_NUMBER -ge 13; then + # iouring support in swoole 6 requires liburing 2.5+: available since Debian Trixie (13) + installRemoteModule_iouring=yes + fi + ;; + esac + ;; + esac + installRemoteModule_zstd=yes + case "$DISTRO" in + debian) + if test $DISTRO_VERSION_NUMBER -lt 11; then + # swoole 6 requires libzstd >= 1.4.0, but on debian 10 (buster) we have 1.3.8 + installRemoteModule_zstd=no + fi + ;; + esac + if test $(compareVersions "$installRemoteModule_version" 6.0.0) -ge 0; then + # enable sockets support? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable curl support? + addConfigureOption enable-swoole-curl $installRemoteModule_curl + # enable cares support? + addConfigureOption enable-cares yes + # enable brotli support? + addConfigureOption enable-brotli yes + # enable zstd support? + addConfigureOption enable-zstd $installRemoteModule_zstd + # enable PostgreSQL database support? + addConfigureOption enable-swoole-pgsql yes + # enable ODBC database support? + addConfigureOption with-swoole-odbc no + # enable Oracle database support? + addConfigureOption with-swoole-oracle no + # enable Sqlite database support? + addConfigureOption enable-swoole-sqlite $installRemoteModule_sqlite + # enable swoole thread support (need php zts support)? + addConfigureOption enable-swoole-thread $installRemoteModule_zts + # enable iouring for file async support? + addConfigureOption enable-iouring $installRemoteModule_iouring + elif test $(compareVersions "$installRemoteModule_version" 5.1.0) -ge 0; then + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable curl support? + addConfigureOption enable-swoole-curl $installRemoteModule_curl + # enable cares support? + addConfigureOption enable-cares yes + # enable brotli support? + addConfigureOption enable-brotli yes + # enable PostgreSQL database support? + addConfigureOption enable-swoole-pgsql yes + # enable ODBC database support? + addConfigureOption with-swoole-odbc no + # enable Oracle database support? + addConfigureOption with-swoole-oracle no + # enable Sqlite database support? + addConfigureOption enable-swoole-sqlite $installRemoteModule_sqlite + elif test $(compareVersions "$installRemoteModule_version" 5.0.1) -ge 0; then # enable sockets supports? addConfigureOption enable-sockets $installRemoteModule_sockets # enable openssl support? @@ -4005,6 +4405,7 @@ installRemoteModule() { fi ;; tensor) + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 703; then installRemoteModule_version=2.2.3 @@ -4072,6 +4473,7 @@ installRemoteModule() { installRemoteModule_manuallyInstalled=1 ;; uopz) + installRemoteModule_cppflags='-Wno-incompatible-pointer-types' if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then installRemoteModule_version=2.0.7 @@ -4189,6 +4591,17 @@ installRemoteModule() { addConfigureOption enable-reader yes fi ;; + xmldiff) + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + if test -z "$installRemoteModule_version"; then + case "$DISTRO_VERSION" in + debian@8) + # The gcc version of Debian Jessie is too old => error: 'nullptr' was not declared in this scope + installRemoteModule_version=1.1.4 + ;; + esac + fi + ;; xmlrpc) if test -z "$installRemoteModule_version"; then installRemoteModule_version=beta @@ -4265,8 +4678,6 @@ installRemoteModule() { if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then installRemoteModule_version=0.5.0 - else - installRemoteModule_version=alpha fi fi installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -4521,23 +4932,18 @@ removeStringFromList() { } # Invoke apt-get update -# -# Set: -# IPE_APTGET_INSTALLOPTIONS invokeAptGetUpdate() { if test -n "${IPE_APTGETUPDATE_ALREADY:-}"; then - DEBIAN_FRONTEND=noninteractive apt-get update -q + apt-get update -q return fi - IPE_APTGET_INSTALLOPTIONS='' - invokeAptGetUpdate_fixdistro='' + IPE_APTGETUPDATE_ALREADY=y if grep -q 'VERSION="8 (jessie)"' /etc/os-release; then invokeAptGetUpdate_fixdistro=jessie elif grep -q 'VERSION="9 (stretch)"' /etc/os-release; then invokeAptGetUpdate_fixdistro=stretch else - IPE_APTGETUPDATE_ALREADY=y - DEBIAN_FRONTEND=noninteractive apt-get update -q + invokeAptGetUpdate return fi # See https://www.debian.org/distrib/archive.en.html for a list of mirrors @@ -4552,19 +4958,18 @@ invokeAptGetUpdate() { sed -ri "s;^(\s*deb\s+)http://security.debian.org/debian-security;\1$IPE_DEB_ARCHIVE_SECURITY;" /etc/apt/sources.list sed -ri "s;^(\s*deb\s+)http://security.debian.org;\1$IPE_DEB_ARCHIVE_SECURITY;" /etc/apt/sources.list invokeAptGetUpdate_tmp="$(mktemp)" - DEBIAN_FRONTEND=noninteractive apt-get update -q 2>"$invokeAptGetUpdate_tmp" + apt-get update -q 2>"$invokeAptGetUpdate_tmp" if test -s "$invokeAptGetUpdate_tmp"; then cat "$invokeAptGetUpdate_tmp" >&2 if grep -qE ' KEYEXPIRED [0-9]' "$invokeAptGetUpdate_tmp"; then - IPE_APTGET_INSTALLOPTIONS='-o APT::Get::AllowUnauthenticated=true' echo '############' >&2 echo '# WARNING! #' >&2 echo '############' >&2 echo 'apt packages will be installed without checking authenticity!' >&2 + printf 'APT::Get::AllowUnauthenticated "true";\n' >>/etc/apt/apt.conf.d/99unauthenticated fi fi rm "$invokeAptGetUpdate_tmp" - IPE_APTGETUPDATE_ALREADY=y } # Fix the Let's Encrypt CA certificates on old distros @@ -4595,7 +5000,7 @@ fixLetsEncrypt() { invokeAptGetUpdate fi printf -- '- installing newer ca-certificates package\n' - DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends ${IPE_APTGET_INSTALLOPTIONS:-} ca-certificates + apt-get install -qqy --no-install-recommends ca-certificates fi ;; *) @@ -4616,8 +5021,12 @@ fixLetsEncrypt() { # Cleanup everything at the end of the execution cleanup() { if test "${IPE_UNINSTALL_CARGO:-}" = y; then - . "$HOME/.cargo/env" - rustup self uninstall -y + if test -f "$HOME/.cargo/env"; then + . "$HOME/.cargo/env" + fi + if command -v rustup >/dev/null; then + rustup self uninstall -y + fi fi if test -n "$UNNEEDED_PACKAGE_LINKS"; then printf '### REMOVING UNNEEDED PACKAGE LINKS ###\n' @@ -4640,11 +5049,11 @@ cleanup() { debian) if test -n "$PACKAGES_VOLATILE"; then printf '### REMOVING UNNEEDED PACKAGES ###\n' - DEBIAN_FRONTEND=noninteractive apt-get remove --purge -y $PACKAGES_VOLATILE + apt-get remove --purge -y $PACKAGES_VOLATILE fi if test -n "$PACKAGES_PREVIOUS"; then printf '### RESTORING PREVIOUSLY INSTALLED PACKAGES ###\n' - DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends --no-upgrade $IPE_APTGET_INSTALLOPTIONS $PACKAGES_PREVIOUS + apt-get install -qqy --no-install-recommends --no-upgrade $PACKAGES_PREVIOUS fi ;; esac @@ -4669,6 +5078,8 @@ cleanup() { esac } +DEBIAN_FRONTEND=noninteractive +export DEBIAN_FRONTEND resetIFS mkdir -p /tmp/src mkdir -p /tmp/pickle.tmp @@ -4684,7 +5095,7 @@ esac setPHPVersionVariables setPHPPreinstalledModules case "$PHP_MAJMIN_VERSION" in - 505 | 506 | 700 | 701 | 702 | 703 | 704 | 800 | 801 | 802 | 803) ;; + 505 | 506 | 700 | 701 | 702 | 703 | 704 | 800 | 801 | 802 | 803 | 804) ;; *) printf "### ERROR: Unsupported PHP version: %s.%s ###\n" $((PHP_MAJMIN_VERSION / 100)) $((PHP_MAJMIN_VERSION % 100)) ;; @@ -4721,6 +5132,8 @@ if test $USE_PICKLE -gt 1; then buildPickle fi +compileLibs + for PHP_MODULE_TO_INSTALL in $PHP_MODULES_TO_INSTALL; do case "$PHP_MODULE_TO_INSTALL" in @fix_letsencrypt)