From 304832e4da73390c85ce0ec5d0f82bbf1b0a1ffd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 18 Feb 2026 10:36:52 +0000 Subject: [PATCH] Improve version checking logic and documentation Co-authored-by: squassina <8495707+squassina@users.noreply.github.com> --- .github/workflows/README.md | 2 +- .github/workflows/build.yml | 40 ++++++++++++++++++++++--------------- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index e3a9e7ae..d171bd87 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -30,7 +30,7 @@ This directory contains the GitHub Actions workflows for the MangoWC project. **Install Strategy**: - Prefers apt packages when available and version requirements are met - Falls back to building from source only when necessary -- wayland: requires >= 1.23.1 (Ubuntu apt has 1.22, builds from source) +- wayland: requires >= 1.23.1 (typically builds from source on Ubuntu 22.04/24.04) - wlroots: requires >= 0.19.0 (checks apt version, builds from source if too old) - scenefx: not in apt repositories (always builds from source) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 26ca7ad5..0da79d44 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,15 +65,19 @@ jobs: run: | # Try to install wayland from apt if sudo apt-get install -y libwayland-dev 2>/dev/null; then - WAYLAND_VERSION=$(pkg-config --modversion wayland-server 2>/dev/null || echo "0.0.0") - echo "Installed wayland version: $WAYLAND_VERSION" - - # Check if version meets requirement (>= 1.23.1) - if dpkg --compare-versions "$WAYLAND_VERSION" ge "1.23.1"; then - echo "✅ wayland $WAYLAND_VERSION from apt meets requirements" - exit 0 + # Check if pkg-config can find wayland-server + if WAYLAND_VERSION=$(pkg-config --modversion wayland-server 2>/dev/null); then + echo "Installed wayland version: $WAYLAND_VERSION" + + # Check if version meets requirement (>= 1.23.1) + if dpkg --compare-versions "$WAYLAND_VERSION" ge "1.23.1"; then + echo "✅ wayland $WAYLAND_VERSION from apt meets requirements" + exit 0 + else + echo "⚠️ wayland $WAYLAND_VERSION from apt is too old, building from source..." + fi else - echo "⚠️ wayland $WAYLAND_VERSION from apt is too old, building from source..." + echo "⚠️ pkg-config cannot find wayland-server, building from source..." fi else echo "⚠️ wayland not available in apt, building from source..." @@ -93,15 +97,19 @@ jobs: run: | # Try to install wlroots from apt if sudo apt-get install -y libwlroots-dev 2>/dev/null; then - WLROOTS_VERSION=$(pkg-config --modversion wlroots 2>/dev/null || echo "0.0.0") - echo "Installed wlroots version: $WLROOTS_VERSION" - - # Check if version meets requirement (>= 0.19.0) - if dpkg --compare-versions "$WLROOTS_VERSION" ge "0.19.0"; then - echo "✅ wlroots $WLROOTS_VERSION from apt meets requirements" - exit 0 + # Check if pkg-config can find wlroots + if WLROOTS_VERSION=$(pkg-config --modversion wlroots 2>/dev/null); then + echo "Installed wlroots version: $WLROOTS_VERSION" + + # Check if version meets requirement (>= 0.19.0) + if dpkg --compare-versions "$WLROOTS_VERSION" ge "0.19.0"; then + echo "✅ wlroots $WLROOTS_VERSION from apt meets requirements" + exit 0 + else + echo "⚠️ wlroots $WLROOTS_VERSION from apt is too old, building from source..." + fi else - echo "⚠️ wlroots $WLROOTS_VERSION from apt is too old, building from source..." + echo "⚠️ pkg-config cannot find wlroots, building from source..." fi else echo "⚠️ wlroots not available in apt, building from source..."