From c8b955f282c29eab37944ffb0f477af714f9fb13 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Fri, 10 Nov 2023 20:03:04 +0800 Subject: [PATCH] update --- plugins/php/versions/all_mac.sh | 2 +- plugins/php/versions/common/intl.sh | 16 +++++++++++++--- plugins/php/versions/common/mcrypt.sh | 2 +- plugins/php/versions/common/sodium.sh | 24 ++++++++++++++++++++---- plugins/php/versions/common/solr.sh | 18 +++++++++++++----- plugins/php/versions/common/swoole.sh | 4 +++- plugins/php/versions/common/yaml.sh | 7 +++++++ 7 files changed, 58 insertions(+), 15 deletions(-) diff --git a/plugins/php/versions/all_mac.sh b/plugins/php/versions/all_mac.sh index 5b42c677c..ff628f3bf 100644 --- a/plugins/php/versions/all_mac.sh +++ b/plugins/php/versions/all_mac.sh @@ -50,7 +50,7 @@ PHP_EXT_LIST=(ZendGuardLoader pdo mysqlnd sqlite3 openssl opcache mcrypt fileinf for PHP_VER in ${PHP_VER_LIST[@]}; do echo "php${PHP_VER} -- start" - if [ ! -d /www/server/php/${PHP_VER} ];then + if [ ! -d /Users/midoks/Desktop/mwdev/server/php/${PHP_VER} ];then echo "php${PHP_VER} is not install!" continue fi diff --git a/plugins/php/versions/common/intl.sh b/plugins/php/versions/common/intl.sh index d082ae203..0aa5c2732 100755 --- a/plugins/php/versions/common/intl.sh +++ b/plugins/php/versions/common/intl.sh @@ -89,13 +89,23 @@ Install_lib() OPTIONS="$OPTIONS --build=aarch64-unknown-linux-gnu --host=aarch64-unknown-linux-gnu" fi + if [ "$sysName" == "Darwin" ];then + BREW_DIR=`which brew` + BREW_DIR=${BREW_DIR/\/bin\/brew/} + LIB_DEPEND_DIR=`brew info icu4c | grep ${BREW_DIR}/Cellar/icu4c | cut -d \ -f 1 | awk 'END {print}'` + + OPTIONS="$OPTIONS --with-icu-dir=${serverPath}/lib/icu" + OPTIONS="$OPTIONS --enable-intl" + fi + + $serverPath/php/$version/bin/phpize ./configure --with-php-config=$serverPath/php/$version/bin/php-config $OPTIONS make clean && make && make install && make clean - if [ -d $sourcePath/php${version} ];then - cd ${sourcePath} && rm -rf $sourcePath/php${version} - fi + # if [ -d $sourcePath/php${version} ];then + # cd ${sourcePath} && rm -rf $sourcePath/php${version} + # fi fi if [ ! -f "$extFile" ];then diff --git a/plugins/php/versions/common/mcrypt.sh b/plugins/php/versions/common/mcrypt.sh index 81c976f9b..e34899c7f 100755 --- a/plugins/php/versions/common/mcrypt.sh +++ b/plugins/php/versions/common/mcrypt.sh @@ -72,7 +72,7 @@ Install_lib() ./configure --with-php-config=$serverPath/php/$version/bin/php-config $OPTIONS make clean && make && make install && make clean - cd $php_lib && rm -rf $php_lib/${LIBNAME}-${LIBV} + # cd $php_lib && rm -rf $php_lib/${LIBNAME}-${LIBV} fi if [ ! -f "$extFile" ];then diff --git a/plugins/php/versions/common/sodium.sh b/plugins/php/versions/common/sodium.sh index b3ea595bf..25cb6bc07 100755 --- a/plugins/php/versions/common/sodium.sh +++ b/plugins/php/versions/common/sodium.sh @@ -43,7 +43,10 @@ Install_lib() return fi - cd ${rootPath}/plugins/php/lib && bash libsodium.sh + if [ "$sysName" != "Darwin" ];then + cd ${rootPath}/plugins/php/lib && bash libsodium.sh + fi + if [ ! -f "$extFile" ];then @@ -57,16 +60,29 @@ Install_lib() fi cd $php_lib/lib${LIBNAME}-${LIBV} + + OPTIONS="" + if [ "$sysName" == "Darwin" ];then + BREW_DIR=`which brew` + BREW_DIR=${BREW_DIR/\/bin\/brew/} + LIB_DEPEND_DIR=`brew info libsodium | grep ${BREW_DIR}/Cellar/libsodium | cut -d \ -f 1 | awk 'END {print}'` + OPTIONS="$OPTIONS --with-sodium=${LIB_DEPEND_DIR}" + else + OPTIONS="$OPTIONS --with-sodium=$serverPath/lib/libsodium" + fi + $serverPath/php/$version/bin/phpize - ./configure --with-php-config=$serverPath/php/$version/bin/php-config --with-sodium=$serverPath/lib/libsodium + ./configure --with-php-config=$serverPath/php/$version/bin/php-config $OPTIONS make clean && make && make install && make clean - cd $php_lib && rm -rf $php_lib/lib${LIBNAME}-${LIBV} + if [ -d $php_lib/lib${LIBNAME}-${LIBV} ];then + cd $php_lib && rm -rf $php_lib/lib${LIBNAME}-${LIBV} + fi fi if [ ! -f "$extFile" ];then echo "ERROR!" - return; + return fi echo "" >> $serverPath/php/$version/etc/php.ini diff --git a/plugins/php/versions/common/solr.sh b/plugins/php/versions/common/solr.sh index 3391b3e85..fc0241365 100755 --- a/plugins/php/versions/common/solr.sh +++ b/plugins/php/versions/common/solr.sh @@ -45,10 +45,7 @@ Install_lib() if [ ! -f "$extFile" ];then - OPTIONS='' - if [ $sysName == 'Darwin' ]; then - OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl" - fi + php_lib=$sourcePath/php_lib mkdir -p $php_lib @@ -61,15 +58,26 @@ Install_lib() fi cd $php_lib/${LIBNAME}-${LIBV} + OPTIONS='' if [ "${SYS_ARCH}" == "aarch64" ] && [ "$version" -lt "56" ];then OPTIONS="$OPTIONS --build=aarch64-unknown-linux-gnu --host=aarch64-unknown-linux-gnu" fi + if [ $sysName == 'Darwin' ]; then + BREW_DIR=`which brew` + BREW_DIR=${BREW_DIR/\/bin\/brew/} + LIB_DEPEND_DIR=`brew info curl | grep ${BREW_DIR}/Cellar/curl | cut -d \ -f 1 | awk 'END {print}'` + OPTIONS="${OPTIONS} --with-curl=${LIB_DEPEND_DIR}" + fi + + $serverPath/php/$version/bin/phpize ./configure --with-php-config=$serverPath/php/$version/bin/php-config $OPTIONS make clean && make && make install && make clean - cd $php_lib && rm -rf $php_lib/${LIBNAME}-${LIBV} + if [ -d $php_lib/lib${LIBNAME}-${LIBV} ];then + cd $php_lib && rm -rf $php_lib/lib${LIBNAME}-${LIBV} + fi fi sleep 1 if [ ! -f "$extFile" ];then diff --git a/plugins/php/versions/common/swoole.sh b/plugins/php/versions/common/swoole.sh index b8069236d..ddc3246c0 100755 --- a/plugins/php/versions/common/swoole.sh +++ b/plugins/php/versions/common/swoole.sh @@ -57,6 +57,8 @@ Install_lib() php_lib=$sourcePath/php_lib mkdir -p $php_lib + cd ${rootPath}/plugins/php/lib && /bin/bash openssl_11.sh + if [ ! -d $php_lib/${LIBNAME}-${LIBV} ];then if [ ! -f $php_lib/${LIBNAME}-${LIBV}.tgz ];then wget --no-check-certificate -O $php_lib/${LIBNAME}-${LIBV}.tgz http://pecl.php.net/get/${LIBNAME}-${LIBV}.tgz @@ -74,7 +76,7 @@ Install_lib() ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ $OPTIONS \ --enable-openssl \ - --with-openssl-dir=$serverPath/lib/openssl \ + --with-openssl-dir=$serverPath/lib/openssl11 \ --enable-sockets make clean && make && make install && make clean diff --git a/plugins/php/versions/common/yaml.sh b/plugins/php/versions/common/yaml.sh index 0bfdac96b..bd1347398 100755 --- a/plugins/php/versions/common/yaml.sh +++ b/plugins/php/versions/common/yaml.sh @@ -58,6 +58,13 @@ Install_lib() OPTIONS="$OPTIONS --build=aarch64-unknown-linux-gnu --host=aarch64-unknown-linux-gnu" fi + if [ $sysName == 'Darwin' ]; then + BREW_DIR=`which brew` + BREW_DIR=${BREW_DIR/\/bin\/brew/} + LIB_DEPEND_DIR=`brew info libyaml | grep ${BREW_DIR}/Cellar/libyaml | cut -d \ -f 1 | awk 'END {print}'` + OPTIONS="${OPTIONS} --with-yaml=${LIB_DEPEND_DIR}" + fi + $serverPath/php/$version/bin/phpize ./configure --with-php-config=$serverPath/php/$version/bin/php-config $OPTIONS make clean && make && make install && make clean