Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
messmerd committed Jun 30, 2024
1 parent eb864a3 commit b7b27aa
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 37 deletions.
36 changes: 27 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ jobs:
fail-fast: false
matrix:
arch: ['32', '64']
#arch: ['64']
name: mingw${{ matrix.arch }}
runs-on: ubuntu-22.04
env:
Expand All @@ -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:
Expand All @@ -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 }}\
Expand All @@ -217,21 +228,23 @@ 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
run: cmake --build build
- 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 }}
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ ca-certificates
ccache
cmake
dirmngr
fftw-mingw-w64
file
git
gnupg
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
Expand All @@ -22,6 +26,7 @@ mingw-w64-tools
nsis
perl
qt5-qmake
qt5base-mingw-w64
software-properties-common
ssh-client
sudo
Expand Down
30 changes: 10 additions & 20 deletions .github/workflows/install-powershell.sh
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
9 changes: 9 additions & 0 deletions .github/workflows/setup-mingw-packages.sh
Original file line number Diff line number Diff line change
@@ -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
11 changes: 8 additions & 3 deletions vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"features": [
"sse",
"sse2"
]
],
"platform": "!mingw"
},
{
"name": "fltk",
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b7b27aa

Please sign in to comment.