diff --git a/0.244-ptrdiff_t.patch b/0.244-ptrdiff_t.patch new file mode 100644 index 0000000..e3c0b16 --- /dev/null +++ b/0.244-ptrdiff_t.patch @@ -0,0 +1,12 @@ +diff --git a/src/lib/netlist/plib/ppmf.h b/src/lib/netlist/plib/ppmf.h +index b188ca0c..e037fc28 100644 +--- a/src/lib/netlist/plib/ppmf.h ++++ b/src/lib/netlist/plib/ppmf.h +@@ -82,6 +82,7 @@ namespace plib { + + #include + #include // uintptr_t ++#include + #include + #include + diff --git a/README.md b/README.md new file mode 100644 index 0000000..6474732 --- /dev/null +++ b/README.md @@ -0,0 +1,39 @@ +## Flatpak + +This is a method for distributing MAME using the Flatpak format. The main reason for this is on locked down systems that only allow sandboxed user applications. + +## Security + +The use of Flatpak here is not intended to secure MAME or provide any isolation from the rest of your system. MAME requires access to many of your systems resources including, but not limited to, devices for controllers, X11 sessions, filesystems writable for configuration and readable for data files, networking, and audio. The Flatpak provided sandbox must be opened up in many areas for MAME to function properly. + +## Building + +`build_icons.sh` will download the logo from the [https://www.mamedev.org](https://www.mamedev.org) site and resize it to various sizes to use as an icon. + +`build_local.sh` will invoke the `flatpak-builder` application to compile MAME and generate a Flatpak package. + +`org.mamedev.MAME.yaml` is the main Flatpak manifest that includes build and install information. + +### Manifest + +An explanation for some of the options included in the `org.mamedev.MAME.yaml' manifest file. + +`org.kde.Platform` is used for its Qt support, required to build the MAME debugger. + +`--device=all` added to allow various input devices, controllers, etc. + +`--persist=.mame` writable location used for cfg, diff, nvram, etc. + +`--filesystem=host:ro` primarily to be used for external data, roms, samples, etc. + +`post-install` section used to copy MAME built-in directories. + +### Patches + +Currently these are the patches applied: + +`0.244-ptrdiff_t.patch` includes `` header to find `ptrdiff_t` type in the 0.244 release. + +`use-system-lib-flac.patch` works around FORTIFY_SOURCE compiler option that causes errors in the included libflac. + +`ldopts.patch` enables an option for the linker to strip debug symbols. diff --git a/ldopts.patch b/ldopts.patch new file mode 100644 index 0000000..19f00a3 --- /dev/null +++ b/ldopts.patch @@ -0,0 +1,13 @@ +diff --git a/makefile b/makefile +index c5cedbc0..727320e5 100644 +--- a/makefile ++++ b/makefile +@@ -60,7 +60,7 @@ + # ARCHOPTS_OBJC = + # ARCHOPTS_OBJCXX = + # OPT_FLAGS = +-# LDOPTS = ++LDOPTS = -Wl,-s + + # USE_SYSTEM_LIB_ASIO = 1 + # USE_SYSTEM_LIB_EXPAT = 1 diff --git a/mame128x128.png b/mame128x128.png new file mode 100644 index 0000000..5b06b1c Binary files /dev/null and b/mame128x128.png differ diff --git a/mame256x256.png b/mame256x256.png new file mode 100644 index 0000000..5dbab8b Binary files /dev/null and b/mame256x256.png differ diff --git a/mame32x32.png b/mame32x32.png new file mode 100644 index 0000000..c0dd878 Binary files /dev/null and b/mame32x32.png differ diff --git a/mame48x48.png b/mame48x48.png new file mode 100644 index 0000000..a8bd817 Binary files /dev/null and b/mame48x48.png differ diff --git a/mame64x64.png b/mame64x64.png new file mode 100644 index 0000000..d420873 Binary files /dev/null and b/mame64x64.png differ diff --git a/org.mamedev.MAME.desktop b/org.mamedev.MAME.desktop new file mode 100644 index 0000000..8d04e80 --- /dev/null +++ b/org.mamedev.MAME.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Name=MAME +Exec=mame +Type=Application +Icon=org.mamedev.MAME +Categories=Game;ArcadeGame;Emulator diff --git a/org.mamedev.MAME.metainfo.xml b/org.mamedev.MAME.metainfo.xml new file mode 100644 index 0000000..04094d8 --- /dev/null +++ b/org.mamedev.MAME.metainfo.xml @@ -0,0 +1,25 @@ + + + org.mamedev.MAME + CC0-1.0 + MAME + + MAME is a multi-purpose emulation framework. + + +

MAME's purpose is to preserve decades of software history. As electronic technology continues to rush forward, MAME prevents this important "vintage" software from being lost and forgotten. This is achieved by documenting the hardware and how it functions. The source code to MAME serves as this documentation. The fact that the software is usable serves primarily to validate the accuracy of the documentation (how else can you prove that you have recreated the hardware faithfully?). Over time, MAME (originally stood for Multiple Arcade Machine Emulator) absorbed the sister-project MESS (Multi Emulator Super System), so MAME now documents a wide variety of (mostly vintage) computers, video game consoles and calculators, in addition to the arcade video games that were its initial focus.

+
+ + Game + ArcadeGame + Emulator + + https://www.mamedev.org + org.mamedev.MAME.desktop + + + + + mame + +
diff --git a/org.mamedev.MAME.yaml b/org.mamedev.MAME.yaml new file mode 100644 index 0000000..4e2dec6 --- /dev/null +++ b/org.mamedev.MAME.yaml @@ -0,0 +1,72 @@ +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=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 + - | + for i in 32 48 64 128 256; do + install -Dm 0644 mame${i}x${i}.png /app/share/icons/hicolor/${i}x${i}/apps/${FLATPAK_ID}.png + done + sources: + - type: archive + url: https://github.com/mamedev/mame/archive/refs/tags/mame0244.tar.gz + sha256: 843c917edc46008a27b439a1fc66fc12a27c84e55e08753b963789e5614cebf7 + - type: file + path: mame32x32.png + - type: file + path: mame48x48.png + - type: file + path: mame64x64.png + - type: file + path: mame128x128.png + - type: file + path: mame256x256.png + - type: file + path: org.mamedev.MAME.desktop + - type: file + path: org.mamedev.MAME.metainfo.xml + - type: patch + path: 0.244-ptrdiff_t.patch + - type: patch + path: use-system-lib-flac.patch + - type: patch + path: ldopts.patch + post-install: + - 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/ diff --git a/use-system-lib-flac.patch b/use-system-lib-flac.patch new file mode 100644 index 0000000..1f7b180 --- /dev/null +++ b/use-system-lib-flac.patch @@ -0,0 +1,13 @@ +diff --git a/makefile b/makefile +index c5cedbc0..797ea027 100644 +--- a/makefile ++++ b/makefile +@@ -66,7 +66,7 @@ + # USE_SYSTEM_LIB_EXPAT = 1 + # USE_SYSTEM_LIB_ZLIB = 1 + # USE_SYSTEM_LIB_JPEG = 1 +-# USE_SYSTEM_LIB_FLAC = 1 ++USE_SYSTEM_LIB_FLAC = 1 + # USE_SYSTEM_LIB_LUA = 1 + # USE_SYSTEM_LIB_SQLITE3 = 1 + # USE_SYSTEM_LIB_PORTMIDI = 1