Changeset 37493 for trunk/doc-new


Ignore:
Timestamp:
Jun 10, 2008, 1:45:53 AM (11 years ago)
Author:
markd@…
Message:

Clarify section with advice from the list.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc-new/guide/xml/portfile-dependencies.xml

    r37455 r37493  
    22<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
    33"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
    4 
    54<section id="reference.dependencies">
    65  <title>Dependencies</title>
    76
    87  <para>Free and open source software is highly modular, and MacPorts ports
    9   often require that other ports be installed beforehand; these
    10   prerequisites for a given port are called a port's
    11   <quote>dependencies</quote>.</para>
     8  often require that other ports be installed beforehand; these prerequisites
     9  for a given port are called a port's <quote>dependencies</quote>.</para>
    1210
    13   <para>There are three types of MacPorts dependencies: library, build, and
    14   run dependencies. Dependency types are important for proper port upgrade
    15   and uninstall behavior. For example, you may not uninstall a port that is
    16   a library dependency for another port, though you may remove one with a
    17   build dependency; likewise, upgrading a port will upgrade its library and
    18   build dependencies also, but not its run dependencies.</para>
     11  <para>There are three ways to specify dependencies in a Portfile: library,
     12  build, and run dependencies. Specifying dependencies correctly is important
     13  for proper port upgrade and uninstall behavior. For example, you may not
     14  uninstall a port that is a library dependency for another port, though you
     15  may remove one with a build dependency; likewise, upgrading a port will
     16  upgrade its library and build dependencies also, but not its run
     17  dependencies.</para>
    1918
    2019  <variablelist>
     
    7069
    7170  <section id="reference.dependencies.types">
    72     <title>Port and Non-Port Dependencies</title>
     71    <title>Port and File Dependencies</title>
    7372
    74     <para>Port dependencies should be provided by MacPorts ports whenever
    75     possible, however dependencies may be provided by vendor-supplied
    76     software when satisfying a dependency by a port is not practical or
    77     desirable for a special reason. Dependencies of this type are called
    78     non-port dependencies.</para>
     73    <para>Port dependencies can be satisfied by reference to a port (in this
     74    case the MacPorts' registry is queried), or by reference to a file
     75    (whether provided by a port or not). The most commonly-used type of
     76    dependencies in Portfiles are port dependencies, because dependencies
     77    should be provided by MacPorts ported software whenever possible, and
     78    usually only one port can provide the needed libraries and files.</para>
    7979
    80     <para>Non-port dependencies should only be used if the application or
    81     library can be installed by multiple ports (for example stable and
    82     -devel version) or if it can't be installed with MacPorts.</para>
     80    <para>But when satisfying a dependency with vendor-supplied software is
     81    preferred for justifiable reasons, or when it is possible for more than
     82    one port to satisfy a dependency, then file dependencies may be used. An
     83    example of the former is with X11 —Apple's is widely preferred; an example
     84    of the latter is with "-devel" named ports —these ports provide identical
     85    files (only one can be activated at a time).</para>
    8386
    8487    <para>Port dependencies, the preferred type, are specified as shown in
     
    9194depends_run         port:apache2 port:php5</programlisting>
    9295
    93     <para>Non-port dependencies are specified as shown in these
    94     examples:</para>
     96    <para>File dependencies may be of three types: <option>bin</option> for
     97    programs, <option>lib</option> for libraries, and <option>path</option>
     98    for any file. File dependencies are specifed in the form:
     99    <replaceable>&lt;type&gt;</replaceable>:<replaceable>&lt;filename&gt;</replaceable>:<replaceable>&lt;port&gt;</replaceable>.
     100    Note that the <replaceable>&lt;port&gt;</replaceable> specified is only
     101    installed if the file the specified library, binary, or file is not found.
     102    See the examples below:</para>
    95103
    96104    <programlisting>depends_lib         lib:libX11.6:xorg
     
    99107
    100108depends_run         path:${prefix}/lib/libltdl.a:libtool</programlisting>
     109
     110    <note>
     111      <para> When using lib dependencies, only the library name is specified
     112      —not its extension (e.g. ".dylib" ".so", etc.).</para>
     113    </note>
    101114  </section>
    102115</section>
Note: See TracChangeset for help on using the changeset viewer.