Opened 13 years ago

Last modified 9 years ago

#32706 new defect

py27-odbc can't find MacPorts ODBC drivers on 10.7 — at Version 2

Reported by: bpanulla (Brian Panulla) Owned by: singingwolfboy@…
Priority: Normal Milestone:
Component: ports Version: 2.0.3
Keywords: haspatch Cc:
Port: py-pyodbc

Description (last modified by ryandesign (Ryan Carsten Schmidt))

The current version of py27-odbc doesn't find ODBC drivers in /opt/local, failing with the classic and super-informative 'Data source name not found, and no default driver specified'. I've tried it with both the mysql-odbc-connector port and my psqlODBC port (still waiting to be approved).

I can connect to the data sources using the MacPorts unixODBC isql client without issue, so this is definitely a problem in pyodbc. I *think* this was previously working under Snow Leopard, but I can't be sure and I don't have a system running that anymore.

I got a hint to the problem from a Stack Overflow question/answer that led me to a solution.

Attached are an updated Portfile and a new setup.py.patch that adds MacPorts library and include paths to the build process.

Alas, I've also included an upgrade to pyodbc 2.1.11. The current version (2.1.8) is quite old and I couldn't see how to accomplish what I needed to do against the old codebase. I f someone who knows more about the build process can tease these two patches apart into one, go for it.

Change History (5)

Changed 13 years ago by bpanulla (Brian Panulla)

Attachment: Portfile added

New Portfile

Changed 13 years ago by bpanulla (Brian Panulla)

Attachment: setup.py.patch added

New patch that fixes include/library paths.

comment:1 Changed 13 years ago by mf2k (Frank Schima)

Owner: changed from macports-tickets@… to singingwolfboy@…

Please supply a unified diff of the portfile so we can easily see the changes you made.

Changed 13 years ago by bpanulla (Brian Panulla)

Attachment: pyodbc-2.1.11.patch added

Full unified patch of the change relative to current MacPorts trunk.

comment:2 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)

Your patch hardcodes /opt/local; you must instead arrange to use the current value of ${prefix}.

Note: See TracTickets for help on using tickets.