Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a _supported_ID function for modules #3907

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

joolswills
Copy link
Member

@joolswills joolswills commented Apr 22, 2024

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.

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
The scriptmodule requires Python2 and python modules that are no longer packaged.
@joolswills
Copy link
Member Author

joolswills commented Apr 23, 2024

@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
Copy link
Member Author

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

@joolswills joolswills mentioned this pull request Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant