#!/usr/bin/make -f

# Disable the compilation of libsecp256k1 from source and use the system library
# instead by setint the environment variable ELECTRUM_ECC_DONT_COMPILE to 1.
# This is based on the logic in setup.py.
export ELECTRUM_ECC_DONT_COMPILE=1

%:
	dh $@ --buildsystem=pybuild

override_dh_gencontrol:
	# Add the correct library package to python3-electrum-ecc's depends.
	# The library package name is not automatically detected by the build
	# system.
	dh_gencontrol -- -Vlibsecp256k1dep="$(shell dpkg-query -f \
		'$${Depends}' -W libsecp256k1-dev | \
		grep -oE 'libsecp256k1-\S+')"
