Merge pull request #192 from mlocati/redis-pecl

Use redis version from pecl, even with PHP 8
pull/193/head 1.0.5
Michele Locati 2020-12-02 18:30:44 +01:00 committed by GitHub
commit cf59243ac4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 26 additions and 39 deletions

View File

@ -1302,47 +1302,34 @@ installPECLModule() {
fi
;;
redis)
if test $PHP_MAJMIN_VERSION -ge 800; then
installPECLModule_src="$(getPackageSource https://codeload.github.com/phpredis/phpredis/tar.gz/develop)"
cd -- "$installPECLModule_src"
installPECLModule_cmd='./configure'
php --ri igbinary >/dev/null 2>/dev/null && installPECLModule_cmd="$installPECLModule_cmd --enable-redis-igbinary"
phpize
$installPECLModule_cmd
make -j$(getProcessorCount)
make install
cd - >/dev/null
installPECLModule_manuallyInstalled=1
# Enable igbinary serializer support?
if php --ri igbinary >/dev/null 2>/dev/null; then
addConfigureOption 'enable-redis-igbinary' 'yes'
else
# Enable igbinary serializer support?
if php --ri igbinary >/dev/null 2>/dev/null; then
addConfigureOption 'enable-redis-igbinary' 'yes'
else
addConfigureOption 'enable-redis-igbinary' 'no'
fi
# Enable lzf compression support?
addConfigureOption 'enable-redis-lzf' 'yes'
if test $PHP_MAJMIN_VERSION -le 506; then
installPECLModule_actual="$1-4.3.0"
else
installPECLModule_machine=$(getTargetTriplet)
if ! test -e /usr/include/zstd.h || ! test -e /usr/lib/libzstd.so -o -e "/usr/lib/$installPECLModule_machine/libzstd.so"; then
installPECLModule_zstdVersion=1.4.4
installPECLModule_zstdVersionMajor=$(echo $installPECLModule_zstdVersion | cut -d. -f1)
rm -rf /tmp/src/zstd
mv "$(getPackageSource https://github.com/facebook/zstd/releases/download/v1.4.4/zstd-$installPECLModule_zstdVersion.tar.gz)" /tmp/src/zstd
cd /tmp/src/zstd
make V=0 -j$(getProcessorCount) lib
cp -f lib/libzstd.so "/usr/lib/$installPECLModule_machine/libzstd.so.$installPECLModule_zstdVersion"
ln -sf "/usr/lib/$installPECLModule_machine/libzstd.so.$installPECLModule_zstdVersion" "/usr/lib/$installPECLModule_machine/libzstd.so.$installPECLModule_zstdVersionMajor"
ln -sf "/usr/lib/$installPECLModule_machine/libzstd.so.$installPECLModule_zstdVersion" "/usr/lib/$installPECLModule_machine/libzstd.so"
ln -sf /tmp/src/zstd/lib/zstd.h /usr/include/zstd.h
UNNEEDED_PACKAGE_LINKS="$UNNEEDED_PACKAGE_LINKS /usr/include/zstd.h"
cd - >/dev/null
fi
# Enable zstd compression support?
addConfigureOption 'enable-redis-zstd' 'yes'
addConfigureOption 'enable-redis-igbinary' 'no'
fi
# Enable lzf compression support?
addConfigureOption 'enable-redis-lzf' 'yes'
if test $PHP_MAJMIN_VERSION -le 506; then
installPECLModule_actual="$1-4.3.0"
else
installPECLModule_machine=$(getTargetTriplet)
if ! test -e /usr/include/zstd.h || ! test -e /usr/lib/libzstd.so -o -e "/usr/lib/$installPECLModule_machine/libzstd.so"; then
installPECLModule_zstdVersion=1.4.4
installPECLModule_zstdVersionMajor=$(echo $installPECLModule_zstdVersion | cut -d. -f1)
rm -rf /tmp/src/zstd
mv "$(getPackageSource https://github.com/facebook/zstd/releases/download/v1.4.4/zstd-$installPECLModule_zstdVersion.tar.gz)" /tmp/src/zstd
cd /tmp/src/zstd
make V=0 -j$(getProcessorCount) lib
cp -f lib/libzstd.so "/usr/lib/$installPECLModule_machine/libzstd.so.$installPECLModule_zstdVersion"
ln -sf "/usr/lib/$installPECLModule_machine/libzstd.so.$installPECLModule_zstdVersion" "/usr/lib/$installPECLModule_machine/libzstd.so.$installPECLModule_zstdVersionMajor"
ln -sf "/usr/lib/$installPECLModule_machine/libzstd.so.$installPECLModule_zstdVersion" "/usr/lib/$installPECLModule_machine/libzstd.so"
ln -sf /tmp/src/zstd/lib/zstd.h /usr/include/zstd.h
UNNEEDED_PACKAGE_LINKS="$UNNEEDED_PACKAGE_LINKS /usr/include/zstd.h"
cd - >/dev/null
fi
# Enable zstd compression support?
addConfigureOption 'enable-redis-zstd' 'yes'
fi
;;
solr)