#!/usr/bin/make -f

include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk

%:
	dh $@ --with autoreconf,gir,gnome

ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH),armel armhf))
CONFFLAGS += \
	--with-default-driver=gles2
else
CONFFLAGS += \
	--with-default-driver=gl
endif

ifeq ($(DEB_HOST_ARCH_OS),linux)
CONFFLAGS += \
	--enable-wayland-egl-platform \
	--enable-wayland-egl-server \
	--enable-kms-egl-platform
endif

override_dh_auto_configure:
	dh_auto_configure -- \
		--enable-gtk-doc \
		--enable-gdk-pixbuf \
		--enable-cogl-pango \
		--enable-introspection \
		--enable-gl \
		--enable-cogl-gst \
		--enable-xlib-egl-platform \
		--enable-cogl-gles2 \
		--enable-gles2 \
		--with-gles2-libname=libGLESv2.so.2 \
		$(CONFFLAGS)

override_dh_makeshlibs:
	dh_makeshlibs -V -- -c4

override_dh_install:
	dh_install --list-missing

override_dh_strip:
	dh_strip -plibcogl20 --dbgsym-migration='libcogl20-dbg (<< 1.22.2-1~)'
	dh_strip -plibcogl-pango20 --dbgsym-migration='libcogl-pango20-dbg (<< 1.22.2-1~)'
	dh_strip -plibcogl-gst20 --dbgsym-migration='libcogl-gst20-dbg (<< 1.22.2-1~)'
	dh_strip --remaining-packages

# disable test suite, they need a working GL/GLES environment
override_dh_auto_test:
