#!/usr/bin/make -f
GNOME_DOWNLOAD_URL = https://ftp.gtk.org/pub/$(GNOME_MODULE)/$(DEB_UPSTREAM_VERSION_MAJOR_MINOR)/$(GNOME_TARBALL)
TARBALL_EXT := tar.bz2
-include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,-O1 -Wl,--as-needed

# Disable SSE2 except on amd64
ifneq ($(DEB_HOST_ARCH_CPU),amd64)
	sse_flags := --disable-mmx --disable-sse --disable-sse2
else
	sse_flags := --enable-mmx --enable-sse --enable-sse2
endif

%:
	dh $@ --with gnome

override_dh_autoreconf:
	dh_autoreconf --as-needed

override_dh_auto_configure:
	dh_auto_configure -- $(sse_flags)

override_dh_install:
	find debian/tmp -name '*.la' -delete
	dh_install --list-missing

override_dh_installdocs:
	dh_installdocs -XMakefile

override_dh_makeshlibs:
	dh_makeshlibs -X/usr/lib/$(DEB_HOST_MULTIARCH)/gegl-0.3/ -V -- -c4

override_dh_strip:
	dh_strip --dbgsym-migration="libgegl-0.3-0-dbg (<< 0.3.20-3~)"

# Re-enable build tests with gegl 0.3.22
# https://git.gnome.org/browse/gegl/commit/?id=5f949cc
override_dh_auto_test:
	-dh_auto_test
