Ticket #15625: patch-guide-variants.diff

File patch-guide-variants.diff, 1.8 KB (added by nerdling (Jeremy Lavergne), 14 years ago)
  • portfiledev.xml

     
    482482    <section id="development.variants.default">
    483483      <title>Default Variants</title>
    484484
    485       <para>Variants are used to specify actions that lie outside the core
     485      <para>MacPorts has a "build everything" approach to ensure the user
     486      gets any functionality they might have been expecting. Sometimes
     487      this includes deciding which version of mysql to use if the user
     488      has not specified a preference.</para>
     489
     490      <programlisting>variant mysql4 conflicts mysql5 description {Build with MySQL 4 support} {
     491    depends_lib-append  port:mysql4
     492    configure.args      --with-mysql=${prefix}
     493}
     494
     495variant mysql5 conflicts mysql4 description {Build with MySQL 5 support} {
     496    depends_lib-append  path:bin/mysql_config5:mysql5
     497    configure.args      --with-mysql-lib=${prefix}/lib/mysql5/mysql \
     498                --with-mysql-include=${prefix}/include/mysql5/mysql
     499}
     500
     501if {![variant_isset mysql4]} {
     502    default_variants +mysql5
     503}
     504
     505</programlisting>
     506
     507      <para>Variants are also used to deselect actions that lie outside the core
    486508      functions of an application or port, but there may be some cases where
    487       you wish to specify these non-core functions by default. For this
     509      you wish to disable these non-core functions by default. For this
    488510      purpose you may use the keyword default_variants.</para>
    489511
    490       <programlisting>default_variants    +foo +bar</programlisting>
     512      <programlisting>default_variants    +no_foo +no_bar</programlisting>
    491513
    492       <!-- TODO: add warning not to use default_variant at the moment -->
    493 
    494514      <note>
    495515        <para>The default_variant keyword may only be used in the global
    496516        Portfile section.</para>