#!/usr/bin/make -f

POLICY = debian/imagemagick-7/etc/ImageMagick-7/policy.xml

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- \
		--enable-hdri \
		--enable-openmp \
		--enable-cipher \
		--enable-legacy-support \
		--with-threads \
		--disable-static \
		--disable-docs \
		--with-quantum-depth=16 \
		--with-modules \
		--with-rsvg \
		--with-raqm \
		--with-lqr \
		--with-fftw \
		--with-webp \
		--with-lcms \
		--with-pango \
		--with-djvu \
		--with-wmf \
		--with-jbig \
		--with-zstd \
		--with-xml \
		--with-lzma \
		--without-x \
		--without-heic \
		--without-jxl \
		--without-gslib \
		--without-raw \
		--without-openexr \
		--without-perl

override_dh_auto_test:

override_dh_install:
	dh_install
	find debian/imagemagick-7 -name '*.la' -delete
	sed -i 's#</policymap>#  <policy domain="coder" rights="none" pattern="{HEIC,HEIF}" />\n</policymap>#' $(POLICY)
