mac osx 10.6 build problem

Asked by reco

we are trying to build pyexiv2 for mac osx 10.6.4

installed packages via mac ports

scons @2.0.1_0
python26 @2.6.6_0+no_tkinter
exiv2 @0.19_0
boost @1.44.0_0+python26
pyexiv2 form source pyexiv2 0.2.2

following robin mills tips @ http://clanmills.com/articles/gpsexiftags/macos.shtml we made the following changes to the SConscript

@@ -1,5 +1,6 @@
 # -*- coding: utf-8 -*-

+import sys
 import os
 import site
 from distutils.sysconfig import get_python_inc, get_python_lib
@@ -7,6 +8,9 @@ import SCons.Util

 env = Environment()

+env['LIBPATH'] = ['/opt/local/lib']
+env['CPPPATH'] = ['/opt/local/include']
+
 # Take environment variables into account
 # (see https://bugs.launchpad.net/pyexiv2/+bug/249835)
 if os.environ.has_key('CXX'):
@@ -16,6 +20,11 @@ if os.environ.has_key('CXXFLAGS'):
 if os.environ.has_key('LDFLAGS'):
     env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])

+# if os.environ.has_key('BOOST_ROOT'):
+'] += '-I' + SCons.Util.CLVar(os.environ['BOOST_ROOT'])
+
 # Include directories to look for 'Python.h' in
 env.Append(CPPPATH=[get_python_inc(plat_specific=True)])

@@ -26,6 +35,12 @@ env.Append(CPPPATH=[get_python_inc(plat_specific=True)])
 libs = [ARGUMENTS.get('BOOSTLIB', 'boost_python'), 'exiv2']
 env.Append(LIBS=libs)

+if sys.platform[:6] == 'darwin':
+ print 'sys.platform' + sys.platform[:6]
+ # MacOS X
+ # link the Python framework
+ env['FRAMEWORKS'] += ['Python']
+
 # Build shared library libpyexiv2
 cpp_sources = ['exiv2wrapper.cpp', 'exiv2wrapper_python.cpp']
 libpyexiv2 = env.SharedLibrary('exiv2python', cpp_sources)
@@ -53,6 +68,15 @@ else:
     else:
         install_dir = os.path.join(dest_dir, python_lib_path[1:])

