The only remaining issue is that, if you try to uninstall NimDBX, you get a warning "Cannot completely remove /Users/xxx/.nimble/pkgs/nimdbx-0.4.1. Files not installed by nimble are present." This happens because object files are created in the libmdbx directory when it builds. Not sure what to do about that.
I’m just used to Apache-licensing everything because that’s what we use at work. TBH I’m not that aware of the subtle differences between that, BSD and MIT.
(I’m not a fan of coercive licenses like GPL. I’m actually kind of amused to hear that my using Apache causes problems with GPL code, because I’m used to the reverse — i.e. I find a useful library but “oh crap, it’s GPL, we can’t use it” or “oh crap, it’s LGPL, we’d have to wait a month getting permission from Legal first.”)
But anyway, it does seem a good idea to adopt the same license as the library this is built on, so I’ll change it to OpenLDAP or BSD when I get a chance.
Apache 2.0 is basically MIT or BSD 2-clause (also called Simplified BSD) with the addition of a royalty-free patent grant. The BSD 3-clause (also called New BSD) adds a line stating that the contributor's names can't be used to promote products derived from the software without prior permission. I highly suggest picking BSD 3-clause since it's a much more widely adopted license than OpenLDAP and it's functionally equivalent.
In case you're mildly interested, I agree the GPL situation is a headache in more ways than one. Apache 2.0 is compatible with (L)GPLv3 but not (L)GPLv2, yet v3 places even more restrictions on distribution than v2. Because of that, v2 code is incompatible with v3 code unless specifically mentioned. Thankfully MIT and BSD are compatible with both v2 and v3.
Personally I'm a fan of MPL 2.0 for libraries since it's copyleft with a patent grant but on a per-file level so it's not "viral" like (L)GPL. It allows static linking to proprietary programs as long as you make the MPL 2.0 source files available on request, instead of the entire program or object files like (L)GPL. If you didn't modify the files, you just have to point to where you got the library from. It's the most fair copyleft license in my opinion. And as a bonus, it's compatible with (L)GPLv2 and v3 by default.
I've been messing with nimterop, which solves their 3rd party source problem like so: They use getCachedDir() to put the wrapped libraryinto an unrelated location. So if I install a nimterop based package, on my linux machine I will get the package contents in ~/.nimble/pkg/mypackage-1.2.3, and the related 3rd party package in ~/.cache/nim/nimterop/library-wrapped-by-mypackage. So I suppose a quickish fix would be to copy your committed source directory to a cache directory before building, and adjusting your linking code.
Alternatively, you could try write code to remove all build artifacts using a "before install" or "after install" hooks in your nimble file- or use those to remove the cache directory if used.