#! /usr/bin/make -f

-include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk

GNOME_MODULE := atk

export DEB_LDFLAGS_MAINT_APPEND = -Wl,-O1 -Wl,-z,defs -Wl,--as-needed

# https://lists.debian.org/debian-devel/2017/09/msg00006.html
# https://github.com/mesonbuild/meson/issues/2268
export LC_ALL=C.UTF-8

%:
	dh $@ --with gir,gnome --buildsystem=meson

override_dh_auto_configure:
	dh_auto_configure -- \
		-Denable_docs=true \
		-Ddisable_introspection=false

override_dh_makeshlibs:
	dh_makeshlibs -plibatk1.0-0 \
		--add-udeb="libatk1.0-udeb" -V -- -c4

override_dh_install:
	find debian \( -name '*.a' -o -name '*.la' \) -delete
	dh_install --fail-missing

override_dh_strip:
	dh_strip --dbgsym-migration='libatk1.0-dbg (<< 2.21.90-1~)'

# Needed by Ubuntu
override_dh_translations:
	ninja -C obj-$(DEB_HOST_GNU_TYPE) atk10-pot
	dh_translations

