diff --git a/pkgs/applications/emulators/mame/001-use-absolute-paths.diff b/pkgs/applications/emulators/mame/001-use-absolute-paths.diff index e349cacb2d96..2acd6b78e21f 100644 --- a/pkgs/applications/emulators/mame/001-use-absolute-paths.diff +++ b/pkgs/applications/emulators/mame/001-use-absolute-paths.diff @@ -1,8 +1,8 @@ diff --git a/src/emu/emuopts.cpp b/src/emu/emuopts.cpp -index 3defd33d0bb..33daacc4fc8 100644 +index 834710c9eb0..6394ad8a7bc 100644 --- a/src/emu/emuopts.cpp +++ b/src/emu/emuopts.cpp -@@ -39,16 +39,16 @@ const options_entry emu_options::s_option_entries[] = +@@ -42,16 +42,16 @@ const options_entry emu_options::s_option_entries[] = { nullptr, nullptr, core_options::option_type::HEADER, "CORE SEARCH PATH OPTIONS" }, { OPTION_PLUGINDATAPATH, ".", core_options::option_type::PATH, "path to base folder for plugin data (read/write)" }, { OPTION_MEDIAPATH ";rp;biospath;bp", "roms", core_options::option_type::MULTIPATH, "path to ROM sets and hard disk images" }, @@ -27,3 +27,16 @@ index 3defd33d0bb..33daacc4fc8 100644 { OPTION_SWPATH, "software", core_options::option_type::MULTIPATH, "path to loose software" }, // output directory options +diff --git a/src/osd/modules/lib/osdobj_common.cpp b/src/osd/modules/lib/osdobj_common.cpp +index 82fabfdc0ba..eefdaba7fbe 100644 +--- a/src/osd/modules/lib/osdobj_common.cpp ++++ b/src/osd/modules/lib/osdobj_common.cpp +@@ -158,7 +158,7 @@ const options_entry osd_options::s_option_entries[] = + { OSDOPTION_NETWORK_PROVIDER, OSDOPTVAL_AUTO, core_options::option_type::STRING, "Emulated networking provider: " }, + + { nullptr, nullptr, core_options::option_type::HEADER, "BGFX POST-PROCESSING OPTIONS" }, +- { OSDOPTION_BGFX_PATH, "bgfx", core_options::option_type::PATH, "path to BGFX-related files" }, ++ { OSDOPTION_BGFX_PATH, "@mamePath@/bgfx", core_options::option_type::PATH, "path to BGFX-related files" }, + { OSDOPTION_BGFX_BACKEND, "auto", core_options::option_type::STRING, "BGFX backend to use (d3d9, d3d11, d3d12, metal, opengl, gles, vulkan)" }, + { OSDOPTION_BGFX_DEBUG, "0", core_options::option_type::BOOLEAN, "enable BGFX debugging statistics" }, + { OSDOPTION_BGFX_SCREEN_CHAINS, "", core_options::option_type::STRING, "comma-delimited list of screen chain JSON names, colon-delimited per-window" }, diff --git a/pkgs/applications/emulators/mame/default.nix b/pkgs/applications/emulators/mame/default.nix index 0db8ba1d4996..e4e6c97518a3 100644 --- a/pkgs/applications/emulators/mame/default.nix +++ b/pkgs/applications/emulators/mame/default.nix @@ -123,8 +123,10 @@ stdenv.mkDerivation rec { # it is not possible to use substituteAll postPatch = '' - substituteInPlace src/emu/emuopts.cpp \ - --subst-var-by mamePath "$out/opt/mame" + for file in src/emu/emuopts.cpp src/osd/modules/lib/osdobj_common.cpp; do + substituteInPlace "$file" \ + --subst-var-by mamePath "$out/opt/mame" + done '' # MAME's build system uses `sw_vers` to test whether it needs to link with # the Metal framework or not. However: