RetroPie / RetroPie-Setup

Shell script to set up a Raspberry Pi/Odroid/PC with RetroArch emulator and various cores
Other
9.99k stars 1.38k forks source link

Add a _supported_ID function for modules #3907

Closed joolswills closed 1 month ago

joolswills commented 2 months ago

packages - add a _supported_ID function for modules:

If a scriptmodule has a _supported_MODULEID() function it will be called when the scriptmodule is added. If the function returns 1, the module is not supported and will be disabled.

This can be used to do additional OS/GCC version checks.

Migrate the depends_ checks in dolphin, mame, ti99sim, lr-bsnes, lr-flycast-dev and lr-mame to supported function.

This will disable the modules when the GCC is too old rather than throwing an error when trying to build

mysticmine - Disable on Debian versions newer than 10 (buster)

--

Some other modules could probably benefit from this (eg fs-uae) and maybe some I missed. I was originally going to handle this with some logic/comparisons in the module flags, but I think this is simpler and more flexible.

Needs some testing.

joolswills commented 2 months ago

@cmitu I revisited this and decided to redo it using module flags with the format: not:$_VAR:-lt:7 for excluding based on the comparison. I think I now prefer it as a flag but will open another PR for review and comments.

joolswills commented 2 months ago

Actually it might be more consistent to use the format !:$_VAR:-lt:7.

joolswills commented 1 month ago

Closing in favour of #3909