build: Fix wrong dependency order, use proper DFS
build: Fix wrong dependency order, use proper DFS

Follows up:

    d98f28f ("build: Fix wrong (reversed) dependency order")
    cd1a0fe ("build: Do not bundle packages reachable through makedepends only")

abusalimov/clion-bundle-buildenv