mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-05-02 06:46:29 -04:00
Prefer apt packages over building from source when available
Co-authored-by: squassina <8495707+squassina@users.noreply.github.com>
This commit is contained in:
parent
e21ae7e013
commit
f2b3b1bd73
2 changed files with 55 additions and 12 deletions
17
.github/workflows/README.md
vendored
17
.github/workflows/README.md
vendored
|
|
@ -20,19 +20,26 @@ This directory contains the GitHub Actions workflows for the MangoWC project.
|
||||||
|
|
||||||
**What it does**:
|
**What it does**:
|
||||||
1. Installs system dependencies (libinput, libdrm, etc.)
|
1. Installs system dependencies (libinput, libdrm, etc.)
|
||||||
2. Builds wayland 1.23.1 from source (Ubuntu has older 1.22)
|
2. Installs wayland (tries apt first, builds 1.23.1 from source if needed)
|
||||||
3. Builds wlroots 0.19 from source
|
3. Installs wlroots (tries apt first, builds 0.19 from source if needed)
|
||||||
4. Builds scenefx 0.4.1 from source
|
4. Builds scenefx 0.4.1 from source (not available in apt)
|
||||||
5. Configures the project with meson
|
5. Configures the project with meson
|
||||||
6. Builds the project with ninja
|
6. Builds the project with ninja
|
||||||
7. Verifies the executables were created
|
7. Verifies the executables were created
|
||||||
|
|
||||||
|
**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)
|
||||||
|
- wlroots: requires >= 0.19.0 (checks apt version, builds from source if too old)
|
||||||
|
- scenefx: not in apt repositories (always builds from source)
|
||||||
|
|
||||||
**Dependencies**:
|
**Dependencies**:
|
||||||
- Ubuntu latest runner
|
- Ubuntu latest runner
|
||||||
- Meson build system
|
- Meson build system
|
||||||
- Ninja build tool
|
- Ninja build tool
|
||||||
- Wayland 1.23.1 (built from source)
|
- Wayland >= 1.23.1
|
||||||
- wlroots 0.19
|
- wlroots >= 0.19.0
|
||||||
- scenefx 0.4.1
|
- scenefx 0.4.1
|
||||||
|
|
||||||
### docs.yml
|
### docs.yml
|
||||||
|
|
|
||||||
50
.github/workflows/build.yml
vendored
50
.github/workflows/build.yml
vendored
|
|
@ -37,7 +37,7 @@ jobs:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install system dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y \
|
sudo apt-get install -y \
|
||||||
|
|
@ -61,9 +61,25 @@ jobs:
|
||||||
libxml2-dev \
|
libxml2-dev \
|
||||||
pkg-config
|
pkg-config
|
||||||
|
|
||||||
- name: Build and install wayland 1.23.1
|
- name: Install wayland (try apt first, build from source if needed)
|
||||||
run: |
|
run: |
|
||||||
# Build wayland 1.23.1 from source since Ubuntu has older version
|
# 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
|
||||||
|
else
|
||||||
|
echo "⚠️ wayland $WAYLAND_VERSION from apt is too old, building from source..."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "⚠️ wayland not available in apt, building from source..."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Build from source if apt package is unavailable or too old
|
||||||
git clone https://gitlab.freedesktop.org/wayland/wayland.git
|
git clone https://gitlab.freedesktop.org/wayland/wayland.git
|
||||||
cd wayland
|
cd wayland
|
||||||
git checkout 1.23.1
|
git checkout 1.23.1
|
||||||
|
|
@ -71,10 +87,27 @@ jobs:
|
||||||
sudo ninja -C build/ install
|
sudo ninja -C build/ install
|
||||||
sudo ldconfig
|
sudo ldconfig
|
||||||
cd ..
|
cd ..
|
||||||
|
echo "✅ Built wayland 1.23.1 from source"
|
||||||
|
|
||||||
- name: Install wlroots 0.19
|
- name: Install wlroots (try apt first, build from source if needed)
|
||||||
run: |
|
run: |
|
||||||
# Install wlroots 0.19 from source since it may not be in apt
|
# 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
|
||||||
|
else
|
||||||
|
echo "⚠️ wlroots $WLROOTS_VERSION from apt is too old, building from source..."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "⚠️ wlroots not available in apt, building from source..."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Build from source if apt package is unavailable or too old
|
||||||
git clone https://gitlab.freedesktop.org/wlroots/wlroots.git
|
git clone https://gitlab.freedesktop.org/wlroots/wlroots.git
|
||||||
cd wlroots
|
cd wlroots
|
||||||
git checkout 0.19.0
|
git checkout 0.19.0
|
||||||
|
|
@ -82,16 +115,19 @@ jobs:
|
||||||
sudo ninja -C build/ install
|
sudo ninja -C build/ install
|
||||||
sudo ldconfig
|
sudo ldconfig
|
||||||
cd ..
|
cd ..
|
||||||
|
echo "✅ Built wlroots 0.19.0 from source"
|
||||||
|
|
||||||
- name: Install scenefx 0.4.1
|
- name: Install scenefx (build from source - not in apt)
|
||||||
run: |
|
run: |
|
||||||
# Install scenefx from source
|
# scenefx is not available in Ubuntu apt repositories
|
||||||
|
# Build from source
|
||||||
git clone -b 0.4.1 https://github.com/wlrfx/scenefx.git
|
git clone -b 0.4.1 https://github.com/wlrfx/scenefx.git
|
||||||
cd scenefx
|
cd scenefx
|
||||||
meson setup build/ --prefix=/usr
|
meson setup build/ --prefix=/usr
|
||||||
sudo ninja -C build/ install
|
sudo ninja -C build/ install
|
||||||
sudo ldconfig
|
sudo ldconfig
|
||||||
cd ..
|
cd ..
|
||||||
|
echo "✅ Built scenefx 0.4.1 from source"
|
||||||
|
|
||||||
- name: Configure meson
|
- name: Configure meson
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue