Skip to content

Commit

Permalink
merge code
Browse files Browse the repository at this point in the history
  • Loading branch information
jingjingxyk committed Jan 10, 2025
1 parent 8e6166f commit 9e9dd88
Show file tree
Hide file tree
Showing 39 changed files with 597 additions and 260 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/windows-cygwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
cp -f /cygdrive/c/setup.exe /cygdrive/c/cygwin/bin/setup-x86_64.exe
bash ./sapi/scripts/cygwin/install-cygwin.sh
- name: Install Cygwin Packages
- name: Install Cygwin Packages with powershell
if: 1
run: |
Copy-Item -Path "C:\setup.exe" -Destination "${{ github.workspace }}\setup-x86_64.exe"
Expand Down
21 changes: 0 additions & 21 deletions phpunit.xml

This file was deleted.

22 changes: 15 additions & 7 deletions sapi/quickstart/windows/cygwin-build/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## cygwin workdir
# windows 快速准备构建环境

## [windows cygwin 环境 构建步骤](../../../../docs/Cygwin.md)

## cygwin 工作目录

```shell

Expand All @@ -8,12 +12,13 @@

```

## 自动安装 cygwin 和 cygwin 依赖项
## 自动下载 cygwin 和 cygwin 安装依赖库

```bash
```shell

# 自动安装 cygwin 和 cygwin 依赖项
# 自动下载 cygwin
.\sapi\quickstart\windows\cygwin-build\download-cygwin.bat
# 自动安装 依赖包
.\sapi\quickstart\windows\cygwin-build\install-cygwin.bat
```

Expand All @@ -24,19 +29,23 @@
```

## powershell 环境中调用批处理命令
### PowerShell 环境中调用批处理命令

```powershell
cmd /c .\sapi\quickstart\windows\cygwin-build\install-cygwin.bat --mirror china
```

## 进入cygwin 环境
## 进入 cygwin 环境

```
C:\cygwin64\bin\mintty.exe -i /Cygwin-Terminal.ico -
# 进入项目所在目录 (USER=Administrator)
cd /cygdrive/c/users/${USER}/swoole-cli
```

### cygwin mirror
Expand All @@ -46,4 +55,3 @@ C:\cygwin64\bin\mintty.exe -i /Cygwin-Terminal.ico -
## 搜索包

https://cygwin.com/cgi-bin2/package-grep.cgi?grep=openssl

4 changes: 2 additions & 2 deletions sapi/quickstart/windows/cygwin-build/download-cygwin.bat
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ cd /d ..\..\..\..\
set "__PROJECT__=%cd%"
echo %cd%

md %__PROJECT__%\var\windows-cygwin-build-deps\
md %__PROJECT__%\var\cygwin-build\

cd /d %__PROJECT__%\var\windows-cygwin-build-deps\
cd /d %__PROJECT__%\var\cygwin-build\

curl.exe -fSLo setup-x86_64.exe https://cygwin.com/setup-x86_64.exe

Expand Down
5 changes: 5 additions & 0 deletions sapi/quickstart/windows/msys2-build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
c:\msys64\msys2.exe
# 进入项目目录
cd /c/Users/Administrator/swoole-cli
cd /c/Users/${USERNAME}/swoole-cli
```

## 进入 环境
Expand All @@ -41,3 +45,4 @@ c:\msys64\ucrt64.exe
https://www.msys2.org/docs/environments/
# MSYS2 包搜索
https://packages.msys2.org/queue

5 changes: 3 additions & 2 deletions sapi/quickstart/windows/msys2-build/download-msys2.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ cd /d %__PROJECT__%\
echo %cd%


md %__PROJECT__%\var\windows-msys2-build-deps\

cd /d %__PROJECT__%\var\windows-msys2-build-deps\
md %__PROJECT__%\var\msys2-build\

cd /d %__PROJECT__%\var\msys2-build\


set "SITE=https://mirror.msys2.org"
Expand Down
1 change: 0 additions & 1 deletion sapi/quickstart/windows/msys2-build/install-msys2.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,4 @@ pacman -Sy --noconfirm git
git clone --recursive https://github.com/swoole/swoole-cli.git



```
9 changes: 7 additions & 2 deletions sapi/quickstart/windows/msys2-build/install-msys2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,13 @@ pacman -S --noconfirm libbz2-devel liblz4-devel liblzma-devel libcares-devel
pacman -S --noconfirm libyaml-devel libzstd-devel libreadline-devel
pacman -S --noconfirm libssh2-devel libidn2-devel gettext-devel
pacman -S --noconfirm libzstd-devel
pacman -S --noconfirm icu
pacman -S --noconfirm sqlite

pacman -S --noconfirm icu-devel
pacman -S --noconfirm libsqlite-devel libsqlite
pacman -S --noconfirm gmp-devel
pacman -S --noconfirm libintl
pacman -S --noconfirm pcre2
pacman -S --noconfirm brotli-devel

