The LÖVE - Free 2D Game Engine stage snap

This stage-snap allows you to incorporate a build of the LÖVE game engine into your snap.

How to use

Prerequisite

This stage snap requires your snap to target the core18 base snap.

Integration

Add the following architectures property as the love snap isn’t available in the s390x architecture:

architectures:
- build-on: i386
- build-on: amd64
- build-on: armhf
- build-on: arm64
- build-on: ppc64el

Add the following part definition into your Snapcraft yaml recipe:

parts:
  love:
    plugin: nil
    stage-snaps:
    - love

The snapped game’s LÖVE source should be placed somewhere under the prime directory, we recommend under a specific folder:

parts:
  game:
    source: game-source-dir-or-repo
    plugin: dump
    organize:
      '*': the-game/

And the apps stanza should look like this:

apps:
  _your_game_:
    adapter: full
    command: bin/love $SNAP/the-game
    command-chain:
    - bin/locales-launch
    - bin/love-launch
    environment:
      # Workaround libpulsecommon library runtime dependency
      LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio

The following plugs are probably needed, depending on your game:

plugs:
  # For snaps with a graphical user interface:
  desktop:
  desktop-legacy:
  x11:
  unity7:
  wayland:

  # Storage access
  home:
  removable-media: # Non-A/C

  # Joystick access
  joystick:

  # Graphics rendering
  opengl:

  # Audio
  pulseaudio:

  # For inhibiting screensavor
  screen-inhibit-control:

  # Network access may be required by some games
  network:

Also, a layout fix if your game displays non-ASCII ranged characters on the window title bar:

layout:
  # Fix characters not in non-ASCII range not displayed in the window's
  # title bar
  /usr/share/X11/locale:
    bind: $SNAP/usr/share/X11/locale

Snaps that uses this stage snap


Happy snapcrafting!