Fix build

This commit is contained in:
Алзим 2020-02-11 12:17:53 +03:00
parent 23431b019a
commit 904d3827c3
2 changed files with 28 additions and 12 deletions

View file

@ -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 : <cflags>"%{optflags}" <cxxflags>"%{optflags}" <linkflags>"%{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 ==================

13
fix-python37.patch Normal file
View file

@ -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<void*>(reinterpret_cast<const void*>(_PyUnicode_AsString(obj))) : 0;
}
#endif