Skip to content

Commit 367ea44

Browse files
committed
Merge branch 'experiment-feature' into build_native_php
2 parents e15538e + 6dcfd3b commit 367ea44

16 files changed

Lines changed: 460 additions & 5 deletions

.github/workflows/windows-msys2.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,26 @@ jobs:
130130
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
131131
with:
132132
files: ${{ env.APP_NAME }}-${{ env.APP_VERSION }}-msys2-x64.zip
133+
134+
135+
upload-to-cloud-object-storage:
136+
if: 1
137+
runs-on: ubuntu-latest
138+
needs: windows-msys2
139+
steps:
140+
- name: Prepare Run Environment
141+
run:
142+
sudo apt install -y curl
143+
- uses: actions/checkout@v4
144+
- uses: actions/download-artifact@v4
145+
- name: upload artifacts to cloud object storage
146+
if: ${{ (github.repository == 'swoole/swoole-cli') && (startsWith(github.ref, 'refs/tags/')) }}
147+
env:
148+
OSS_SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
149+
OSS_SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
150+
OSS_BUCKET: ${{ vars.QCLOUD_OSS_BUCKET }}
151+
OSS_REGION: ${{ vars.QCLOUD_OSS_REGION }}
152+
run: |
153+
FILE_NAME=$(ls -d swoole-cli-v*-msys2-x64)
154+
FILE="${{ github.workspace }}/${FILE_NAME}/${FILE_NAME}.zip"
155+
bash sapi/scripts/tencent-cloud-object-storage.sh --upload-file ${FILE}

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,4 +351,3 @@ php-fpm-*
351351
*.rpm
352352
nfpm-pkg.yaml
353353
!/var/.gitkeep
354-

sapi/quickstart/windows/msys2-build/install-msys2.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ pacman -S --needed --noconfirm icu-devel
7171
pacman -S --needed --noconfirm gettext-devel
7272
pacman -S --needed --noconfirm libintl
7373
pacman -S --needed --noconfirm flex
74+
pacman -S --needed --noconfirm nasm yasm
7475

7576
: <<'COMMENT'
7677
# 不存在的包

sapi/scripts/msys2/config-ext.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,11 @@ download_and_extract "yaml" ${YAML_VERSION}
7373
download_and_extract "imagick" ${IMAGICK_VERSION}
7474

7575
cd ${__PROJECT__}/pool/ext
76+
set +u
7677
if [ -n "${GITHUB_ACTION}" ]; then
7778
test -f ${__PROJECT__}/pool/ext/swoole-${SWOOLE_VERSION}.tgz && rm -f ${__PROJECT__}/pool/ext/swoole-${SWOOLE_VERSION}.tgz
7879
fi
80+
set -u
7981
if [ ! -f swoole-${SWOOLE_VERSION}.tgz ]; then
8082
test -d ${WORK_TEMP_DIR}/swoole && rm -rf ${WORK_TEMP_DIR}/swoole
8183
git clone -b ${SWOOLE_VERSION} https://github.com/swoole/swoole-src.git ${WORK_TEMP_DIR}/swoole

sapi/scripts/msys2/config.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ test -f Makefile && make clean
9191
--enable-mbstring \
9292
--with-pgsql \
9393
--enable-intl \
94-
${OPTIONS}
94+
${OPTIONS} \
95+
--enable-gd --with-jpeg --with-freetype --with-webp --with-avif \
96+
--with-imagick
9597

9698
# --enable-intl \
9799
# --with-sodium \

