My extremely embarassing script for getting the DLLs is as follows, but at least it avoids a WINE dependency:
STAGING=/tmp/myqemu/ make install prefix=$STAGING #todo: probably better to walk these dependencies in a loop, and not use grep (but seriously, where's the mingw dumpbin) FIRST=$(strings $STAGING/*.exe | grep '\.dll' | sort -u | xargs -I{} readlink -e /usr/x86_64-w64-mingw32/sys-root/mingw/bin/{}) SECOND=$(for d in $FIRST; do strings $d | grep '\.dll' | sort -u | xargs -I{} readlink -e /usr/x86_64-w64-mingw32/sys-root/mingw/bin/{}; done) THIRD=$(for d in $SECOND; do strings $d | grep '\.dll' | sort -u | xargs -I{} readlink -e /usr/x86_64-w64-mingw32/sys-root/mingw/bin/{}; done) echo $FIRST $SECOND $THIRD | sed 's/ /\n/g' | sort -u | xargs -I{} cp -v {} $STAGING --Adam On Thu, 31 Jan 2019 at 21:49, Daniel P. Berrangé <berra...@redhat.com> wrote: > > On Thu, Jan 31, 2019 at 02:45:13PM +1100, Adam Baxter wrote: > > Hi, > > How do I gather and include the required DLLs (SDL, zlib etc) in the NSIS > > installer? (and also in a standalone build to be zipped up, but that's less > > important) > > > > I noticed the wiki doesn't really mention bundling dependencies anywhere. > > > > The official unofficial windows builds are documented at > > https://qemu.weilnetz.de/FAQ but this doesn't cover building the actual > > installer. > > Yeah, this is a pretty major ommision in QEMU's build rules for the NSIS > installer making it pretty much useless as is. We really need to expand > it so that it can resolve the dlls that qemu .exe's need, locate them > on the host and bundle them into the installer automatically. > > It seems we can get a list of deps for an .exe using > > $ winedump -j import /path/to/binary.exe | grep offset | grep dll | awk > '{print $3}' > > We would need to run that for each .exe we're bundling. I think we might > need to also then run that recursively for each .dll to get the transitive > set of required dlls. > > Even this is not entirely satisfactory though, as it is blindly assuming > that the only thing we need in the QEMU installer is the dlls themselves. > GTK at least has other resources used at runtime besides the dll that > should be bundled. > > This kind of problem is why the GNOME project created the msitools project > for creating .msi installers, to relpace nsis. With msitools there is a > metadata file for each package listing all the files that need it needs > to have bundled into an installer: > > https://gitlab.gnome.org/GNOME/msitools/tree/master/data/wixl > > This is not without its own downsides though. It bundles all the .wxi > files itself, with their content based on current mingw packages present > in the most recent Fedora release. This means it won't work on any other > distro :-( > > Regards, > Daniel > -- > |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| > |: https://libvirt.org -o- https://fstop138.berrange.com :| > |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|