I've been nagged for a while (by Wookey mainly) about the unhelpfulness of dpkg-checkbuilddeps when it outputs the versions and alternatives alongside the package names which are missing, making it harder to pass the list to the package manager. apt-get build-dep isn't particular helpful either - it doesn't look at the modified package at all.
Of course, once the output is in a suitable format, a new script might as well make it possible to simply pass that output to said package manager. Once it can do that, it can then pass the output to the cross-dependency tools, like xapt.
So, I've refactored the embuilddeps script in the xapt package to do just this.
It's gained a few features in the process:
Support for Build-Conflicts resolution
Support for virtual packages, swapping the virtual for the first package to provide it (borrowed some code from Dpkg::Deps for that one).
Support for Build-Depends alternatives (currently using the buildd default of "first alternative gets first chance")
Reads data from debian/control, not the apt cache - to help with the package you're building instead of the one you've already uploaded.
Handles cross dependencies (which are always assumed to not currently be installed) and native dependencies. This support is transitory until such time as enough packages are Multi-Arch compatible that Cross-Multi-Arch becomes trivial.
Support for being used as a build-dependency resolver in pbuilder, including cross-architecture dependencies with pdebuild-cross.
Can locate a debian/control file in a specified directory without needing to be called from that directory
Checks your apt-cache policy to see if the required version of a package is available from your current apt sources. Fails completely if not. (The pdebuild-cross usage will need that to be extended a touch to look at the apt-cache policy from within the chroot.)
Hector Oron has also been asking me to get embuilddeps working with sbuild, so I'm working on that feature too.
verbose and quiet support (so use -q inside other scripts)
most output is already translated - more translations are welcome, especially for the documentation, but hold on until this version has actually been uploaded.
More testing is needed, particularly that the extensive refactoring hasn't broken the pbuilder resolution support and then looking at what still needs to be done for sbuild support. The new script is in Emdebian SVN.
The first-choice method for virtuals and alternatives may well bear extension to explicit management via command-line options. I'm unsure yet whether it needs to be a configuration file setting. It could simply be a recursive - try one, move on - model.