File tree Expand file tree Collapse file tree 12 files changed +75
-228
lines changed Expand file tree Collapse file tree 12 files changed +75
-228
lines changed Original file line number Diff line number Diff line change 93
93
php prepare.php --show-tarball-hash=1 --with-php-version=8.3.23
94
94
php prepare.php --show-tarball-hash=1 --with-php-version=8.4.10
95
95
96
- echo 'cygwin: https://www.cygwin.com/COPYING' > bin/LICENSE
96
+ echo 'cygwin: https://www.cygwin.com/COPYING' >> bin/LICENSE
97
97
cd ${{ github.workspace }}/pool/
98
98
zip -9 -r ${WORK_DIR}/all-deps.zip ext lib php-tar
99
99
HASH=$(sha256sum ${WORK_DIR}/all-deps.zip | awk '{print $1}')
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 6
6
7
7
` php-cli ` 是一个 ` PHP ` 的 运行时 ,默认包含 swoole 扩展
8
8
9
-
10
9
> 本项目 派生于 [ swoole-cli] ( https://github.com/swoole/swoole-cli/ )
11
10
12
-
13
11
> 代码与 swoole-cli 项目的 build_native_php 分支的代码 保持一致
14
12
15
13
> 构建流程 与 swoole-cli 构建流程一致
Original file line number Diff line number Diff line change 2
2
3
3
## 一个脚本执行整个构建流程
4
4
5
- > 定制 build-release-php.sh 脚本 即可开始构建
5
+ > 定制 build-release-php.sh 即可开始构建
6
6
7
7
``` bash
8
8
9
- cp build-release-example.sh build-release-php.sh
9
+ cp build-release-example.sh build-release-php.sh
10
10
11
- bash build-release-php.sh
11
+ bash build-release-php.sh
12
12
13
13
```
14
14
@@ -22,6 +22,50 @@ bash build-release-php.sh
22
22
23
23
## [ wsl] ( ../../docs/wsl.md )
24
24
25
+ ## 准备 PHP 运行时
26
+
27
+ ``` bash
28
+ # 准备 PHP 运行时
29
+ bash sapi/setup-php-runtime.sh
30
+
31
+ # 准备PHP 运行时 使用代理
32
+ bash sapi/setup-php-runtime.sh --proxy http://192.168.3.26:8015
33
+
34
+ # 准备PHP 运行时 使用镜像 (镜像源 https://www.swoole.com/download)
35
+ bash sapi/setup-php-runtime.sh --mirror china
36
+
37
+
38
+ # 验证
39
+ shopt -s expand_aliases
40
+ __DIR__=$( pwd)
41
+ export PATH=" ${__DIR__} /runtime/php/:$PATH "
42
+ alias php=" php -d curl.cainfo=${__DIR__} /runtime/php/cacert.pem -d openssl.cafile=${__DIR__} /runtime/php/cacert.pem"
43
+
44
+ php -v
45
+ composer -v
46
+
47
+ ```
48
+
49
+ ## 准备依赖库源码
50
+
51
+ ``` bash
52
+
53
+ # 源码来源 https://github.com/swoole/swoole-cli/releases/download/${TAG}/all-deps.zip
54
+
55
+ bash sapi/download-box/download-box-get-archive-from-server.sh
56
+
57
+ ```
58
+
59
+ ## 准备 swoole 源码
60
+
61
+ > 拉取 swoole-cli 源码时没有拉取子模块,就需要执行这一步
62
+
63
+ ``` bash
64
+
65
+ git submodule update --init -f
66
+
67
+ ```
68
+
25
69
## 准备运行环境 (linux/macos/windows)
26
70
27
71
1 . [ linux 快速启动 容器 构建环环境 ] ( linux/README.md )
Original file line number Diff line number Diff line change 51
51
pacman -S --needed --noconfirm git curl wget openssl
52
52
pacman -S --needed --noconfirm zip unzip xz gcc gcc-libs cmake make
53
53
pacman -S --needed --noconfirm re2c
54
- pacman -S --needed --noconfirm openssl-devel libreadline
55
54
pacman -S --needed --noconfirm lzip
56
55
pacman -S --needed --noconfirm zip unzip
57
56
pacman -S --needed --noconfirm zlib-devel
58
57
pacman -S --needed --noconfirm bison automake autoconf libtool coreutils
58
+ pacman -S --needed --noconfirm openssl-devel libreadline-devel libiconv-devel
59
59
pacman -S --needed --noconfirm libcurl-devel libxml2-devel libxslt-devel
60
60
pacman -S --needed --noconfirm libbz2-devel liblz4-devel liblzma-devel libcares-devel
61
- pacman -S --needed --noconfirm libyaml-devel libzstd-devel libreadline-devel
62
- pacman -S --needed --noconfirm libssh2-devel libidn2-devel gettext-devel
63
61
pacman -S --needed --noconfirm libzstd-devel
64
- pacman -S --needed --noconfirm icu-devel
65
- pacman -S --needed --noconfirm libsqlite-devel libsqlite
62
+ pacman -S --needed --noconfirm libyaml-devel
63
+ pacman -S --needed --noconfirm libssh2-devel libidn2-devel gettext-devel
64
+ pacman -S --needed --noconfirm libsqlite-devel
66
65
pacman -S --needed --noconfirm libedit-devel
67
66
pacman -S --needed --noconfirm gmp-devel
68
67
pacman -S --needed --noconfirm brotli-devel
Original file line number Diff line number Diff line change 4
4
use SwooleCli \Extension ;
5
5
6
6
return function (Preprocessor $ p ) {
7
- $ file = "swoole-latest.tar.gz " ;
7
+ $ swoole_tag = 'master ' ;
8
+ $ file = "swoole-v {$ swoole_tag }.tar.gz " ;
8
9
$ options = [];
9
10
10
11
if ($ p ->getBuildType () === 'debug ' ) {
42
43
$ p ->withExportVariable ('URING_LIBS ' , '$(pkg-config --libs --static liburing) ' );
43
44
}
44
45
45
- $ p ->addExtension ((new Extension ('swoole ' ))
46
+ $ p ->addExtension ((new Extension ('swoole_latest ' ))
47
+ ->withAliasName ('swoole ' )
46
48
->withHomePage ('https://github.com/swoole/swoole-src ' )
47
49
->withLicense ('https://github.com/swoole/swoole-src/blob/master/LICENSE ' , Extension::LICENSE_APACHE2 )
48
50
->withManual ('https://wiki.swoole.com/#/ ' )
49
51
->withFile ($ file )
50
52
->withDownloadScript (
51
53
'swoole-src ' ,
52
54
<<<EOF
53
- git clone -b master --depth=1 https://github.com/swoole/swoole-src.git
55
+ git clone -b $ swoole_tag --depth=1 https://github.com/swoole/swoole-src.git
54
56
EOF
55
57
)
56
58
->withAutoUpdateFile ()
Original file line number Diff line number Diff line change 5
5
use SwooleCli \Extension ;
6
6
7
7
return function (Preprocessor $ p ) {
8
-
9
- $ file = "swoole-v5.1.x.tar.gz " ;
10
8
$ swoole_tag = '5.1.x ' ;
9
+ $ file = "swoole-v $ {$ swoole_tag }.tar.gz " ;
11
10
$ options = [];
12
11
13
12
if ($ p ->getBuildType () === 'debug ' ) {
Original file line number Diff line number Diff line change 5
5
use SwooleCli \Library ;
6
6
7
7
return function (Preprocessor $ p ) {
8
+ $ swow_tag = 'v1.6.1 ' ;
8
9
$ options = ' --enable-swow ' ;
9
10
$ options .= ' --enable-swow-ssl ' ;
10
11
$ options .= ' --enable-swow-curl ' ;
20
21
->withHomePage ('https://github.com/swow/swow ' )
21
22
->withLicense ('https://github.com/swow/swow/blob/develop/LICENSE ' , Extension::LICENSE_APACHE2 )
22
23
->withManual ('https://docs.toast.run/swow/en/install.html ' )
23
- ->withFile (' swow-v1.5.3. tar.gz ' )
24
+ ->withFile (" swow- { $ swow_tag } . tar.gz" )
24
25
->withDownloadScript (
25
26
"swow " ,
26
27
<<<EOF
27
- git clone -b v1.5.3 https://github.com/swow/swow.git
28
- mv swow swow-t
29
- mv swow-t/ext swow
30
- rm -rf swow-t
28
+ git clone -b {$ swow_tag } https://github.com/swow/swow.git swow-code
29
+ mv swow-code/ext swow
31
30
EOF
32
31
)
33
32
->withBuildCached (false )
Original file line number Diff line number Diff line change 26
26
->withDownloadScript (
27
27
"swow " ,
28
28
<<<EOF
29
- git clone -b develop https://github.com/swow/swow.git
30
- mv swow swow-t
31
- mv swow-t/ext swow
32
- rm -rf swow-t
29
+ git clone -b develop https://github.com/swow/swow.git swow-code
30
+ mv swow-code/ext swow
33
31
EOF
34
32
)
35
33
->withDependentLibraries (...$ dependentLibraries )
Original file line number Diff line number Diff line change 97
97
98
98
case " $MIRROR " in
99
99
china)
100
- APP_DOWNLOAD_URL=" https://wenda-1252906962.file.myqcloud .com/dist/${APP_NAME} -${APP_VERSION} -${OS} -${ARCH} .tar.xz"
100
+ APP_DOWNLOAD_URL=" https://storage.swoole .com/dist/${APP_NAME} -${APP_VERSION} -${OS} -${ARCH} .tar.xz"
101
101
COMPOSER_DOWNLOAD_URL=" https://mirrors.tencent.com/composer/composer.phar"
102
102
if [ $OS = ' windows' ]; then
103
- APP_DOWNLOAD_URL=" https://wenda-1252906962.file.myqcloud .com/dist/${APP_NAME} -${APP_VERSION} -cygwin-${ARCH} .zip"
103
+ APP_DOWNLOAD_URL=" https://storage.swoole .com/dist/${APP_NAME} -${APP_VERSION} -cygwin-${ARCH} .zip"
104
104
fi
105
105
;;
106
106
You can’t perform that action at this time.
0 commit comments