sapi/scripts/msys2/install-deps-lib.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,14 @@ bash install-libzip.sh
1414
bash install-libsodium.sh
1515
bash install-liboniguruma.sh
1616
bash install-libpq.sh
17+
bash install-libgif.sh
18+
bash install-libpng.sh
19+
bash install-freetype.sh
20+
bash install-libjpeg.sh
21+
bash install-libwebp.sh
22+
bash install-libyuv.sh
23+
bash install-libaom.sh
24+
bash install-libgav1.sh
25+
bash install-libavif.sh
26+
bash install-imagemagick.sh
27+
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/usr/bin/env bash
2+
3+
set -exu
4+
__DIR__=$(
5+
cd "$(dirname "$0")"
6+
pwd
7+
)
8+
__PROJECT__=$(
9+
cd ${__DIR__}/../../../
10+
pwd
11+
)
12+
cd ${__PROJECT__}
13+
mkdir -p pool/lib/
14+
WORK_TEMP_DIR=${__PROJECT__}/var/msys2-build/
15+
mkdir -p ${WORK_TEMP_DIR}
16+
17+
VERSION=2.13.2
18+
19+
download() {
20+
curl -fSLo ${__PROJECT__}/pool/lib/freetype-${VERSION}.tar.gz https://github.com/freetype/freetype/archive/refs/tags/VER-2-13-2.tar.gz
21+
}
22+
23+
build() {
24+
25+
cd ${WORK_TEMP_DIR}
26+
mkdir -p freetype-${VERSION}
27+
tar --strip-components=1 -xvf ${__PROJECT__}/pool/lib/freetype-${VERSION}.tar.gz -C freetype-${VERSION}
28+
cd freetype-${VERSION}
29+
30+
mkdir -p build
31+
cd build
32+
33+
cmake -S .. -B . \
34+
-DCMAKE_INSTALL_PREFIX=/usr \
35+
-DCMAKE_BUILD_TYPE=Release \
36+
-DBUILD_SHARED_LIBS=ON \
37+
-DFT_REQUIRE_ZLIB=TRUE \
38+
-DFT_REQUIRE_BZIP2=TRUE \
39+
-DFT_REQUIRE_BROTLI=TRUE \
40+
-DFT_REQUIRE_PNG=TRUE \
41+
-DFT_DISABLE_HARFBUZZ=TRUE \
42+
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
43+
44+
make -j $(nproc)
45+
make install
46+
47+
}
48+
49+
cd ${__PROJECT__}
50+
test -f ${__PROJECT__}/pool/lib/freetype-${VERSION}.tar.gz || download
51+
52+
build
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
#!/usr/bin/env bash
2+
3+
set -exu
4+
__DIR__=$(
5+
cd "$(dirname "$0")"
6+
pwd
7+
)
8+
__PROJECT__=$(
9+
cd ${__DIR__}/../../../
10+
pwd
11+
)
12+
cd ${__PROJECT__}
13+
mkdir -p pool/lib/
14+
WORK_TEMP_DIR=${__PROJECT__}/var/msys2-build/
15+
mkdir -p ${WORK_TEMP_DIR}
16+
17+
VERSION=7.1.2-8
18+
19+
download() {
20+
curl -fSLo ${__PROJECT__}/pool/lib/ImageMagick-v${VERSION}.tar.gz https://github.com/ImageMagick/ImageMagick/archive/refs/tags/7.1.2-8.tar.gz
21+
}
22+
23+
build() {
24+
25+
cd ${WORK_TEMP_DIR}
26+
mkdir -p ImageMagick-v${VERSION}
27+
tar --strip-components=1 -xvf ${__PROJECT__}/pool/lib/ImageMagick-v${VERSION}.tar.gz -C ImageMagick-v${VERSION}
28+
cd ImageMagick-v${VERSION}
29+
30+
./configure \
31+
--prefix=/usr/ \
32+
--enable-shared=yes \
33+
--enable-static=no \
34+
--with-pic \
35+
--with-zip \
36+
--with-zlib \
37+
--with-lzma \
38+
--with-zstd \
39+
--with-jpeg \
40+
--with-png \
41+
--with-webp \
42+
--with-xml \
43+
--with-freetype \
44+
--with-heic \
45+
--with-raw \
46+
--with-tiff \
47+
--with-lcms \
48+
--enable-zero-configuration \
49+
--enable-bounds-checking \
50+
--enable-hdri \
51+
--disable-dependency-tracking \
52+
--without-perl \
53+
--disable-docs \
54+
--disable-opencl \
55+
--disable-openmp \
56+
--without-djvu \
57+
--without-rsvg \
58+
--without-fontconfig \
59+
--without-jbig \
60+
--without-jxl \
61+
--without-openjp2 \
62+
--without-lqr \
63+
--without-openexr \
64+
--without-pango \
65+
--without-x \
66+
--without-modules \
67+
--with-magick-plus-plus \
68+
--without-utilities \
69+
--without-gvc \
70+
--without-autotrace \
71+
--without-dps \
72+
--without-fftw \
73+
--without-flif \
74+
--without-fpx \
75+
--without-gslib \
76+
--without-perl \
77+
--without-raqm \
78+
--without-wmf
79+
80+
make -j $(nproc)
81+
make install
82+
83+
}
84+
85+
cd ${__PROJECT__}
86+
test -f ${__PROJECT__}/pool/lib/ImageMagick-v${VERSION}.tar.gz || download
87+
88+
build
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/usr/bin/env bash
2+
3+
set -exu
4+
__DIR__=$(
5+
cd "$(dirname "$0")"
6+
pwd
7+
)
8+
__PROJECT__=$(
9+
cd ${__DIR__}/../../../
10+
pwd
11+
)
12+
cd ${__PROJECT__}
13+
mkdir -p pool/lib/
14+
WORK_TEMP_DIR=${__PROJECT__}/var/msys2-build/
15+
mkdir -p ${WORK_TEMP_DIR}
16+
17+
VERSION=v3.10.0
18+
19+
download() {
20+
curl -fSLo ${__PROJECT__}/pool/lib/libaom-${VERSION}.tar.gz https://aomedia.googlesource.com/aom/+archive/c2fe6bf370f7c14fbaf12884b76244a3cfd7c5fc.tar.gz
21+
}
22+
23+
build() {
24+
25+
cd ${WORK_TEMP_DIR}
26+
mkdir -p libaom-${VERSION}
27+
tar -xvf ${__PROJECT__}/pool/lib/libaom-${VERSION}.tar.gz -C libaom-${VERSION}
28+
cd libaom-${VERSION}
29+
30+
mkdir -p build_dir
31+
cd build_dir
32+
cmake -S .. -B . \
33+
-DCMAKE_INSTALL_PREFIX=/usr/ \
34+
-DCMAKE_BUILD_TYPE=Release \
35+
-DCMAKE_C_STANDARD=11 \
36+
-DBUILD_SHARED_LIBS=OFF \
37+
-DBUILD_STATIC_LIBS=ON \
38+
-DENABLE_DOCS=OFF \
39+
-DENABLE_EXAMPLES=OFF \
40+
-DENABLE_TESTS=OFF \
41+
-DENABLE_TOOLS=ON
42+
43+
make -j $(nproc)
44+
make install
45+
46+
}
47+
48+
cd ${__PROJECT__}
49+
test -f ${__PROJECT__}/pool/lib/libaom-${VERSION}.tar.gz || download
50+
51+
build

sapi/scripts/msys2/install-libavif.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ build() {
4545
-DENABLE_ZSTD=ON \
4646
-DBUILD_REGRESS=OFF \
4747
-DBUILD_OSSFUZZ=OFF \
48-
-DCMAKE_VERBOSE_MAKEFILE=ON \
49-
-DCMAKE_PREFIX_PATH="/usr/local/;/usr/"
48+
-DCMAKE_VERBOSE_MAKEFILE=ON
5049

5150

5251
make -j $(nproc)

0 commit comments

Comments
 (0)