add support for building package in dependencies, Fix #883