New port: postgis2 (PostGIS 2.0)

Ryan Schmidt ryandesign at macports.org
Sun Apr 29 13:51:44 PDT 2012


On Apr 29, 2012, at 14:14, vincent habchi wrote:

>>> I’ve committed this morning in r92462 a new port corresponding to PostGIS v 2.0 and up.
>>> This port is incompatible with postgis, that is to say PostGIS 1.x. Both install the same files at the same place.
>> 
>> Hmmm... That's a deal breaker for me. I don't have two machines to test it out. Since the two different versions can haooily coexist, why not make it so instead of requiring uninstalling PostGIS 1.5?
> 
> Because PostGIS 2.0 won’t compile with PostGIS 1.5 installed. There are several include files that PostGIS 1.5/2.0 installs in ${prefix}/include that take precedence over the ones furnished with the distribution (because -I${prefix}/include appears before other -I… during compilation). Thus, if you have PostGIS 1.5 installed, PostGIS 2.0 will mistakenly use the already installed headers to compile and fail.

Then ideally you should fix the order of the arguments so that -I${prefix}/include appears later. If that's difficult, sometimes you can fix this by replacing -I${prefix}/include with -isystem${prefix}/include, if you can figure out where to do that.

If you can't make postgis2 build when postgis is installed, then you should prevent the problem up-front with a nice error message; see for example how the ImageMagick port handles bailing out nicely when it discovers that the cryptlib port is installed. The relevant block in the ImageMagick port is designed to be general-purpose so you can copy it and modify it for your ports.

You added this line to the postgis2 port:

> # PostGIS 2.0 is not compatible with PostGIS 1.5
> conflicts           postgis

But note that the conflicts keyword only models an install-time conflict, as in two ports wanting to install the same files to the same locations. The conflicts keyword does *not* model a build-time conflict such as the one you're saying exists.




More information about the macports-dev mailing list