Skip to content

Commit

Permalink
Build mir-libs for both core22 and core24 (#3364)
Browse files Browse the repository at this point in the history
This allows snaps (such as Miriway) to build on either base, and to
transition to core24 at their own pace
  • Loading branch information
AlanGriffiths authored May 3, 2024
2 parents 88f5ed1 + 0066962 commit a1ad6e4
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 11 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/snap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ jobs:
name: Determine which architectures to build for
run: |
ARCHES=( amd64 )
if ${{ github.event_name == 'pull_request' && github.repository == github.event.pull_request.head.repo.full_name }}; then
ARCHES+=( armhf arm64 )
fi
# remote-build is flaky: Don't risk it
# if ${{ github.event_name == 'pull_request' && github.repository == github.event.pull_request.head.repo.full_name }}; then
# ARCHES+=( armhf arm64 )
# fi
jq --compact-output --null-input '$ARGS.positional' --args -- "${ARCHES[@]}" | awk '{ print "arches=" $0 }' >> $GITHUB_OUTPUT
mir-libs:
Expand All @@ -34,13 +35,22 @@ jobs:
fail-fast: false
matrix:
architecture: ${{ fromJSON(needs.arches.outputs.arches) }}
base: ["22", "24"]

steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0 # needed for version determination

- name: Tweak the snapcraft.yaml
run: |
if [ "${{ matrix.base }}" == "24" ]; then
mv snap/local/core24~snapcraft.yaml snap/snapcraft.yaml
fi
git config --global --add safe.directory $(pwd)
sed -i 's@version: testing@version: '$(git describe)'@' snap/snapcraft.yaml
- name: Build and publish the snap
uses: canonical/actions/build-snap@release
with:
Expand All @@ -49,7 +59,7 @@ jobs:
launchpad-credentials: ${{ secrets.LAUNCHPAD_CREDENTIALS }}
launchpad-accept-public-upload: true
publish: ${{ github.event_name == 'pull_request' && github.repository == github.event.pull_request.head.repo.full_name }}
publish-channel: 22/edge/pr${{ github.event.number }}
publish-channel: ${{ matrix.base }}/edge/pr${{ github.event.number }}

snap:
# Only run if we have access to secrets.
Expand Down
100 changes: 100 additions & 0 deletions snap/local/core24~snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: mir-libs
base: core24
build-base: devel
summary: The fast, open and secure display server for any device - build environment
description: |
Mir is a display server running on linux systems, with a focus on efficiency,
robust operation and a well-defined driver model.
This snap contains the build environment necessary to build Mir display servers.
confinement: strict
version: testing
grade: devel

parts:
mir:
plugin: cmake
source: .
cmake-parameters:
- -DCMAKE_INSTALL_PREFIX=/usr
- -DMIR_ENABLE_WLCS_TESTS=OFF
- -DMIR_PLATFORM='gbm-kms;eglstream-kms;x11;wayland'
build-packages:
- build-essential
- eglexternalplatform-dev
- git
- libboost-date-time-dev
- libboost-filesystem-dev
- libboost-iostreams-dev
- libboost-program-options-dev
- libcapnp-dev
- libdrm-dev
- libegl1-mesa-dev
- libepoxy-dev
- libfreetype-dev
- libgbm-dev
- libglm-dev
- libgtest-dev
- libinput-dev
- liblttng-ust-dev
- libnvidia-egl-wayland-dev
- libudev-dev
- libumockdev-dev
- libwayland-dev
- libxcb-composite0-dev
- libxcb-randr0-dev
- libx11-xcb-dev
- libxcursor-dev
- libxkbcommon-dev
- libxkbcommon-x11-dev
- libxml++2.6-dev
- libyaml-cpp-dev
- nettle-dev
- python3-pil
- systemtap-sdt-dev
stage-packages:
- libboost-filesystem1.83.0
- libboost-iostreams1.83.0
- libboost-program-options1.83.0
- libcapnp-1.0.1
- libdrm2
- libegl1
- libepoxy0
- libevdev2
- libfreetype6
- libgbm1
- libgles2
- libglibmm-2.4-1t64
- libglvnd0
- libgudev-1.0-0
- libicu74
- libinput10
- liblttng-ust1t64
- libmtdev1t64
- libnuma1
- libnvidia-egl-wayland1
- libpng16-16t64
- libsigc++-2.0-0v5
- liburcu8t64
- libwacom9
- libwayland-client0
- libwayland-egl1
- libwayland-server0
- libx11-6
- libxau6
- libxcb-composite0
- libxcb-randr0
- libxcb-render0
- libxcb-xfixes0
- libxcb1
- libx11-xcb1
- libxcursor1
- libxdmcp6
- libxfixes3
- libxkbcommon0
- libxkbcommon-x11-0
- libxml++2.6-2v5
- libxml2
- libxrender1
- libyaml-cpp0.8
9 changes: 2 additions & 7 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ description: |
This snap contains the build environment necessary to build Mir display servers.
confinement: strict
adopt-info: mir
version: testing
grade: devel

parts:
mir:
Expand Down Expand Up @@ -96,9 +97,3 @@ parts:
- libxml2
- libxrender1
- libyaml-cpp0.7
override-pull: |
craftctl default
# work around https://github.com/diddlesnaps/snapcraft-multiarch-action/issues/22
git config --global --add safe.directory ${CRAFT_PART_SRC}
craftctl set version=$( git describe | awk -F- '{ gsub(/^v/, "", $1); printf $1; if ($2) { printf "+dev" $2 "-" $3 } }' )
craftctl set grade=$( [[ $( git describe ) =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && echo stable || echo devel )

0 comments on commit a1ad6e4

Please sign in to comment.