Use scripts/buildorder.py with a new -i flag to get all dependencies (including subpackages). The script now also spits out both package name and package dir, to make it easier to build packages from another repo.