From 1e04b3c11091a5ec0cc11d77166833774188928f Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Fri, 7 Jun 2024 17:47:24 +0200 Subject: [PATCH] Fix installing swoole (#926) * Install swoole 5.1.2 on Alpine 3.12 Fix this error: configure: error: Package requirements (libbrotlienc) were not met: Package 'libbrotlienc', required by 'virtual:world', not found Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables BROTLIENC_CFLAGS and BROTLIENC_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. Test: swoole * Fix installing swoole on Debian * Workaround for https://github.com/swoole/swoole-src/issues/5365 * Fix installing swoole on Debian --- install-php-extensions | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/install-php-extensions b/install-php-extensions index 22f4c5f..976b349 100755 --- a/install-php-extensions +++ b/install-php-extensions @@ -1364,7 +1364,8 @@ buildRequiredPackageLists() { buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libc-ares-dev" fi if test $PHP_MAJMIN_VERSION -ge 800; then - buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev" + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libbrotli1" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev libbrotli-dev" fi ;; sybase_ct@alpine) @@ -3811,6 +3812,14 @@ 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 else installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" @@ -3829,8 +3838,8 @@ installRemoteModule() { fi ;; esac - if test $PHP_MAJMIN_VERSION -eq 803; then - # see https://github.com/swoole/docker-swoole/issues/45 + if test $PHP_MAJMIN_VERSION -ge 800; then + # see https://github.com/swoole/swoole-src/issues/5365 installRemoteModule_curl=no else installRemoteModule_curl=yes