#! /usr/bin/make -f

include /usr/share/dpkg/architecture.mk

export PYBUILD_NAME=psygnal

# hatch-mypyc builds in a temporary directory.  Make this reproducible.
export PYBUILD_BEFORE_BUILD := rm -rf debian/hatch-tmp; mkdir -p debian/hatch-tmp
export HATCH_MYPYC_BUILD_DIR := $(CURDIR)/debian/hatch-tmp

ifeq (64,$(DEB_HOST_ARCH_BITS))
ifeq (little,$(DEB_HOST_ARCH_ENDIAN))
# python-msgspec is only available on 64-bit little-endian architectures.
export HATCH_BUILD_HOOKS_ENABLE=1
endif
endif
export PYBUILD_BUILD_ARGS=--verbose
export HATCH_VERBOSE=3

PYBUILD_TEST_ARGS=--ignore=tests/test_qt_compat.py
ifeq (1,$(PYBUILD_AUTOPKGTEST))
PYBUILD_TEST_ARGS += -k 'not (test_decompile_recompile or test_hook_content)'
endif
export PYBUILD_TEST_ARGS

# assume that this one test fails on all 32 bit platforms
ifeq (32,$(DEB_HOST_ARCH_BITS))
export AUDITWHEEL_PLAT=i686
endif

%:
	dh $@ --buildsystem=pybuild
