#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.

include debian/variables.mk
include debian/gencontrol.mk

#export DH_VERBOSE = 1


# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed


%:
	dh $@ --with gir


# dh_make generated override targets
# This is example for Cmake (See https://bugs.debian.org/641051 )
#override_dh_auto_configure:
#	dh_auto_configure -- #	-DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)

override_dh_auto_clean: gen_control
	dh_auto_clean

override_dh_auto_configure: gen_control
	dh_auto_configure -- \
	    -DCMAKE_BUILD_TYPE=Release \
	    -DLIB_INSTALL_DIR=/usr/lib/$(DEB_HOST_MULTIARCH) \
	    -DSYSCONFDIR=/etc \
	    -DENABLE_X11=ON \
	    -DENABLE_GLIB2=ON \
	    -DENABLE_CAIRO=ON \
	    -DENABLE_DBUS=ON \
	    -DENABLE_PANGO=ON \
	    -DENABLE_LIBXML2=ON \
	    -DENABLE_DEBUG=OFF \
	    -DENABLE_PINYIN=ON \
	    -DENABLE_TABLE=ON \
	    -DENABLE_GTK2_IM_MODULE=ON \
	    -DENABLE_GTK3_IM_MODULE=ON \
	    -DENABLE_QT=ON \
	    -DENABLE_QT_IM_MODULE=ON \
	    -DENABLE_QT_GUI=ON \
	    -DENABLE_LUA=ON \
	    -DENABLE_STATIC=OFF \
	    -DENABLE_TEST=ON \
	    -DENABLE_SNOOPER=ON \
	    -DENABLE_GIR=ON \
	    -DENABLE_ENCHANT=ON \
	    -DENABLE_PRESAGE=ON \
	    -DENABLE_ICU=ON \
	    -DENABLE_BACKTRACE=ON \
	    -DENABLE_XDGAUTOSTART=ON \
	    -DENABLE_GETTEXT=ON

override_dh_missing:
	dh_missing --fail-missing

override_dh_makeshlibs:
	dh_makeshlibs -plibfcitx-core0
	dh_makeshlibs -plibfcitx-config4
	dh_makeshlibs -plibfcitx-utils0
	dh_makeshlibs -plibfcitx-qt0
	dh_makeshlibs -plibfcitx-gclient1

override_dh_strip:
	dh_strip --dbgsym-migration='fcitx-dbg (<< 4.2.9.4-1~)'