Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
jingjingxyk committed Jan 10, 2025
1 parent 5371830 commit ddb1088
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 134 deletions.
12 changes: 6 additions & 6 deletions sapi/scripts/cygwin/cygwin-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ __PROJECT__=$(
pwd
)
cd ${__PROJECT__}
cd ${__PROJECT__}/php-src
cd ${__PROJECT__}/var/cygwin-build/php-src

mkdir -p bin/.libs
# export LDFLAGS="-all-static"

LOGICAL_PROCESSORS=$(nproc)
if test $LOGICAL_PROCESSORS -ge 4; then
LOGICAL_PROCESSORS=$((LOGICAL_PROCESSORS - 2))
fi
if test $LOGICAL_PROCESSORS -ge 4; then
LOGICAL_PROCESSORS=$((LOGICAL_PROCESSORS - 2))
fi
set +u
if [ -n "${GITHUB_ACTION}" ]; then
if test $LOGICAL_PROCESSORS -ge 4; then
Expand All @@ -31,9 +31,9 @@ else
fi
set -u

${__PROJECT__}/php-src/sapi/cli/php.exe -v
${__PROJECT__}/var/cygwin-build/php-src/sapi/cli/php.exe -v

cp -f ${__PROJECT__}/php-src/sapi/cli/php.exe ${__PROJECT__}/bin/
cp -f ${__PROJECT__}/var/cygwin-build/php-src/sapi/cli/php.exe ${__PROJECT__}/bin/

${__PROJECT__}/bin/php.exe -v
${__PROJECT__}/bin/php.exe -m
Expand Down
100 changes: 35 additions & 65 deletions sapi/scripts/cygwin/cygwin-config-ext.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ __DIR__=$(
pwd
)
__PROJECT__=$(
cd ${__DIR__}/../../../
cd ${__DIR__}/../../
pwd
)
cd ${__PROJECT__}

ROOT=${__PROJECT__}

