emulators/mame: Increasing option granularity woes

From: Alastair Hogge <agh_at_riseup.net>
Date: Fri, 23 Feb 2024 02:51:10 UTC
Hello,

The current in-tree port of mame, 0.261, is built around the core
multi-emulation framework, which results in the usual mega monolithic
mame binary. There are options for TOOLS, which include two other
emulators. The current upstream release, 0.262 has enabled separation of
mame from the rest of the project—TOOLS can now be built separately. I
would like to reflect this in the Port, however, that means moving the
two added emulators (LaserDisk player, and Netlist resolver) out of
TOOLS (which I think the correct path to take). Considering the new
upstream build pattern, I would like to configure the Port to option any
of the emulators, and existing TOOLS. The problem I am facing, the three
emulators require the same (or close to it) runtime config/resources,
the assets are currently covered by the do-install target[1], how do I
cover the assets in the Port, specifically in the pkg-plist to be
conditioned on either of 3 potential emulator options? Should I add an
option MAMEDATA? But then that moves the problem to the user, why should
the user make a choice to install the runtime data, if they select any
emulator, the Port should automate that? How can I avoid fixing the data
to only one emulator option?

In summary, the current Port is structured as a monolith with optional
tools (including two other emulators fixed to the bulk MAME build),
enabling a Qt debugger for the emulators, enabling platform
optimisation, and object production type. What I am attempting, which is
not proving successful, a minimal port (which is a single project man
page, tho would be nicer to have at a minimum TOOLS or at least one
emulator), adding new options for the current 3 build-able emulators,
separate TOOLS from the emulators, and a way to install the data if any
emulator is selected, the last element being the most difficult.

Any feedback would be muchly appreciated.

1:
https://codeberg.org/FreeBSD/freebsd-ports/src/commit/7ec8098ee3483dc19cbd23e16139a737d601153a/emulators/mame/Makefile#L189

To anarchy and health,
Alastair