patching in general

Anders F Björklund afb at macports.org
Thu Feb 5 08:47:34 PST 2009


>>> 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.

Yeah, it's especially painful when you have to extract
the list of all files touched from the patch and then
duplicate that list in the Portfile for reinplace...

That's why some ports use a custom patch{} phase instead,
to filter the patch accordingly before applying it. Like yum,
http://trac.macports.org/browser/trunk/dports/sysutils/yum/ ?

Having such a patch-filter built-in to port would be nice.

--anders



More information about the macports-dev mailing list