Hi all,
The original package splitting approach in makepkg was aligned to the
KDE packaging approach (at the time) where each component had its own
"make install-foo" target. In practice, distributions want to split a
wider variety of packages that do not fit this mould, and various hacks
have arisen.
I have implemented a second approach to package splitting that can be
used in parallel to the current one. A PKGBUILD can provide a stash()
function that is run (in fakeroot) between building and packaging. This
function will typically do the full install of the built software into
the $stashdir directory. I.e. run a command similar to make
DESTDIR=$stashdir install. Each package_foo() function can then include
a list of files that are transferred from the stash into the package, in
addition to any other packaging commands.
For example:
filelist=('usr/bin/pacman'
'usr/lib/*')
The filelist accepts glob patterns as understood by bash with extglob
enabled - including *, ? and []. Files can be excluded from the filelist
by prefixing with the ! character.
Files are removed from the stash as they are included in packages. This
allows makepkg to warn about any files that are not packaged. To include
files in multiple packages, an additional copy should be made in the
stash function.
You can see the change here
https://gitlab.archlinux.org/pacman/pacman/-/merge_requests/314
This patch applies cleanly to 7.1.0, and I suspect will also to 7.0.0 (I
have not checked...)
An example of changing the elfutils set of packages to use the new approach:
https://gitlab.archlinux.org/archlinux/packaging/packages/elfutils/-/merge_requests/2
I need help testing this approach. While it works for the packages I
have tested, I'm sure there will be edge cases I was not expecting, or
people will use the functionality in unexpected ways. Any reports of
success/failure in using this feature would be very helpful.
Thanks,
Allan