Different approach, patch in default ini search path

This commit is contained in:
Jason Flatt 2022-08-01 14:15:20 -07:00
parent 658cc63c36
commit 47dadd2d42
4 changed files with 55 additions and 1 deletions

View file

@ -30,6 +30,9 @@ An explanation for some of the options included in the `org.mamedev.MAME.yaml' m
Currently these are the patches applied:
`inipath.patch` 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'.
`ldopts.patch` enables an option for the linker to strip debug symbols.
`use-system-lib-flac.patch` works around FORTIFY_SOURCE compiler option that causes errors in the included libflac.

13
inipath.patch Normal file
View file

@ -0,0 +1,13 @@
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

33
mame.ini Normal file
View file

@ -0,0 +1,33 @@
#
# CORE SEARCH PATH OPTIONS
#
homepath $HOME/.mame
rompath /app/share/mame/roms
hashpath /app/share/mame/hash
samplepath /app/share/mame/samples
artpath /app/share/mame/artwork
ctrlrpath /app/share/mame/ctrlr
inipath $HOME/.mame;/app/share/mame/ini
fontpath /app/bin/
cheatpath /app/share/mame/cheat
crosshairpath /app/share/mame/crosshair
pluginspath /app/share/mame/plugins
languagepath /app/share/mame/language
swpath /app/share/mame/software
#
# CORE OUTPUT DIRECTORY OPTIONS
#
cfg_directory $HOME/.mame/cfg
nvram_directory $HOME/.mame/nvram
input_directory $HOME/.mame/inp
state_directory $HOME/.mame/sta
snapshot_directory $HOME/.mame/snap
diff_directory $HOME/.mame/diff
comment_directory $HOME/.mame/comments
share_directory $HOME/.mame/share
#
# OSD VIDEO OPTIONS
#
video opengl

View file

@ -39,6 +39,7 @@ modules:
- cp -r hash/ ${FLATPAK_DEST}/share/mame/
- cp -r hlsl/ ${FLATPAK_DEST}/share/mame/
- cp -r ini/ ${FLATPAK_DEST}/share/mame/
- install -Dm 0644 mame.ini ${FLATPAK_DEST}/share/mame/ini/mame.ini
- cp -r language/ ${FLATPAK_DEST}/share/mame/
- cp -r plugins/ ${FLATPAK_DEST}/share/mame/
- cp -r roms/ ${FLATPAK_DEST}/share/mame/
@ -53,7 +54,11 @@ modules:
path: org.mamedev.MAME.desktop
- type: file
path: org.mamedev.MAME.metainfo.xml
- type: file
path: mame.ini
- type: patch
path: use-system-lib-flac.patch
path: inipath.patch
- type: patch
path: ldopts.patch
- type: patch
path: use-system-lib-flac.patch