:<<EOF
# 不存在的包
Expand Down
17 changes: 17 additions & 0 deletions sapi/quickstart/windows/msys2-build/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -x

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

bash sapi/scripts/msys2/config-ext.sh
bash sapi/scripts/msys2/config.sh
bash sapi/scripts/msys2/build.sh
40 changes: 29 additions & 11 deletions sapi/quickstart/windows/native-build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,34 @@ git config --global core.ignorecase false
```

```bash

.\sapi\quickstart\windows\native-build\windows-init-download.bat
.\sapi\quickstart\windows\native-build\windows-init-install.bat
.\sapi\quickstart\windows\native-build\windows-init-install-vs-tools.bat

.\sapi\quickstart\windows\native-build\php-sdk.bat


.\sapi\quickstart\windows\native-build\run.bat

.\sapi\quickstart\windows\native-build\config.bat
.\sapi\quickstart\windows\native-build\x_custom_config.bat
.\sapi\quickstart\windows\native-build\build.bat

```

```powershell
cmd /c .\sapi\quickstart\windows\native-build\windows-init-download.bat
cmd /c .\sapi\quickstart\windows\native-build\windows-init-install.bat
cmd /c .\sapi\quickstart\windows\native-build\windows-init-install-vs-tools.bat
cmd /c .\sapi\quickstart\windows\native-build\php-sdk.bat
cmd /c .\sapi\quickstart\windows\native-build\config.bat
cmd /c .\\sapi\quickstart\windows\native-build\x_custom_config.bat
cmd /c .\sapi\quickstart\windows\native-build\build.bat
```

```bat
Expand Down Expand Up @@ -48,13 +76,6 @@ cmd /k "d:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Bui
:: phpsdk_buildtree phpdev
.\var\windows-build-deps\php-sdk-binary-tools\phpsdk-vs17-x64.bat
.\sapi\quickstart\windows\native-build\config.bat
.\sapi\quickstart\windows\native-build\build.bat
.\sapi\quickstart\windows\native-build\clean.bat
.\sapi\quickstart\windows\native-build\show-var.bat
cd .\var\windows-build-deps\php-src\
buildconf.bat -f
Expand Down Expand Up @@ -99,12 +120,9 @@ start C:\msys64\home\Administrator\swoole-cli
start C:\msys64\home\Administrator\swoole-cli\php-src\
start C:\msys64\home\Administrator\swoole-cli\php-src\x64\Release
sapi\quickstart\windows\native-build\install-visualstudio-2022.bat
# vs2022
"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
sapi\quickstart\windows\native-build\native-build-php-sdk-vs2022.bat
```

Expand Down Expand Up @@ -158,7 +176,7 @@ VisualStudioSetup.exe
--add Microsoft.VisualStudio.Component.Windows11SDK.22000
--add Microsoft.VisualStudio.Component.Windows10SDK.20348
--add Microsoft.VisualStudio.Component.Windows10SDK
--path install="C:\VS" --path cache="C:\VS\cache" --path shared="C:\VS\shared"
--path install="C:\VS" --path cache="C:\VS-cache" --path shared="C:\VS-shared"
--quiet --force --norestart
--channelId VisualStudio.16.Release ^

Expand Down
11 changes: 6 additions & 5 deletions sapi/quickstart/windows/native-build/config.bat
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ echo %cd%
cd /d %__PROJECT__%\var\windows-build-deps\php-src\
echo %cd%

if exist "Makefile" (
if exist "configure.js" (
nmake clean
)

:: buildconf.bat -f
call buildconf.bat -f

echo "===================="
echo "========HELP============"

:: configure.bat --help
call configure.bat --help


echo "===================="

rem set "INCLUDE=%INCLUDE%;%__PROJECT__%\build\openssl\include\;%__PROJECT__%\build\zlib\include"
rem set "LIB=%LIB%;%__PROJECT__%\build\openssl\lib\;%__PROJECT__%\build\zlib\lib"
Expand All @@ -37,7 +38,7 @@ set "CFLAGS=/EHsc /MT "
rem https://learn.microsoft.com/zh-cn/cpp/c-runtime-library/crt-library-features?view=msvc-170
rem https://learn.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features?view=msvc-170

set "LDFLAGS=/VERBOSE:LIB /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrtd.lib /NODEFAULTLIB:libcmt.lib /DEFAULTLIB:libucrt.lib /NODEFAULTLIB:libucrtd.lib /NODEFAULTLIB:ucrt.lib /NODEFAULTLIB:ucrtd.lib "
set "LDFLAGS=/VERBOSE:LIB /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrtd.lib /DEFAULTLIB:libcmt.lib /link libucrt.lib libvcruntime.lib /NODEFAULTLIB:libucrtd.lib /NODEFAULTLIB:ucrt.lib /NODEFAULTLIB:ucrtd.lib "



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ Write-Host $__DIR__
Write-Host $__PROJECT__
Write-Host (Get-Location).Path

# 获得环境变量
Get-ChildItem env:

# 临时设置环境
$env:http_proxy = "http://127.0.0.1:8016"
$env:https_proxy = "http://127.0.0.1:8016"

<#
var\windows-build-deps\php-sdk-binary-tools\phpsdk-vs17-x64.bat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ setlocal enableextensions enabledelayedexpansion

echo %~dp0
cd /d %~dp0
cd /d ..\..\..\..\
cd /d ..\..\..\..\..\

set "__PROJECT__=%cd%"
echo %cd%
Expand Down Expand Up @@ -44,11 +44,9 @@ curl.exe -V

rem C:\Windows\System32\curl.exe


rem 32 bit
rem https://curl.se/windows/dl-8.11.1_2/curl-8.11.1_2-win32-mingw.zip
rem https://www.7-zip.org/a/7z2409.exe



endlocal
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
setlocal


echo %~dp0
cd /d %~dp0
cd /d .\..\..\..\..\..\

set "__PROJECT__=%cd%"
echo %cd%

md %__PROJECT__%\var\windows-build-deps\

cd /d %__PROJECT__%\var\windows-build-deps\

if not exist "Git-2.47.1-64-bit.exe" curl.exe -fSLo Git-2.47.1-64-bit.exe https://github.com/git-for-windows/git/releases/download/v2.47.1.windows.1/Git-2.47.1-64-bit.exe
if not exist "npp.8.6.7.Installer.x64.exe" curl.exe -fSLo npp.8.6.7.Installer.x64.exe https://github.com/notepad-plus-plus/notepad-plus-plus/releases/download/v8.6.7/npp.8.6.7.Installer.x64.exe
if not exist "socat-v1.8.0.1-cygwin-x64.zip" curl.exe -fSLo socat-v1.8.0.1-cygwin-x64.zip https://github.com/jingjingxyk/build-static-socat/releases/download/v2.2.1/socat-v1.8.0.1-cygwin-x64.zip
if not exist "Microsoft.WindowsTerminal_1.21.3231.0_8wekyb3d8bbwe.msixbundle" curl.exe -fSLo Microsoft.WindowsTerminal_1.21.3231.0_8wekyb3d8bbwe.msixbundle https://github.com/microsoft/terminal/releases/download/v1.21.3231.0/Microsoft.WindowsTerminal_1.21.3231.0_8wekyb3d8bbwe.msixbundle
if not exist "winget-install.ps1" curl.exe -fSLo winget-install.ps1 https://github.com/asheroto/winget-install/releases/latest/download/winget-install.ps1
if not exist "chocolatey-install.ps1" curl.exe -fSLo chocolatey-install.ps1 https://community.chocolatey.org/install.ps1
if not exist "scoop-install.ps1" curl.exe -fSLo scoop-install.ps1 https://get.scoop.sh



:: curl.exe -fSLo npp.8.6.7.Installer.x64.exe https://php-cli.jingjingxyk.com/npp.8.6.7.Installer.x64.exe
:: curl.exe -fSLo socat-v1.8.0.1-cygwin-x64.zip https://php-cli.jingjingxyk.com/socat-v1.8.0.1-cygwin-x64.zip

:: curl.exe -fSLo curl-8.11.1_1-win64-mingw.zip https://curl.se/windows/dl-8.11.1_1/curl-8.11.1_1-win64-mingw.zip
:: curl.exe -fSLo curl-8.11.1_1-win64arm-mingw.zip https://curl.se/windows/dl-8.11.1_1/curl-8.11.1_1-win64a-mingw.zip

endlocal
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ setlocal

echo %~dp0
cd /d %~dp0
cd /d .\..\..\..\..\
cd /d .\..\..\..\..\..\

set "__PROJECT__=%cd%"
echo %cd%
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ echo %~dp0


cd /d %~dp0
cd /d ..\..\..\..\
cd /d ..\..\..\..\..\


set "__PROJECT__=%cd%"
Expand Down
2 changes: 1 addition & 1 deletion sapi/quickstart/windows/native-build/php-sdk.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cd /d ..\..\..\..\
set "__PROJECT__=%cd%"
echo %cd%

.\var\windows-build-deps\php-sdk-binary-tools\phpsdk-vs17-x64.bat
call %__PROJECT__%\var\windows-build-deps\php-sdk-binary-tools\phpsdk-vs17-x64.bat

cd /d %__PROJECT__%

1 change: 1 addition & 0 deletions sapi/quickstart/windows/native-build/run.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ cd /d ..\..\..\..\
set "__PROJECT__=%cd%"
echo %cd%


call %__PROJECT__%\sapi\quickstart\windows\native-build\config.bat
call %__PROJECT__%\sapi\quickstart\windows\native-build\x_custom_config.bat
call %__PROJECT__%\sapi\quickstart\windows\native-build\build.bat
Expand Down
Loading

0 comments on commit 9e9dd88

Please sign in to comment.