Skip to content

Commit 426bc0f

Browse files
committed
Migrate to graphics-core20
1 parent 0c66f33 commit 426bc0f

File tree

1 file changed

+26
-7
lines changed

1 file changed

+26
-7
lines changed

snap/snapcraft.yaml

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ architectures:
1515
environment:
1616
SHELL: bash
1717
LC_ALL: C.UTF-8
18-
LD_LIBRARY_PATH: ${SNAP}/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/pulseaudio
1918
PATH: $SNAP/bin/:$SNAP/usr/bin/:${SNAP}/usr/games:${PATH}
2019
# XDG config
2120
XDG_CACHE_HOME: $SNAP_USER_COMMON/.cache
2221
XDG_CONFIG_DIRS: ${SNAP}/etc/xdg:$XDG_CONFIG_DIRS
2322
XDG_CONFIG_HOME: $SNAP_USER_DATA/.config
2423
# Prep EGL
25-
__EGL_VENDOR_LIBRARY_DIRS: $SNAP/etc/glvnd/egl_vendor.d:$SNAP/usr/share/glvnd/egl_vendor.d
26-
LIBGL_DRIVERS_PATH: ${SNAP}/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/dri
27-
LIBVA_DRIVERS_PATH: ${SNAP}/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/dri
24+
LD_LIBRARY_PATH: $SNAP/graphics/lib
25+
__EGL_VENDOR_LIBRARY_DIRS: $SNAP/graphics/glvnd/egl_vendor.d
26+
LIBGL_DRIVERS_PATH: $SNAP/graphics/dri
27+
LIBVA_DRIVERS_PATH: $SNAP/graphics/dri
2828
# Prep SDL
2929
SDL_VIDEODRIVER: wayland
3030

@@ -35,11 +35,17 @@ layout:
3535
bind: $SNAP/etc/fonts
3636
/usr/games:
3737
bind: $SNAP/usr/games
38+
/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/pulseaudio:
39+
bind: $SNAP/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/pulseaudio
3840

3941
plugs:
4042
wayland:
4143
opengl:
4244
audio-playback:
45+
graphics-core20:
46+
interface: content
47+
target: $SNAP/graphics
48+
default-provider: mesa-core20
4349

4450
apps:
4551
daemon:
@@ -75,7 +81,7 @@ parts:
7581
mir-kiosk-snap-launch:
7682
plugin: dump
7783
source: https://github.com/MirServer/mir-kiosk-snap-launch.git
78-
override-build: $SNAPCRAFT_PART_BUILD/build-with-plugs.sh opengl wayland audio-playback
84+
override-build: $SNAPCRAFT_PART_BUILD/build-with-plugs.sh opengl wayland graphics-core20 audio-playback
7985
stage-packages:
8086
- inotify-tools
8187

@@ -105,14 +111,27 @@ parts:
105111
- libsdl2-mixer-2.0-0
106112
- libsdl2-net-2.0-0
107113

114+
# scummvm needs libGLU which mesa supplies. But is isn't included in graphics-core20.
108115
mesa:
109116
plugin: nil
110117
stage-packages:
111-
- libgl1-mesa-dri
112-
- libwayland-egl1-mesa
113118
- libglu1-mesa
114119

115120
wayland:
116121
plugin: nil
117122
stage-packages:
118123
- libwayland-client0
124+
- libwayland-egl1
125+
126+
cleanup:
127+
after: [scummvm, mir-kiosk-snap-launch, sdl2, wayland, glue, icons]
128+
plugin: nil
129+
build-snaps: [ mesa-core20 ]
130+
override-prime: |
131+
set -eux
132+
cd /snap/mesa-core20/current/egl/lib
133+
find . -type f,l -exec rm -f $SNAPCRAFT_PRIME/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/{} \;
134+
rm -fr "$SNAPCRAFT_PRIME/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/dri"
135+
for CRUFT in bug lintian man; do
136+
rm -rf "$SNAPCRAFT_PRIME/usr/share/$CRUFT"
137+
done

0 commit comments

Comments
 (0)