From 904d3827c305c0c4293fc4853670387cbc61784b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B7=D0=B8=D0=BC?= Date: Tue, 11 Feb 2020 12:17:53 +0300 Subject: [PATCH] Fix build --- boost.spec | 27 +++++++++++++++------------ fix-python37.patch | 13 +++++++++++++ 2 files changed, 28 insertions(+), 12 deletions(-) create mode 100644 fix-python37.patch diff --git a/boost.spec b/boost.spec index 3fa881f..67549d1 100644 --- a/boost.spec +++ b/boost.spec @@ -20,7 +20,7 @@ %define libmathtr1l %mklibname boost_math_tr1l %{version} %define libprgexecmonitor %mklibname boost_prg_exec_monitor %{version} %define libprogramoptions %mklibname boost_program_options %{version} -%define libpython %mklibname boost_python %{version} +%define libpython2 %mklibname boost_python2 %{version} %define libpython3 %mklibname boost_python3_ %{version} %define librandom %mklibname boost_random %{version} %define libregex %mklibname boost_regex %{version} @@ -52,7 +52,7 @@ Summary: Portable C++ libraries Name: boost Version: 1.61.0 -Release: 5 +Release: 6 License: Boost Group: Development/C++ Url: http://boost.org/ @@ -79,12 +79,14 @@ Patch12: boost-1.50.0-polygon.patch # https://bugzilla.redhat.com/show_bug.cgi?id=828856 # https://bugzilla.redhat.com/show_bug.cgi?id=828857 Patch15: boost-1.61.0-pool.patch +# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=902702 +Patch16: fix-python37.patch BuildRequires: doxygen BuildRequires: xsltproc BuildRequires: bzip2-devel BuildRequires: pkgconfig(expat) BuildRequires: pkgconfig(icu-uc) -BuildRequires: pkgconfig(python) +BuildRequires: pkgconfig(python2) BuildRequires: pkgconfig(python3) BuildRequires: pkgconfig(zlib) @@ -493,19 +495,19 @@ running programs dynamically linked against Boost program_options. #---------------------------------------------------------------------------- -%package -n %{libpython} -Summary: Boost python shared library +%package -n %{libpython2} +Summary: Boost python2 shared library Group: System/Libraries # no one should require this, but provided anyway for maximum compatibility: Provides: boost = %{EVRD} -%description -n %{libpython} +%description -n %{libpython2} Boost is a collection of free peer-reviewed portable C++ source libraries. The emphasis is on libraries which work well with the C++ Standard Library. This package contains the shared library needed for running programs dynamically linked against Boost python. -%files -n %{libpython} +%files -n %{libpython2} %doc LICENSE_1_0.txt %{_libdir}/libboost_python.so.%{version} @@ -750,7 +752,7 @@ Requires: %{libmathtr1f} = %{EVRD} Requires: %{libmathtr1l} = %{EVRD} Requires: %{libprgexecmonitor} = %{EVRD} Requires: %{libprogramoptions} = %{EVRD} -Requires: %{libpython} = %{EVRD} +Requires: %{libpython2} = %{EVRD} Requires: %{librandom} = %{EVRD} Requires: %{libregex} = %{EVRD} Requires: %{libserialization} = %{EVRD} @@ -840,6 +842,7 @@ symlinks needed for Boost development. %patch10 -p1 %patch12 -p3 %patch15 -p0 +%patch16 -p1 # Preparing the docs mkdir packagedoc @@ -856,9 +859,9 @@ find libs -type f \( -name "*.?pp" ! -path "*test*" ! -path "*src*" ! -path "*to cat > ./tools/build/src/user-config.jam << EOF using gcc : %{gcc_ver} : gcc : "%{optflags}" "%{optflags}" "%{ldflags}" ; using python : %{py3_ver} : %{_bindir}/python%{py3_ver} : %{_includedir}/python%{py3_ver} : %{_libdir} : : : ; -using python : %{py_ver} : %{_bindir}/python%{py_ver} : %{_includedir}/python%{py_ver} : %{_libdir} : : : ; +using python : %{py2_ver} : %{_bindir}/python%{py2_ver} : %{_includedir}/python%{py2_ver} : %{_libdir} : : : ; EOF -./bootstrap.sh --with-toolset=gcc --with-icu --prefix=%{_prefix} --libdir=%{_libdir} --with-python=%{py_ver} +./bootstrap.sh --with-toolset=gcc --with-icu --prefix=%{_prefix} --libdir=%{_libdir} --with-python=%{py2_ver} ./b2 -d+2 -q %{?_smp_mflags} --without-mpi \ --prefix=%{_prefix} --libdir=%{_libdir} \ %if !%{with context} @@ -866,7 +869,7 @@ EOF %endif linkflags="%{ldflags} -lstdc++ -lm" \ -sHAVE_ICU=1 \ - python=%{py_ver} \ + python=%{py2_ver} \ link=shared threading=multi debug-symbols=off --layout=system # Taken from the Fedora .src.rpm. @@ -881,7 +884,7 @@ echo ============================= build Boost.Build ================== --without-context --without-coroutine \ %endif link=shared \ - python=%{py_ver} \ + python=%{py2_ver} \ install echo ============================= install Boost.Build ================== diff --git a/fix-python37.patch b/fix-python37.patch new file mode 100644 index 0000000..bdc9f16 --- /dev/null +++ b/fix-python37.patch @@ -0,0 +1,13 @@ +Index: boost1.62-1.62.0+dfsg/libs/python/src/converter/builtin_converters.cpp +=================================================================== +--- boost1.62-1.62.0+dfsg.orig/libs/python/src/converter/builtin_converters.cpp ++++ boost1.62-1.62.0+dfsg/libs/python/src/converter/builtin_converters.cpp +@@ -48,7 +48,7 @@ namespace + #else + void* convert_to_cstring(PyObject* obj) + { +- return PyUnicode_Check(obj) ? _PyUnicode_AsString(obj) : 0; ++ return PyUnicode_Check(obj) ? const_cast(reinterpret_cast(_PyUnicode_AsString(obj))) : 0; + } + #endif +