One of the big issues we’re having with wrappers is nested wrappers. It is not uncommon that during a build nested wrappers are created, either automatically using setup hooks, manually, or as a combination.
Furthermore, the behaviour when having multiple setup hooks is also not always obvious. E.g.,
wrapQtAppsHook ignores scripts whereas other hooks typically do not.
Earlier I suggested the concept of declarative wrappers, but there are limitations to that as well. Specifically, not all the information that is needed to generate wrappers is known up front, increasing the burden of writing derivations.
I now suggest that hooks do not actually create wrappers, but simply “tell” what needs to be done for a path, e.g. in a JSON file or a shell array. After all “normal” setup hooks are executed, we run a hook that invokes
wrapProgram for the paths mentioned in the file or array.