Skip to content

Commit

Permalink
优化 cygwin 环境初始化
Browse files Browse the repository at this point in the history
  • Loading branch information
jingjingxyk committed Jan 9, 2025
1 parent e655263 commit f5f7b2d
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 14 deletions.
38 changes: 34 additions & 4 deletions sapi/quickstart/windows/cygwin-build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,49 @@

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

## 双击如下两个脚本,自动下载cygwin 和 cygwin安装依赖库
## 自动下载cygwin 和 cygwin安装依赖库

```shell

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


```

# windows 软连接例子
### 使用镜像 安装 cygwin 环境依赖包

```
.\sapi\quickstart\windows\cygwin-build\install-cygwin.bat --mirror china
```

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

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

## 进入cygwin 环境

```
C:\cygwin64\bin\mintty.exe -i /Cygwin-Terminal.ico -
```

### cygwin mirror

https://cygwin.com/mirrors.html

### 搜索包

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

### windows 软连接例子

```bash

Expand Down
26 changes: 16 additions & 10 deletions sapi/quickstart/windows/cygwin-build/install-cygwin.bat
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,37 @@ cd /d ..\..\..\..\
set "__PROJECT__=%cd%"
cd /d %__PROJECT__%\
echo %cd%
:: package separate with commas


set SITE="https://mirrors.kernel.org/sourceware/cygwin/"

set "SITE=https://mirrors.kernel.org/sourceware/cygwin/"

:getopt
if /i "%1" equ "--mirror" (
if /i "%2" equ "china" (
set SITE="https://mirrors.ustc.edu.cn/cygwin/"
set "SITE=https://mirrors.ustc.edu.cn/cygwin/"
)
)
shift

if not (%1)==() goto getopt

if "%GITHUB_ACTIONS%"=="" (
setup-x86_64.exe --quiet-mode --disable-buggy-antivirus --site %SITE%
)
set "OPTIONS= --quiet-mode --disable-buggy-antivirus --site %SITE% "
set "PACKAGES="

setup-x86_64.exe --no-desktop --no-shortcuts --no-startmenu --quiet-mode --disable-buggy-antivirus --site %SITE% --packages make,git,curl,wget,tar,libtool,bison,gcc-g++,autoconf,automake,openssl,libpcre2-devel,libssl-devel,libcurl-devel,libxml2-devel,libxslt-devel,libgmp-devel,ImageMagick,libpng-devel,libjpeg-devel,libfreetype-devel,libwebp-devel,libsqlite3-devel,zlib-devel,libbz2-devel,liblz4-devel,liblzma-devel,libzip-devel,libicu-devel,libonig-devel,libcares-devel,libsodium-devel,libyaml-devel,libMagick-devel,libzstd-devel,libbrotli-devel,libreadline-devel,libintl-devel,libpq-devel,libssh2-devel,libidn2-devel,gettext-devel,coreutils
if defined GITHUB_ACTIONS (
set "OPTIONS= %OPTIONS% --no-desktop --no-shortcuts --no-startmenu "
)

setup-x86_64.exe --no-desktop --no-shortcuts --no-startmenu --quiet-mode --disable-buggy-antivirus --site %SITE% --packages zip unzip
:: package separate with commas
set "PACKAGES=make,git,curl,wget,tar,libtool,bison,gcc-g++,autoconf,automake,openssl,libpcre2-devel,libssl-devel,libcurl-devel,libxml2-devel,libxslt-devel,libgmp-devel,ImageMagick,libpng-devel,libjpeg-devel,libfreetype-devel,libwebp-devel,libsqlite3-devel,zlib-devel,libbz2-devel,liblz4-devel,liblzma-devel,libzip-devel,libicu-devel,libonig-devel,libcares-devel,libsodium-devel,libyaml-devel,libMagick-devel,libzstd-devel,libbrotli-devel,libreadline-devel,libintl-devel,libpq-devel,libssh2-devel,libidn2-devel,gettext-devel,coreutils"
set "PACKAGES=%PACKAGES%,zip,unzip"
set "PACKAGES=%PACKAGES%,libpq5,libpq-devel"
set "PACKAGES=%PACKAGES%,libzstd-devel"

setup-x86_64.exe --no-desktop --no-shortcuts --no-startmenu --quiet-mode --disable-buggy-antivirus --site %SITE% --packages libpq5 libpq-devel
set "OPTIONS=%OPTIONS% --packages %PACKAGES%"
echo %OPTIONS%

setup-x86_64.exe --no-desktop --no-shortcuts --no-startmenu --quiet-mode --disable-buggy-antivirus --site %SITE% --packages libzstd-devel
start /b /wait setup-x86_64.exe %OPTIONS%

endlocal

0 comments on commit f5f7b2d

Please sign in to comment.