#!/usr/bin/make -f

export PYBUILD_NAME = quark-engine
export DH_VIRTUALENV_INSTALL_ROOT = /usr/share/

%:
	dh $@ --with python-virtualenv

# Workaround outdated buildsystem:
# ```
# dh_auto_configure: warning: Please use the third-party "pybuild" build system instead of python-distutils
# dh_auto_configure: error: This feature was removed in compat 12.
# make: *** [debian/rules:7: binary] Error 255
# ```
# Drop this workaround when upstream switches to pyproject or something.
# References: #984767 and https://github.com/spotify/dh-virtualenv/issues/326
override_dh_auto_configure:
	echo -e 'clean:\n\trm Makefile' > Makefile

override_dh_auto_test:
	# Skip tests, need network

# Generate strict python dependency
override_dh_gencontrol:
	dh_gencontrol -- -Vpython3:Depends="python3, $$(basename $$(realpath /usr/bin/python3))" 

# Don't let dh touch shared libraries, cf. howtos.rst
override_dh_dwz:

override_dh_strip:
	dh_strip --exclude=/site-packages/

override_dh_shlibdeps:
	dh_shlibdeps --exclude=/site-packages/
