Skip to content

Commit

Permalink
ci/gha: use system deps in one Windows meson build
Browse files Browse the repository at this point in the history
And install meson from system except for Chocolatey
which doesn’t like installing meson without a reboot.

Split out Chocolatey is necessary, because using bash as a shell
for some reason also changes the used linker leading to config-time
failures for MSVC.
  • Loading branch information
TheOneric committed Apr 21, 2024
1 parent ae6f88b commit ffe070b
Showing 1 changed file with 37 additions and 14 deletions.
51 changes: 37 additions & 14 deletions .github/workflows/meson.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,18 @@ jobs:
name: Windows MSVC Release,
os: windows-latest,
msvc: true,
pkgmanager: choco,
shell: 'powershell',
buildtype: release,
args: '-Ddefault_library=static --wrap-mode=forcefallback'
}
- {
name: Windows MinGW Release,
os: windows-latest,
msvc: false,
pkgmanager: msys,
msystem: MINGW64,
shell: 'msys2 {0}',
buildtype: debugoptimized,
args: ''
}
Expand All @@ -42,42 +47,60 @@ jobs:
args: ''
}

defaults:
run:
shell: ${{ matrix.config.shell || 'bash' }}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'

- uses: actions/setup-python@v5
- name: Setup MSys2
if: matrix.config.pkgmanager == 'msys'
uses: msys2/setup-msys2@v2
with:
python-version: '3.x'

- name: Setup Meson
run: |
python -m pip install --upgrade pip
pip install meson
msystem: ${{ matrix.config.msystem }}
update: false

- name: Setup MSVC
if: matrix.config.os == 'windows-latest' && matrix.config.msvc == true
uses: ilammy/msvc-dev-cmd@v1

- name: Install dependecies with choco
if: matrix.config.pkgmanager == 'choco'
run: |
# for whatever reason choco insist on a reboot if it installs meson
choco install ninja nasm python
python -m pip install --upgrade pip
pip install meson
- name: Install dependencies
shell: bash
if: matrix.config.pkgmanager != 'choco'
run: |
case "${{ matrix.config.os }}" in
windows-*)
choco install ninja nasm
case "${{ matrix.config.pkgmanager || matrix.config.os }}" in
msys)
pre="$MINGW_PACKAGE_PREFIX"
pacman --noconfirm -S \
$pre-gcc $pre-meson $pre-ninja nasm \
$pre-fribidi $pre-freetype $pre-harfbuzz \
$pre-fontconfig $pre-libpng
;;
macos-*)
brew install nasm ninja pkg-config
brew install nasm ninja pkg-config meson
;;
ubuntu-*)
sudo apt-get update
sudo apt-get install ninja-build build-essential pkg-config nasm libfreetype6-dev libfontconfig1-dev libharfbuzz-dev libfribidi-dev
sudo apt-get install ninja-build build-essential pkg-config nasm \
libfreetype-dev libfontconfig-dev libharfbuzz-dev libfribidi-dev \
python3-pip
# Drop once 24.04 is available in GHA
pip3 install meson
;;
esac
- name: Set up WrapDB
if: matrix.config.os == 'windows-latest' || matrix.config.os == 'macos-latest'
if: matrix.config.pkgmanager == 'choco' || matrix.config.os == 'macos-latest'
run: |
meson wrap update-db
Expand Down

0 comments on commit ffe070b

Please sign in to comment.