Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/auto-cache-pool-tarball.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
php prepare.php --show-tarball-hash=1 --with-php-version=8.3.23
php prepare.php --show-tarball-hash=1 --with-php-version=8.4.10

echo 'cygwin: https://www.cygwin.com/COPYING' > bin/LICENSE
echo 'cygwin: https://www.cygwin.com/COPYING' >> bin/LICENSE
cd ${{ github.workspace }}/pool/
zip -9 -r ${WORK_DIR}/all-deps.zip ext lib php-tar
HASH=$(sha256sum ${WORK_DIR}/all-deps.zip | awk '{print $1}')
Expand Down
196 changes: 0 additions & 196 deletions .github/workflows/linux-mips64le.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@

`php-cli` 是一个 `PHP`的 运行时 ,默认包含 swoole 扩展


> 本项目 派生于 [swoole-cli](https://github.com/swoole/swoole-cli/)


> 代码与 swoole-cli 项目的 build_native_php 分支的代码 保持一致

> 构建流程 与 swoole-cli 构建流程一致
Expand Down
50 changes: 47 additions & 3 deletions sapi/quickstart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

## 一个脚本执行整个构建流程

> 定制 build-release-php.sh 脚本 即可开始构建
> 定制 build-release-php.sh 即可开始构建

```bash

cp build-release-example.sh build-release-php.sh
cp build-release-example.sh build-release-php.sh

bash build-release-php.sh
bash build-release-php.sh

```

Expand All @@ -22,6 +22,50 @@ bash build-release-php.sh

## [wsl](../../docs/wsl.md)

## 准备 PHP 运行时

```bash
# 准备 PHP 运行时
bash sapi/setup-php-runtime.sh

# 准备PHP 运行时 使用代理
bash sapi/setup-php-runtime.sh --proxy http://192.168.3.26:8015

# 准备PHP 运行时 使用镜像 (镜像源 https://www.swoole.com/download)
bash sapi/setup-php-runtime.sh --mirror china


# 验证
shopt -s expand_aliases
__DIR__=$(pwd)
export PATH="${__DIR__}/runtime/php/:$PATH"
alias php="php -d curl.cainfo=${__DIR__}/runtime/php/cacert.pem -d openssl.cafile=${__DIR__}/runtime/php/cacert.pem"

php -v
composer -v

```

## 准备依赖库源码

```bash

# 源码来源 https://github.com/swoole/swoole-cli/releases/download/${TAG}/all-deps.zip

bash sapi/download-box/download-box-get-archive-from-server.sh

```

## 准备 swoole 源码

> 拉取 swoole-cli 源码时没有拉取子模块,就需要执行这一步

```bash

git submodule update --init -f

```

## 准备运行环境 (linux/macos/windows)

1. [ linux 快速启动 容器 构建环环境 ](linux/README.md)
Expand Down
9 changes: 4 additions & 5 deletions sapi/quickstart/windows/msys2-build/install-msys2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,17 @@ fi
pacman -S --needed --noconfirm git curl wget openssl
pacman -S --needed --noconfirm zip unzip xz gcc gcc-libs cmake make
pacman -S --needed --noconfirm re2c
pacman -S --needed --noconfirm openssl-devel libreadline
pacman -S --needed --noconfirm lzip
pacman -S --needed --noconfirm zip unzip
pacman -S --needed --noconfirm zlib-devel
pacman -S --needed --noconfirm bison automake autoconf libtool coreutils
pacman -S --needed --noconfirm openssl-devel libreadline-devel libiconv-devel
pacman -S --needed --noconfirm libcurl-devel libxml2-devel libxslt-devel
pacman -S --needed --noconfirm libbz2-devel liblz4-devel liblzma-devel libcares-devel
pacman -S --needed --noconfirm libyaml-devel libzstd-devel libreadline-devel
pacman -S --needed --noconfirm libssh2-devel libidn2-devel gettext-devel
pacman -S --needed --noconfirm libzstd-devel
pacman -S --needed --noconfirm icu-devel
pacman -S --needed --noconfirm libsqlite-devel libsqlite
pacman -S --needed --noconfirm libyaml-devel
pacman -S --needed --noconfirm libssh2-devel libidn2-devel gettext-devel
pacman -S --needed --noconfirm libsqlite-devel
pacman -S --needed --noconfirm libedit-devel
pacman -S --needed --noconfirm gmp-devel
pacman -S --needed --noconfirm brotli-devel
Expand Down
8 changes: 5 additions & 3 deletions sapi/src/builder/extension/swoole_latest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
use SwooleCli\Extension;

return function (Preprocessor $p) {
$file = "swoole-latest.tar.gz";
$swoole_tag = 'master';
$file = "swoole-v{$swoole_tag}.tar.gz";
$options = [];

if ($p->getBuildType() === 'debug') {
Expand Down Expand Up @@ -42,15 +43,16 @@
$p->withExportVariable('URING_LIBS', '$(pkg-config --libs --static liburing)');
}

$p->addExtension((new Extension('swoole'))
$p->addExtension((new Extension('swoole_latest'))
->withAliasName('swoole')
->withHomePage('https://github.com/swoole/swoole-src')
->withLicense('https://github.com/swoole/swoole-src/blob/master/LICENSE', Extension::LICENSE_APACHE2)
->withManual('https://wiki.swoole.com/#/')
->withFile($file)
->withDownloadScript(
'swoole-src',
<<<EOF
git clone -b master --depth=1 https://github.com/swoole/swoole-src.git
git clone -b $swoole_tag --depth=1 https://github.com/swoole/swoole-src.git
EOF
)
->withAutoUpdateFile()
Expand Down
3 changes: 1 addition & 2 deletions sapi/src/builder/extension/swoole_v5.1.x.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
use SwooleCli\Extension;

return function (Preprocessor $p) {

$file = "swoole-v5.1.x.tar.gz";
$swoole_tag = '5.1.x';
$file = "swoole-v${$swoole_tag}.tar.gz";
$options = [];

if ($p->getBuildType() === 'debug') {
Expand Down
9 changes: 4 additions & 5 deletions sapi/src/builder/extension/swow.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use SwooleCli\Library;

return function (Preprocessor $p) {
$swow_tag = 'v1.6.1';
$options = ' --enable-swow ';
$options .= ' --enable-swow-ssl ';
$options .= ' --enable-swow-curl ';
Expand All @@ -20,14 +21,12 @@
->withHomePage('https://github.com/swow/swow')
->withLicense('https://github.com/swow/swow/blob/develop/LICENSE', Extension::LICENSE_APACHE2)
->withManual('https://docs.toast.run/swow/en/install.html')
->withFile('swow-v1.5.3.tar.gz')
->withFile("swow-{$swow_tag}.tar.gz")
->withDownloadScript(
"swow",
<<<EOF
git clone -b v1.5.3 https://github.com/swow/swow.git
mv swow swow-t
mv swow-t/ext swow
rm -rf swow-t
git clone -b {$swow_tag} https://github.com/swow/swow.git swow-code
mv swow-code/ext swow
EOF
)
->withBuildCached(false)
Expand Down
6 changes: 2 additions & 4 deletions sapi/src/builder/extension/swow_latest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@
->withDownloadScript(
"swow",
<<<EOF
git clone -b develop https://github.com/swow/swow.git
mv swow swow-t
mv swow-t/ext swow
rm -rf swow-t
git clone -b develop https://github.com/swow/swow.git swow-code
mv swow-code/ext swow
EOF
)
->withDependentLibraries(...$dependentLibraries)
Expand Down
4 changes: 2 additions & 2 deletions setup-php-runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ done

case "$MIRROR" in
china)
APP_DOWNLOAD_URL="https://wenda-1252906962.file.myqcloud.com/dist/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz"
APP_DOWNLOAD_URL="https://storage.swoole.com/dist/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz"
COMPOSER_DOWNLOAD_URL="https://mirrors.tencent.com/composer/composer.phar"
if [ $OS = 'windows' ]; then
APP_DOWNLOAD_URL="https://wenda-1252906962.file.myqcloud.com/dist/${APP_NAME}-${APP_VERSION}-cygwin-${ARCH}.zip"
APP_DOWNLOAD_URL="https://storage.swoole.com/dist/${APP_NAME}-${APP_VERSION}-cygwin-${ARCH}.zip"
fi
;;

Expand Down
Loading
Loading