[MacPorts] PortfileRecipes modified

MacPorts noreply at macports.org
Fri Apr 29 15:52:38 PDT 2011


Changed page "PortfileRecipes" by jmr at macports.org from 14.200.200.212*
Page URL: <https://trac.macports.org/wiki/PortfileRecipes>
Diff URL: <https://trac.macports.org/wiki/PortfileRecipes?action=diff&version=26>
Revision 26
Comment: update default_variants section

-------8<------8<------8<------8<------8<------8<------8<------8<--------
Index: PortfileRecipes
=========================================================================
--- PortfileRecipes (version: 25)
+++ PortfileRecipes (version: 26)
@@ -78,17 +78,20 @@
 }}}
 
 == default_variants == #default_variants
-Currently negating a variant (through {{{-variant}}}) is not remembered which means a {{{port upgrade}}} will not keep that negation around.  This causes issues with default_variants which must be kept in mind (ticket #2377).
-
-The preferred technique is to only select a default variant when one of a set is actually needed; e.g. from [browser:trunk/dports/graphics/ImageMagick ImageMagick], when selecting the pixel quantum:
+When some users may want to turn a feature off but most will want it on, you can use a variant that is on by default. Define the variant as usual, and then use the default_variants keyword like this (to make the `foo` variant on by default):
+{{{
+default_variants +foo
+}}}
+The port will then be installed with `+foo` unless the user specifies `-foo` on the command line or in variants.conf.
+
+You can also use default_variants when one of a set of mutually exclusive variants is needed; e.g. from [browser:trunk/dports/graphics/ImageMagick ImageMagick], when selecting the pixel quantum:
 {{{
 if {![variant_isset q8] && ![variant_isset q32]} {
     default_variants +q16
 }
 }}}
 
-This also leads to preferring negative-based variants (like {{{no_x11}}}) as using {{{+no_x11}}} is remembered, whereas if you had {{{x11}}} as a variant and set it in default_variants, {{{-x11}}} would not be remembered.
-
+Formerly, use of negatively-named variants (like `no_x11`) was preferred to having a default positively-named variant (like `x11`), due to a deficiency in the port registry (ticket #2377). Now that this is fixed, use of negatively-named variants should be avoided.
 
 == cvs/svn/git tag for consistency == #checkout_tag
 When using one of the checkout-based fetch types (cvs, svn, git, etc) it is best to also use the accompanying tag or date to make sure everyone gets the same checkout as you originally did when creating the port.  For example, [browser:trunk/dports/lang/slime slime] does the following for cvs:

-------8<------8<------8<------8<------8<------8<------8<------8<--------

* The IP shown here might not mean anything if the user or the server is
behind a proxy.

--
MacPorts <http://www.macports.org/>
Ports system for Mac OS

This is an automated message. Someone at http://www.macports.org/ added your email
address to be notified of changes on PortfileRecipes. If it was not you, please
report to .


More information about the macports-changes mailing list