Skip to content

Commit

Permalink
snap: Initial packaging
Browse files Browse the repository at this point in the history
Pincab works on Ubuntu Core 10 on RPi4 (~23 FPS)

Few configuration steps:

```
sudo snap install mir-kiosk
cat <<EOF | sudo tee /var/snap/mir-kiosk/current/miral-kiosk.display
layouts:
  default:
    cards:
    - card-id: 0
      HDMI-A-1:
        mode: [email protected]
        orientation: left

package=pinball-table-gnu
sudo snap install --devmode ${package}
sudo snap connections ${package} | grep -- '-' | grep -v ' :' | cut -f1 -d' ' \
| while read plug ; do sudo snap connect ${package}:$plug  ; done ;
sudo snap set ${package} daemon=true
```

For the record:

```sudo snap list
Name               Version                     Rev    Tracking         Publisher   Notes
core18             20210309                    2002   latest/stable    canonical✓  base
core20             20210319                    974    latest/stable    canonical✓  base
lxd                4.13                        20319  latest/stable/…  canonical✓  -
mir-kiosk          2.3.2-snap117               6526   latest/stable    canonical✓  -
pinball-table-gnu  0.0.20200601+git13.5d54821  x2     -                -           devmode
snapd              2.49.2                      11584  latest/stable    canonical✓  snapd
```

Relate-to: adoptware/pinball#21
Signed-off-by: Philippe Coval <[email protected]>
Change-Id: Iacce3cd83c9a8f1f6d4f88ae0990f610db1ce785
  • Loading branch information
rzr committed May 7, 2021
1 parent 04e5b64 commit 0d38eb3
Show file tree
Hide file tree
Showing 2 changed files with 160 additions and 0 deletions.
2 changes: 2 additions & 0 deletions snap/hooks/configure
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
snapctl restart $SNAP_NAME
158 changes: 158 additions & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
name: pinball-table-gnu
version: git
summary: Pinball table dedicated to GNU project with Emilia game
description: |
The Emilia Pinball Project is a pinball simulator for GNU/Linux and other Unix
systems. There are only two levels to play with, but they are very addictive.
You can play with two types of boards and keep high scores.
confinement: strict
grade: devel
base: core20
license: GPL-2.0+

plugs:
alsa:
audio-playback:
home:
joystick:
network-bind: # Mir/Xwayland
opengl:
pulseaudio:
wayland:
x11:

environment:
__EGL_VENDOR_LIBRARY_DIRS: "$SNAP/etc/glvnd/egl_vendor.d:$SNAP/usr/share/glvnd/egl_vendor.d"
LD_LIBRARY_PATH: "$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio"
LIBGL_DRIVERS_PATH: "$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/dri"
PINBALL_TABLE: gnu
PULSE_SERVER: unix:$XDG_RUNTIME_DIR/../pulse/native
XWAYLAND_FULLSCREEN_WINDOW_HINT: title="Emilia Pinball"

apps:
daemon:
command-chain:
- bin/run-daemon
- bin/wayland-launch
command: usr/local/bin/pinball --fullscreen
daemon: simple
restart-condition: always
pinball:
command: usr/local/bin/pinball
mir-kiosk-pinball:
command-chain:
- bin/wayland-launch
command: usr/local/bin/pinball

layout:
/etc/alsa:
bind: $SNAP/etc/alsa
/etc/pinball:
bind: $SNAP/etc/pinball
/usr/local:
bind: $SNAP/usr/local
/usr/share/alsa:
bind: $SNAP/usr/share/alsa
/usr/share/X11:
bind: $SNAP/usr/share/X11
/usr/bin/xkbcomp:
symlink: $SNAP/usr/bin/xkbcomp
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/alsa-lib:
bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/alsa-lib
parts:
pinball:
source: https://github.com/rzr/pinball.git
plugin: autotools
override-build: |
snapcraftctl build
install -d $SNAPCRAFT_PART_INSTALL/etc/pinball
install extra/profile/pincab/etc/pinball/pinball $SNAPCRAFT_PART_INSTALL/etc/pinball/
build-packages:
- libasound2-dev
- libgl1-mesa-dev
- libjpeg-dev
- libltdl-dev
- libogg-dev
- libpng-dev
- libsdl2-image-dev
- libsdl2-mixer-dev
- libsdl2-dev
- libtool-bin
- libvorbis-dev
stage-packages:
- alsa-utils
- libasound2
- libasyncns0
- libflac8
- libfluidsynth2
- libgl1
- libglvnd0
- libglx0
- libinstpatch-1.0-2
- libjack-jackd2-0
- libjbig0
- libjpeg-turbo8
- libltdl7
- libmodplug1
- libmpg123-0
- libogg0
- libopus0
- libopusfile0
- libpng16-16
- libpulse0
- libsdl2-2.0-0
- libsdl2-image-2.0-0
- libsdl2-mixer-2.0-0
- libsndfile1
- libtiff5
- libvorbis0a
- libvorbisenc2
- libvorbisfile3
- libwayland-client0
- libwayland-cursor0
- libwayland-egl1
- libwebp6
- libx11-6
- libxau6
- libxcb1
- libxcursor1
- libxdmcp6
- libxext6
- libxfixes3
- libxi6
- libxinerama1
- libxkbcommon0
- libxrandr2
- libxrender1
- libxss1
- libxxf86vm1

pinball-table-gnu:
source: https://github.com/rzr/pinball-table-gnu.git
plugin: autotools
build-packages:
- automake
- libtool
- libltdl-dev
- libsdl2-dev
build-environment:
- PATH: $SNAPCRAFT_PART_INSTALL/../../pinball/install/usr/local/bin:${PATH}
override-build: |
sed \
-e "s|prefix=/\(.*\)|prefix=$SNAPCRAFT_PART_INSTALL/../../pinball/install/\1|g" \
-e "s|exec_prefix=/\(.*\)|exec_prefix=$SNAPCRAFT_PART_INSTALL/../../pinball/install/\1|g" \
-i "$SNAPCRAFT_PART_INSTALL/../../pinball/install/usr/local/bin/pinball-config"
snapcraftctl build
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 alsa wayland hardware-observe
stage-packages:
- inotify-tools

mesa:
plugin: nil
stage-packages:
- libwayland-egl1-mesa

0 comments on commit 0d38eb3

Please sign in to comment.