Changes to the handling of PKGBUILD variables in split packages
The body of articles related to packaging guidelines and creating, maintaining, and reviewing packages includes very little about split packages, specifically how they differ from their non-split counterparts and what guidelines or conventions should be reflected in PKGBUILDs for split packages. There are some inconsistencies between what's documented on ArchWiki and what is implemented in pacman/makepkg. (I'll try to re-find the inconsistencies I've encountered.)
#pkgbase documents, "Everything, except #makedepends, #Sources, and #Integrity variables can be overridden within each split package's
package() function", while the actual code of makepkg seems to allow overrides for a subset of those variables as defined in the following:
splitpkg_overrides=('pkgdesc' 'arch' 'url' 'license' 'groups' 'depends' 'optdepends' 'provides' 'conflicts' 'replaces' 'backup' 'options' 'install' 'changelog')
Specifically, #Version and #checkdepends variables are not part of that overrides' array but are not mentioned in #pkgbase. Is makepkg missing the ability to process overrides for these variables or is the documentation inaccurate in not listing these variables as not subject to overrides?
- All options and directives for the split packages default to the global values given in
- the PKGBUILD. Nevertheless, the following ones can be overridden within each split
- package’s packaging function: pkgdesc, arch, url, license, groups, depends, optdepends,
- provides, conflicts, replaces, backup, options, install, and changelog.
- Just realised this post is two years old. Maybe the man page was not clear at the time.
- It's certainly clear now though so I think it's safe to change it.
- Morganamilo (talk) 21:09, 9 June 2018 (UTC)
Undo "Remove incorrect warning"
package()is only useful for split packaging. You should not do this for single packages, even if you know the dependencies are run time only.
I believe this warning is valid. Sure makepkg will allow you to override the depends on a singular package. But I don't think this is recommended at all and is a needless complication.
Without the warning, clarifying that depends inside of
package() are run time only might give readers that this should be done any time they have run time only depends but that is not the case.
Morganamilo (talk) 21:40, 9 June 2018 (UTC)
- It is also perfectly acceptable when repackaging pre-built binaries. Putting this restriction in here has no basis in fact and is just plain wrong.
- Scimmia (talk) 21:45, 9 June 2018 (UTC)
- Alright if that's the case I guess the warning was overkill. I still would like to see at least a note of some sort saying that you don't need to go separating the make only and run only dependencies. It is perfectly acceptable to put run time deps in the global depends.