#!/usr/bin/make -f

# use local fork of debcargo and dh-cargo
PATH := $(CURDIR)/debian/dh-cargo/bin:$(PATH)
PERL5LIB = $(CURDIR)/debian/dh-cargo/lib
export PATH PERL5LIB

%:
	dh $@ --buildsystem cargo

# TODO: teach dh-cargo to mangle Cargo.toml to strip same-workspace path
execute_after_dh_auto_install:
	perl -p -i \
		-e 's!(?=, )?path= " \./peg-\w+"(?= ,)?!!;' \
		debian/librust-*-dev/usr/share/cargo/registry/*/Cargo.toml
