[MacPorts] snc modified

MacPorts noreply at macports.org
Thu Feb 5 06:08:16 PST 2009

Changed page "snc" by snc at macports.org from*
Page URL: <http://trac.macports.org/wiki/snc>
Diff URL: <http://trac.macports.org/wiki/snc?action=diff&version=18>
Revision 18

Index: snc
--- snc (version: 17)
+++ snc (version: 18)
@@ -5,6 +5,8 @@
 Unfortunately, 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.
 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. 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}}}.
+=== Patch Files ===
+Use a patchfile when possible:  When the upstream source changes and your patch breaks, you'll have the context of the patchfile to know whether you need to update or remove the patchfile. Use reinplace to replace things like {{{${prefix} }}}and {{{${x11prefix} }}}and other variables that can be different on users' systems — ideally first have a patchfile that changes the prefix to {{{@PREFIX@}}} then use {{{reinplace}}} to change {{{@PREFIX@}}} to {{{${prefix} }}}.
 === Do Not Hardcode /opt/local ===
 Speaking of {{{reinplace}}}, '''do not''' hardcode {{{/opt/local}}} anywhere! Instead, use {{{reinplace}}} for string manipulation in files.
 == Portindex ==


* 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 snc. If it was not you, please
report to .

More information about the macports-changes mailing list