+# if sys.platform[:6] == 'darwin':
+ install_dir = '/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/'
+
+print "doing an install into ", install_dir
+
 env.Install(install_dir, [libpyexiv2])
 modules = ['__init__', 'metadata', 'exif', 'iptc', 'xmp', 'preview', 'utils']
 env.Install(os.path.join(install_dir, 'pyexiv2'),

scons does successfully build.
sudo scons install copies the files into the install_dir above:

./libexiv2python.dylib
./pyexiv2/__init__.py
./pyexiv2/exif.py
./pyexiv2/iptc.py
./pyexiv2/metadata.py
./pyexiv2/preview.py
./pyexiv2/utils.py
./pyexiv2/xmp.py

we symlink the lib so python finds it.

ls -s ./libexiv2python.dylib ./libexiv2python.so

$ python2.6
>>> import pyexiv2
Segmentation fault

mac os x crash report:
Process: Python [80534]
Path: /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python
Identifier: Python
Version: ??? (???)
Code Type: X86-64 (Native)
Parent Process: bash [80449]

Date/Time: 2010-11-05 00:58:12.823 -0400
OS Version: Mac OS X 10.6.4 (10F569)
Report Version: 6

Interval Since Last Report: 223175 sec
Crashes Since Last Report: 9
Per-App Crashes Since Last Report: 9
Anonymous UUID: 937A886A-264A-45D5-AC0B-4ACC5C0065EF

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 org.python.python 0x000000010134f776 PyInt_FromLong + 36
1 libexiv2python.dylib 0x00000001010013b8 boost::python::converter::arg_to_python<int>::arg_to_python(int const&) + 30
2 libexiv2python.dylib 0x00000001010013e0 _object* boost::python::api::object_initializer_impl<false, false>::get<int>(int const&, mpl_::bool_<false>) + 26
3 libexiv2python.dylib 0x000000010100142c _object* boost::python::api::object_base_initializer<int>(int const&) + 37
4 libexiv2python.dylib 0x0000000101001447 boost::python::api::object::object<int>(int const&) + 25
5 libexiv2python.dylib 0x00000001010014ad boost::python::tuple boost::python::make_tuple<int, int, int>(int const&, int const&, int const&) + 88
6 libexiv2python.dylib 0x0000000101001785 __static_initialization_and_destruction_0(int, int) + 262
7 libexiv2python.dylib 0x00000001010018a7 _GLOBAL__I__ZN12_GLOBAL__N_12_1E + 19
8 dyld 0x00007fff5fc0d500 ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 228
9 dyld 0x00007fff5fc0bcec ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int) + 236
10 dyld 0x00007fff5fc0bda6 ImageLoader::runInitializers(ImageLoader::LinkContext const&) + 58
11 dyld 0x00007fff5fc08fbb dlopen + 573
12 libSystem.B.dylib 0x00007fff8786d2c0 dlopen + 61
13 org.python.python 0x00000001000e959f _PyImport_GetDynLoadFunc + 303
14 org.python.python 0x00000001000d38e4 _PyImport_LoadDynamicModule + 132
15 org.python.python 0x00000001000d1bcf import_submodule + 383
16 org.python.python 0x00000001000d2171 load_next + 369
17 org.python.python 0x00000001000d23fb PyImport_ImportModuleLevel + 363
18 org.python.python 0x00000001000af973 builtin___import__ + 131
19 org.python.python 0x000000010000b902 PyObject_Call + 98
20 org.python.python 0x00000001000b0bb7 PyEval_CallObjectWithKeywords + 87
21 org.python.python 0x00000001000b4e7e PyEval_EvalFrameEx + 12622
22 org.python.python 0x00000001000b9af5 PyEval_EvalCodeEx + 2197
23 org.python.python 0x00000001000b9c16 PyEval_EvalCode + 54
24 org.python.python 0x00000001000ceac0 PyImport_ExecCodeModuleEx + 208
25 org.python.python 0x00000001000cfd22 load_source_module + 722
26 org.python.python 0x00000001000d12df load_package + 463
27 org.python.python 0x00000001000d1bcf import_submodule + 383
28 org.python.python 0x00000001000d20ea load_next + 234
29 org.python.python 0x00000001000d23fb PyImport_ImportModuleLevel + 363
30 org.python.python 0x00000001000af973 builtin___import__ + 131
31 org.python.python 0x000000010000b902 PyObject_Call + 98
32 org.python.python 0x00000001000b0bb7 PyEval_CallObjectWithKeywords + 87
33 org.python.python 0x00000001000b4e7e PyEval_EvalFrameEx + 12622
34 org.python.python 0x00000001000b9af5 PyEval_EvalCodeEx + 2197
35 org.python.python 0x00000001000b9c16 PyEval_EvalCode + 54
36 org.python.python 0x00000001000de50c PyRun_InteractiveOneFlags + 380
37 org.python.python 0x00000001000de76e PyRun_InteractiveLoopFlags + 78
38 org.python.python 0x00000001000defe1 PyRun_AnyFileExFlags + 161
39 org.python.python 0x00000001000ee40c Py_Main + 2764
40 org.python.python 0x0000000100000f14 0x100000000 + 3860

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x000000010146e740 rbx: 0x0000000000000000 rcx: 0x0000000100700030 rdx: 0x0000000000000000
  rdi: 0x0000000000000000 rsi: 0x00007fff5fbfcafc rbp: 0x00007fff5fbfc960 rsp: 0x00007fff5fbfc950
   r8: 0x0000000000000000 r9: 0x0000000000000000 r10: 0x0000000000001002 r11: 0x0000000000000206
  r12: 0x0000000000000001 r13: 0x0000000101001894 r14: 0x0000000101000330 r15: 0x000000010105a000
  rip: 0x000000010134f776 rfl: 0x0000000000010287 cr2: 0x0000000000000000

