Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#37635 closed defect (fixed)

py-spatialite 2.6.2 fails to build

Reported by: ian.rees@… Owned by: anddam (Andrea D'Amore)
Priority: Normal Milestone:
Component: ports Version: 2.1.2
Keywords: haspatch Cc:
Port: py-spatialite

Description

Macports 2.1.2 updated ports tree 2013-01-14

Darwin 11.4.2

Xcode 4.2

spatialite 2.3.1 installed

Build fails with errors relating to finding geos_c.h .

The problem seems to be that setup.py in py-spatialite directory doesn't add my macports installation ${PREFIX}/include and ${PREFIX}/lib directories to clang search paths. I'm not sure on the proper way to fix this - the existing diff file for setup.py makes some changes to the include/lib directories to remove the wrong paths, but doesn't put anything in to replace them. I'd imagine there's a clever portfile construct to inject the desired macports prefix into the diff files, or otherwise get the proper include/lib directories to clang by the time it runs?

Have attached an updated patch-setup_py.diff that gets it going* assuming the macports installation prefix is /opt/local/ .

*This doesn't resolve (what I think is) a separate issue - src/connection.h redefines spatialite_init() from the existing /opt/local/include/spatialite.h, so I hackily fixed that in src/connection.h:

#ifndef SPATIALITE_DECLARE
int spatialite_init(int verbose);
#endif

Attachments (2)

patch-setup_py.diff-new (1.0 KB) - added by ian.rees@… 11 years ago.
py27-spatialite.log (33.1 KB) - added by ian.rees@… 11 years ago.

Download all attachments as: .zip

Change History (14)

Changed 11 years ago by ian.rees@…

Attachment: patch-setup_py.diff-new added

comment:1 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: changed from macports-tickets@… to and.damore@…

comment:2 Changed 11 years ago by anddam (Andrea D'Amore)

Status: newassigned

I'd like to reproduce the error before patching. I'm on 11.4.2 as well, using Xcode 4.5.2 and I'm able to build py27-spatialite without errors.

What command are you actually running in order to install pyXX-spatialite?

Can you please run

port log py27-spatialite >~/Desktop/port_py-spatialite.log

and attach to this ticket the file that gets created on your desktop?

Change the python version according to your selection, I picked python 2.7 in the upward command.

Last edited 11 years ago by anddam (Andrea D'Amore) (previous) (diff)

comment:3 in reply to:  2 Changed 11 years ago by ian.rees@…

Replying to and.damore@…:

I'd like to reproduce the error before patching. I'm on 11.4.2 as well, using Xcode 4.5.2 and I'm able to build py27-spatialite without errors.

Understood - it's entirely possible that my machine is in some weird state. In case it matters, I've got sqlite3 3.7.15.2 installed through macports as well.

What command are you actually running in order to install pyXX-spatialite?

I started with 'sudo port install qgis', then 'sudo port install py-spatialite' when that didn't fly.

Can you please run

port log py27-spatialite >~/Desktop/port_py-spatialite.log

and attach to this ticket the file that gets created on your desktop?

Sure, will do shortly.

Change the python version according to your selection, I picked python 2.7 in the upward command.

Thanks! -Ian-

Changed 11 years ago by ian.rees@…

Attachment: py27-spatialite.log added

comment:4 Changed 11 years ago by jmroot (Joshua Root)

Clang versions that support CPATH wouldn't have problems due to the missing -I flag.

comment:5 in reply to:  4 Changed 11 years ago by anddam (Andrea D'Amore)

Replying to jmr@…:

Clang versions that support CPATH wouldn't have problems due to the missing -I flag.

Is there a reference to check what Xcode version and compiler combinations support what/whatnot?

comment:6 Changed 11 years ago by dshean@…

Ran into the same issue during an install of qgis.

The patch for the existing setup.py patchfile (!) and the connection.h hack worked for me.

Are there plans to incorporate these fixes, or something cleaner?

Darwin 11.4.2 x86_64, XCode 4.2.1

comment:7 Changed 11 years ago by anddam (Andrea D'Amore)

What issue is the connection.h hack trying to fix?

comment:8 Changed 11 years ago by anddam (Andrea D'Amore)

Resolution: fixed
Status: assignedclosed

Committed r103345, ticket closed.

comment:9 Changed 11 years ago by jmroot (Joshua Root)

You appear to have forgotten to commit the new patchfile?

comment:10 Changed 11 years ago by anddam (Andrea D'Amore)

No, it's there. The proposed patchfile was an extension to the already existing one, compare the committed version and the proposed one.

Last edited 11 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:11 Changed 11 years ago by jmroot (Joshua Root)

#38211 says otherwise.

comment:12 Changed 11 years ago by anddam (Andrea D'Amore)

Correct, I thought you were referring to file patch-setup_py.diff-new attached to this very ticket due to the "-new" in name, see comment:ticket:38211:3.

Note: See TracTickets for help on using tickets.