Yeah, macports still works fine. It has an equivalent to the OpenBSD flavors and does versioning fine. The only pain point is OS upgrades.
xcode-select --install
That said, MacPorts is often opinionated, e.g. they package certain versions of some software and not others.> 1. Install Xcode and the Xcode Command Line Tools