From 2fa27b046078d83fa5d62f34c4186594bd236d6b Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Mon, 18 Apr 2011 18:12:27 +0000 Subject: [PATCH] osx: python 3.2 fixes --- osx/patches/boost_python1_46_1_for_3.2.diff | 14 ++++++++++++++ osx/scripts/build_boost_pythons.py | 16 +++++++++------- osx/scripts/fetch_py_releases.sh | 5 ++++- 3 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 osx/patches/boost_python1_46_1_for_3.2.diff diff --git a/osx/patches/boost_python1_46_1_for_3.2.diff b/osx/patches/boost_python1_46_1_for_3.2.diff new file mode 100644 index 000000000..46c33cb54 --- /dev/null +++ b/osx/patches/boost_python1_46_1_for_3.2.diff @@ -0,0 +1,14 @@ +Index: libs/python/src/converter/builtin_converters.cpp +=================================================================== +--- libs/python/src/converter/builtin_converters.cpp (revision 56305) ++++ libs/python/src/converter/builtin_converters.cpp (revision 71050) +@@ -432,5 +432,8 @@ + { + int err = PyUnicode_AsWideChar( +- (PyUnicodeObject *)intermediate ++#if PY_VERSION_HEX < 0x03020000 ++ (PyUnicodeObject *) ++#endif ++ intermediate + , &result[0] + , result.size()); diff --git a/osx/scripts/build_boost_pythons.py b/osx/scripts/build_boost_pythons.py index b55a280ff..df68524ff 100644 --- a/osx/scripts/build_boost_pythons.py +++ b/osx/scripts/build_boost_pythons.py @@ -14,22 +14,24 @@ if ! darwin in [ feature.values ] project : default-build darwin ; using python : %(ver)s # version - : %(system)s/Library/Frameworks/Python.framework/Versions/%(ver)s/bin/python%(ver)s # cmd-or-prefix - : %(system)s/Library/Frameworks/Python.framework/Versions/%(ver)s/include/python%(ver)s # includes - : %(system)s/Library/Frameworks/Python.framework/Versions/%(ver)s/lib/python%(ver)s/config # a lib actually symlink + : %(system)s/Library/Frameworks/Python.framework/Versions/%(ver)s/bin/python%(ver)s%(variant)s # cmd-or-prefix + : %(system)s/Library/Frameworks/Python.framework/Versions/%(ver)s/include/python%(ver)s%(variant)s # includes + : %(system)s/Library/Frameworks/Python.framework/Versions/%(ver)s/lib/python%(ver)s/config%(variant)s # a lib actually symlink : darwin # condition ; libraries = --with-python ; """ def compile_lib(ver,arch='32_64'): - if ver in ('2.5','2.6'): + if ver in ('3.2'): + open('user-config.jam','w').write(USER_JAM % {'ver':ver,'system':'','variant':'m'}) + elif ver in ('2.5','2.6'): # build against system pythons so we can reliably link against FAT binaries - open('user-config.jam','w').write(USER_JAM % {'ver':ver,'system':'/System'}) + open('user-config.jam','w').write(USER_JAM % {'ver':ver,'system':'/System','variant':''}) else: # for 2.7 and above hope that python.org provides 64 bit ready binaries... - open('user-config.jam','w').write(USER_JAM % {'ver':ver,'system':''}) - cmd = "./bjam -q --with-python -a -j2 --ignore-site-config --user-config=user-config.jam link=shared toolset=darwin -d2 address-model=%s architecture=x86 release stage" % arch#linkflags=-search_paths_first + open('user-config.jam','w').write(USER_JAM % {'ver':ver,'system':'','variant':''}) + cmd = "./bjam -q --with-python -a -j2 --ignore-site-config --user-config=user-config.jam link=shared toolset=darwin -d2 address-model=%s architecture=x86 variant=release stage" % arch#linkflags=-search_paths_first print cmd os.system(cmd) diff --git a/osx/scripts/fetch_py_releases.sh b/osx/scripts/fetch_py_releases.sh index 1b01a1ff5..8718f99fc 100755 --- a/osx/scripts/fetch_py_releases.sh +++ b/osx/scripts/fetch_py_releases.sh @@ -15,4 +15,7 @@ wget http://www.python.org/ftp/python/2.7.1/python-2.7.1-macosx10.6.dmg wget http://www.python.org/ftp/python/3.1.3/python-3.1.3-macosx10.3.dmg # 3.1.2 sources -wget http://www.python.org/ftp/python/3.1.2/Python-3.1.2.tar.bz2 \ No newline at end of file +wget http://www.python.org/ftp/python/3.1.2/Python-3.1.2.tar.bz2 + +# 3.2 +wget http://www.python.org/ftp/python/3.2/python-3.2-macosx10.6.dmg \ No newline at end of file