name: reicast
version: git
summary: Reicast -- The fastest Dreamcast Emulator
description: |
  Reicast is a Sega Dreamcast emulator. It is designed to run Dreamcast games
  and homebrew in x86, x64 and aarch64 based platforms.
grade: stable
icon: shell/linux/reicast.png
confinement: strict
# architectures: all

apps:
  reicast:
    command:  desktop-launch alsa-launch $SNAP/bin/reicast
    plugs: [home, alsa, pulseaudio, opengl, x11, joystick, unity7]
    desktop: share/applications/reicast.desktop
  joyconfig:
    command:  desktop-launch $SNAP/bin/reicast-joyconfig
    plugs: [home, joystick]

parts:
  joyconfig:
    plugin: python
    python-version: python3
    python-packages:
      - evdev
    source: .

  reicast:
    source: .
    source-subdir: shell/linux
    plugin: make
    make-parameters: [ PREFIX= ]
    build-packages:
      - build-essential
      - libasound2-dev
      - libegl1-mesa-dev
      - libgl1-mesa-dev
      - libgles2-mesa-dev
      - mesa-common-dev
      - pkg-config
      - libudev-dev
    stage-packages:
      - libevdev2
    after: [desktop-gtk2, alsa]

    # use prime to select specific packages

# TODOS:
#   * have to setup docker image to test on clean environment for further customization
#   * add a stable channel and all the specific releases
#   * research on cmake usage with snapcraft
#   * research on gradle integration for android testing
