Skip to content

Update to use the latest techniques #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 26 additions & 9 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ architectures:
environment:
SHELL: bash
LC_ALL: C.UTF-8
LD_LIBRARY_PATH: ${LD_LIBRARY_PATH}:${SNAP}/usr/lib/:${SNAP}/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/:${SNAP}/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/pulseaudio
PATH: $SNAP/bin/:$SNAP/usr/bin/:${SNAP}/usr/games:${PATH}
# XDG config
XDG_CACHE_HOME: $SNAP_USER_COMMON/.cache
XDG_CONFIG_DIRS: ${SNAP}/etc/xdg:$XDG_CONFIG_DIRS
XDG_CONFIG_HOME: $SNAP_USER_DATA/.config
# Prep EGL
__EGL_VENDOR_LIBRARY_DIRS: $SNAP/etc/glvnd/egl_vendor.d:$SNAP/usr/share/glvnd/egl_vendor.d
LIBGL_DRIVERS_PATH: ${SNAP}/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/dri
LIBVA_DRIVERS_PATH: ${SNAP}/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/dri
LD_LIBRARY_PATH: $SNAP/graphics/lib
__EGL_VENDOR_LIBRARY_DIRS: $SNAP/graphics/glvnd/egl_vendor.d
LIBGL_DRIVERS_PATH: $SNAP/graphics/dri
LIBVA_DRIVERS_PATH: $SNAP/graphics/dri
# Prep SDL
SDL_VIDEODRIVER: wayland

Expand All @@ -35,13 +35,17 @@ layout:
bind: $SNAP/etc/fonts
/usr/games:
bind: $SNAP/usr/games
/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/pulseaudio:
bind: $SNAP/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/pulseaudio

plugs:
wayland:
opengl:
audio-playback:
pulseaudio:
alsa:
graphics-core20:
interface: content
target: $SNAP/graphics
default-provider: mesa-core20

apps:
daemon:
Expand Down Expand Up @@ -77,7 +81,7 @@ parts:
mir-kiosk-snap-launch:
plugin: dump
source: https://github.com/MirServer/mir-kiosk-snap-launch.git
override-build: $SNAPCRAFT_PART_BUILD/build-with-plugs.sh opengl audio-playback pulseaudio alsa wayland
override-build: $SNAPCRAFT_PART_BUILD/build-with-plugs.sh opengl wayland graphics-core20 audio-playback
stage-packages:
- inotify-tools

Expand Down Expand Up @@ -107,14 +111,27 @@ parts:
- libsdl2-mixer-2.0-0
- libsdl2-net-2.0-0

# scummvm needs libGLU which mesa supplies. But it isn't included in graphics-core20.
mesa:
plugin: nil
stage-packages:
- libgl1-mesa-dri
- libwayland-egl1-mesa
- libglu1-mesa

wayland:
plugin: nil
stage-packages:
- libwayland-client0
- libwayland-egl1

cleanup:
after: [scummvm, mir-kiosk-snap-launch, sdl2, wayland, glue, icons, mesa]
plugin: nil
build-snaps: [ mesa-core20 ]
override-prime: |
set -eux
cd /snap/mesa-core20/current/egl/lib
find . -type f,l -exec rm -f $SNAPCRAFT_PRIME/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/{} \;
rm -fr "$SNAPCRAFT_PRIME/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/dri"
for CRUFT in bug lintian man; do
rm -rf "$SNAPCRAFT_PRIME/usr/share/$CRUFT"
done