diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 40993e87921..038913061e4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -171,6 +171,7 @@ jobs: fail-fast: false matrix: arch: ['32', '64'] + #arch: ['64'] name: mingw${{ matrix.arch }} runs-on: ubuntu-22.04 env: @@ -189,13 +190,22 @@ jobs: with: fetch-depth: 0 submodules: recursive - - name: Install APT dependencies - run: xargs -a .github/workflows/deps-mingw-w64.txt sudo apt-get install --yes - - name: Install CMake - run: .github/workflows/install-cmake.sh - - name: Install PowerShell - run: .github/workflows/install-powershell.sh + - name: Download vcpkg for ACT + if: ${{ env.ACT }} # ACT apparently doesn't have vcpkg installed + run: | + cd /usr/local/share + sudo git clone --recursive https://github.com/microsoft/vcpkg.git + sudo ./vcpkg/bootstrap-vcpkg.sh + echo "VCPKG_INSTALLATION_ROOT=$(pwd)/vcpkg" >> "$GITHUB_ENV" + export VCPKG_INSTALLATION_ROOT="$(pwd)/vcpkg" + - name: Install system dependencies + run: | + sudo apt-get update + .github/workflows/setup-cmake.sh + .github/workflows/setup-mingw-packages.sh + sudo apt-get install -y $(xargs < .github/workflows/deps-ubuntu-24.04-mingw.txt) - name: Cache vcpkg dependencies + if: ${{ !env.ACT }} # skip during local actions testing id: cache-deps uses: actions/cache@v3 with: @@ -204,6 +214,7 @@ jobs: vcpkg-mingw${{ matrix.arch }}- path: build/vcpkg_installed - name: Cache ccache data + if: ${{ !env.ACT }} # skip during local actions testing uses: actions/cache@v3 with: key: "ccache-${{ github.job }}-${{ matrix.arch }}-${{ github.ref }}\ @@ -217,14 +228,15 @@ jobs: ccache --zero-stats cmake -S . \ -B build \ - -DCMAKE_TOOLCHAIN_FILE="./cmake/toolchains/MinGW-W64-${{ matrix.arch }}.cmake" \ + -DCMAKE_TOOLCHAIN_FILE="../cmake/toolchains/MinGW-W64-${{ matrix.arch }}.cmake" \ -DVCPKG_TARGET_TRIPLET="${{ env.vcpkg_arch }}-mingw-static" \ -DVCPKG_HOST_TRIPLET="${{ env.vcpkg_arch }}-linux" \ -DVCPKG_MANIFEST_INSTALL="${{ env.should_install_manifest }}" \ $CMAKE_OPTS env: - should_install_manifest: - ${{ steps.cache-deps.outputs.cache-hit == 'true' && 'NO' || 'YES' }} + #should_install_manifest: + # ${{ steps.cache-deps.outputs.cache-hit == 'true' && 'NO' || 'YES' }} + should_install_manifest: 'YES' vcpkg_arch: ${{ matrix.arch == '32' && 'x86' || 'x64' }} - name: Build @@ -232,6 +244,7 @@ jobs: - name: Package run: cmake --build build --target package - name: Upload artifacts + if: ${{ !env.ACT }} # skip during local actions testing uses: actions/upload-artifact@v4 with: name: mingw${{ matrix.arch }} @@ -245,6 +258,11 @@ jobs: ccache --show-stats env: CCACHE_MAXSIZE: 500M + - name: Keep container running on failure + if: ${{ env.ACT && failure() }} + run: | + echo "Build failed. Dropping into an interactive shell." + tail -f /dev/null msvc: strategy: fail-fast: false diff --git a/.github/workflows/deps-mingw-w64.txt b/.github/workflows/deps-ubuntu-24.04-mingw.txt similarity index 81% rename from .github/workflows/deps-mingw-w64.txt rename to .github/workflows/deps-ubuntu-24.04-mingw.txt index d74f0a957a6..9378882bf18 100644 --- a/.github/workflows/deps-mingw-w64.txt +++ b/.github/workflows/deps-ubuntu-24.04-mingw.txt @@ -4,6 +4,7 @@ ca-certificates ccache cmake dirmngr +fftw-mingw-w64 file git gnupg @@ -11,8 +12,11 @@ gpg g++-mingw-w64-i686-posix g++-mingw-w64-x86-64-posix libc6-dev +libfltk1.3-dev +libglx-dev liblist-moreutils-perl libmpc3 +libopengl-dev libxml2-utils libxml-perl lsb-release @@ -22,6 +26,7 @@ mingw-w64-tools nsis perl qt5-qmake +qt5base-mingw-w64 software-properties-common ssh-client sudo diff --git a/.github/workflows/install-powershell.sh b/.github/workflows/install-powershell.sh index 2ec8f3f7638..1839032a579 100755 --- a/.github/workflows/install-powershell.sh +++ b/.github/workflows/install-powershell.sh @@ -1,33 +1,23 @@ #!/bin/sh # PowerShell is needed for some MinGW dependencies from vcpkg - # Script taken from: https://learn.microsoft.com/en-us/powershell/scripting/install/install-ubuntu?view=powershell-7.4#installation-via-direct-download -################################### -# Prerequisites - # Update the list of packages sudo apt-get update # Install pre-requisite packages. -sudo apt-get install -y wget apt-transport-https software-properties-common - -# Get the version of Ubuntu -source /etc/os-release +sudo apt-get install -y wget -# Download the Microsoft repository keys -wget -q https://packages.microsoft.com/config/ubuntu/$VERSION_ID/packages-microsoft-prod.deb +# Download the PowerShell package file +wget https://github.com/PowerShell/PowerShell/releases/download/v7.4.3/powershell_7.4.3-1.deb_amd64.deb -# Register the Microsoft repository keys -sudo dpkg -i packages-microsoft-prod.deb - -# Delete the Microsoft repository keys file -rm packages-microsoft-prod.deb +################################### +# Install the PowerShell package +sudo dpkg -i powershell_7.4.3-1.deb_amd64.deb -# Update the list of packages after we added packages.microsoft.com -sudo apt-get update +# Resolve missing dependencies and finish the install (if necessary) +sudo apt-get install -f -################################### -# Install PowerShell -sudo apt-get install -y powershell +# Delete the downloaded package file +rm powershell_7.4.3-1.deb_amd64.deb diff --git a/.github/workflows/install-cmake.sh b/.github/workflows/setup-cmake.sh similarity index 77% rename from .github/workflows/install-cmake.sh rename to .github/workflows/setup-cmake.sh index 6c0c4359caf..4106b267167 100755 --- a/.github/workflows/install-cmake.sh +++ b/.github/workflows/setup-cmake.sh @@ -1,9 +1,10 @@ #!/bin/sh -# Kitware APT repo for latest CMake --- See: https://apt.kitware.com/ -# As of 5/21/2024, only focal and jammy are supported +# Add Kitware APT repo for latest CMake --- See: https://apt.kitware.com/ +# As of 6/29/2024, only focal, jammy, and noble are supported . /etc/os-release -if [ "$UBUNTU_CODENAME" = "focal" ] || [ "$UBUNTU_CODENAME" = "jammy" ]; then +if [ "$UBUNTU_CODENAME" = "focal" ] || [ "$UBUNTU_CODENAME" = "jammy" ] || [ "$UBUNTU_CODENAME" = "noble" ]; then + sudo apt-get install -y wget gpg test -f /usr/share/doc/kitware-archive-keyring/copyright || \ wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null \ | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null @@ -14,5 +15,3 @@ if [ "$UBUNTU_CODENAME" = "focal" ] || [ "$UBUNTU_CODENAME" = "jammy" ]; then sudo rm /usr/share/keyrings/kitware-archive-keyring.gpg sudo apt-get install -y kitware-archive-keyring fi - -sudo apt-get update && sudo apt-get install -y cmake diff --git a/.github/workflows/setup-mingw-packages.sh b/.github/workflows/setup-mingw-packages.sh new file mode 100755 index 00000000000..597c5120030 --- /dev/null +++ b/.github/workflows/setup-mingw-packages.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +# Currently using these PPA packages: +# fftw-mingw-w64 +# qt5base-mingw-w64 + +sudo echo "deb http://ppa.launchpad.net/tobydox/mingw-w64/ubuntu focal main" >> /etc/apt/sources.list +sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 72931B477E22FEFD47F8DECE02FE5F12ADDE29B2 +sudo apt-get update diff --git a/vcpkg.json b/vcpkg.json index 0d06be64d11..61f348a4810 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -8,7 +8,8 @@ "features": [ "sse", "sse2" - ] + ], + "platform": "!mingw" }, { "name": "fltk", @@ -63,13 +64,17 @@ }, { "name": "mp3lame", - "default-features": false, - "platform": "!mingw" + "default-features": false }, { "name": "portaudio", "default-features": false }, + { + "name": "pulseaudio", + "default-features": false, + "platform": "mingw" + }, { "name": "sdl2", "default-features": false