#!/usr/bin/make -f

#export DH_VERBOSE=1
export DPKG_GENSYMBOLS_CHECK_LEVEL = 4

%:
	dh $@ 

# Upstream CMakeLists.txt still declares cmake_minimum_required(VERSION 2.6).
# CMake >= 4 refuses to configure such projects; instruct CMake to fall back to
# the CMake 3.5 policy set so the build keeps working with the newer toolchain.
override_dh_auto_configure:
	dh_auto_configure -- -DCMAKE_POLICY_VERSION_MINIMUM=3.5

override_dh_auto_test:
ifeq (, $(findstring nocheck, $(DEB_BUILD_OPTIONS)))
	mkdir -p debian/tmp/home/run
	env HOME=$(CURDIR)/debian/tmp/home XDG_RUNTIME_DIR=$(CURDIR)/debian/tmp/home/run \
		xvfb-run -a -e $(CURDIR)/debian/tmp/X.log dh_auto_test || \
	        { echo "==== X.org log ===="; cat $(CURDIR)/debian/tmp/X.log; false; }
endif

override_dh_install:
	dh_install --fail-missing

override_dh_makeshlibs:
	dh_makeshlibs -V

