[MacPorts] #41874: Exempi patch causes python ctypes problem, relates to ticket 20965
MacPorts
noreply at macports.org
Sat Dec 21 13:27:45 PST 2013
#41874: Exempi patch causes python ctypes problem, relates to ticket 20965
-------------------------------+--------------------------------
Reporter: john.g.evans.ne@… | Owner: macports-tickets@…
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.2.1
Keywords: | Port: exempi
-------------------------------+--------------------------------
When trying to access the exempi library via python's ctypes module, the
following error is seen
{{{
>>> import ctypes
>>> c = ctypes.CDLL('/opt/local/lib/libexempi.dylib')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py",
line 365, in __init__
self._handle = _dlopen(self._name, mode)
OSError: dlopen(/opt/local/lib/libexempi.dylib, 6): Symbol not found:
__Z16ConvertToMacLangRKSstPSs
Referenced from: /opt/local/lib/libexempi.dylib
Expected in: flat namespace
in /opt/local/lib/libexempi.dylib
}}}
This does not happen when exempi is compiled from source. The symbol
being referenced is the `ConvertToMacLang` function, which is defined in
exempi's `Quicktime_Support.cpp` file, and exempi's portfile excludes this
file from the library (as applied by the 3rd of three patches)
{{{
# see http://trac.macports.org/ticket/20965
if {${build_arch} eq "x86_64" || ${build_arch} eq "ppc64"} {
patchfiles-append patch-
source__XMPFiles__FormatSupport__Makefile.am
configure.cppflags-append -DXMP_64
}
}}}
However, `ConvertToMacLang` is called in another exempi file, so the
symbol is still there and listed as undefined when `nm` is used on the
library.
{{{
nm /opt/local/lib/libexempi.dylib | grep ConvertToMac
U __Z16ConvertToMacLangRKSstPSs
}}}
When looking over the history of ticket #20965, it looks to me like the
original issue that the ticket tries to resolve has actually been resolved
upstream by the exempi maintainer (see exempi bug #58175 at
https://bugs.freedesktop.org/show_bug.cgi?id=58175 ).
When the above portfile stanza is removed and exempi recompiled and
reinstalled with only the first two patches applied, python can then load
the library via ctypes. Have tested this on snow leopard, lion, and
mavericks.
--
Ticket URL: <https://trac.macports.org/ticket/41874>
MacPorts <http://www.macports.org/>
Ports system for OS X
More information about the macports-tickets
mailing list