Hello. Recently, while thinking about build-depends problems we are all familar with, I came up with the following idea: what if all of the packages we intend to cross-compile would have a special control-like file in debian/, which would have build-depends in a way we need them, that is, Host-Build-Depends for those packages that should be present on host as is (such as flex, bison, whatever), and Target-Build-Depends for those packages that should be present on host dpkg-crossed. If we are not cross-compiling, original dpkg-checkbuilddeps might be called. If we are cross-compiling and the special control-like file is not found, dpkg-checkbuilddeps might just return with successful return code -- this situation would mean that there are no special build-depends (unlikely, yes). Advantages of this approach are more or less obvious: we remove any wild guesses from package building tools, and rely the task of providing correct build-depends on feeble maintainer's shoulders :) Disadvantages: this is not a real control file. Thus, for example, those fields will not be present in .dsc, and, as a consequence, all of the package building tools except those that call dpkg-checkbuilddeps would not notice those fields (sbuild, apt-get build-dep, etc.). Tools that we might need in future (such as sbuild) may be patched to check this file if they run on an unpacked source (actually, sbuild already does that, checking debian/.sbuild-build-deps or something like that), but they would still fail if they run on a packed one with .dsc. While this can easily be fixed patching dpkg-dev, I am not sure what else will break finding unusual fields in .dsc, and this will also introduce YADI (Yet Another Debian Incompatibility) which I'm not that happy about. Attached is a sample implementation of this idea -- dpkg-checkbuilddeps wrapper for dpkg-cross. If you wish to play with it, do not forget to switch on checkbuilddep in dpkg-buildpackage.orig for -a* case. Usage is pretty simple: put a file (currently called "crossbuilddeps") into debian/ of your package, and fill it with any of the fields "Host-Build-Depends", "Target-Build-Depends", "Host-Build-Conflicts", "Target-Build-Conflicts". Please also note that for Target-* you don't have to append "-<arch>-cross" to package names, as this is done automagically (at least, it should be ;). Have fun and let me know what you guys think. -- Regards, Wartan.
Attachment:
dpkg-checkbuilddeps
Description: Binary data