variants.conf is the configuration file used to globally select or deselect certain variants on all ports installed by MacPorts. Changes in this file will affect all ports that are installed after the file was changed.

For a description of what variants are and how they work, see port-variants(1).

variants.conf is read by the port command. In the file, lines beginning with # are comments, empty lines are ignored. Each line in the file is a space- or tab-delimited list of zero or more variants, where each variant is either explicitly enabled or disabled using a leading + or -. In EBNF:

line    = variant, { space, variant } ;
space   = ' ' | '\t' ;
variant = ( '+' | '-' ), name ;

where name is the name of the variant. Variants that are not provided by a port (or no port at all) are silently ignored.


The path of the variants.conf file is specified in the variants_conf option of macports.conf(5). It defaults to ${prefix}/etc/macports/variants.conf. There is no user-specific variants.conf file, but support for this can be emulated by setting variants.conf in the user-specific macports.conf(5) file.


To prefer the +quartz variant over +x11, you can add the following line to your variants.conf:

-x11 +quartz

This will disable all x11 variants and enable the quartz variant, when it exists.

Similarly, if you want all your ports to support multiple architectures, you can enable the universal variant by default:




(C) 2015 The MacPorts Project
Clemens Lang <>