Hello,
Sharing an idea and implementation.
Some ebuilds in Sabayon are split (things like separate one for gtk, qt,
mono etc.) which is necessary in binary distributions to avoid bloat.
Maintaing such split ebuilds isn't very exciting (textual and logical
merging of changes, testing), and I'm trying a few approaches to
simplify it from different angles, and reduce mistakes.[1]
Here is one approach: all code in a single template file, with things like:
{% if pkg == "gtk3" %}
so it's like another dimension with use flags on how the package is
configured.
Constructive feedback is welcome. Anyway actual support of split ebuilds
in Portage (then Entropy) would be better. :)
https://github.com/Sabayon/sabayon-distro/commit/d9cd87cd16b1ab43ca3d9cf943757b848c4131f3
[net-dns] add Jinja2 template and gen. script for avahi
It generates exactly how the ebuilds look like for easier testing.
As stated in the comment, it can be cleaned a bit, but still it could be
easier during version and revision bumps (applying changes to ebuilds.)
Time will tell; it's an experiment, and moving back to previous
(hopefully only after due consideration!) is as easy as just starting
to use the generated ebuilds.
[1] One of them was three way merges with Gentoo using git, with rerere,
but for the most part split ebuilds differ enough to produce many
conflicts and the end result isn't as helpful as it might be.