A platform specifier that is just a platform name is purely informational for users; it is displayed in the output of port info but has no other effect. Ports for software that does not require macOS-specific features can generally use the default value of darwin. Most ports use this value on the presumption that they would work on Pure Darwin, even if that has not been attempted. Ports for software that is known to require macOS-specific features should use macosx. Including the xcode portgroup will change the default to macosx automatically.
(Added: MacPorts 2.6.0) By default, it is assumed on macOS that ports will not need tools from Xcode.app unless (1) Command Line Tools aren't installed, (2) you are on an old version of Mac OS X that does not support the xcode-select mechanism, or (3) the port uses build.type xcode or includes the xcode PortGroup. If a port needs to use Xcode (i.e., xcodebuild) in any way, use_xcode yes should be set or the port should include the xcode PortGroup. The environment variable DEVELOPER_DIR is now exported during all build phases, set to the value of $configure.developer_dir which may be the directory of Xcode or CLT depending on use_xcode. This means that libxcselect shims (i.e., /usr/bin/clang) will resolve to Xcode/CLT. Build systems that ignore the environment may accidentally use Xcode which will cause a failure in trace mode.
Don't set this option conditionally on the basis of anything that can change dynamically, such as $build_arch or $xcodeversion, since it will be recorded in the static PortIndex. If a port works only on certain OS versions, use the platforms option to indicate this rather than setting known_fail directly.
PortGroup xcode allows for efficient porting of Xcode-based opensource software. A minimum Portfile for PortGroup xcode uses defaults for the configuration, build, and destroot phases. It also defines some values for Xcode-based software.
Once Xcode is installed, you will need to run xcode-select to expand your path since tools like make and compilers/linkers are in /Applications/Xcode and not in your typical bash path. You can go to settings and download the command line tools to keep them if decide to delete Xcode later.
caa09b180b