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

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# On arm64 the QML GUI unit tests (qmltestrunner under Xvfb) crash with a
# segmentation fault in the Lomiri/Qt graphics stack, while the same tests
# pass on amd64 and loong64 and all binaries build fine, so skip the test
# suite on arm64 only.
ifeq ($(DEB_HOST_ARCH),arm64)
export DEB_BUILD_OPTIONS += nocheck
endif

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- -DCLICK_MODE=OFF

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	CTEST_OUTPUT_ON_FAILURE=1 make -C obj-$(DEB_HOST_GNU_TYPE) test
endif

override_dh_install:
	rm debian/lomiri-clock-app/usr/share/lomiri-clock-app/lomiri-clock-app-migrate.py
	dh_install

override_dh_missing:
	dh_missing --fail-missing

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