#!/usr/bin/make -f
export PYBUILD_NAME = dttlib

export CARGO_HOME = $(CURDIR)/.cargo
export CARGO_NET_OFFLINE = true
export MATURIN_PEP517_ARGS = --locked

# keep debug info, don't let upstream's profile strip it away
export CARGO_PROFILE_RELEASE_STRIP = false
export CARGO_PROFILE_RELEASE_DEBUG = 2

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export RUSTFLAGS = -Clink-arg=-Wl,-z,relro,-z,now

%:
	dh $@ --buildsystem=pybuild

override_dh_auto_configure:
	mkdir -p $(CARGO_HOME)
	sed 's|^directory = .*|directory = "$(CURDIR)/vendor"|' \
	    debian/cargo-vendor-config.toml > $(CARGO_HOME)/config.toml
	dh_auto_configure

override_dh_auto_clean:
	dh_auto_clean
#!/usr/bin/make -f

export PYBUILD_NAME=dttlib
%:
	dh $@ --with python3 --buildsystem=pybuild

override_dh_auto_test:
	true

override_dh_auto_build:
	export CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
	dh_auto_build
	rm -rf $(CARGO_HOME) target
