#!/usr/bin/make -f

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

%:
	dh $@ --with gnome,gir

override_dh_autoreconf:
	NOCONFIGURE=yes dh_autoreconf gnome-autogen.sh

override_dh_auto_configure:
	dh_auto_configure -- \
		--enable-gtk-doc \
		--enable-python2 \
		--enable-python3

override_dh_makeshlibs:
	dh_makeshlibs -p libpeas-1.0-0 \
		-X/usr/lib/$(DEB_HOST_MULTIARCH)/libpeas-1.0/ -V -- -c4
	dh_makeshlibs --remaining-packages

override_dh_install:
	# remove compiled python and libtool .la files
	find debian/tmp \( \
		-name '*.la' -o -name '*.pyc' -o -name '*.pyo' \
		\) -delete
	rm -rf debian/tmp/usr/lib/*/peas-demo/plugins/*/__pycache__
	dh_install --fail-missing

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	HOME=$(CURDIR) xvfb-run $(MAKE) check
endif

