#!/usr/bin/make -f
%:
	dh $@ --buildsystem=meson

# Override the following:
#
# 1) Release build because Debian's meson manager will use a
#    'plain' build type, missing out on release-specific settings.
#
# 2) Disable zlib_ng because as a follow-on zlib dependency this
#    also builds a statically linked libpng which is a hard-
#    conflict against Debian's own library (the debian linter
#    scans the binary and detects the embedded library).
#    We can turn this on when Debian adds zlib-ng.
#
# 3) Debian is missing packages for IIR and mt32emu so we
#    build from source and statically link them.
#
# 4) Debian overrides Meson's build flags with less optimizations,
#    So we clobber their override to ensure Debian users get the
#    same performance as the project's other release formats.
#
override_dh_auto_configure:
	dh_auto_configure -- \
		--buildtype=release \
		-Duse_zlib_ng=false \
		-Dtry_static_libs=iir,mt32emu --wrap-mode=default \
		-Dc_args="-g -O3" -Dcpp_args="-g -O3"

override_dh_auto_build:
	dh_auto_build --parallel
