patching in general

Ryan Schmidt ryandesign at macports.org
Wed Feb 4 21:23:40 PST 2009


On Feb 4, 2009, at 09:54, Bradley Giesbrecht wrote:

> The method macports uses to enable package versioning breaks  
> virtually every --with-mysql script I know of.

Yeah... The kicker is that for all mysql5's gyrations, it still  
doesn't enable you to install multiple versions of MySQL simultaneously.

http://trac.macports.org/ticket/4115


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


> Daniel (dluke) is not fond of that approach

I saw that, but wasn't sure why, since it seems to me to be the  
easiest and least-intrusive way to make it work, short of changing  
the layout of the mysql5 port (which I'm not opposed to if someone  
makes a reasonable proposal).

> and asked me if I could find another way to pass the libs and  
> includes to configure. The way the configure script is written for  
> bind9 this isn't possible. It does file exists tests with the  
> common locations if you don't pass in a path. If you pass in a path  
> it assumes this path is the install prefix and looks for lib/mysql  
> and include/mysql from there.

Some configure scripts may let you separately indicate the library  
and include dirs, but for those that don't, and that don't use  
mysql_config, this is a problem.

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

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

> Example, since you are the maintainer for php5 you probably  
> wouldn't have objected to me linking /opt/loca/lib/mysql5/mysql  
> and /opt/local/include/mysql5/mysql into bind9 ./work.
>
> I'm thinking of just gutting the mysql section of all configure  
> scripts and adding compatibility for passing the path to  
> mysql_config to each port I work on. Something I can almost do  
> without paying attention. And if sent upstream it might stand a  
> chance of making it into the source distribution.

Yes, it would be nice of configure scripts would support  
mysql_config; sending such patches upstream would be great.


> If you want to post this message to the list or ignore it  
> altogether that's fine. I know it's a rant and I don't want to be a  
> complainer. You've probably had these discussions a thousand times.
>
> Sorry, macports is great, your great, Daniel's great and you all  
> deserve and have my praise.
>
> I need to add mysql support to pureftpd and I have the same issue  
> with configure not working out of the box. I guess I could just put  
> in a feature request and patch my own locally until the maintainer  
> adds mysql support. I then could offer my patch and not take  
> offense if the maintainer doesn't like my method and move on.
>
> I really need to stop typing this horse to death;)

It does help to type things out sometimes, and I certainly welcome  
your suggestions for improving the ports. Sometimes the only reason  
something is the way it is is because nobody has questioned it...





More information about the macports-dev mailing list