Proposal: variants naming conventions

Randall Wood rhwood at mac.com
Sun Feb 11 07:25:04 PST 2007


I have noticed that most variants add or delete a configure flag in  
the form of --enable-*/--disable-*/--with-*/--without-* and maybe add  
or delete a related dependency.

Therefore, I propose that all variants should fit the following forms:

{en|dis}able_package: If a ported software package has optional  
compile-time features, the user can give configure command line  
options to specify whether to compile them. The options have one of  
these forms:
--enable-feature
--disable-feature
(Note that this is slightly different then how configure scripts work 
[1]).

with[out]_package: When a port requires, or can optionally use, other  
ports that can be or already are installed. The user can give  
configure command line options to specify which such external  
software to use. A port can be written with options have one of these  
forms:
+with_package
+without_package
(Note that this is slightly different then how configure scripts work 
[2]).

(Most configure scripts allow these options to passed with further  
information in the form of --option=arg where a reasonable default is  
set if =arg is not specified. port can't handle that, so =arg is not  
allowed in variant names and this proposal does not contemplate  
changing that)

Changing this variant structure has, I believe, the following benefits:

1) Adding the verb enable/disable/use/with/without makes the variant  
more meaningful to users. I know there have been comments on the  
mailing list about the inability to comment on variants such that  
'port info' is capable of explaining what each variant does. The verb  
will help address those complaints.

2) There are currently variants no-*, no_*, and no* These are  
inconsistent and do not tell me (the user) if I am disabling a  
feature (that some other port may depend on) or simply building the  
port without using some other package.

3) Negative variants are confusing. with_*/without_* or enable_*/ 
disable_* is more readable than +*/-* as an indicator of  what is  
going on.

References:
[1] GNU Autoconf Manual Section 12.2: Choosing Package Options,  
http://www.gnu.org/software/autoconf/manual/autoconf-2.57/html_mono/ 
autoconf.html#SEC131
[2] GNU Autoconf Manual Section 12.1: Working With External Software,  
http://www.gnu.org/software/autoconf/manual/autoconf-2.57/html_mono/ 
autoconf.html#SEC130

Randall Wood
rhwood at mac.com

"The rules are simple: The ball is round. The game lasts 90 minutes.  
All the
rest is just philosophy."





More information about the macports-dev mailing list