Skip to content

Commit

Permalink
snap: use mir-libs snap
Browse files Browse the repository at this point in the history
  • Loading branch information
Saviq authored and AlanGriffiths committed Jan 23, 2024
1 parent 97f6539 commit 1a5eb0d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/snap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ jobs:
with:
fetch-depth: 0 # needed for version determination

- name: Patch PPA and version
run: |
sed -i 's@mir-team/release@mir-team/dev@' snap/snapcraft.yaml
sed -i 's@rev-list --count@rev-parse --short@' snap/snapcraft.yaml
- name: Build and publish the snap
uses: canonical/actions/build-snap@multiarch
with:
Expand Down
24 changes: 18 additions & 6 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ confinement: strict
base: core22
license: GPL-3.0
compression: lzo
package-repositories:
- type: apt
ppa: mir-team/release

architectures:
- build-on: amd64
Expand Down Expand Up @@ -93,10 +90,20 @@ slots:
- $SNAP_COMMON/diagnostic

parts:
mir:
plugin: nil
stage-snaps:
- mir-libs/22/edge
prime:
- -*.h
- -*.pc
- -share

ubuntu-frame:
override-pull: |
after: [mir]
override-build: |
craftctl default
mir_version=`LANG=C apt-cache policy mir-graphics-drivers-desktop | sed -rne 's/^\s+Candidate:\s+([^-]*)-.+$/\1/p'`
mir_version=$( sed -rne 's/^version:\s+([^-]*)-.+$/\1/p' ${SNAPCRAFT_STAGE}/meta.mir-libs/snap.yaml )
# work around https://github.com/diddlesnaps/snapcraft-multiarch-action/issues/22
git config --global --add safe.directory ${CRAFT_PROJECT_DIR}
recipe_version=`git -C ${CRAFT_PROJECT_DIR} rev-list --count HEAD`
Expand All @@ -106,15 +113,16 @@ parts:
source: src
build-packages:
- pkg-config
- libmiral-dev
- libwayland-dev
- libboost-filesystem-dev
- libboost-iostreams-dev
- libapparmor-dev
- libfreetype6-dev
- libxkbcommon-dev
stage-packages:
- libboost-filesystem1.74.0
- libboost-iostreams1.74.0
- libxkbcommon0
# Stage libmiral<n> indirectly as we cannot (since core22) do `try:/else:`
- libmiral-dev
prime:
Expand All @@ -123,6 +131,10 @@ parts:
- -usr/lib/*/pkgconfig
- -usr/lib/*/libmir*.so

build-environment:
- LD_LIBRARY_PATH: ${CRAFT_STAGE}/usr/lib/${CRAFT_ARCH_TRIPLET}


assets:
plugin: nil
stage-packages:
Expand Down

0 comments on commit 1a5eb0d

Please sign in to comment.