update nt5 toolchain (#428)

This commit is contained in:
Cyano Hao 2024-05-17 15:52:36 +08:00 committed by GitHub
parent 00f911d5da
commit 01dffbe72e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 52 additions and 50 deletions

View File

@ -50,59 +50,56 @@ jobs:
path: pkg/ path: pkg/
windows_legacy: windows_legacy:
name: Windows NT 5.16.0 MinGW name: Windows NT 5.x
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
arch: [32, 64] profile:
- 64-ucrt
- 32-ucrt
- 64-msvcrt
- 32-msvcrt
- 32-win2000
include: include:
- arch: 32 - isUcrt: 0
vcArch: x86 - profile: 64-ucrt
- arch: 64 isUcrt: 1
vcArch: x64 - profile: 32-ucrt
isUcrt: 1
runs-on: windows-2019 runs-on: windows-2019
defaults: defaults:
run: run:
shell: bash shell: msys2 {0}
env: env:
_QT_VERSION: "5.15.13" _REDPANDA_QT_BUILD: "5.15.13+redpanda1"
_QT_NAME: mingw132_${{ matrix.arch }}-redpanda _QT_NAME: mingw141_${{ matrix.profile }}
_REDPANDA_QT_BUILD: "20240428.0"
_MINGW_LITE_RELEASE: "13.2.0-r4"
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Setup toolchain - name: Setup
run: | uses: msys2/setup-msys2@v2
curl -LO https://github.com/redpanda-cpp/mingw-lite/releases/download/$_MINGW_LITE_RELEASE/mingw${{ matrix.arch }}-ucrt-$_MINGW_LITE_RELEASE.7z with:
7z x mingw${{ matrix.arch }}-ucrt-$_MINGW_LITE_RELEASE.7z msystem: UCRT64
update: true
install: mingw-w64-x86_64-7zip mingw-w64-x86_64-cmake mingw-w64-i686-nsis curl git
- name: Setup Qt - name: Setup Qt
run: | run: |
curl -LO https://github.com/redpanda-cpp/qtbase-xp/releases/download/$_REDPANDA_QT_BUILD/$_QT_NAME.7z curl -LO https://github.com/redpanda-cpp/qtbase-xp/releases/download/$_REDPANDA_QT_BUILD/$_QT_NAME.7z
7z x $_QT_NAME.7z -oC:/Qt /mingw64/bin/7z x $_QT_NAME.7z -oC:/Qt
- name: Build - name: Build
run: | run: |
export PATH="/c/Qt/$_QT_VERSION/$_QT_NAME/bin:$PWD/mingw${{ matrix.arch }}/bin:$PATH" ./packages/msys/build-xp.sh -p ${{ matrix.profile }} $( [[ ${{ matrix.isUcrt }} -eq 1 ]] && echo --ucrt 22621 )
mkdir build && pushd build
{
qmake PREFIX=$GITHUB_WORKSPACE/pkg $GITHUB_WORKSPACE/Red_Panda_CPP.pro
mingw32-make -j$(nproc)
mingw32-make install
cp "/c/Program Files (x86)/Windows Kits/10/Redist/10.0.22621.0/ucrt/DLLs/${{ matrix.vcArch }}"/*.dll $GITHUB_WORKSPACE/pkg/
}
popd
- name: Upload - name: Upload
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: Windows NT 5.16.0 MinGW - arch=${{ matrix.arch }} name: Windows NT 5.x - profile=${{ matrix.profile }}
path: pkg/ path: dist/*
windows_msvc_x64: windows_msvc_x64:
name: Windows MSVC x64 name: Windows MSVC x64

View File

@ -79,7 +79,7 @@ Extra arguments for `build-mingw.sh`:
## Windows NT 5.x Qt Library with MinGW Lite Toolchain ## Windows NT 5.x Qt Library with MinGW Lite Toolchain
The script `build-xp.sh` is alike `build-mingw.sh`, but it will download a standalone MinGW Lite toolchain to build Red Panda C++ for Windows NT 5.x. The script `build-xp.sh` is alike `build-mingw.sh`, but the toolchain is provided by Qt library.
Prerequisites: Prerequisites:
@ -97,21 +97,27 @@ Prerequisites:
``` ```
C: C:
└─ Qt └─ Qt
└─ 5.15.13 └─ 5.15.13+redpanda1
├─ mingw141_32-msvcrt-redpanda ├─ mingw141_32-msvcrt
│ ├─ bin │ ├─ bin
│ │ ├─ gcc.exe
│ │ ├─ mingw32-make.exe
│ │ └─ qmake.exe
│ ├─ include │ ├─ include
│ ├─ lib │ ├─ lib
│ └─ ... │ └─ ...
└─ mingw141_64-msvcrt-redpanda └─ mingw141_64-msvcrt
├─ bin ├─ bin
│ ├─ gcc.exe
│ ├─ mingw32-make.exe
│ └─ qmake.exe
├─ include ├─ include
├─ lib ├─ lib
└─ ... └─ ...
``` ```
- Or you can build from source and specify the path with `--qt` argument. - Or you can build from source and specify the path with `--qt` argument.
To build, launch selected MSYS2 environment, run: To build, launch MSYS2 environment, run:
```bash ```bash
./packages/msys/build-xp.sh -p 32-msvcrt ./packages/msys/build-xp.sh -p 32-msvcrt
``` ```

View File

@ -79,7 +79,7 @@
## 用于 Windows NT 5.x 的 Qt 库 + MinGW Lite 工具链 ## 用于 Windows NT 5.x 的 Qt 库 + MinGW Lite 工具链
`build-xp.sh` 脚本和 `build-mingw.sh` 类似,但是会下载独立的 MinGW Lite 工具链来构建用于 Windows NT 5.x 的小熊猫C++ `build-xp.sh` 脚本和 `build-mingw.sh` 类似,但是工具链由 Qt 库提供
前置条件: 前置条件:
@ -97,21 +97,27 @@
``` ```
C: C:
└─ Qt └─ Qt
└─ 5.15.13 └─ 5.15.13+redpanda1
├─ mingw141_32-msvcrt-redpanda ├─ mingw141_32-msvcrt
│ ├─ bin │ ├─ bin
│ │ ├─ gcc.exe
│ │ ├─ mingw32-make.exe
│ │ └─ qmake.exe
│ ├─ include │ ├─ include
│ ├─ lib │ ├─ lib
│ └─ ... │ └─ ...
└─ mingw141_64-msvcrt-redpanda └─ mingw141_64-msvcrt
├─ bin ├─ bin
│ ├─ gcc.exe
│ ├─ mingw32-make.exe
│ └─ qmake.exe
├─ include ├─ include
├─ lib ├─ lib
└─ ... └─ ...
``` ```
- 也可以从源代码自行构建 Qt 并在构建时指定 `--qt` 参数。 - 也可以从源代码自行构建 Qt 并在构建时指定 `--qt` 参数。
要构建此项目,启动所选的 MSYS2 环境,然后运行 要构建此项目,启动 MSYS2 环境,然后运行
```bash ```bash
./packages/msys/build-xp.sh -p 32-msvcrt ./packages/msys/build-xp.sh -p 32-msvcrt
``` ```

View File

@ -39,8 +39,8 @@ fi
PROFILE=$2 PROFILE=$2
shift 2 shift 2
QT_VERSION="5.15.13" QT_VERSION="5.15.13+redpanda1"
QT_NAME="mingw141_${PROFILE}-redpanda" QT_NAME="mingw141_${PROFILE}"
case "${PROFILE}" in case "${PROFILE}" in
64-ucrt|64-msvcrt) 64-ucrt|64-msvcrt)
NSIS_ARCH=x64 NSIS_ARCH=x64
@ -161,10 +161,6 @@ SOURCE_DIR="$(pwd)"
ASSETS_DIR="${SOURCE_DIR}/assets" ASSETS_DIR="${SOURCE_DIR}/assets"
UCRT_DIR="/c/Program Files (x86)/Windows Kits/10/Redist/10.0.${UCRT}.0/ucrt/DLLs/${NSIS_ARCH}" UCRT_DIR="/c/Program Files (x86)/Windows Kits/10/Redist/10.0.${UCRT}.0/ucrt/DLLs/${NSIS_ARCH}"
MINGW_LITE_RELEASE="14.1.0-r1"
HOST_MINGW_ARCHIVE="mingw${PROFILE}-${MINGW_LITE_RELEASE}.7z"
HOST_MINGW_BIT="${PROFILE%%-*}"
REDPANDA_MINGW_RELEASE="11.4.0-r0" REDPANDA_MINGW_RELEASE="11.4.0-r0"
MINGW32_ARCHIVE="mingw32-${REDPANDA_MINGW_RELEASE}.7z" MINGW32_ARCHIVE="mingw32-${REDPANDA_MINGW_RELEASE}.7z"
MINGW32_COMPILER_NAME="MinGW-w64 i686 GCC" MINGW32_COMPILER_NAME="MinGW-w64 i686 GCC"
@ -174,6 +170,7 @@ MINGW64_ARCHIVE="mingw64-${REDPANDA_MINGW_RELEASE}.7z"
MINGW64_COMPILER_NAME="MinGW-w64 x86_64 GCC" MINGW64_COMPILER_NAME="MinGW-w64 x86_64 GCC"
MINGW64_PACKAGE_SUFFIX="mingw64" MINGW64_PACKAGE_SUFFIX="mingw64"
MINGW_LITE_RELEASE="14.1.0-r2"
MINGW32_WIN2000_ARCHIVE="mingw32-win2000-${MINGW_LITE_RELEASE}.7z" MINGW32_WIN2000_ARCHIVE="mingw32-win2000-${MINGW_LITE_RELEASE}.7z"
if [[ ${#compilers[@]} -eq 0 ]]; then if [[ ${#compilers[@]} -eq 0 ]]; then
@ -213,6 +210,8 @@ if [[ -n "${UCRT}" && ! -f "${UCRT_DIR}/ucrtbase.dll" ]]; then
exit 1 exit 1
fi fi
export PATH="${QT_DIR}/bin:${PATH}"
## prepare dirs ## prepare dirs
if [[ ${CLEAN} -eq 1 ]]; then if [[ ${CLEAN} -eq 1 ]]; then
@ -243,12 +242,6 @@ if [[ ${COMPILER_MINGW32_WIN2000} -eq 1 && ! -f "${ASSETS_DIR}/${MINGW32_WIN2000
curl -L "https://github.com/redpanda-cpp/mingw-lite/releases/download/${MINGW_LITE_RELEASE}/${MINGW32_WIN2000_ARCHIVE}" -o "${ASSETS_DIR}/${MINGW32_WIN2000_ARCHIVE}" curl -L "https://github.com/redpanda-cpp/mingw-lite/releases/download/${MINGW_LITE_RELEASE}/${MINGW32_WIN2000_ARCHIVE}" -o "${ASSETS_DIR}/${MINGW32_WIN2000_ARCHIVE}"
fi fi
## prepare host compiler
[[ -f "${ASSETS_DIR}/${HOST_MINGW_ARCHIVE}" ]] || curl -L "https://github.com/redpanda-cpp/mingw-lite/releases/download/${MINGW_LITE_RELEASE}/${HOST_MINGW_ARCHIVE}" -o "${ASSETS_DIR}/${HOST_MINGW_ARCHIVE}"
[[ -x "${BUILD_DIR}/mingw${HOST_MINGW_BIT}/bin/gcc.exe" ]] || "${_7Z}" x "${ASSETS_DIR}/${HOST_MINGW_ARCHIVE}" -o"${BUILD_DIR}"
export PATH="${BUILD_DIR}/mingw${HOST_MINGW_BIT}/bin:${PATH}"
## build ## build
fn_print_progress "Building astyle..." fn_print_progress "Building astyle..."
pushd "${ASSETS_DIR}/astyle" pushd "${ASSETS_DIR}/astyle"