Changes between Version 16 and Version 17 of snc


Ignore:
Timestamp:
Feb 3, 2009, 5:26:03 PM (16 years ago)
Author:
nerdling (Jeremy Lavergne)
Comment:

DO NOT HARDCODE /OPT/LOCAL!!!

Legend:

Unmodified
Added
Removed
Modified
  • snc

    v16 v17  
    55Unfortunately, there are useful things that end up buried in the Guide. For example, if you're developing against mysql5 (where multiple packages might create the mysql5 binary), you'd want to [http://guide.macports.org/#reference.dependencies.types depend on the binary] instead of a specific port.  This is accomplished in [source:trunk/dports/www/php5/Portfile#L264 php5] through {{{depends_lib-append path:bin/mysql_config5:mysql5}}}.  '''Note:''' The trailing mysql5 indicates which port to be installed if the binary cannot be found.
    66
    7 Also hidden (to the point where I cannot find it) is how to write wrapper scripts; [source:trunk/dports/x11/wine/ wine] is considered the poster-portfile. The scripts should be included in the port's {{{files}}} directory and dynamically modified through the portfile by the [http://guide.macports.org/#reference.tcl-extensions tcl extensions], {{{xinstall}}} and {{{reinplace}}}.  Another example is [source:trunk/dports/math/pspp/ pspp].
     7Also hidden (to the point where I cannot find it) is how to write wrapper scripts; [source:trunk/dports/x11/wine/ wine] is considered the poster-portfile. Another example is [source:trunk/dports/math/pspp/ pspp]. The scripts should be included in the port's {{{files}}} directory and dynamically modified through the portfile by the [http://guide.macports.org/#reference.tcl-extensions tcl extensions], {{{xinstall}}} and {{{reinplace}}}.
     8=== Do Not Hardcode /opt/local ===
     9Speaking of {{{reinplace}}}, '''do not''' hardcode {{{/opt/local}}} anywhere! Instead, use {{{reinplace}}} for string manipulation in files.
    810== Portindex ==
    911Once you've created your portfile, it's best to test it with your copy of MacPorts.  The first step is to create a [http://guide.macports.org/#development.local-repositories local portfile repository] for testing. For this, I suggest creating the directory {{{~/ports}}}.   Inside this new directory, you should run {{{portindex}}} which will create the repository index of everything following the {{{./group/port/Portfile}}} heirarchy.  '''Note:''' This command should be run everytime you make changes as it will include the new index data for MacPorts. Also watch out for any errors it reports, which stop the portfile from showing up in MacPorts.