Skip to content

Commit

Permalink
automated build attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
sdumetz committed May 15, 2024
1 parent 8691e08 commit 9b60f9d
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 12 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Artefact builder
on:
push:
branches:
- internal
tags:
- v*.*.*
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build
run: |
docker buildx build --platform linux/amd64,linux/arm64 --tag holusion-cage .
docker container create --platform "linux/amd64" --name "cage-amd64" holusion-cage
docker container cp cage-amd64:/app/build/cage ./build/cage-amd64
docker container rm cage-amd64
docker container create --platform "linux/arm64/v7" --name "cage-arm64" holusion-cage
docker container cp cage-arm64:/app/build/cage ./build/cage-arm64
docker container rm cage-arm64
- name: Upload
uses: actions/upload-artifact@v4
with:
name: cage
path: build/cage-*
retention-days: 1

6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
/subprojects/**
!/subprojects/*.wrap
!/subprojects/*.wrap
!/subprojects/packagecache
!/subprojects/packagecache/.placeholder
!/subprojects/packagefiles
!/subprojects/packagefiles/*.patch
32 changes: 21 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
FROM debian:12-slim
#debian 12 is required to have a recent-enough built-in meson.
ENV DEBIAN_FRONTEND=noninteractive

# Install build tools
RUN apt-get -qqy update \
&& apt-get -qqy --no-install-recommends install \
git \
ca-certificates \
build-essential \
cmake \
Expand All @@ -26,13 +28,9 @@ RUN apt-get -qqy update \
quilt \
libexpat1-dev \
libffi-dev \
libxml2-dev \
liblzma-dev \
&& rm -rf /var/lib/apt/lists/*

# wlroots build-deps (https://packages.debian.org/source/bookworm/wlroots)
# - libwayland-dev is required for wayland-scanner, which is set as "native" but could probablyt be force to use the local file.
# (https://gitlab.freedesktop.org/wlroots/wlroots/-/blob/master/protocol/meson.build#L8)
RUN apt-get -qqy update \
&& apt-get -qqy --no-install-recommends install \
libavformat-dev \
Expand Down Expand Up @@ -63,19 +61,31 @@ RUN apt-get -qqy update \
libx11-xcb-dev \
libxkbcommon-dev \
hwdata \
libwayland-dev \
xwayland \
libxcb-ewmh-dev \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app
COPY . /app

RUN rm -rf /app/build
RUN mkdir -p /app/subprojects

RUN meson setup build --prefer-static --default-library=static --buildtype=release -Dwerror=false -Doptimization=2 \
-Dxwayland=enabled \
COPY meson_options.txt meson.build /app/
COPY *.in *.scd .clang-format .clang-format-ignore /app/

COPY subprojects/*.wrap /app/subprojects/
COPY subprojects/packagefiles /app/subprojects/packagefiles
COPY subprojects/packagecache /app/subprojects/packagecache

COPY ./protocol /app/protocol
COPY *.[ch] /app/


# Fix for the use of local wayland-scanner in subsequent builds
ENV PATH="${PATH}:/app/build/subprojects/wayland-1.22.0/src"

RUN meson setup build --prefer-static --default-library=static --buildtype=release -Dwerror=false \
-Dxwayland=enabled -Dinput_calibration=enabled -Dman-pages=disabled \
-Dwlroots:auto_features=enabled -Dwlroots:backends=auto -Dwlroots:renderers=auto \
-Dwayland:documentation=false -Dwayland:tests=false
-Dwayland:documentation=false -Dwayland:dtd_validation=false

RUN ninja -C build
RUN ninja -C build
Empty file.
25 changes: 25 additions & 0 deletions subprojects/packagefiles/0001-use-local-wayland-scanner.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Use local wayland-scanner instead of looking for the native one in the host system.
Since we don't plan to do cross-compilation and wayland-scanner is built from wayland subproject, we override this.
---
protocol/meson.build | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/protocol/meson.build b/protocol/meson.build
index c60f2b9a..76cfbf24 100644
--- a/protocol/meson.build
+++ b/protocol/meson.build
@@ -5,10 +5,8 @@ wayland_protos = dependency('wayland-protocols',
)
wl_protocol_dir = wayland_protos.get_variable('pkgdatadir')

-wayland_scanner_dep = dependency('wayland-scanner', native: true)
wayland_scanner = find_program(
- wayland_scanner_dep.get_variable('wayland_scanner'),
- native: true,
+ 'wayland-scanner'
)

protocols = {
--
2.39.2

2 changes: 2 additions & 0 deletions subprojects/wlroots.wrap
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ source_url =https://gitlab.freedesktop.org/wlroots/wlroots/-/releases/0.17.2/dow
source_filename = wlroots-0.17.2.tar.xz
source_hash = f4007d3f71e190b9000ab4a30afd87833b034ab2602030a00af4465ffd4e997c

diff_files = 0001-use-local-wayland-scanner.patch

[provide]
wlroots = wlroots

0 comments on commit 9b60f9d

Please sign in to comment.