PHP_VERSION='8.2.27'
SWOOLE_VERSION='v6.0.0'
X_PHP_VERSION='8.2'
Expand All @@ -34,87 +32,59 @@ while [ $# -gt 0 ]; do
done

REDIS_VERSION=6.1.0
MONGODB_VERSION=1.17.2
YAML_VERSION=2.2.2
IMAGICK_VERSION=3.7.0

if [ ! -d pool/ext ]; then
mkdir -p pool/ext
fi
mkdir -p pool/ext
mkdir -p pool/lib
mkdir -p pool/php-tar
mkdir -p var/cygwin-build/

test -d ext && rm -rf ext
test -d pool/ext && rm -rf pool/ext
mkdir -p pool/ext
mkdir -p ext
cd pool/ext

if [ ! -d $ROOT/ext/redis ]; then
if [ ! -f redis-${REDIS_VERSION}.tgz ]; then
curl -fSLo redis-${REDIS_VERSION}.tgz https://pecl.php.net/get/redis-${REDIS_VERSION}.tgz
fi
tar xvf redis-${REDIS_VERSION}.tgz
mv redis-${REDIS_VERSION} $ROOT/ext/redis
cd ${__PROJECT__}/pool/ext
if [ ! -f redis-${REDIS_VERSION}.tgz ]; then
curl -fSLo redis-${REDIS_VERSION}.tgz https://pecl.php.net/get/redis-${REDIS_VERSION}.tgz
fi
mkdir -p ${__PROJECT__}/ext/redis/
tar --strip-components=1 -C ${__PROJECT__}/ext/redis/ redis-${REDIS_VERSION}.tgz

# mongodb no support cygwin
if [ ! -d $ROOT/ext/mongodb ]; then
if [ ! -f mongodb-${MONGODB_VERSION}.tgz ]; then
curl -fSLo mongodb-${MONGODB_VERSION}.tgz https://pecl.php.net/get/mongodb-${MONGODB_VERSION}.tgz
fi
tar xvf mongodb-${MONGODB_VERSION}.tgz
mv mongodb-${MONGODB_VERSION} $ROOT/ext/mongodb
cd ${__PROJECT__}/pool/ext
if [ ! -f yaml-${YAML_VERSION}.tgz ]; then
curl -fSLo yaml-${YAML_VERSION}.tgz https://pecl.php.net/get/yaml-${YAML_VERSION}.tgz
fi
mkdir -p ${__PROJECT__}/ext/yaml/
tar --strip-components=1 -C ${__PROJECT__}/ext/yaml/ yaml-${YAML_VERSION}.tgz

if [ ! -d $ROOT/ext/yaml ]; then
if [ ! -f yaml-${YAML_VERSION}.tgz ]; then
curl -fSLo yaml-${YAML_VERSION}.tgz https://pecl.php.net/get/yaml-${YAML_VERSION}.tgz
fi
tar xvf yaml-${YAML_VERSION}.tgz
mv yaml-${YAML_VERSION} $ROOT/ext/yaml
cd ${__PROJECT__}/pool/ext
if [ ! -f imagick-${IMAGICK_VERSION}.tgz ]; then
curl -fSLo imagick-${IMAGICK_VERSION}.tgz https://pecl.php.net/get/imagick-${IMAGICK_VERSION}.tgz
fi

if [ ! -d $ROOT/ext/imagick ]; then
if [ ! -f imagick-${IMAGICK_VERSION}.tgz ]; then
curl -fSLo imagick-${IMAGICK_VERSION}.tgz https://pecl.php.net/get/imagick-${IMAGICK_VERSION}.tgz
fi
tar xvf imagick-${IMAGICK_VERSION}.tgz
mv imagick-${IMAGICK_VERSION} $ROOT/ext/imagick
if [ "$X_PHP_VERSION" = "8.4" ]; then
sed -i.backup "s/php_strtolower(/zend_str_tolower(/" $ROOT/ext/imagick/imagick.c
fi
mkdir -p ${__PROJECT__}/ext/imagick/
tar --strip-components=1 -C ${__PROJECT__}/ext/imagick/ imagick-${IMAGICK_VERSION}.tgz
if [ "$X_PHP_VERSION" = "8.4" ]; then
sed -i.backup "s/php_strtolower(/zend_str_tolower(/" ${__PROJECT__}/ext/imagick/imagick.c
fi

cd ${__PROJECT__}/pool/ext
if [ ! -f swoole-${SWOOLE_VERSION}.tgz ]; then
test -d /tmp/swoole && rm -rf /tmp/swoole
git clone -b ${SWOOLE_VERSION} https://github.com/swoole/swoole-src.git /tmp/swoole
cd /tmp/swoole
tar -czvf $ROOT/pool/ext/swoole-${SWOOLE_VERSION}.tgz .
cd $ROOT/pool/ext/
test -d ${__PROJECT__}/var/cygwin-build/swoole && rm -rf ${__PROJECT__}/var/cygwin-build/swoole
git clone -b ${SWOOLE_VERSION} https://github.com/swoole/swoole-src.git ${__PROJECT__}/var/cygwin-build/swoole
cd ${__PROJECT__}/var/cygwin-build/swoole
tar -czvf ${__PROJECT__}/pool/ext/swoole-${SWOOLE_VERSION}.tgz .
cd ${__PROJECT__}/pool/ext
fi
mkdir -p swoole-${SWOOLE_VERSION}
tar --strip-components=1 -C swoole-${SWOOLE_VERSION} -xf swoole-${SWOOLE_VERSION}.tgz
test -d $ROOT/ext/swoole && rm -rf $ROOT/ext/swoole
mv swoole-${SWOOLE_VERSION} $ROOT/ext/swoole

cd $ROOT
mkdir -p ${__PROJECT__}/ext/swoole/
tar --strip-components=1 -C ${__PROJECT__}/ext/swoole/ -xf swoole-${SWOOLE_VERSION}.tgz

cd ${__PROJECT__}/pool/php-tar
# download php-src source code

if [ ! -f php-${PHP_VERSION}.tar.gz ]; then
curl -fSLo php-${PHP_VERSION}.tar.gz https://github.com/php/php-src/archive/refs/tags/php-${PHP_VERSION}.tar.gz
fi
test -d php-src && rm -rf php-src
mkdir -p php-src
tar --strip-components=1 -C php-src -xf php-${PHP_VERSION}.tar.gz

cd $ROOT

if [ ! -d $ROOT/ext/pgsql ]; then
mv $ROOT/php-src/ext/pgsql $ROOT/ext/pgsql
fi

cd $ROOT
test -d ${__PROJECT__}/var/cygwin-build/php-src && rm -rf ${__PROJECT__}/var/cygwin-build/php-src
mkdir -p ${__PROJECT__}/var/cygwin-build/php-src
tar --strip-components=1 -C ${__PROJECT__}/var/cygwin-build/php-src -xf php-${PHP_VERSION}.tar.gz

ls -lh $ROOT
ls -lh $ROOT/ext/
cd $ROOT
cd ${__PROJECT__}
5 changes: 3 additions & 2 deletions sapi/scripts/cygwin/cygwin-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ while [ $# -gt 0 ]; do
done

mkdir -p ${__PROJECT__}/bin/
mkdir -p ${__PROJECT__}/var/cygwin-build/php-src
# cp -f ${__PROJECT__}/php-src/ext/openssl/config0.m4 ${__PROJECT__}/php-src/ext/openssl/config.m4

cp -rf ${__PROJECT__}/ext/* ${__PROJECT__}/php-src/ext/
cp -rf ${__PROJECT__}/ext/* ${__PROJECT__}/var/cygwin-build/php-src/ext/

cd ${__PROJECT__}/php-src/
cd ${__PROJECT__}/var/cygwin-build/php-src/
if [ "$X_PHP_VERSION" = "8.4" ] || [ "$X_PHP_VERSION" = "8.3" ] || [ "$X_PHP_VERSION" = "8.2" ] || [ "$X_PHP_VERSION" = "8.1" ]; then
sed -i.backup 's/!defined(__HAIKU__)/!defined(__HAIKU__) \&\& !defined(__CYGWIN__)/' TSRM/TSRM.c
fi
Expand Down
6 changes: 3 additions & 3 deletions sapi/scripts/msys2/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ __PROJECT__=$(
pwd
)
cd ${__PROJECT__}
cd ${__PROJECT__}/php-src
cd ${__PROJECT__}/var/msys2-build/php-src/

mkdir -p bin/.libs
# export LDFLAGS="-all-static"
Expand All @@ -29,9 +29,9 @@ else
fi
set -u

${__PROJECT__}/php-src/sapi/cli/php.exe -v
${__PROJECT__}/var/msys2-build/php-src/sapi/cli/php.exe -v

cp -f ${__PROJECT__}/php-src/sapi/cli/php.exe ${__PROJECT__}/bin/
cp -f ${__PROJECT__}/var/msys2-build/php-src/sapi/cli/php.exe ${__PROJECT__}/bin/

${__PROJECT__}/bin/php.exe -v
${__PROJECT__}/bin/php.exe -m
Expand Down
91 changes: 35 additions & 56 deletions sapi/scripts/msys2/config-ext.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ __PROJECT__=$(
pwd
)
cd ${__PROJECT__}
ROOT=${__PROJECT__}

PHP_VERSION='8.2.27'
SWOOLE_VERSION='v6.0.0'
Expand All @@ -33,79 +32,59 @@ while [ $# -gt 0 ]; do
done

REDIS_VERSION=6.1.0
MONGODB_VERSION=1.17.2
YAML_VERSION=2.2.2
IMAGICK_VERSION=3.7.0

if [ ! -d pool/ext ]; then
mkdir -p pool/ext
fi
mkdir -p pool/ext
mkdir -p pool/lib
mkdir -p pool/php-tar
mkdir -p var/msys2-build/

test -d ext && rm -rf ext
test -d pool/ext && rm -rf pool/ext
mkdir -p pool/ext
mkdir -p ext
cd pool/ext

if [ ! -d $ROOT/ext/redis ]; then
if [ ! -f redis-${REDIS_VERSION}.tgz ]; then
curl -fSLo redis-${REDIS_VERSION}.tgz https://pecl.php.net/get/redis-${REDIS_VERSION}.tgz
fi
tar xvf redis-${REDIS_VERSION}.tgz
mv redis-${REDIS_VERSION} $ROOT/ext/redis
cd ${__PROJECT__}/pool/ext
if [ ! -f redis-${REDIS_VERSION}.tgz ]; then
curl -fSLo redis-${REDIS_VERSION}.tgz https://pecl.php.net/get/redis-${REDIS_VERSION}.tgz
fi
mkdir -p ${__PROJECT__}/ext/redis/
tar --strip-components=1 -C ${__PROJECT__}/ext/redis/ redis-${REDIS_VERSION}.tgz


if [ ! -d $ROOT/ext/yaml ]; then
if [ ! -f yaml-${YAML_VERSION}.tgz ]; then
curl -fSLo yaml-${YAML_VERSION}.tgz https://pecl.php.net/get/yaml-${YAML_VERSION}.tgz
fi
tar xvf yaml-${YAML_VERSION}.tgz
mv yaml-${YAML_VERSION} $ROOT/ext/yaml
cd ${__PROJECT__}/pool/ext
if [ ! -f yaml-${YAML_VERSION}.tgz ]; then
curl -fSLo yaml-${YAML_VERSION}.tgz https://pecl.php.net/get/yaml-${YAML_VERSION}.tgz
fi
mkdir -p ${__PROJECT__}/ext/yaml/
tar --strip-components=1 -C ${__PROJECT__}/ext/yaml/ yaml-${YAML_VERSION}.tgz

if [ ! -d $ROOT/ext/imagick ]; then
if [ ! -f imagick-${IMAGICK_VERSION}.tgz ]; then
curl -fSLo imagick-${IMAGICK_VERSION}.tgz https://pecl.php.net/get/imagick-${IMAGICK_VERSION}.tgz
fi
tar xvf imagick-${IMAGICK_VERSION}.tgz
mv imagick-${IMAGICK_VERSION} $ROOT/ext/imagick
if [ "$X_PHP_VERSION" = "8.4" ]; then
sed -i.backup "s/php_strtolower(/zend_str_tolower(/" $ROOT/ext/imagick/imagick.c
fi
cd ${__PROJECT__}/pool/ext
if [ ! -f imagick-${IMAGICK_VERSION}.tgz ]; then
curl -fSLo imagick-${IMAGICK_VERSION}.tgz https://pecl.php.net/get/imagick-${IMAGICK_VERSION}.tgz
fi
mkdir -p ${__PROJECT__}/ext/imagick/
tar --strip-components=1 -C ${__PROJECT__}/ext/imagick/ imagick-${IMAGICK_VERSION}.tgz
if [ "$X_PHP_VERSION" = "8.4" ]; then
sed -i.backup "s/php_strtolower(/zend_str_tolower(/" ${__PROJECT__}/ext/imagick/imagick.c
fi

cd ${__PROJECT__}/pool/ext
if [ ! -f swoole-${SWOOLE_VERSION}.tgz ]; then
test -d /tmp/swoole && rm -rf /tmp/swoole
git clone -b ${SWOOLE_VERSION} https://github.com/swoole/swoole-src.git /tmp/swoole
cd /tmp/swoole
tar -czvf $ROOT/pool/ext/swoole-${SWOOLE_VERSION}.tgz .
cd $ROOT/pool/ext/
test -d ${__PROJECT__}/var/msys2-build/swoole && rm -rf ${__PROJECT__}/var/msys2-build/swoole
git clone -b ${SWOOLE_VERSION} https://github.com/swoole/swoole-src.git ${__PROJECT__}/var/msys2-build/swoole
cd ${__PROJECT__}/var/msys2-build/swoole
tar -czvf ${__PROJECT__}/pool/ext/swoole-${SWOOLE_VERSION}.tgz .
cd ${__PROJECT__}/pool/ext
fi
mkdir -p swoole-${SWOOLE_VERSION}
tar --strip-components=1 -C swoole-${SWOOLE_VERSION} -xf swoole-${SWOOLE_VERSION}.tgz
test -d $ROOT/ext/swoole && rm -rf $ROOT/ext/swoole
mv swoole-${SWOOLE_VERSION} $ROOT/ext/swoole

cd $ROOT
mkdir -p ${__PROJECT__}/ext/swoole/
tar --strip-components=1 -C ${__PROJECT__}/ext/swoole/ -xf swoole-${SWOOLE_VERSION}.tgz

cd ${__PROJECT__}/pool/php-tar
# download php-src source code

if [ ! -f php-${PHP_VERSION}.tar.gz ]; then
curl -fSLo php-${PHP_VERSION}.tar.gz https://github.com/php/php-src/archive/refs/tags/php-${PHP_VERSION}.tar.gz
fi
test -d php-src && rm -rf php-src
mkdir -p php-src
tar --strip-components=1 -C php-src -xf php-${PHP_VERSION}.tar.gz

cd $ROOT

if [ ! -d $ROOT/ext/pgsql ]; then
mv $ROOT/php-src/ext/pgsql $ROOT/ext/pgsql
fi

cd $ROOT
test -d ${__PROJECT__}/var/msys2-build/php-src && rm -rf ${__PROJECT__}/var/msys2-build/php-src
mkdir -p ${__PROJECT__}/var/msys2-build/php-src
tar --strip-components=1 -C ${__PROJECT__}/var/msys2-build/php-src -xf php-${PHP_VERSION}.tar.gz

ls -lh $ROOT
ls -lh $ROOT/ext/
cd $ROOT
cd ${__PROJECT__}
5 changes: 3 additions & 2 deletions sapi/scripts/msys2/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ while [ $# -gt 0 ]; do
done

mkdir -p ${__PROJECT__}/bin/
mkdir -p ${__PROJECT__}/var/msys2-build/php-src/ext/
# cp -f ${__PROJECT__}/php-src/ext/openssl/config0.m4 ${__PROJECT__}/php-src/ext/openssl/config.m4

cp -rf ${__PROJECT__}/ext/* ${__PROJECT__}/php-src/ext/
cp -rf ${__PROJECT__}/ext/* ${__PROJECT__}/var/msys2-build/php-src/ext/

cd ${__PROJECT__}/php-src/
cd ${__PROJECT__}/var/msys2-build/php-src/
if [ "$X_PHP_VERSION" = "8.4" ] || [ "$X_PHP_VERSION" = "8.3" ] || [ "$X_PHP_VERSION" = "8.2" ] || [ "$X_PHP_VERSION" = "8.1" ]; then
sed -i.backup 's/!defined(__HAIKU__)/!defined(__HAIKU__) \&\& !defined(__CYGWIN__)/' TSRM/TSRM.c
fi
Expand Down

0 comments on commit ddb1088

Please sign in to comment.