On Wed, Oct 07, 2020 at 09:37:17PM +0200, Yves-Alexis Perez wrote: > On Mon, 2020-10-05 at 20:25 +0200, Helmut Grohne wrote: > > + dh_auto_configure -- --$(if $(filter tumbler-common,$(shell > > dh_listpackages)),en,dis)able-gtk-doc > > Hi Helmut, thanks for the report. Is there not a nicer way to detect from > debian/rules that we're running a cross build or something? It might just be > aesthetics, but I'm not sure I really like the above line =/
There are ways to check whether we're running a cross build. The code snippet above does not do that however. It checks whether the tumbler-common package is part of the build, which really is the thing we care about here. It does fix cross builds, but really what it says is: Enable gtk-doc iff tumbler-common is being built. The method used here is a quite common pattern. You can easily find lots of users: https://codesearch.debian.net/search?q=filter.*dh_listpackages&literal=0 You do have a point in that it is a little difficult to understand. Would it help to write it more verbosely? DO_PACKAGES:=$(shell dh_listpackages) ifeq (,$(filter tumbler-common,$(DO_PACKAGES))) CONFIGURE_ARGS += --disable-gtk-doc else CONFIGURE_ARGS += --enable-gtk-doc endif override_dh_auto_configure: dh_auto_configure -- $(CONFIGURE_ARGS) Helmut
