From 8fd34761267de02ffb223b972d18aa3ef5df1c66 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Fri, 10 Nov 2023 19:06:31 +0800 Subject: [PATCH] up --- plugins/php/lib/libiconv.sh | 4 ++-- plugins/php/versions/common/gettext.sh | 11 ++++++++--- plugins/php/versions/common/gmp.sh | 4 ++++ plugins/php/versions/common/iconv.sh | 4 ++++ plugins/php/versions/common/imagemagick.sh | 4 ++-- scripts/install/macos.sh | 1 + 6 files changed, 21 insertions(+), 7 deletions(-) diff --git a/plugins/php/lib/libiconv.sh b/plugins/php/lib/libiconv.sh index 61b94b927..eda5c34f6 100644 --- a/plugins/php/lib/libiconv.sh +++ b/plugins/php/lib/libiconv.sh @@ -26,12 +26,12 @@ if [ ! -d ${SERVER_ROOT}/libiconv ];then if [ "$LOCAL_ADDR" == 'cn' ];then if [ ! -f ${SOURCE_ROOT}/libiconv-1.15.tar.gz ];then - wget --no-check-certificate -O libiconv-1.15.tar.gz https://dl.midoks.me/lib/libiconv-1.15.tar.gz -T 20 + wget --no-check-certificate -O ${SOURCE_ROOT}/libiconv-1.15.tar.gz https://dl.midoks.me/lib/libiconv-1.15.tar.gz -T 20 fi fi if [ ! -f ${SOURCE_ROOT}/libiconv-1.15.tar.gz ];then - wget --no-check-certificate -O libiconv-1.15.tar.gz https:/github.com/midoks/mdserver-web/releases/download/init/libiconv-1.15.tar.gz -T 5 + wget --no-check-certificate -O ${SOURCE_ROOT}/libiconv-1.15.tar.gz https:/github.com/midoks/mdserver-web/releases/download/init/libiconv-1.15.tar.gz -T 5 fi if [ ! -d ${SOURCE_ROOT}/libiconv-1.15 ];then diff --git a/plugins/php/versions/common/gettext.sh b/plugins/php/versions/common/gettext.sh index 0ccffb443..7cac66663 100755 --- a/plugins/php/versions/common/gettext.sh +++ b/plugins/php/versions/common/gettext.sh @@ -54,6 +54,11 @@ Install_lib() OPTIONS="$OPTIONS --build=aarch64-unknown-linux-gnu --host=aarch64-unknown-linux-gnu" fi + if [ "$sysName" == "Darwin" ];then + OPTIONS="$OPTIONS --with-gettext=$(brew --prefix gettext)" + fi + + $serverPath/php/$version/bin/phpize ./configure --with-php-config=$serverPath/php/$version/bin/php-config $OPTIONS @@ -65,9 +70,9 @@ Install_lib() 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/gmp.sh b/plugins/php/versions/common/gmp.sh index 67e0dfe7f..fcc49a01e 100755 --- a/plugins/php/versions/common/gmp.sh +++ b/plugins/php/versions/common/gmp.sh @@ -65,6 +65,10 @@ Install_lib() # sed -i $BAK 's/CFLAGS \=/CFLAGS \= -std=c99/g' Makefile # fi + if [ "$sysName" == "Darwin" ];then + OPTIONS="$OPTIONS --with-gmp=$(brew --prefix gmp)" + fi + make clean && make && make install && make clean if [ -d $sourcePath/php${version} ];then diff --git a/plugins/php/versions/common/iconv.sh b/plugins/php/versions/common/iconv.sh index c213617c7..f20ce60c8 100755 --- a/plugins/php/versions/common/iconv.sh +++ b/plugins/php/versions/common/iconv.sh @@ -60,6 +60,10 @@ Install_lib() OPTIONS="$OPTIONS --build=aarch64-unknown-linux-gnu --host=aarch64-unknown-linux-gnu" fi + if [ "$sysName" == "Darwin" ];then + OPTIONS="$OPTIONS --with-iconv=${serverPath}/lib/libiconv" + fi + $serverPath/php/$version/bin/phpize ./configure --with-php-config=$serverPath/php/$version/bin/php-config $OPTIONS make clean && make && make install && make clean diff --git a/plugins/php/versions/common/imagemagick.sh b/plugins/php/versions/common/imagemagick.sh index 6fe8b7070..34ad72961 100755 --- a/plugins/php/versions/common/imagemagick.sh +++ b/plugins/php/versions/common/imagemagick.sh @@ -84,7 +84,7 @@ Install_lib() echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini - bash ${rootPath}/plugins/php/versions/lib.sh $version restart + cd ${curPath} && bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -107,7 +107,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - bash ${rootPath}/plugins/php/versions/lib.sh $version restart + cd ${curPath} && bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/scripts/install/macos.sh b/scripts/install/macos.sh index ecba37d96..b7af491f3 100755 --- a/scripts/install/macos.sh +++ b/scripts/install/macos.sh @@ -28,6 +28,7 @@ brew install librdkafka brew install coreutils libxml2 xml2 brew install md5sum libevent pidof bison brew install pcre2 libxpm libelf +brew install automake if [ ! -d $DEV/server/mdserver-web ]; then wget -O /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master