#!/usr/bin/make -f

export PYTHON = /usr/bin/python3

# With extreme parallel builds, translations go missing
# See https://bugzilla.gnome.org/show_bug.cgi?id=770100
%:
	dh $@ --with gnome,python3 --max-parallel=4

override_dh_autoreconf:
	NOCONFIGURE=true dh_autoreconf ./autogen.sh

override_dh_auto_configure:
	dh_auto_configure -- \
		--enable-python \
		--enable-vala

override_dh_install:
	find debian/tmp -name '*.la' -delete
	find debian/tmp -name 'code-assistance.page' -delete
	find debian/tmp -name 'session-saver.page' -delete
	find debian/tmp -name '__pycache__' | xargs -r rm -rf
	dh_install --fail-missing

override_dh_python3:
	dh_python3 --no-ext-rename /usr/lib/$(DEB_HOST_MULTIARCH)/gedit/plugins
	dh_python3 --no-ext-rename /usr/share/gedit/plugins
