This is an old wound, I know. I also know that libraries should not have lib stripping, or so I hear. Therefore, I am wondering about addons themselves.
LibStub, CallbackHandler-1.0, and LibDataBroker-1.1 should not be disembedded. Is the following toc acceptable?
## OptionalDeps: Ace3, LibOne, LibTwo, LibDBIcon-1.0
-- these cannot be stripped
LibDBIcon-1.0\LibDBIcon-1.0.lua -- must be loaded after LibDataBroker-1.1
Further, in the pkgmeta, I am using tools-used for LDB-1.1; is that better than putting it in the externals? Should LS and CBH be put in tools-used or in externals?
Every addon's toc I look at that has stripping puts LS and CBH in the stripping, as the first two entries, yet I hear neither should be directly in the AddOns folder. Just to further muddle things, what about registering callbacks and loading libs in the addon?
Every addon you look at has CBH and Libstub stripped. This is simply because if the user chose a no-lib installation, then Ace3 would be installed disembedded. Ace3 itself is a package of libraries that contains and uses both LibStub and CBH. Thus, the main addon doesn't need to include them.
If an addon (or library) is using CBH or LibStub directly, without using Ace3, then yes, they cannot be stripped.
Thus your TOC should have CBH and libstub moved into the strip, something like what Omen does here:
Due to library load ordering, you'll see LDB is not stripped in the middle there. The usage of the "Libs" subfolder for all the libraries that an addon uses is just a convention, I see you haven't used them in your TOC.
In that case, one could put LDB into the externals. Do the externals grant curse points as well?
Yes, but that's not why you can't list LDB as an external. Tekkub (LDB's creator) has decreed that LDB shalt not be runneth standalone, so if you list it as an external, then it will be "missing" for people who download the -nolib version of your addon. The Curse Client will still install LDB in the AddOns folder, but LDB doesn't have a TOC file, so WoW won't load it that way. I strongly disagree with Tekkub's decision in this case, and I don't think that this particular principle ("embeddable libraries should always be embedded") is remotely important enough to justify the pain in the ass it is for everyone else to deal with. And, LDB is "all rights reserved" so nobody can distribute a version with a TOC either. :rolleyes: