Skip to content

Commit

Permalink
Merge pull request #647 from jingjingxyk/experiment_v4.8.x
Browse files Browse the repository at this point in the history
Experiment v4.8.x 同步主分支
  • Loading branch information
jingjingxyk committed Jun 7, 2024
2 parents 2fdb63d + c001b27 commit 87a264c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 19 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/macos-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [ push, pull_request ]

jobs:
macos-aarch64:
if: 1
if: 0
runs-on: macos-14
# macos-latest (macos-14) 变更了 CPU 架构,由 x86_64 变更为 arm64
# macos-14 CPU 架构 arm64
Expand Down Expand Up @@ -66,6 +66,7 @@ jobs:
echo ${CURRENT_USER}
sudo mkdir -p /usr/local/swoole-cli
CURRENT_USER=$(whoami) && sudo chown -R ${CURRENT_USER}:staff /usr/local/swoole-cli
# git submodule update --init
- name: Cache PHP Runtime
Expand Down
12 changes: 8 additions & 4 deletions build-release-example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ fi

cd ${__PROJECT__}

if [ ! -d ext/swoole/.git ] ; then
git submodule update --init --recursive
fi

set -x

# shellcheck disable=SC2034
Expand Down Expand Up @@ -49,9 +53,9 @@ MIRROR=''

# 依赖库默认安装目录
LIBRARY_INSTALL_PREFIX=/usr/local/swoole-cli

OPTIONS=''


while [ $# -gt 0 ]; do
case "$1" in
--mirror)
Expand Down Expand Up @@ -97,7 +101,7 @@ done
# 构建环境依赖检查
CMDS_NUMS=0
CMDS=("flex" "pkg-config" "cmake" "re2c" "bison" "curl" "automake" "libtool" "clang" "xz" "zip" "unzip" "autoconf")
CMDS_ARRAY_LEN=${#CMDS[@]}
CMDS_LEN=${#CMDS[@]}
for cmd in "${CMDS[@]}"; do
if command -v "$cmd" >/dev/null 2>&1; then
# echo "$cmd exists"
Expand All @@ -108,7 +112,7 @@ done
if [ "$OS" = 'linux' ] ; then
if [ -f /.dockerenv ]; then
IN_DOCKER=1
if test $CMDS_ARRAY_LEN -ne $CMDS_NUMS ;then
if test $CMDS_LEN -ne $CMDS_NUMS ;then
{
if [ "$MIRROR" = 'china' ] ; then
sh sapi/quickstart/linux/alpine-init.sh --mirror china
Expand All @@ -130,7 +134,7 @@ if [ "$OS" = 'linux' ] ; then
fi

if [ "$OS" = 'macos' ] ; then
if test $CMDS_ARRAY_LEN -ne $CMDS_NUMS ; then
if test $CMDS_LEN -ne $CMDS_NUMS ; then
{
if [ "$MIRROR" = 'china' ] ; then
bash sapi/quickstart/macos/macos-init.sh --mirror china
Expand Down
16 changes: 4 additions & 12 deletions sapi/quickstart/setup-php-runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,10 @@ __DIR__=$(
cd "$(dirname "$0")"
pwd
)
if [ -f ${__DIR__}/prepare.php ] ; then
__PROJECT__=$(
cd ${__DIR__}/
pwd
)
else
__PROJECT__=$(
cd ${__DIR__}/../../
pwd
)
fi

__PROJECT__=$(
cd ${__DIR__}/../../
pwd
)
cd ${__PROJECT__}

bash ${__PROJECT__}/setup-php-runtime.sh "$@"
6 changes: 4 additions & 2 deletions sapi/src/builder/extension/swoole.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@
)
->withBuildCached(false)
->withDependentLibraries(...$dependentLibraries)
->withDependentExtensions(...$dependentExtensions)
;
->withDependentExtensions(...$dependentExtensions);
$p->addExtension($ext);

$libs = $p->isMacos() ? '-lc++' : ' -lstdc++ ';
$p->withVariable('LIBS', '$LIBS ' . $libs);

$p->withExportVariable('CARES_CFLAGS', '$(pkg-config --cflags --static libcares)');
$p->withExportVariable('CARES_LIBS', '$(pkg-config --libs --static libcares)');
};

0 comments on commit 87a264c

Please sign in to comment.