Changeset 27554 for trunk/doc


Ignore:
Timestamp:
Aug 8, 2007, 4:30:45 AM (12 years ago)
Author:
markd@…
Message:

Add a Port Dependencies section to the Port Reference section.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/guide/new/xml/portfileref.xml

    r27549 r27554  
    132132
    133133  <section>
     134    <title>Port Dependencies</title>
     135
     136    <para>Free and open source software is highly modular, and MacPorts ports
     137    often require modules not provided in a port's distribution to be
     138    installed before a port may be installed, compiled, or run. These support
     139    modules are generally other MacPorts ports, and the ports required to
     140    satisfy prerequistes for a given port are called a port's
     141    "dependencies".</para>
     142
     143    <para>There are three types of dependencies in MacPorts: library, build,
     144    and run dependencies.</para>
     145
     146    <section>
     147      <title>depends_lib</title>
     148
     149      <para>Library dependencies are needed both at build time (for headers
     150      and libraries to link against) and at run time (to provide necessary
     151      code).</para>
     152
     153      <programlisting>depends_lib         port:rrdtool</programlisting>
     154    </section>
     155
     156    <section>
     157      <title>depends_build</title>
     158
     159      <para>Build dependencies are only needed when software is compiled. They
     160      are not needed at all once the software is compiled and
     161      installed.</para>
     162
     163      <programlisting>depends_build       port:gcc42</programlisting>
     164    </section>
     165
     166    <section>
     167      <title>depends_run</title>
     168
     169      <para>Run dependencies are needed when the software is run, but not to
     170      compile the software.</para>
     171
     172      <programlisting>depends_run         port:apache2</programlisting>
     173
     174      <note>
     175        <para>The three dependency types become important for port upgrades
     176        and uninstalls. For example, you may not uninstall a port that is a
     177        library dependency for another port, though you may remove ports that
     178        are build dependencies for other ports.</para>
     179      </note>
     180    </section>
     181
     182    <section>
     183      <title>Non-Port Dependencies</title>
     184
     185      <para>Port dependencies should refer to other MacPort ports whenever
     186      possible. However, if satisfying a dependency with a port is not
     187      practical or desirable for a special reason, you may specify
     188      dependencies in the Unix standard binary, library, or a specified
     189      path.</para>
     190
     191      <para>In this lib style dependency, if the file
     192      <filename>libX11.6.2.dylib</filename> is not found in the library path
     193      the XFree86 port will be installed to satisfy it.</para>
     194
     195      <programlisting>depends_lib         lib:libX11.6:XFree86</programlisting>
     196
     197      <para>In this bin style dependency, if the <filename>rrdtool</filename>
     198      binary is not found in the binary path the port rrdtool will be
     199      installed.</para>
     200
     201      <programlisting>depends_lib         bin:python:python24</programlisting>
     202
     203      <para>In this path style dependency, if the <filename>nano</filename>
     204      binary is not found in the path /usr/bin/nano the nano port will be
     205      installed.</para>
     206
     207      <programlisting>depends_lib         path:/usr/bin/nano:nano</programlisting>
     208    </section>
     209  </section>
     210
     211  <section>
    134212    <title>Variants</title>
    135213
    136214    <para>Variants are a way for port authors to provide options that may be
    137     invoked at install time. They are declared in a
    138     <filename>Portfile</filename>'s global section using the "variant" keyword
    139     and may provide a description.</para>
     215    invoked at install time. They are declared in a Porfile's global section
     216    using the "variant" keyword and may provide a description.</para>
    140217
    141218    <section>
     
    666743    particular installation phase.</para>
    667744
    668     <para>Remember that default port installation phase behavior is performed
    669     by the MacPorts base, so that <filename>Portfile</filename> phase
    670     declarations need only be defined for non-default behavior. But keywords
    671     for port phases affect installation phase behavior, whether it is
    672     performed by the MacPorts base code or defined using
    673     <filename>Portfile</filename> phase declarations.</para>
     745    <para>Remember that default port installation phase characteristics are
     746    determined by the MacPorts base, so <filename>Portfile</filename> phase
     747    declarations need only be defined for non-default characteristics. But
     748    keywords that specify options for port phases take affect whether or not
     749    phase characteristics are defined explicitly using
     750    <filename>Portfile</filename> declarations or set by default by the
     751    MacPorts base, or a combination.</para>
    674752
    675753    <section>
Note: See TracChangeset for help on using the changeset viewer.