#!/usr/bin/make -f

export QT_SELECT = qt5

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# This is currently needed for the dmxusb plugin with libftdi >= 1.5
export DEB_CXXFLAGS_MAINT_APPEND = -Wno-error=deprecated-declarations

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk

TESTS_HOME = $(CURDIR)/debian/tests.home

%:
	dh $@

override_dh_clean:
	dh_clean
	rm -rf "$(TESTS_HOME)"

override_dh_auto_configure:
	./translate.sh
	dh_auto_configure -- FORCECONFIG=release

override_dh_auto_install:
	dh_auto_install
	# remove symlinks of private libraries
	find debian/tmp -name '*.so' -type l -print -delete

override_dh_auto_test: export HOME="$(TESTS_HOME)"
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	mkdir -p "$(TESTS_HOME)"
	localehelper LANG=en_US.UTF-8 \
		xvfb-run -a dh_auto_test --no-parallel
endif
