Opened 11 years ago

Closed 10 years ago

#41874 closed defect (fixed)

Exempi patch causes python ctypes problem, relates to ticket 20965

Reported by: quintusdias (John G Evans) Owned by: dbevans (David B. Evans)
Priority: Normal Milestone:
Component: ports Version: 2.2.1
Keywords: Cc:
Port: exempi

Description

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.

Change History (3)

comment:1 Changed 11 years ago by larryv (Lawrence Velázquez)

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

comment:2 Changed 11 years ago by dbevans (David B. Evans)

Status: newassigned

comment:3 Changed 10 years ago by dbevans (David B. Evans)

Resolution: fixed
Status: assignedclosed

exempi updated to version 2.2.2 along with suggested change in r128973. Sorry for not fixing this earlier.

Note: See TracTickets for help on using tickets.