patching in general

Bradley Giesbrecht brad at pixilla.com
Thu Feb 5 06:11:51 PST 2009


On Feb 4, 2009, at 9:23 PM, Ryan Schmidt wrote:

> On Feb 4, 2009, at 09:54, Bradley Giesbrecht wrote:
>> ...............
>> Patching things isn't all that big a deal but I recently patched  
>> bind9 to (+dlz-mysql) and I used the method used in php5 to help  
>> bind9 find the mysql libs and headers.
>> Basically symlink the mysql dirs into ./work/.
>
> It's kinda clever, isn't it? But also a bit annoying that it's  
> necessary.

I thought so. It makes the fewest changes to files and goes away after  
install.

>> In macports the fact that they are in lib/mysql5/mysql and include/ 
>> mysql5/mysql will break every configure script I can think of.
>>
>> I really don't mind patching, I'm kinda used to it on osx although  
>> I do not claim to be an expert, but it would be nice if there was a  
>> macports best practice or something so if a person takes the time  
>> to add a some functionality there is the best chance that it will  
>> be acceptable to the maintainer.
>
> Best practice specifically for linking a port with MacPorts mysql5?  
> Or were you looking for something more general?

In general.

>> For instance, some guidance on reinplace vs patch files. Use of  
>> symlinks vs patching configure.
>
> 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"


It's important for me to thank you and the entire macports community  
for your work. I may be getting behind on my projects by trying to use  
and contribute to macports but I wouldn't even be attempting to do  
this on a mac if projects like macports didn't exist. And I am so  
happy to be typing this on my Macbook running Leopard rather then a  
FreeBsd desktop or always needing a remote shell.

Thank you, thank you all!!!


//Brad


More information about the macports-dev mailing list