#!/usr/bin/make -f
# -*- makefile -*-

# reproducible builds: texlive needs FORCE_SOURCE_DATE set in order to
# respect SOURCE_DATE_EPOCH.
export FORCE_SOURCE_DATE=1

export SETUPTOOLS_SCM_PRETEND_VERSION=$(DEB_VERSION_UPSTREAM)
export DEB_BUILD_MAINT_OPTIONS=hardening=+all

include /usr/share/dpkg/pkg-info.mk
include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/buildflags.mk

export DH_VERBOSE = 1

%:
	dh $@ --buildsystem=meson

override_dh_auto_configure:
	dh_auto_configure -- \
		-Dpython=enabled \
		-Dtests=True \
		-Dtools=True \
		-Dvalgrind=$(if $(filter $(DEB_HOST_ARCH),amd64 arm64 armhf i386 mips mips64el mipsel powerpc ppc64 ppc64el s390x),enabled,disabled) \
		-Dyaml=enabled \

override_dh_auto_build:
	dh_auto_build
ifeq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS)))
	$(MAKE) -C Documentation
endif
