patching in general

markd at macports.org markd at macports.org
Thu Feb 5 08:34:41 PST 2009


>> I say use a patchfile when possible, so that if and 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 
>> different users' systems, but ideally first have a patchfile that 
>> changes the prefix to "@PREFIX@", then use reinplace to change 
>> "@PREFIX@" to "${prefix}".
>
>This is the type of guidance I was thinking of.
>
>Preferred method for fixing paths.
>        1. Patch files with "@PREFIX@" or "@X11PREFIX@" and use reinplace
>"$
>{prefix}" or "${x11prefix}".
>Preferred method for fixing libs and includes.
>        1. Check if configure.ldflags-append and
>configure.cppflags-append 
>will work.
>        2. Patch file.
>Preferred method for removing incompatible flags.
>        1. Example mysql, -lcrypt. reinplace " -lcrypt"
>
I wonder if some macro would be useful that would automatically parse
patched files for a set of standard names (highly unique) to be replaced
according to defaults ( '__mports__prefix__' -> ${prefix} etc.) that could
be overridden.  Maybe that is too complex, but sometimes I think the
current patch-and-reinplace way does seem like a cumbersome (though not
difficult) way to do it.

Mark



More information about the macports-dev mailing list