#!/usr/bin/make -f

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

# Augment path to find gphoto2-config; workaround for #826166
export PATH := $(PATH):/usr/lib/$(DEB_HOST_MULTIARCH)/libgphoto2-dev/bin

# Architectures that support QWEBENGINE (qtwebengine5-dev)
has_qwebengine = amd64 arm64 armhf i386 mips64el mipsel
ENABLE_QWEBENGINE = OFF
ifeq ($(DEB_HOST_ARCH), $(filter $(DEB_HOST_ARCH),$(has_qwebengine)))
	ENABLE_QWEBENGINE = ON
endif

%:
	dh $@ --with kf6 --buildsystem=kf6

override_dh_auto_configure:
	dh_auto_configure -- \
					  -DDIGIKAMSC_CHECKOUT_DOC=ON \
					  -DDIGIKAMSC_COMPILE_DOC=ON \
					  -DDIGIKAMSC_COMPILE_PO=ON \
					  -DENABLE_AKONADICONTACTSUPPORT=ON \
					  -DENABLE_APPSTYLES=ON \
					  -DENABLE_DBUS=ON \
					  -DENABLE_INTERNALMYSQL=ON \
					  -DENABLE_KFILEMETADATASUPPORT=ON \
					  -DENABLE_MEDIAPLAYER=ON \
					  -DENABLE_MYSQLSUPPORT=ON \
					  -DENABLE_QTMULTIMEDIA=ON \
					  -DENABLE_QWEBENGINE=$(ENABLE_QWEBENGINE) \
					  -DENABLE_SHOWFOTO=ON \
		  			  -DBUILD_WITH_QT6=ON \

override_dh_gencontrol:
	dh_gencontrol -- -Vdigikam:Conflicts='$(CONFLICTS_SUBSTVAR)'

# auto tests require user interaction - override
override_dh_auto_test:
	.

