Re: Building package twice
Hi,
On 12/8/25 7:50 PM, Giovanni Mascellani wrote:
To do all of that I'd need to configure, compile and install the source
code twice when building the package, with different configuration
options. Is there a reasonably simple way to do that, possibly with
debhelper? Are there other packages doing this I can take as an example?
If you want an extreme example, webkit2gtk.
The simple way is to override dh_auto_configure and call
dh_auto_configure multiple times with different parameters, then repeat
for dh_auto_build, dh_auto_install, dh_auto_test and dh_auto_clean.
In rare cases, when the build itself uses make and doesn't parallelize
well, it can make sense to override dh_auto_build with a dependency list
and a dummy command:
override_dh_auto_build: auto-build-conf1 auto-build-conf2
@:
auto-build-conf1:
dh_auto_build -- ...
auto-build-conf2:
dh_auto_build -- ...
so the two sub-make invocations are run in parallel using the jobserver
from the original debian/rules invocation. But as said, it is rather
seldom that this provides a tangible benefit, and more difficult to read
than just a sequence.
Simon
Reply to: