[MacPorts] howto/PatchLocal modified

Rainer Müller raimue at macports.org
Fri Oct 5 05:16:44 PDT 2012


Hey,

this is regarding your addition to the MacPorts wiki at
https://trac.macports.org/wiki/howto/PatchLocal

First of all, this is a great idea for a tutorial. Thank you for your
contribution. However, I have some notes on this topic:

Users should not apply patches directly in sources synced from the
main ports tree. The changes would be overwritten on the next
selfupdate/sync and ports can be rebuild due to various conditions.
Examples would be adding a +universal variant to a dependent, which
could even happen automatically if a specific arch is not supported
in a port, or rev-upgrade finds this port in a broken state and
issues a rebuild.

Therefore the better way is to add a local ports tree (also called a
repository but not to be confused with the subversion repository) and
apply the patch in this local ports tree. Setting up a local ports tree
is described in the guide:
http://guide.macports.org/#development.local-repositories

We should avoid documenting the same things at multiple places (as we
experienced with our installation instructions as they are now shattered
across the wiki, the website and the guide in different versions). For
instance, there is also a section for applying patches in the guide:
http://guide.macports.org/#development.patches.source

I have no preference whether this topic should be covered in the guide
or in the wiki. However, there should be a single place where users
interested in this topic find a tutorial.

Some smaller suggestions on the howto: use 'port dir arb' to get the
port directory and use 'port work arb' to get the path of the work
directory. Probably all the commands listed should be start with 'sudo
port' when targeting a default installation.

Rainer

On 2012-10-05 01:44, MacPorts wrote:
> Page "howto/PatchLocal" was changed by macports.org at ch.pkts.ca
> Diff URL: <https://trac.macports.org/wiki/howto/PatchLocal?action=diff&version=2>
> Revision 2
> Comment: Testing the port, after testing the program
> Changes:
> -------8<------8<------8<------8<------8<------8<------8<------8<--------
> Index: howto/PatchLocal
> =========================================================================
> --- howto/PatchLocal (version: 1)
> +++ howto/PatchLocal (version: 2)
> @@ -14,14 +14,14 @@
>  === Step 1: '''Get your port's sourcecode''' ===
>  
>  {{{
> -   port patch arb
> -   find /opt/local/var/macports -name 'arb*'
> +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/
> +/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''' ===
> @@ -30,7 +30,7 @@
>  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 *
> +* make changes, compile it, test it *
>  }}}
>  
>  === Step 3: '''Make a patch''' ===
> @@ -40,6 +40,13 @@
>  port edit arb     (add the patch-ARB-makefile2.diff file to the list of patches)
>  }}}
>  
> +=== Step 4: '''Test the modified port''' ===
> +
> +{{{
> +port clean arb
> +port build arb
> +}}}
> +
>  === Step 4: '''Make it real''' ===
>  
>  {{{
> -------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 .
> _______________________________________________
> macports-changes mailing list
> macports-changes at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo/macports-changes
> 



More information about the macports-dev mailing list