I’m maintaining and publishing an open source package which needs to be built for Windows and Linux. I’ve chosen to cross-compile with mingw, and used Debian packages for building and maintaining the binaries for my Windows packages. That is, I’ve defined Debian architectures mingw-i686 and mingw-amd64, massaged slight modifications into dpkg-cross and some Debian install scripts to account for the PE naming scheme (*.dll, *.dll.a instead of .so. and *.so), and started building.
That went very well, and until recently I could easily build a Windows setup using Inno Setup from an installation schedule, i.e. a list of .deb’s that need to be installed for my package. This list was generated by a chroot-ed apt-get (with --print-uris) and looked like:
/projects/www/debian/dev/pool/dists/experimental/main/base/libfreetype6_2.4.4-1+mingw.1_mingw-amd64.deb
/projects/www/debian/dev/pool/dists/experimental/main/base/libwxmsw2.8_2.8.10.1-3.1_mingw-amd64.deb
[...]
Basically, I was using apt to resolve the dependencies and Inno Setup to do the installation.
Of course, there is no real debian system for mingw-i686, so I couldn’t run apt natively. I had hacked a solution by putting the necessary files into a directory and using apt-get -o RootDir= to change apt’s root into this directory. This worked since apt-get never really chrooted into this directory and only looked for its databases there.
Lately, a new apt version was pushed into Debian testing, and this apt version does actually chroot into the RootDir. So, my RootDir solution got impracticable, it would be quite a lot of work to set up a proper chroot.
Does anyone have an idea how I could get the package list any other way? That is, get a list of .deb’s and all their dependencies for a specific package on a non-native architecture?
I’ve found a solution by fixing my apt.
I’ve been running into two different issues: Firstly, apt with foreign versions seems to be currently broken in testing because multi-arch dpkg is not yet here. Apt tries to call
dpkg --print-foreign-architectures, which fails because it is a multi-arch dpkg call and dpkg isn’t that far yet. This must be fixed by explicitely setting APT::Architectures.Secondly, I could re-root apt’s state only by calling apt as:
and using this config file:
with @TREE@ replaced by my prepared, clean apt-tree and @ARCH@ replaced by my architecture (mingw-i686). It has all been in the fine documentation, even though a wee bit hidden.