Skip to content

use sdl2-compat

use sdl2-compat #7

Workflow file for this run

name: Build chiaki-ng pull request
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
build-windows_x64-msys2:
name: Build windows msys2 version
runs-on: windows-latest
permissions:
contents: write
defaults:
run:
shell: msys2 {0}
steps:
- name: Disable autocrlf
shell: pwsh
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: msys2/setup-msys2@v2
with:
msystem: mingw64
update: true
install: git
pacboy: >-
ca-certificates:p
cc:p
cmake:p
curl:p
diffutils:p
fast_float:p
fftw:p
hidapi:p
json-c:p
lcms2:p
libdovi:p
meson:p
miniupnpc:p
gcc:p
nasm:p
ninja:p
openssl:p
opus:p
pkgconf:p
protobuf:p
python:p
python-psutil:p
python-glad:p
python-jinja:p
python-pip:p
qt6-base:p
qt6-declarative:p
qt6-svg:p
SDL2:p
shaderc:p
speexdsp:p
spirv-cross:p
vulkan:p
vulkan-headers:p
- name: Install python protobuf and zip
run: |
pip install protobuf
pacman -S git make unzip zip --noconfirm
- name: Build libbplacebo
run: |
scripts/build-libplacebo-windows.sh
- name: Setup ffmpeg
run: |
curl -LO https://github.com/streetpea/FFmpeg-Builds/releases/download/latest/ffmpeg-n7.1-latest-win64-gpl-shared-7.1.zip
unzip ffmpeg-n7.1-latest-win64-gpl-shared-7.1.zip
cp -a "ffmpeg-n7.1-latest-win64-gpl-shared-7.1/bin/." /mingw64/bin
cp -a "ffmpeg-n7.1-latest-win64-gpl-shared-7.1/include/." /mingw64/include
cp -a "ffmpeg-n7.1-latest-win64-gpl-shared-7.1/lib/." /mingw64/lib
- name: Configure chiaki-ng
run: |
cmake -S . -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCHIAKI_ENABLE_CLI=OFF
- name: Build chiaki-ng
run: |
cmake --build build --config Release --clean-first --target chiaki
- name: Deploy chiaki-ng
run: |
mkdir chiaki-ng-Win
cp build/gui/chiaki.exe chiaki-ng-Win/
export PATH="${{ github.workspace }}/build/third-party/cpp-steam-tools:/mingw64/share/qt6/bin/:${PATH}"
export QT_PLUGIN_PATH="/mingw64/share/qt6/plugins"
export QML2_IMPORT_PATH="/mingw64/share/qt6/qml"
echo chiaki-ng-Win/chiaki.exe > tmp0.txt
while [ -e tmp0.txt ]
do
cp tmp0.txt tmp.txt
rm tmp0.txt
sort -u tmp.txt -o tmp.txt
ldd $(<tmp.txt) | grep -v ":" | cut -d " " -f3 | grep -iv "system32" | grep -iv "not" | xargs -d $'\n' sh -c 'for arg do if [ -n "$arg" ] && [ ! -e "chiaki-ng-Win/${arg##*/}" ]; then echo "Copied $arg"; cp "$arg" chiaki-ng-Win/ ; echo "$arg" >> tmp0.txt; fi; done'
done
windeployqt6.exe --no-translations --qmldir=gui/src/qml chiaki-ng-Win/chiaki.exe
- name: Package chiaki-ng
run: |
CHIAKI_VERSION_MAJOR="$(grep 'CHIAKI_VERSION_MAJOR' CMakeLists.txt | grep -Eo '[0-9]')"
CHIAKI_VERSION_MINOR="$(grep 'CHIAKI_VERSION_MINOR' CMakeLists.txt | grep -Eo '[0-9]')"
CHIAKI_VERSION_PATCH="$(grep 'CHIAKI_VERSION_PATCH' CMakeLists.txt | grep -Eo '[0-9]')"
RELEASE_PACKAGE_FILE="chiaki-ng-win_x64-MSYS2-portable-$CHIAKI_VERSION_MAJOR.$CHIAKI_VERSION_MINOR.$CHIAKI_VERSION_PATCH-test-build-${{ github.sha }}.zip"
zip -r $RELEASE_PACKAGE_FILE chiaki-ng-Win
echo "RELEASE_PACKAGE_PATH=${RELEASE_PACKAGE_FILE}" >> $GITHUB_ENV
- name: Upload chiaki-ng Artifact
uses: actions/upload-artifact@v4
with:
name: chiaki-ng-win_x64-MSYS2-Release-portable.zip
path: ${{ env.RELEASE_PACKAGE_PATH }}
if-no-files-found: error
retention-days: 7
- name: Compile .ISS to .EXE Installer
uses: Minionguyjpro/Inno-Setup-Action@v1.2.2
with:
path: "scripts/chiaki-ng.iss"
options: /O+
- name: Upload chiaki-ng Artifact
uses: actions/upload-artifact@v4
with:
name: chiaki-ng-win_x64-MSYS2-Release-installer.exe
path: chiaki-ng-windows-installer.exe
if-no-files-found: error
retention-days: 7
build-mac_arm64_github:
name: Build macOSX arm64 version Github
runs-on: macos-14
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install protobuf
run: |
pip3 install --user 'protobuf>=5,<6' --break-system-packages
- name: Install brew dependencies
run: |
brew update
brew uninstall pkgconfig || true
brew install streetpea/streetpea/chiaki-ng-qt@6 ffmpeg pkgconfig opus openssl cmake ninja nasm sdl2 protobuf@29 speexdsp libplacebo wget python-setuptools json-c miniupnpc
- name: Install sdl2-compat
run: |
sudo INSTALL_PREFIX=/usr/local scripts/build-sdl2-compat.sh
sudo cp /usr/local/lib/pkgconfig/sdl2-compat.pc /usr/local/lib/pkgconfig/sdl2.pc
- name: Configure chiaki-ng
run: |
cmake -S . -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCHIAKI_ENABLE_CLI=OFF -DCHIAKI_ENABLE_STEAMDECK_NATIVE=OFF -DCMAKE_PREFIX_PATH="/usr/local;$(brew --prefix)/opt/@openssl@3;$(brew --prefix)/opt/chiaki-ng-qt@6;$(brew --prefix)/opt/protobuf@29"
- name: Build chiaki-ng
run: |
export CPATH=$(brew --prefix)/opt/ffmpeg/include
cmake --build build --config Release --clean-first --target chiaki
- name: Deploy chiaki-ng
run: |
cp -a build/gui/chiaki.app chiaki-ng.app
cp scripts/qtwebengine_import.qml gui/src/qml/
$(brew --prefix)/opt/chiaki-ng-qt@6/bin/macdeployqt chiaki-ng.app -qmldir="$PWD/gui/src/qml" -libpath=/usr/local/lib -libpath=$(brew --prefix)/lib
mkdir -p chiaki-ng.app/Contents/Resources/vulkan/icd.d
wget https://github.com/KhronosGroup/MoltenVK/releases/download/v1.2.11-artifacts/MoltenVK-macos.tar && tar xf MoltenVK-macos.tar
cp MoltenVK/MoltenVK/dylib/macOS/* chiaki-ng.app/Contents/Resources/vulkan/icd.d
$(brew --prefix)/opt/chiaki-ng-qt@6/bin/macdeployqt chiaki-ng.app -qmldir="$PWD/gui/src/qml" -libpath=/usr/local/lib -libpath=$(brew --prefix)/lib
if [[ -d chiaki-ng.app/Contents/Frameworks/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app ]]
then
ln -s ../../../../../../../Frameworks chiaki-ng.app/Contents/Frameworks/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents
fi
cp /usr/local/lib/libSDL3.dylib chiaki-ng.app/Contents/MacOS/libSDL3.dylib
ln -s libvulkan.1.dylib chiaki-ng.app/Contents/Frameworks/vulkan
codesign --force --entitlements gui/entitlements.xml --deep --sign - chiaki-ng.app
hdiutil create -srcfolder chiaki-ng.app chiaki-ng.dmg
codesign --force --entitlements gui/entitlements.xml --deep --sign - chiaki-ng.dmg
- name: Upload chiaki-ng Artifact
uses: actions/upload-artifact@v4
with:
name: chiaki-ng-macos_arm64-Release.dmg
path: chiaki-ng-macos_arm64-Release.dmg
if-no-files-found: error
retention-days: 7
build-appimage_x64:
name: Build chiaki-ng appimage_x64
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Setup Podman
run: |
sudo apt update
sudo apt-get -y install podman
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: 'recursive'
path: 'chiaki-ng'
- name: Add QmlWebEngine Import
working-directory: chiaki-ng
run: |
cp scripts/qtwebengine_import.qml gui/src/qml/
- name: Run build script
working-directory: chiaki-ng
run: |
set -xe
podman run --rm \
-v "`pwd`:/build/chiaki" \
-w "/build/chiaki" \
--device /dev/fuse \
--cap-add SYS_ADMIN \
-t docker.io/streetpea/chiaki-ng-builder:qt6.9 \
/bin/bash -c "sudo -E scripts/build-appimage.sh /build/appdir"
cp appimage/chiaki-ng.AppImage appimage/chiaki-ng.AppImage_x86_64
- name: Upload chiaki-ng Artifact
uses: actions/upload-artifact@v4
with:
name: chiaki-ng.AppImage_x86_64
path: chiaki-ng/appimage/chiaki-ng.AppImage_x86_64
if-no-files-found: error
retention-days: 7
build-appimage_arm64:
name: Build chiaki-ng appimage_arm64
runs-on: ubuntu-24.04-arm
permissions:
contents: write
steps:
- name: Setup Podman
run: |
sudo apt update
sudo apt-get -y install podman
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: 'recursive'
path: 'chiaki-ng'
- name: Add QmlWebEngine Import
working-directory: chiaki-ng
run: |
cp scripts/qtwebengine_import.qml gui/src/qml/
- name: Run build script
working-directory: chiaki-ng
run: |
set -xe
podman run --rm \
-v "`pwd`:/build/chiaki" \
-w "/build/chiaki" \
--device /dev/fuse \
--cap-add SYS_ADMIN \
-t docker.io/streetpea/chiaki-ng-builder:qt6.7 \
/bin/bash -c "sudo -E scripts/build-appimage.sh /build/appdir"
cp appimage/chiaki-ng.AppImage appimage/chiaki-ng.AppImage_arm64
- name: Upload chiaki-ng Artifact
uses: actions/upload-artifact@v4
with:
name: chiaki-ng.AppImage_arm64
path: chiaki-ng/appimage/chiaki-ng.AppImage_arm64
if-no-files-found: error
retention-days: 7
build-switch_x64:
name: Build chiaki-ng switch_x64
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Setup Docker
run: |
sudo apt update
sudo apt-get -y install docker-ce-cli
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: 'recursive'
path: 'chiaki-ng'
- name: Run build script
working-directory: chiaki-ng
run: |
chmod +x scripts/switch/run-docker-build-chiaki.sh
scripts/switch/run-docker-build-chiaki.sh
- name: Upload chiaki-ng Artifact
uses: actions/upload-artifact@v4
with:
name: chiaki-ng.nro
path: chiaki-ng/build_switch/switch/chiaki-ng.nro
if-no-files-found: error
retention-days: 7