Skip to content

Commit

Permalink
Merge pull request #728 from jingjingxyk/build_native_php
Browse files Browse the repository at this point in the history
Build native php
  • Loading branch information
jingjingxyk committed Aug 1, 2024
2 parents 02d922c + 7129e81 commit ae3044e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/linux-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
# - "8.3.3"
steps:
- uses: actions/checkout@v4
- name: Prepare Source Code
- name: Show Environment Info
run: |
echo $PATH
env
Expand All @@ -37,9 +37,10 @@ jobs:
echo "X_IPV6=${IPV6}" >> $GITHUB_ENV
echo "X_IPV4=${IPV4}" >> $GITHUB_ENV
echo "BUILD_PHP_VERSION=${{ matrix.php-version }}" >> $GITHUB_ENV
- name: Prepare Build Environment
run: |
# git submodule update --init
echo "BUILD_PHP_VERSION=${{ matrix.php-version }}" >> $GITHUB_ENV
sudo mkdir -p /usr/local/swoole-cli
uid=$(id -u) && gid=$(id -g) && sudo chown -R ${uid}:${gid} /usr/local/swoole-cli
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/linux-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
# - "8.3.3"
steps:
- uses: actions/checkout@v4
- name: Prepare Source Code
- name: Show Environment Info
run: |
echo $PATH
env
Expand Down Expand Up @@ -82,18 +82,19 @@ jobs:
echo "X_IPV6=${IPV6}" >> $GITHUB_ENV
echo "X_IPV4=${IPV4}" >> $GITHUB_ENV
echo "BUILD_PHP_VERSION=${{ matrix.php-version }}" >> $GITHUB_ENV
echo ${{ github.actor }}
echo ${{ github.repository }}
echo ${{ github.repository_owner }}
echo ${{ github.head_ref }}
echo ${{ github.ref_name }}
- name: Prepare Build Environment
run: |
# git submodule update --init
echo "BUILD_PHP_VERSION=${{ matrix.php-version }}" >> $GITHUB_ENV
# 准备数据库容器
docker-compose version
bash sapi/src/UnitTest/scripts/database/start.sh
sudo mkdir -p /usr/local/swoole-cli
Expand Down
21 changes: 11 additions & 10 deletions sapi/scripts/cygwin/cygwin-config-ext.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ 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
Expand All @@ -49,7 +48,7 @@ cd pool/ext

if [ ! -d $ROOT/ext/redis ]; then
if [ ! -f redis-${REDIS_VERSION}.tgz ]; then
wget https://pecl.php.net/get/redis-${REDIS_VERSION}.tgz
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
Expand All @@ -58,31 +57,35 @@ fi
# mongodb no support cygwin
if [ ! -d $ROOT/ext/mongodb ]; then
if [ ! -f mongodb-${MONGODB_VERSION}.tgz ]; then
wget https://pecl.php.net/get/mongodb-${MONGODB_VERSION}.tgz
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
fi

if [ ! -d $ROOT/ext/yaml ]; then
if [ ! -f yaml-${YAML_VERSION}.tgz ]; then
wget https://pecl.php.net/get/yaml-${YAML_VERSION}.tgz
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
fi

if [ ! -d $ROOT/ext/imagick ]; then
if [ ! -f imagick-${IMAGICK_VERSION}.tgz ]; then
wget https://pecl.php.net/get/imagick-${IMAGICK_VERSION}.tgz
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
fi

if [ ! -d $ROOT/ext/swoole ]; then
if [ ! -f $ROOT/ext/swoole/config.m4 ]; then
if [ ! -f swoole-${SWOOLE_VERSION}.tgz ]; then
wget -O swoole-${SWOOLE_VERSION}.tgz https://github.com/swoole/swoole-src/archive/refs/tags/${SWOOLE_VERSION}.tar.gz
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/
fi
mkdir -p swoole-${SWOOLE_VERSION}
tar --strip-components=1 -C swoole-${SWOOLE_VERSION} -xf swoole-${SWOOLE_VERSION}.tgz
Expand All @@ -94,12 +97,10 @@ cd $ROOT
# download php-src source code

if [ ! -f php-${PHP_VERSION}.tar.gz ]; then
wget -O php-${PHP_VERSION}.tar.gz https://github.com/php/php-src/archive/refs/tags/php-${PHP_VERSION}.tar.gz
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

0 comments on commit ae3044e

Please sign in to comment.