Skip to content

Prepare QCW QEMU (from TarBall sources) #109

Prepare QCW QEMU (from TarBall sources)

Prepare QCW QEMU (from TarBall sources) #109

name: Prepare QCW QEMU (from TarBall sources)
on:
workflow_dispatch:
workflow_call:
outputs:
qemu_version:
description: QEMU version"
value: ${{ jobs.build.outputs.qemu_version }}
env:
QEMU_VERSION: 10.2.1
MSYS: "winsymlinks:native"
jobs:
build:
strategy:
fail-fast: false
matrix:
msystem: [clang64, mingw64, ucrt64]
runs-on: windows-2025
outputs:
qemu_version: ${{ steps.make_versions.outputs.qemu }}
steps:
- name: "πŸ—οΈ Install msys2 MINGW64"
if: "${{ matrix.msystem == 'mingw64' }}"
uses: msys2/setup-msys2@4f806de0a5a7294ffabaff804b38a9b435a73bda # v2.30.0
with:
msystem: ${{ matrix.msystem }}
update: true
install: >-
base-devel cmake git make mingw-w64-x86_64-SDL2 mingw-w64-x86_64-SDL2_image mingw-w64-x86_64-binutils mingw-w64-x86_64-capstone mingw-w64-x86_64-cc mingw-w64-x86_64-curl-winssl mingw-w64-x86_64-cyrus-sasl mingw-w64-x86_64-gtk-vnc mingw-w64-x86_64-gtk3 mingw-w64-x86_64-libcbor mingw-w64-x86_64-libnfs mingw-w64-x86_64-libslirp mingw-w64-x86_64-libssh mingw-w64-x86_64-libxml2 mingw-w64-x86_64-lzo2 mingw-w64-x86_64-ncurses mingw-w64-x86_64-ninja mingw-w64-x86_64-nsis mingw-w64-x86_64-pixman mingw-w64-x86_64-pkgconf mingw-w64-x86_64-python mingw-w64-x86_64-sccache mingw-w64-x86_64-snappy mingw-w64-x86_64-spice mingw-w64-x86_64-spice-protocol mingw-w64-x86_64-toolchain mingw-w64-x86_64-usbredir mingw-w64-x86_64-virglrenderer mingw-w64-x86_64-zlib mingw-w64-x86_64-zstd patch zip
- name: "πŸ—οΈ Install msys2 UCRT64"
if: "${{ matrix.msystem == 'ucrt64' }}"
uses: msys2/setup-msys2@4f806de0a5a7294ffabaff804b38a9b435a73bda # v2.30.0
with:
msystem: ${{ matrix.msystem }}
update: true
install: >-
base-devel cmake git make mingw-w64-ucrt-x86_64-SDL2 mingw-w64-ucrt-x86_64-SDL2_image mingw-w64-ucrt-x86_64-binutils mingw-w64-ucrt-x86_64-capstone mingw-w64-ucrt-x86_64-cc mingw-w64-ucrt-x86_64-curl-winssl mingw-w64-ucrt-x86_64-cyrus-sasl mingw-w64-ucrt-x86_64-gtk-vnc mingw-w64-ucrt-x86_64-gtk3 mingw-w64-ucrt-x86_64-libcbor mingw-w64-ucrt-x86_64-libnfs mingw-w64-ucrt-x86_64-libslirp mingw-w64-ucrt-x86_64-libssh mingw-w64-ucrt-x86_64-libxml2 mingw-w64-ucrt-x86_64-lzo2 mingw-w64-ucrt-x86_64-ncurses mingw-w64-ucrt-x86_64-ninja mingw-w64-ucrt-x86_64-nsis mingw-w64-ucrt-x86_64-pixman mingw-w64-ucrt-x86_64-pkgconf mingw-w64-ucrt-x86_64-python mingw-w64-ucrt-x86_64-sccache mingw-w64-ucrt-x86_64-snappy mingw-w64-ucrt-x86_64-spice mingw-w64-ucrt-x86_64-spice-protocol mingw-w64-ucrt-x86_64-toolchain mingw-w64-ucrt-x86_64-usbredir mingw-w64-ucrt-x86_64-virglrenderer mingw-w64-ucrt-x86_64-zlib mingw-w64-ucrt-x86_64-zstd patch zip
- name: "πŸ—οΈ Install msys2 CLANG64"
if: "${{ matrix.msystem == 'clang64' }}"
uses: msys2/setup-msys2@4f806de0a5a7294ffabaff804b38a9b435a73bda # v2.30.0
with:
msystem: ${{ matrix.msystem }}
update: true
# mingw-w64-clang-x86_64-virglrenderer is missing
install: >-
base-devel cmake git make mingw-w64-clang-x86_64-SDL2 mingw-w64-clang-x86_64-SDL2_image mingw-w64-clang-x86_64-binutils mingw-w64-clang-x86_64-capstone mingw-w64-clang-x86_64-cc mingw-w64-clang-x86_64-curl-winssl mingw-w64-clang-x86_64-cyrus-sasl mingw-w64-clang-x86_64-gtk-vnc mingw-w64-clang-x86_64-gtk3 mingw-w64-clang-x86_64-libcbor mingw-w64-clang-x86_64-libnfs mingw-w64-clang-x86_64-libslirp mingw-w64-clang-x86_64-libssh mingw-w64-clang-x86_64-libxml2 mingw-w64-clang-x86_64-lzo2 mingw-w64-clang-x86_64-ncurses mingw-w64-clang-x86_64-ninja mingw-w64-clang-x86_64-nsis mingw-w64-clang-x86_64-pixman mingw-w64-clang-x86_64-pkgconf mingw-w64-clang-x86_64-python mingw-w64-clang-x86_64-sccache mingw-w64-clang-x86_64-snappy mingw-w64-clang-x86_64-spice mingw-w64-clang-x86_64-spice-protocol mingw-w64-clang-x86_64-toolchain mingw-w64-clang-x86_64-usbredir mingw-w64-clang-x86_64-zlib mingw-w64-clang-x86_64-zstd patch zip
- name: "πŸ“ Configure checkout"
run: git config --global core.autocrlf input
- name: "πŸ“ Checkout"
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 1
- name: "πŸ”— Link tools"
shell: msys2 {0}
run: |
mkdir -p /usr/local/bin
ln -sf "$PROGRAMFILES\\7-Zip\\7z.exe" "/usr/local/bin/7z.exe"
- name: "πŸ“ Fetch sources"
shell: msys2 {0}
run: |
wget -q "https://download.qemu.org/qemu-$QEMU_VERSION.tar.xz"
wget -q "https://download.qemu.org/qemu-$QEMU_VERSION.tar.xz.sig"
gpg --keyserver hkps://keys.openpgp.org:443 --recv-key CEACC9E15534EBABB82D3FA03353C9CEF108B584
gpg "qemu-$QEMU_VERSION.tar.xz.sig"
7z x -sdel -snld "qemu-$QEMU_VERSION.tar.xz"
7z x -sdel -snld "qemu-$QEMU_VERSION.tar"
mv "qemu-$QEMU_VERSION" qemu-release
cd qemu-release
patch --binary -l -p 1 < ../patches/qemu/0001-Revert-9pfs-Introduce-futimens-file-op.patch
patch --binary -l -p 1 < ../patches/qemu/0002-9pfs-Add-9pfs-support-for-Windows-host.patch
patch --binary -l -p 1 < ../patches/qemu/0003-Fix-9p-utils-compilation-on-Windows.patch
patch --binary -l -p 1 < ../patches/qemu/0004-WHPX-Add-support-for-device-backed-memory-regions.patch
patch --binary -l -p 1 < ../patches/qemu/0005-Fix-Windows-build-issues-with-newer-MinGW.patch
patch --binary -l -p 1 < ../patches/qemu/0006-win32-Add-ftruncate-function-detection.patch
patch --binary -l -p 1 < ../patches/qemu/0007-Force-relative-share-path-on-Windows.patch
- name: "πŸ› οΈ Build QEMU"
working-directory: qemu-release
shell: msys2 {0}
# --disable-spice --disable-spice-protocol is needed for no warnings in clang64 config
# --enable-lto is postponed
run: |
./configure --enable-gtk --enable-sdl --disable-user --disable-debug-info --disable-spice --disable-spice-protocol --extra-cflags="-D_FORTIFY_SOURCE=2"
make
make installer
- name: "πŸ“¦ Pack QEMU"
shell: msys2 {0}
run: |
mkdir -p qcw
cp qemu-release/build/qemu-setup-*.exe qcw/
cd qcw
ls | xargs -I fn mv fn ${{ matrix.msystem }}-fn
find . -type f \( ! -iname "*.checksums" \) -exec sha256sum -b {} \; > sha.checksums
find . -type f \( ! -iname "*.checksums" \) -exec sha512sum -b {} \; >> sha.checksums
cat sha.checksums
- id: make_versions
name: "πŸ“Œ Export versions"
shell: msys2 {0}
run: |
echo "qemu=$QEMU_VERSION" >> "$GITHUB_OUTPUT"
- name: "πŸš€ Upload artifact"
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: qcw-qemu-${{ matrix.msystem }}
path: qcw