Merge pull request #251 from mlocati/rdkafka-php5.6

Fix installing rdkafka in PHP 5.6
pull/252/head 1.1.32
Michele Locati 2021-01-14 14:54:59 +01:00 committed by GitHub
commit 641ec6a75b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 40 additions and 19 deletions

View File

@ -2,7 +2,7 @@
# This script wraps docker-php-ext-install, properly configuring the system. # This script wraps docker-php-ext-install, properly configuring the system.
# #
# Copyright (c) Michele Locati, 2018-2020 # Copyright (c) Michele Locati, 2018-2021
# #
# Source: https://github.com/mlocati/docker-php-extension-installer # Source: https://github.com/mlocati/docker-php-extension-installer
# #
@ -46,6 +46,15 @@ setPHPVersionVariables() {
PHP_MAJMINPAT_VERSION=$(printf '%s' "$setPHPVersionVariables_textual" | awk -F. '{print $1*10000+$2*100+$3}') PHP_MAJMINPAT_VERSION=$(printf '%s' "$setPHPVersionVariables_textual" | awk -F. '{print $1*10000+$2*100+$3}')
} }
# Fix apt-get being very slow on Debian Jessie
# See https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1332440
fixMaxOpenFiles() {
fixMaxOpenFiles_cur=$(ulimit -n 2>/dev/null || echo 0)
if test "$fixMaxOpenFiles_cur" -gt 10000; then
ulimit -n 10000
fi
}
# Get the directory containing the compiled PHP extensions # Get the directory containing the compiled PHP extensions
# #
# Output: # Output:
@ -1643,27 +1652,34 @@ installRemoteModule() {
;; ;;
rdkafka) rdkafka)
if test -z "$installRemoteModule_version"; then if test -z "$installRemoteModule_version"; then
installRemoteModule_version1=''
if test $PHP_MAJMIN_VERSION -le 505; then if test $PHP_MAJMIN_VERSION -le 505; then
installRemoteModule_version=3.0.5 installRemoteModule_version1=3.0.5
else elif test $PHP_MAJMIN_VERSION -le 506; then
installRemoteModule_tmp= installRemoteModule_version1=4.1.2
case "$DISTRO" in fi
alpine) installRemoteModule_version2=''
installRemoteModule_tmp='librdkafka' case "$DISTRO" in
;; alpine)
debian) installRemoteModule_tmp='librdkafka'
installRemoteModule_tmp='librdkafka*' ;;
;; debian)
esac installRemoteModule_tmp='librdkafka*'
if test -n "$installRemoteModule_tmp"; then ;;
installRemoteModule_tmp="$(getInstalledPackageVersion "$installRemoteModule_tmp")" esac
if test -n "$installRemoteModule_tmp"; then if test -n "$installRemoteModule_tmp"; then
if test $(compareVersions "$installRemoteModule_tmp" '0.11.0') -lt 0; then installRemoteModule_tmp="$(getInstalledPackageVersion "$installRemoteModule_tmp")"
installRemoteModule_version=3.1.3 if test -n "$installRemoteModule_tmp" && test $(compareVersions "$installRemoteModule_tmp" '0.11.0') -lt 0; then
fi installRemoteModule_version2=3.1.3
fi
fi fi
fi fi
if test -z "$installRemoteModule_version1" || test -z "$installRemoteModule_version2"; then
installRemoteModule_version="$installRemoteModule_version1$installRemoteModule_version2"
elif test $(compareVersions "$installRemoteModule_version1" "$installRemoteModule_version2") -le 0; then
installRemoteModule_version="$installRemoteModule_version1"
else
installRemoteModule_version="$installRemoteModule_version2"
fi
fi fi
;; ;;
redis) redis)
@ -2235,6 +2251,11 @@ mkdir -p /tmp/pickle.tmp
IPE_ERRFLAG_FILE="$(mktemp -p /tmp/src)" IPE_ERRFLAG_FILE="$(mktemp -p /tmp/src)"
CONFIGURE_FILE=/tmp/configure-options CONFIGURE_FILE=/tmp/configure-options
setDistro setDistro
case "$DISTRO_VERSION" in
debian@8)
fixMaxOpenFiles || true
;;
esac
setPHPVersionVariables setPHPVersionVariables
setPHPPreinstalledModules setPHPPreinstalledModules
case "$PHP_MAJMIN_VERSION" in case "$PHP_MAJMIN_VERSION" in