port [-qvd] [-D portdir] variants [--index]
     [[portname | pseudo-portname | port-expressions | port-url]]
     [+/-variant …]


port variants prints a list of variants provided by the port(s) given on the command line. Variants allow users to select certain features when installing a certain port. For example, the gtk3 port provides two conflicting variants +quartz and +x11 that select whether Gtk uses the X11 backend (which requires an X server) or the macOS-native Quartz backend (which attempts to provide a more native macOS look and feel). In addition, many ports feature an +universal variant that enables building of universal (i.e. multi-arch) binaries.

port variants lists all variants by name and (if available) description. If variants depend on or conflict with other variants, this information is printed as a bulleted list for each variant.

The output of port variants contains [+] before a variant name, if the port declares this variant as default. (+) or (-) in the same spot mark variants enabled or disabled by your variants.conf(5). Last, a single + or - marks variants explicitly enabled or disabled on the command line by appending +variantname or -variantname.



Do not read the Portfile, but rely solely on the port index information. Note that this will limit the output to the variant names only. No descriptions, dependencies or conflicts between variants will be reported.


Please see the section GLOBAL OPTIONS in the port(1) man page for a description of global port options.


Do not print the header line.


The output of port variants provides all available information on a port’s variants. The gtk3 port can serve as a good example:

$> port variants gtk3 -universal
gtk3 has the variants:
(+)quartz: Enable native macOS graphics support
     * conflicts with x11
  -universal: Build for multiple architectures
[+]x11: Enable X11 support
     * conflicts with quartz

In this case, (+) means that we have chosen +quartz as a default variant in our variants.conf(5). Additionally, we have explicitly disabled the universal variant on the command line, as indicated by its leading - symbol. Finally, the port maintainer has chosen +x11 as the default, indicated by [+]. Furthermore, the quartz and x11 variants conflict with each other.



(C) 2015 The MacPorts Project
Clemens Lang <>