Binary Images:
       0x100000000 - 0x100000fff +org.python.python 2.6.6 (2.6.6) <07609241-6C28-4635-A674-C13EDAE17F8A> /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python
       0x100003000 - 0x10014fff7 +org.python.python 2.6.6, (c) 2004-2008 Python Software Foundation. (2.6.6) <3519EF3C-B19E-7EA0-2445-007FA26B7377> /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Python
       0x1002e3000 - 0x1002e5ff7 +readline.so ??? (???) <CBCFF103-E51C-2316-8292-951A5ECA2EFD> /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload/readline.so
       0x100440000 - 0x100468ff7 +libreadline.6.1.dylib 6.1.0 (compatibility 6.0.0) <E3BB833E-6694-4ABE-38CA-A1673CF32ECE> /opt/local/lib/libreadline.6.1.dylib
       0x10047e000 - 0x1004c3fef +libncursesw.5.dylib 5.0.0 (compatibility 5.0.0) <66125717-236D-0F6C-9C1B-15E266948B7F> /opt/local/lib/libncursesw.5.dylib
       0x1004d2000 - 0x1004fcff7 +libncurses.5.dylib 5.0.0 (compatibility 5.0.0) <B5CBC236-D8A4-B4F3-9F5B-EDF44861E479> /opt/local/lib/libncurses.5.dylib
       0x100515000 - 0x100554ff7 +libboost_python.dylib ??? (???) <4D51FC8E-495D-9BE1-D2D7-5BAF375084DC> /opt/local/lib/libboost_python.dylib
       0x1005a2000 - 0x1005abff7 +libintl.8.dylib 10.1.0 (compatibility 10.0.0) <D1004391-54AA-C4FD-47A1-80B94415BD62> /opt/local/lib/libintl.8.dylib
       0x1005b1000 - 0x1005c5ff7 +libz.1.dylib 1.2.5 (compatibility 1.0.0) <6D767FC2-DF89-6017-4B82-A1E5EB8CEED9> /opt/local/lib/libz.1.dylib
       0x1005c9000 - 0x1005e8fef +libexpat.1.dylib 7.2.0 (compatibility 7.0.0) <4F23C4ED-72D8-5478-FBBC-5DC01F8E4752> /opt/local/lib/libexpat.1.dylib
       0x101000000 - 0x101059fff +libexiv2python.dylib ??? (???) <B6A675E0-15AA-9C43-AB46-2460C4B4F939> /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/libexiv2python.dylib
       0x10113f000 - 0x1012a3fff +libexiv2.6.dylib 7.0.0 (compatibility 7.0.0) <25F6719D-DACD-56BE-1DC1-7D5EAB3AE03E> /opt/local/lib/libexiv2.6.dylib
       0x101326000 - 0x101436ff7 org.python.python 2.6.1 (2.6.1) <A07FF07F-4DA8-CBF7-A075-7464786DD7BB> /System/Library/Frameworks/Python.framework/Versions/2.6/Python
       0x101496000 - 0x101592fe7 +libiconv.2.dylib 8.0.0 (compatibility 8.0.0) <6907D6DB-2535-7725-484F-74378F42AFED> /opt/local/lib/libiconv.2.dylib
    0x7fff5fc00000 - 0x7fff5fc3bdef dyld 132.1 (???) <B536F2F1-9DF1-3B6C-1C2C-9075EA219A06> /usr/lib/dyld
    0x7fff803d7000 - 0x7fff80423fff libauto.dylib ??? (???) <072804DF-36AD-2DBE-7EF8-639CFB79077F> /usr/lib/libauto.dylib
    0x7fff80f47000 - 0x7fff80f58ff7 libz.1.dylib 1.2.3 (compatibility 1.0.0) <FB5EE53A-0534-0FFA-B2ED-486609433717> /usr/lib/libz.1.dylib
    0x7fff81501000 - 0x7fff81505ff7 libmathCommon.A.dylib 315.0.0 (compatibility 1.0.0) <95718673-FEEE-B6ED-B127-BCDBDB60D4E5> /usr/lib/system/libmathCommon.A.dylib
    0x7fff862dd000 - 0x7fff86452ff7 com.apple.CoreFoundation 6.6.3 (550.29) <48810602-63C3-994D-E563-DD02B16E76E1> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
    0x7fff87866000 - 0x7fff87a26fef libSystem.B.dylib 125.2.0 (compatibility 1.0.0) <95E02DD0-ADEA-745B-E7FA-ABA064E4658C> /usr/lib/libSystem.B.dylib
    0x7fff87b1d000 - 0x7fff87bd3fff libobjc.A.dylib 227.0.0 (compatibility 1.0.0) <F206BE6D-8777-AE6C-B367-7BEA76C14241> /usr/lib/libobjc.A.dylib
    0x7fff888bb000 - 0x7fff88938fef libstdc++.6.dylib 7.9.0 (compatibility 7.0.0) <35ECA411-2C08-FD7D-11B1-1B7A04921A5C> /usr/lib/libstdc++.6.dylib
    0x7fff88939000 - 0x7fff88af7fff libicucore.A.dylib 40.0.0 (compatibility 1.0.0) <0E53A4A6-AC06-1B61-2285-248F534EE356> /usr/lib/libicucore.A.dylib
    0x7fffffe00000 - 0x7fffffe01fff libSystem.B.dylib ??? (???) <95E02DD0-ADEA-745B-E7FA-ABA064E4658C> /usr/lib/libSystem.B.dylib

