From 4af36525ebd85fe58ddd96271a6cc0193db75c70 Mon Sep 17 00:00:00 2001
From: Jason Flatt <jflatt@cox.net>
Date: Wed, 31 Aug 2022 14:12:02 -0700
Subject: [PATCH] Remove ini patch

---
 README.md             |  2 +-
 inipath.patch         | 13 -------------
 org.mamedev.MAME.yaml |  8 +++++---
 3 files changed, 6 insertions(+), 17 deletions(-)
 delete mode 100644 inipath.patch

diff --git a/README.md b/README.md
index 0ea308c..4458570 100644
--- a/README.md
+++ b/README.md
@@ -28,4 +28,4 @@ An explanation for some of the options included in the `org.mamedev.MAME.yaml' m
 
 ### Configuring
 
-Default ini paths include the home '\~/.mame' directory and two relative paths '.' and 'ini'.  The relative paths are not helpful inside the sandbox, and the '\~/.mame' contents shouldn't be overwritten with each new MAME release.  Instead the default ini search path is patched to '$HOME/.mame;/app/share/mame/ini'.  This will allow a default base ini in '/app/share/mame/ini/mame.ini' and can be overridden in '\~/.mame/mame.ini'.
+The default ini paths include the home `~/.mame` directory and two relative paths '.' and 'ini'.  The relative paths are not helpful inside the sandbox, and the `~/.mame` contents shouldn't be overwritten with each new MAME release.  Instead the default ini search path is patched to `$HOME/.mame;/app/share/mame/ini`.  This will allow a default base ini in `/app/share/mame/ini/mame.ini` and can be overridden in `~/.mame/mame.ini`.
diff --git a/inipath.patch b/inipath.patch
deleted file mode 100644
index 563c6e7..0000000
--- a/inipath.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/src/osd/sdl/sdlmain.cpp b/src/osd/sdl/sdlmain.cpp
-index f238c7bd..dd6f2e4f 100644
---- a/src/osd/sdl/sdlmain.cpp
-+++ b/src/osd/sdl/sdlmain.cpp
-@@ -58,7 +58,7 @@
- #elif defined(SDLMAME_MACOSX)
- 	#define INI_PATH "$HOME/Library/Application Support/APP_NAME;$HOME/.APP_NAME;.;ini"
- #else
--	#define INI_PATH "$HOME/.APP_NAME;.;ini"
-+	#define INI_PATH "$HOME/.APP_NAME;/app/share/APP_NAME/ini"
- #endif // MACOSX
- #endif // INI_PATH
- 
diff --git a/org.mamedev.MAME.yaml b/org.mamedev.MAME.yaml
index 68f6d07..0340ccc 100644
--- a/org.mamedev.MAME.yaml
+++ b/org.mamedev.MAME.yaml
@@ -22,7 +22,11 @@ modules:
       no-debuginfo: true
       strip: true
     build-commands:
-      - make -j ${FLATPAK_BUILDER_N_JOBS} USE_SYSTEM_LIB_FLAC=1 LDOPTS=-Wl,-s
+      - make
+          -j ${FLATPAK_BUILDER_N_JOBS}
+          USE_SYSTEM_LIB_FLAC=1
+          SDL_INI_PATH='$$HOME/.APP_NAME;/app/share/APP_NAME/ini'
+          LDOPTS=-Wl,-s
       - install -Dm 0755 mame ${FLATPAK_DEST}/bin/mame
       - install -Dm 0644 ${FLATPAK_ID}.desktop ${FLATPAK_DEST}/share/applications/${FLATPAK_ID}.desktop
       - install -Dm 0644 ${FLATPAK_ID}.metainfo.xml ${FLATPAK_DEST}/share/metainfo/${FLATPAK_ID}.metainfo.xml
@@ -74,5 +78,3 @@ modules:
         path: org.mamedev.MAME.metainfo.xml
       - type: file
         path: mame.ini
-      - type: patch
-        path: inipath.patch