#!/usr/bin/make -f
# -*- makefile -*-

export DPKG_GENSYMBOLS_CHECK_LEVEL=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# Skip tests on s390x. The QML unittests crash with floating point exception.
# Pretty sure that is not a problem of lomiri-media-player app. For all other
# architectures in Debian, lomiri-mediaplayer-app builds successfully.
testskip_architectures := s390x

# Also skip tests on mips64el. There we get a segmentation fault in QML
# unittests. Probably a similar problem.
testskip_architectures += mips64el

%:
	dh $@ --with user-session-migration

override_dh_auto_configure:
	dh_auto_configure -- -DADD_MPRIS=ON             \
	                     $(NULL)

override_dh_missing:
	dh_missing --fail-missing

override_dh_install:
	rm debian/tmp/usr/share/lomiri-mediaplayer-app/qml/CMakeLists.txt
	dh_install

override_dh_auto_test:
ifneq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), $(testskip_architectures)))
	dh_auto_test
else
	-dh_auto_test
endif

get-orig-source:
	uscan --noconf --force-download --rename --download-current-version --destdir=..