------ Added by <email address hidden> -- 2010-11-05 08:24:53PDT ------

I'll build the combo:

scons @2.0.1_0
python26 @2.6.6_0+no_tkinter
exiv2 @0.19_0
boost @1.44.0_0+python26
pyexiv2 form source pyexiv2 0.2.2

I do have a suggestion. On each library you have built and installed run (libpyexiv2, libexiv2.dylib, libboost-python and python himself)

"otool -L"
"lipo -info"
"install_name_tool"

Another thought is to set the environment variable DYLD_PRINT_LIBRARIES (see man dyld) and start up again to be sure your python is loading your libraries.

I don't think this is going to reveal anything extraordinary. I think this is about the same as the doctor using his stethoscope - it keeps you busy while he's thinking!

Question information

Language:
English Edit question
Status:
Solved
For:
pyexiv2 Edit question
Assignee:
robinmills Edit question
Solved by:
reco
Solved:
Last query:
Last reply:
Revision history for this message
Olivier Tilloy (osomon) said :
#1

Thanks Robin for looking into this!
I'm away from home at the moment and haven't had time to test the mac build yet, but I'll keep a close eye on the resolution of this question.
Note: Robin, you may want to add comments to the question, instead of modifying the original description.

Revision history for this message
reco (reco.nex9) said :
#2

hi olivier,

this would be amazing. we are now using the command line tool of exif2 inside python.
we are pretty new to to this stuff. but would love to help to get this running.

reco

Revision history for this message
robinmills (robinmills) said :
#3

Olivier

Yes. I assigned the issue to me, the web-ui immediately offered to
change the description - with no option to "Add new information". So I
tacked it on the bottom (with a very clear indication of what I had done).

However after I submitted the update, it offered to "Add Note", which
was what I expected in the first place. Software .... grrrrrrrrr ......

Anyway, I'll spend Saturday morning on this.

Robin

On 11/5/10 11:04 AM, Olivier Tilloy wrote:
> Question #132670 on pyexiv2 changed:
> https://answers.launchpad.net/pyexiv2/+question/132670
>
> Olivier Tilloy posted a new comment:
> Thanks Robin for looking into this!
> I'm away from home at the moment and haven't had time to test the mac build yet, but I'll keep a close eye on the resolution of this question.
> Note: Robin, you may want to add comments to the question, instead of modifying the original description.
>

Revision history for this message
reco (reco.nex9) said :
#4

hi robin,

cool i will be around if you need more info or help.

reco

Revision history for this message
robinmills (robinmills) said :
#5

