#!/usr/bin/make -f

ifeq (,$(filter-out armel powerpc,$(DEB_HOST_ARCH)))
	export DEB_LDFLAGS_MAINT_APPEND=-latomic
endif

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- \
	-Dfft=fftw \
	-Djni=disabled \
	-Dresampler=libsamplerate

execute_before_dh_auto_build:
# Disable Stretcher test on powerpc, ppc64 and ppc64el because it fails with SIGinvalid
ifeq ($(DEB_HOST_ARCH),$(filter $(DEB_HOST_ARCH),powerpc ppc64 ppc64el))
	sed -e "/TestStretcher/ s/^#*/#/" -i meson.build
	sed -e "/test('Stretcher/ s/^#*/#/" -i meson.build
endif

execute_before_dh_installman:
	help2man --no-info --no-discard-stderr --help-option=--full-help obj-*/rubberband > debian/rubberband.1

override_dh_auto_test:
	dh_auto_test -- --timeout-multiplier 20
