Improve version checking logic and documentation

Co-authored-by: squassina <8495707+squassina@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-02-18 10:36:52 +00:00
parent f2b3b1bd73
commit 304832e4da
2 changed files with 25 additions and 17 deletions

View file

@ -30,7 +30,7 @@ This directory contains the GitHub Actions workflows for the MangoWC project.
**Install Strategy**: **Install Strategy**:
- Prefers apt packages when available and version requirements are met - Prefers apt packages when available and version requirements are met
- Falls back to building from source only when necessary - 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) - wlroots: requires >= 0.19.0 (checks apt version, builds from source if too old)
- scenefx: not in apt repositories (always builds from source) - scenefx: not in apt repositories (always builds from source)

View file

@ -65,15 +65,19 @@ jobs:
run: | run: |
# Try to install wayland from apt # Try to install wayland from apt
if sudo apt-get install -y libwayland-dev 2>/dev/null; then 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") # Check if pkg-config can find wayland-server
echo "Installed wayland version: $WAYLAND_VERSION" 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) # Check if version meets requirement (>= 1.23.1)
if dpkg --compare-versions "$WAYLAND_VERSION" ge "1.23.1"; then if dpkg --compare-versions "$WAYLAND_VERSION" ge "1.23.1"; then
echo "✅ wayland $WAYLAND_VERSION from apt meets requirements" echo "✅ wayland $WAYLAND_VERSION from apt meets requirements"
exit 0 exit 0
else
echo "⚠️ wayland $WAYLAND_VERSION from apt is too old, building from source..."
fi
else else
echo "⚠️ wayland $WAYLAND_VERSION from apt is too old, building from source..." echo "⚠️ pkg-config cannot find wayland-server, building from source..."
fi fi
else else
echo "⚠️ wayland not available in apt, building from source..." echo "⚠️ wayland not available in apt, building from source..."
@ -93,15 +97,19 @@ jobs:
run: | run: |
# Try to install wlroots from apt # Try to install wlroots from apt
if sudo apt-get install -y libwlroots-dev 2>/dev/null; then 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") # Check if pkg-config can find wlroots
echo "Installed wlroots version: $WLROOTS_VERSION" 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) # Check if version meets requirement (>= 0.19.0)
if dpkg --compare-versions "$WLROOTS_VERSION" ge "0.19.0"; then if dpkg --compare-versions "$WLROOTS_VERSION" ge "0.19.0"; then
echo "✅ wlroots $WLROOTS_VERSION from apt meets requirements" echo "✅ wlroots $WLROOTS_VERSION from apt meets requirements"
exit 0 exit 0
else
echo "⚠️ wlroots $WLROOTS_VERSION from apt is too old, building from source..."
fi
else else
echo "⚠️ wlroots $WLROOTS_VERSION from apt is too old, building from source..." echo "⚠️ pkg-config cannot find wlroots, building from source..."
fi fi
else else
echo "⚠️ wlroots not available in apt, building from source..." echo "⚠️ wlroots not available in apt, building from source..."