Good News. I have a fix.

This issue is being caused by build/libexiv2python.dylib being built to link again /System/Library/Frameworks/Python.framework instead of /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Python built by macports.

251 /Users/rmills/gnu/pyexiv2-0.2.2 $ scons
scons: Reading SConscript files ...
sys.platformdarwin
doing an install into /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages
scons: done reading SConscript files.
scons: Building targets ...
scons: `.' is up to date.
scons: done building targets.
252 /Users/rmills/gnu/pyexiv2-0.2.2 $ del build
253 /Users/rmills/gnu/pyexiv2-0.2.2 $ scons
scons: Reading SConscript files ...
sys.platformdarwin
doing an install into /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages
scons: done reading SConscript files.
scons: Building targets ...
g++ -o build/exiv2wrapper.os -c -fPIC -I/opt/local/include -I/opt/local/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 src/exiv2wrapper.cpp
g++ -o build/exiv2wrapper_python.os -c -fPIC -I/opt/local/include -I/opt/local/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 src/exiv2wrapper_python.cpp
g++ -o build/libexiv2python.dylib -arch x86_64 -dynamiclib build/exiv2wrapper.os build/exiv2wrapper_python.os -L/opt/local/lib -lboost_python -lexiv2 -framework Python
scons: done building targets.
254 /Users/rmills/gnu/pyexiv2-0.2.2 $ otool -L build/libexiv2python.dylib
build/libexiv2python.dylib:
 build/libexiv2python.dylib (compatibility version 0.0.0, current version 0.0.0)
 /opt/local/lib/libexiv2.6.dylib (compatibility version 7.0.0, current version 7.0.0)
 /System/Library/Frameworks/Python.framework/Versions/2.6/Python (compatibility version 2.6.0, current version 2.6.1)
 /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
 /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0)
255 /Users/rmills/gnu/pyexiv2-0.2.2 $

The fix is to use install_name_tool to change the linking:

255 /Users/rmills/gnu/pyexiv2-0.2.2 $ install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.6/Python /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Python build/libexiv2python.dylib

256 /Users/rmills/gnu/pyexiv2-0.2.2 $ otool -L build/libexiv2python.dylib
build/libexiv2python.dylib:
 build/libexiv2python.dylib (compatibility version 0.0.0, current version 0.0.0)
 /opt/local/lib/libexiv2.6.dylib (compatibility version 7.0.0, current version 7.0.0)
 /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Python (compatibility version 2.6.0, current version 2.6.1)
 /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
 /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0)

257 /Users/rmills/gnu/pyexiv2-0.2.2 $ sudo scons install
scons: Reading SConscript files ...
sys.platformdarwin
doing an install into /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages
scons: done reading SConscript files.
scons: Building targets ...
g++ -o build/libexiv2python.dylib -dynamiclib build/exiv2wrapper.os build/exiv2wrapper_python.os -L/opt/local/lib -lboost_python -lexiv2 -framework Python
scons: `install' is up to date.
scons: done building targets.
258 /Users/rmills/gnu/pyexiv2-0.2.2 $

A much better fix is to change src/SConscript to link to the Python framework built by macports in /opt/local/Library/Frameworks. I've been unable to achieve that (however I'm sure I'll figure this out and update this page). My unsuccessful attempt was to add a -F/opt/local/Library/Frameworks link option, however that isn't sufficient to fix this.

if sys.platform[:6] == 'darwin':
    print 'sys.platform' + sys.platform[:6]
    # MacOS X
    # link the Python framework
    env['FRAMEWORKS'] += ['Python']
    env['LINKFLAGS'] += SCons.Util.CLVar('-F/opt/local/Library/Frameworks/') # <--- Add this

For the moment, the magic is to build as follows:

$ cd pyexiv2-0.2.2
$ scons
$ install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.6/Python /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Python build/libexiv2python.dylib
$ sudo scons install
$ python2.6
>>> import pyexiv2
>>> help(pyexiv2)
---------- Happiness ----------

