#!/usr/bin/make -f

include /usr/share/dpkg/architecture.mk

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

VALAFLAGS:=$(foreach w,$(CPPFLAGS) $(CFLAGS) $(LDFLAGS),-X $(w))

%:
	dh $@ --with gir

override_dh_auto_configure:
ifneq ($(filter nogir,$(DEB_BUILD_PROFILES)),)
	dh_auto_configure -- -Dintrospection=false
else
	dh_auto_configure
endif

override_dh_installchangelogs:
	dh_installchangelogs NEWS

# The license is reproduced verbatim in debian/copyright
execute_after_dh_auto_install:
	rm -f debian/tmp/usr/share/wixl-*/ext/ui/LICENSE.txt

# See https://gitlab.gnome.org/GNOME/msitools/-/issues/32
# We still ship the package for now, it's not clear whether the tools
# or the tests are broken
ifeq (big,$(DEB_HOST_ARCH_ENDIAN))
override_dh_auto_test:
else
# The tests assume wixl is available, but it isn't built if introspection
# is disabled
ifneq ($(filter nogir,$(DEB_BUILD_PROFILES)),)
override_dh_auto_test:
endif
endif
