Equivalent of +universal checking for other variants?

Michael Dickens michaelld at macports.org
Fri Jan 21 06:42:51 PST 2011

I haven't checked the dev list, but I'm sure this topic must have been discussed before.  So, apologies ... but, maybe it's time to re-discuss anyway?

The variant +universal seems to have a special status among variants: If +universal is specified for building then 'port' will check all dependencies to make sure they are already installed as +universal (or cannot be) and if not try to upgrade them to be so; 'port' will print an error message if it cannot accomplish this task.  This check / upgrade works quite well for this specific variant, and so I'm wondering if it can also be applied to other variants such as +debug, +x11, +quartz, and so forth.

For example: If I have nothing already installed (except 'port') and do "sudo port install gtk2 +quartz" then 'port' will go off and try to apply the +quartz variant to all dependencies -- those that can use it will do so; those that cannot will ignore it.  But after all of the dependencies are installed, if I do "sudo port install gtk2 +x11" then 'port' does not go back and try to reinstall the dependencies with the +x11 variant.  Instead it either (1) requires the Portfile to manually check to make sure the installed variant is correct & if not then tell the user; and/or (2) tries to build the port and will in general eventually generate an error since the correct dependency variant isn't installed.  Portfiles that come to mind that do this to some degree include libglade2, gtk2, pango, and cairo.

For Qt4, in the PortGroup I put in a manual check for the +debug variant, which covers just Qt4 itself.  So, for example, amarok would want to not just check Qt4 (which it does automatically via the qt4 PortGroup), but ideally it would also check kdelibs4, phonon, and a bunch of others.  One could come up with a PortGroup for doing such checking (for example: create a list of variants to check for, with each one containing a list of {the dependency port name and a file specific to this port and variant} to check) -- but that's what "depends_FOO" provides info for to a first order & hence it seems silly to duplicate the information that's already there (IIUC sort of like what "archcheck" did, but then deprecated because it was incorporated into "universal").

It seems to me that changing all variants to use the same behavior as is done by +universal makes sense (there could also be an opt-out keyword for ports that just want a unique variant that does not propagate to other ports), even if it would require "standardizing" what a variant means.  I'm wondering if this behavior is desirable to other developers ... - MLD

More information about the macports-dev mailing list