From c623429f33c434cb1cb11974d9e71f48dd5a881f Mon Sep 17 00:00:00 2001 From: root Date: Mon, 1 Apr 2013 00:05:25 -0700 Subject: Mon Apr 1 00:05:25 PDT 2013 --- extra/boost/PKGBUILD | 12 ++--- extra/boost/boost-1.52.0-python3.patch | 96 ---------------------------------- extra/boost/boost-1.53.0-python3.patch | 96 ++++++++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+), 102 deletions(-) delete mode 100644 extra/boost/boost-1.52.0-python3.patch create mode 100644 extra/boost/boost-1.53.0-python3.patch (limited to 'extra/boost') diff --git a/extra/boost/PKGBUILD b/extra/boost/PKGBUILD index 4ca50f46f..d2ecd0b95 100644 --- a/extra/boost/PKGBUILD +++ b/extra/boost/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 180862 2013-03-27 13:30:16Z stephane $ +# $Id: PKGBUILD 181117 2013-03-31 19:16:40Z stephane $ # Maintainer: Stéphane Gaudreault # Maintainer: Ionut Biru # Contributor: kevin @@ -8,16 +8,16 @@ pkgbase=boost pkgname=('boost-libs' 'boost') -pkgver=1.52.0 +pkgver=1.53.0 _boostver=${pkgver//./_} -pkgrel=3 +pkgrel=2 url="http://www.boost.org/" arch=('i686' 'x86_64') license=('custom') makedepends=('icu>=51.1' 'python' 'python2' 'bzip2' 'zlib' 'openmpi') source=(http://downloads.sourceforge.net/${pkgbase}/${pkgbase}_${_boostver}.tar.gz - boost-1.52.0-python3.patch) -sha1sums=('1120430030315b0a94b6d63fc04662960db2444c' + boost-1.53.0-python3.patch) +sha1sums=('0e4ef26cc7780c6bbc63987ef2f29be920e2395b' '34026072a7cb2534164f20e77bb71a5c75093307') _stagedir="${srcdir}/stagedir" @@ -29,7 +29,7 @@ build() { # Fix build errors with python 3 sed -i "/PYTHON_ROOT/s/print sys.prefix/print(sys.prefix)/g" bootstrap.sh - patch -Np1 -i ../boost-1.52.0-python3.patch + patch -Np1 -i ../boost-1.53.0-python3.patch # Shut up strict aliasing warnings echo "using gcc : : : -fno-strict-aliasing ;" >> ./tools/build/v2/user-config.jam diff --git a/extra/boost/boost-1.52.0-python3.patch b/extra/boost/boost-1.52.0-python3.patch deleted file mode 100644 index 8d2f59269..000000000 --- a/extra/boost/boost-1.52.0-python3.patch +++ /dev/null @@ -1,96 +0,0 @@ -diff -Naur boost_1_53_0.ori/libs/mpi/src/python/datatypes.cpp boost_1_53_0/libs/mpi/src/python/datatypes.cpp ---- boost_1_53_0.ori/libs/mpi/src/python/datatypes.cpp 2007-11-25 13:38:02.000000000 -0500 -+++ boost_1_53_0/libs/mpi/src/python/datatypes.cpp 2013-03-11 20:59:57.171732691 -0400 -@@ -13,6 +13,10 @@ - #include - #include - -+#if PY_MAJOR_VERSION >= 3 -+#define PyInt_Type PyLong_Type -+#endif -+ - namespace boost { namespace mpi { namespace python { - - void export_datatypes() -diff -Naur boost_1_53_0.ori/libs/mpi/src/python/py_environment.cpp boost_1_53_0/libs/mpi/src/python/py_environment.cpp ---- boost_1_53_0.ori/libs/mpi/src/python/py_environment.cpp 2007-11-25 13:38:02.000000000 -0500 -+++ boost_1_53_0/libs/mpi/src/python/py_environment.cpp 2013-03-11 21:02:12.961737401 -0400 -@@ -11,6 +11,9 @@ - * This file reflects the Boost.MPI "environment" class into Python - * methods at module level. - */ -+ -+#include -+#include - #include - #include - -@@ -50,11 +53,65 @@ - - // If anything changed, convert C-style argc/argv into Python argv - if (mpi_argv != my_argv) -+ { -+#if PY_MAJOR_VERSION >= 3 -+ // Code stolen from py3k/Modules/python.c. -+ -+ wchar_t **argv_copy = (wchar_t **)PyMem_Malloc(sizeof(wchar_t*)*mpi_argc); -+ /* We need a second copies, as Python might modify the first one. */ -+ wchar_t **argv_copy2 = (wchar_t **)PyMem_Malloc(sizeof(wchar_t*)*mpi_argc); -+ -+ if (!argv_copy || !argv_copy2) { -+ fprintf(stderr, "out of memory\n"); -+ return false; -+ } -+ -+ std::locale mylocale; -+ mbstate_t mystate; -+ -+ const std::codecvt& myfacet = -+ std::use_facet >(mylocale); -+ -+ for (int i = 0; i < mpi_argc; i++) -+ { -+ size_t length = strlen(mpi_argv[i]); -+ -+ wchar_t *dest = (wchar_t *) PyMem_Malloc(sizeof(wchar_t) * (length + 1)); -+ -+ const char *from_next; -+ wchar_t *to_next; -+ -+ std::codecvt::result myresult = -+ myfacet.out(mystate, -+ mpi_argv[i], mpi_argv[i] + length + 1, from_next, -+ dest, dest+length+1, to_next); -+ -+ if (myresult != std::codecvt::ok ) -+ { -+ fprintf(stderr, "failure translating argv\n"); -+ return 1; -+ } -+ -+ argv_copy2[i] = argv_copy[i] = dest; -+ if (!argv_copy[i]) -+ return false; -+ } -+ -+ PySys_SetArgv(mpi_argc, argv_copy); -+ -+ for (int i = 0; i < mpi_argc; i++) { -+ PyMem_Free(argv_copy2[i]); -+ } -+ PyMem_Free(argv_copy); -+ PyMem_Free(argv_copy2); -+#else - PySys_SetArgv(mpi_argc, mpi_argv); -+#endif -+ } - -- for (int arg = 0; arg < my_argc; ++arg) -- free(my_argv[arg]); -- delete [] my_argv; -+ for (int arg = 0; arg < mpi_argc; ++arg) -+ free(mpi_argv[arg]); -+ delete [] mpi_argv; - - return true; - } diff --git a/extra/boost/boost-1.53.0-python3.patch b/extra/boost/boost-1.53.0-python3.patch new file mode 100644 index 000000000..8d2f59269 --- /dev/null +++ b/extra/boost/boost-1.53.0-python3.patch @@ -0,0 +1,96 @@ +diff -Naur boost_1_53_0.ori/libs/mpi/src/python/datatypes.cpp boost_1_53_0/libs/mpi/src/python/datatypes.cpp +--- boost_1_53_0.ori/libs/mpi/src/python/datatypes.cpp 2007-11-25 13:38:02.000000000 -0500 ++++ boost_1_53_0/libs/mpi/src/python/datatypes.cpp 2013-03-11 20:59:57.171732691 -0400 +@@ -13,6 +13,10 @@ + #include + #include + ++#if PY_MAJOR_VERSION >= 3 ++#define PyInt_Type PyLong_Type ++#endif ++ + namespace boost { namespace mpi { namespace python { + + void export_datatypes() +diff -Naur boost_1_53_0.ori/libs/mpi/src/python/py_environment.cpp boost_1_53_0/libs/mpi/src/python/py_environment.cpp +--- boost_1_53_0.ori/libs/mpi/src/python/py_environment.cpp 2007-11-25 13:38:02.000000000 -0500 ++++ boost_1_53_0/libs/mpi/src/python/py_environment.cpp 2013-03-11 21:02:12.961737401 -0400 +@@ -11,6 +11,9 @@ + * This file reflects the Boost.MPI "environment" class into Python + * methods at module level. + */ ++ ++#include ++#include + #include + #include + +@@ -50,11 +53,65 @@ + + // If anything changed, convert C-style argc/argv into Python argv + if (mpi_argv != my_argv) ++ { ++#if PY_MAJOR_VERSION >= 3 ++ // Code stolen from py3k/Modules/python.c. ++ ++ wchar_t **argv_copy = (wchar_t **)PyMem_Malloc(sizeof(wchar_t*)*mpi_argc); ++ /* We need a second copies, as Python might modify the first one. */ ++ wchar_t **argv_copy2 = (wchar_t **)PyMem_Malloc(sizeof(wchar_t*)*mpi_argc); ++ ++ if (!argv_copy || !argv_copy2) { ++ fprintf(stderr, "out of memory\n"); ++ return false; ++ } ++ ++ std::locale mylocale; ++ mbstate_t mystate; ++ ++ const std::codecvt& myfacet = ++ std::use_facet >(mylocale); ++ ++ for (int i = 0; i < mpi_argc; i++) ++ { ++ size_t length = strlen(mpi_argv[i]); ++ ++ wchar_t *dest = (wchar_t *) PyMem_Malloc(sizeof(wchar_t) * (length + 1)); ++ ++ const char *from_next; ++ wchar_t *to_next; ++ ++ std::codecvt::result myresult = ++ myfacet.out(mystate, ++ mpi_argv[i], mpi_argv[i] + length + 1, from_next, ++ dest, dest+length+1, to_next); ++ ++ if (myresult != std::codecvt::ok ) ++ { ++ fprintf(stderr, "failure translating argv\n"); ++ return 1; ++ } ++ ++ argv_copy2[i] = argv_copy[i] = dest; ++ if (!argv_copy[i]) ++ return false; ++ } ++ ++ PySys_SetArgv(mpi_argc, argv_copy); ++ ++ for (int i = 0; i < mpi_argc; i++) { ++ PyMem_Free(argv_copy2[i]); ++ } ++ PyMem_Free(argv_copy); ++ PyMem_Free(argv_copy2); ++#else + PySys_SetArgv(mpi_argc, mpi_argv); ++#endif ++ } + +- for (int arg = 0; arg < my_argc; ++arg) +- free(my_argv[arg]); +- delete [] my_argv; ++ for (int arg = 0; arg < mpi_argc; ++arg) ++ free(mpi_argv[arg]); ++ delete [] mpi_argv; + + return true; + } -- cgit v1.2.3-54-g00ecf