[MacPorts] howto/PatchLocal added

MacPorts noreply at macports.org
Thu Oct 4 16:15:57 PDT 2012


Page "howto/PatchLocal" was added by macports.org at ch.pkts.ca
Comment: Created a brand new HOWTO, and it seems to work!
Content:
-------8<------8<------8<------8<------8<------8<------8<------8<--------
[wiki:howto <- Back to the HOWTO section]

= How to Patch a Port on Your System =

 * Audience: People who want to change the code of an existing port
 * Requires: MacPorts >= 2.1.2?

== Introduction ==

If you've ever found a port that doesn't work, then found a patch for it with Google, the next step is to apply the patch to the source code, then compile, test, and install the new version of the port so you can use it and get on with your work.  This HOWTO will show you how to do that.  In this example, I'll be using the 'arb' program as an example.

== Installation ==

=== Step 1: '''Get your port's sourcecode''' ===

{{{
   port patch arb
   find /opt/local/var/macports -name 'arb*'
}}}

I found:
{{{
   /opt/local/var/macports/distfiles/arb
   /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_science_arb/arb/work/arbsrc_8210/
}}}

=== Step 2: '''Modify the source with your patch''' ===

{{{
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_science_arb/arb/work/
cp Makefile Makefile.orig
vi Makefile
* make changes, compile, test *
}}}

=== Step 3: '''Make a patch''' ===

{{{
diff -u Makefile.orig Makefile > /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/science/arb/files/patch-ARB-makefile2.diff
port edit arb     (add the patch-ARB-makefile2.diff file to the list of patches)
}}}

=== Step 4: '''Make it real''' ===

{{{
port install arb
}}}
  
[wiki:howto <- Back to the HOWTO section]

-------8<------8<------8<------8<------8<------8<------8<------8<--------

--
Page URL: <https://trac.macports.org/wiki/howto/PatchLocal>
MacPorts <http://www.macports.org/>
Ports system for Mac OS

This is an automated message. Someone added your email address to be
notified of changes on 'howto/PatchLocal' page.
If it was not you, please report to .


More information about the macports-changes mailing list