id: org.mamedev.MAME
runtime: org.kde.Platform
runtime-version: 5.15-21.08
sdk: org.kde.Sdk
command: mame
separate-locales: false
finish-args:
  - --device=all
  - --persist=.mame
  - --filesystem=home
  - --filesystem=host:ro
  - --share=network
  - --share=ipc
  - --socket=fallback-x11
  - --socket=pulseaudio
  - --socket=wayland
  - --allow=bluetooth
modules:
  - name: mame
    buildsystem: simple
    build-options:
      no-debuginfo: true
      strip: true
    build-commands:
      - make -j ${FLATPAK_BUILDER_N_JOBS}
      - install -Dm 0755 mame /app/bin/mame
      - install -Dm 0644 ${FLATPAK_ID}.desktop /app/share/applications/${FLATPAK_ID}.desktop
      - install -Dm 0644 ${FLATPAK_ID}.metainfo.xml /app/share/metainfo/${FLATPAK_ID}.metainfo.xml
      - install -Dm 0644 mame128x128.png /app/share/icons/hicolor/128x128/apps/${FLATPAK_ID}.png
      - cp COPYING /app/bin/
      - cp uismall.bdf /app/bin/
      - mkdir -p /app/share/mame/
      - cp -r artwork/ /app/share/mame/
      - cp -r bgfx/ /app/share/mame/
      - cp -r ctrlr/ /app/share/mame/
      - mkdir -p /app/share/mame/docs/
      - cp -r docs/legal/ /app/share/mame/docs/
      - cp -r docs/man/ /app/share/mame/docs
      - cp -r hash/ /app/share/mame/
      - cp -r hlsl/ /app/share/mame/
      - cp -r ini/ /app/share/mame/
      - cp -r language/ /app/share/mame/
      - cp -r plugins/ /app/share/mame/
      - cp -r roms/ /app/share/mame/
      - cp -r samples/ /app/share/mame/
    sources:
    - type: archive
      url: https://github.com/mamedev/mame/archive/refs/tags/mame0245.tar.gz
      sha256: 3b6ea528c9b6d6a5bfec289c4c5ee0282eea00836f4c261336923597b89b95bc
    - type: file
      path: mame128x128.png
    - type: file
      path: org.mamedev.MAME.desktop
    - type: file
      path: org.mamedev.MAME.metainfo.xml
    - type: patch
      path: use-system-lib-flac.patch
    - type: patch
      path: ldopts.patch