Here is the src/SConcript file which I used (courtesy of reco). I have included the unsuccessful 'fix' to LINKFLAGS (on line 44). You will have to run install_name_tool between scons and sudo scons install to reach your goal.

# -*- coding: utf-8 -*-

import sys
import os
import site
from distutils.sysconfig import get_python_inc, get_python_lib
import SCons.Util

env = Environment()

# macports 2.6
env['LIBPATH'] = ['/opt/local/lib']
env['CPPPATH'] = ['/opt/local/include']

# Take environment variables into account
# (see https://bugs.launchpad.net/pyexiv2/+bug/249835)
if os.environ.has_key('CXX'):
    env['CXX'] = os.environ['CXX']
if os.environ.has_key('CXXFLAGS'):
    env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS'])
if os.environ.has_key('LDFLAGS'):
    env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])

if os.environ.has_key('BOOST_ROOT'):
    env['CXXFLAGS'] += '-I' + SCons.Util.CLVar(os.environ['BOOST_ROOT'])

# Include directories to look for 'Python.h' in
env.Append(CPPPATH=[get_python_inc(plat_specific=True)])

# Libraries to link against
# On some systems, boost_python is actually called boost_python-mt.
# Use the BOOSTLIB argument to override the default value.
# See https://bugs.launchpad.net/pyexiv2/+bug/523858.
libs = [ARGUMENTS.get('BOOSTLIB', 'boost_python'), 'exiv2']
env.Append(LIBS=libs)

if sys.platform[:6] == 'darwin':
    print 'sys.platform' + sys.platform[:6]
    # MacOS X
    # link the Python framework
    env['FRAMEWORKS'] += ['Python']
    env['LINKFLAGS'] += SCons.Util.CLVar('-F/opt/local/Library/Frameworks/')

# Build shared library libpyexiv2
cpp_sources = ['exiv2wrapper.cpp', 'exiv2wrapper_python.cpp']
libpyexiv2 = env.SharedLibrary('exiv2python', cpp_sources)
env.Alias('lib', libpyexiv2)

# Install the shared library and the Python modules, invoked with
# 'scons install'.
try:
    user_site = GetOption('user')
except AttributeError:
    user_site = False

if user_site:
    # Install in the current user site directory.
    # See http://www.python.org/dev/peps/pep-0370/ for reference.
    install_dir = site.USER_SITE
else:
    python_lib_path = get_python_lib(plat_specific=True)
    # If DESTDIR is specified on the command line when invoking
    # scons, its value will be prepended to each installed target file. See
    # http://www.gnu.org/prep/standards/html_node/DESTDIR.html for reference.
    dest_dir = ARGUMENTS.get('DESTDIR')
    if dest_dir is None or not os.path.isabs(dest_dir):
        install_dir = python_lib_path
    else:
        install_dir = os.path.join(dest_dir, python_lib_path[1:])

if sys.platform[:6] == 'darwin':
    # MacOS X
    # tell him where he really lives
    # NOT HERE '/Library/Python/2.6/site-packages'
    install_dir = '/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages'

print "doing an install into ", install_dir

env.Install(install_dir, [libpyexiv2])
modules = ['__init__', 'metadata', 'exif', 'iptc', 'xmp', 'preview', 'utils']
env.Install(os.path.join(install_dir, 'pyexiv2'),
            ['pyexiv2/%s.py' % module for module in modules])
env.Alias('install', install_dir)

Revision history for this message
reco (reco.nex9) said :
#6

hi robin,
thanx

$ cd pyexiv2-0.2.2
$ rm -rf build
$ scons
$ install_name_tool -change \
   /System/Library/Frameworks/Python.framework/Versions/2.6/Python \
   /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Python \
   build/libexiv2python.dylib
$ sudo scons install
$ ln -s /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/libexiv2python.dylib /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/libexiv2python.so
$ python2.6

Revision history for this message
keith fitzgerald (keith-n) said :
#7

i'm having this issue with python 2.7.2 and pyexiv 0.3.0. i tried the steps above to no avail.

import pyexiv2

results in seg fault.

halp?