Summary: | Is it allowed to support multiples build systems from one ebuild ? | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Fab <netbox253> |
Component: | Unclassified | Assignee: | Portage team <dev-portage> |
Status: | RESOLVED INVALID | ||
Severity: | normal | ||
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=626054 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Fab
2022-02-09 12:15:02 UTC
It is not allowed to do this. You should be inheriting each eclass that you need. You may not modify inherits via the environment: https://devmanual.gentoo.org/general-concepts/portage-cache/index.html. What you may want to do is have a variable at the top you flip or something like that. But you can't do it via an environment variable. You could maybe have a _pN where N is even == meson, N is odd == cmake or something, or just change a variable at the top of the ebuild when testing. Well, strictly speaking there is no technical rule against supporting two build systems as long as their respective eclasses permit that. However, the ebuild metadata must be immutable, i.e. environment variables must not cause things like inherits or dependencies to change. This is necessary for caching to work correctly. So technically you could inherit all the necessary eclasses and switch the phases appropriately but the ebuild would end up depending on both build systems, i.e. in both cases you'd have extraneous dependencies. Now, you could get around that by replacing the envvar with USE flags or || blocks and detecting which build system is available and using that. However, such an ebuild would not be accepted into ::gentoo as containing a lot of unnecessary complexity. If both build systems are equivalent, settle on one and use it. If they're not, use the one that's better (e.g. more functional). |