Re: Bug#1093222: Minimizing build-arch for pam
On Thu, 16 Jan 2025 at 09:38:38 -0700, Sam Hartman wrote:
> But the meson setup call is in override_dh_auto_configure.
> I don't know at that point how to figure out of I am building arch all
> packages.
I find that it's often better to do this in terms of "am I building
package X?" instead of "am I building arch: all packages?" because that
way, you will also get the correct answer when dealing with build-profiles.
We do this a lot in GNOME and GNOME-adjacent packages. Something like this
(in this case taken from gobject-introspection, and enabling/disabling
the gtk_doc option depending on whether we are building the -doc package):
built_binaries := $(shell dh_listpackages)
configure_options = ... options you use unconditionally ...
ifeq ($(filter %-doc,$(built_binaries)),)
configure_options += -Dgtk_doc=false
else
configure_options += -Dgtk_doc=true
endif
override_dh_auto_configure:
dh_auto_configure -- $(configure_options)
Reply to: