For my Rust cross-compiler builder, I have cobbled together a pkgman tool (in Python) that is designed to work on top of a cross-compiler docker image, and is able to connect to a remote repo, and install packages by name. It does not do any fancy stuff like resolving dependencies, but it is good enough to dynamically download packages from HaikuPorts based on a package name, without having to maintain a list of URLs with the latest versions.
I might be interested, if this is a tool that works for you too, to harden the code a bit more and then add it to the cross-compiler image.