This is probably more of a Portmod 3.0 feature (or 2.x, given that this doesn't really break anything in the current spec), but there are certain aspects of it that could be implemented sooner.
The basic idea is to create a specification for a build file, very similar to existing pybuilds, which could be included in a mod and used to provide the metadata that portmod uses.
In its simplest form, I would suggest a
package.pybuild file (or package.yaml in case of #167 (closed)), which includes an additional field called
ATOM to specify the package atom and version.
We could have a command line tool that submits the information to a repository, similar to systems used by the Python Package Index, or Rust's cargo (might need something custom to automatically merge changes, as well as a separate, uncurated repository).
For mods which are redistributable, we could even have the same tool package and upload the mod's sources (Additional packaging information such as additional files and directories to include beyond InstallDirs would be needed).
Another thing that could be done is to have the default implementations of
src_install make use of the scripts in the packaged version of the file. That way we wouldn't need to specify in the repository any custom prepare/install scripts. Obviously this wouldn't work for src_unpack, and perhaps some of the other scripts, as it would only work once the build file has been unpacked from the source archive. This bundled build file would also need to be installed into the VDB (assuming that re-installing from VDB is ever fully possible).
This would be relatively easy to implement, however the infrastructure required to allow mod authors to submit their own mods would be more significant.
- While it's useful to have keywording such that mod authors can declare which archs are compatible with their mods, we may want to force unstable keywords on any submissions in an un-curated system, given that there would be no guarantees of stability.
- Portmod is designed to be decentralized, so such package files might only make sense within the context of a particular repository. One option would be to include the repository in the
package.yamlfile (perhaps in the name, so that you could include multiple package files side by side for different repositories).
- We probably shouldn't allow uncurated source uploads, to avoid people uploading files they don't have the rights to redistribute (such as Bethesda's assets, or derivatives of them), but we could have uncurated submissions of mods, with approval required for those who want to also upload archives for the first upload of each mod.