setting variants on the fly

Markus Weissmann mww at macports.org
Wed Nov 21 04:55:35 PST 2007


On Wed, 2007-11-21 at 06:17 -0500, Randall Wood wrote:
> Is it possible?
> 
> What I would like to do is be able to test either that a dependency  
> was installed with a certain variant or that a file exists and then  
> set a variant on the port being installed based on that information.
> 
> Background:
> I am reworking the gtk2 port so that it can be installed without X11.  
> What I want to be able to do is have "sudo port install gtk2" work  
> correctly, installing gtk2 with the correct variants for the machine  
> its being installed on without user intervention or complaint.

I didn't try to hack a Portfile to do this, so no idea; if these are
common tests, we could include them in port(1) like with the platform
and architecture variants.

Depending on a variant of a port to be installed will create a big mess
and is imho a bad idea:
If A requires C1, B requires C0 and C1 conflicts with C0 you're stuck.
I'd like to avoid having this kind of conflicts in the first place by
_not_ relying on variants. If it is crucial for a port to have something
installed in a "non-standard" way, either create a new port that takes
the non-standard options or try to make your requirements the defaults
for the dependencies.
A good example I just recently saw are the smlnj/smlnj-dev ports which
can both be installed simultaneously (different versions); ncurses and
ncursesw als come to my mind here.


Regards,

-Markus

-- 
Dipl. Inf. (FH) Markus Weissmann
http://www.mweissmann.de/
http://www.macports.org/



More information about the macports-dev mailing list