rustpkg: Register correct dependencies for built and installed files

r? @brson as per #9112

Closes #9112