[Mageia-dev] [110263] (boost build change)

Anssi Hannula anssi.hannula at iki.fi
Sun Sep 25 00:02:56 CEST 2011


On 20.06.2011 06:37, root at mageia.org wrote:
> Revision
>     110263
> Author
>     fwang
> Date
>     2011-06-20 05:37:46 +0200 (Mon, 20 Jun 2011)
> 
> 
>       Log Message
> 
> - New version 1.46.1
> - synch with fedora (cmake flavour)

Is there any actual advantage big enough to justify switching the build
to use cmake instead of upstream bjam, relying on fedora-provided
non-upstream big patch that changes the entire build system?
(in the past I've run into issues when there was no cmake 'version'
available yet when packaging an update)

In addition, the change modifies SONAMEs to a non-upstream configuration
(it adds '-mt' to them), plus changes the devel symlink names to have an
'-mt' in them (which is easily workaroundable with compatibility
symlinks which I'm adding now, though).
This makes some sense on Fedora as they package both single-threaded and
multi-threaded versions of all the libraries, while we (and e.g. Debian)
have only the multi-threaded versions (without '-mt' as per upstream).


(BTW, while it doesn't affect us, the Fedora convention seems quite
scary, since software could expect the non-'-mt' variant to be
multithreaded as per upstream and other distros...)


>       Modified Paths
> 
>   * cauldron/boost/current/SPECS/boost.spec
>     <#cauldronboostcurrentSPECSboostspec>
> 
> Modified: cauldron/boost/current/SPECS/boost.spec
> ===================================================================
> --- cauldron/boost/current/SPECS/boost.spec	2011-06-20 02:17:11 UTC (rev 110262)
> +++ cauldron/boost/current/SPECS/boost.spec	2011-06-20 03:37:46 UTC (rev 110263)
> @@ -1,41 +1,26 @@
> -%define cmake_build 0
> -
> -%if %cmake_build
> -%define cmake_pl 0
> -%else
>  %define packver %(echo "%{version}" | sed -e "s/\\\./_/g")
> -%endif
> -
> -# From the version 13 of Fedora, the Boost libraries are delivered
> -# with sonames equal to the Boost version (e.g., 1.41.0). 
>  %define	libname %mklibname boost %{version}
>  %define	libnamedevel %mklibname boost -d
>  %define	libnamestaticdevel %mklibname boost -d -s
>  
>  Summary:	Portable C++ libraries
>  Name:		boost
> -Version:	1.44.0
> -Release:	%mkrel 6
> +Version:	1.46.1
> +Release:	%mkrel 1
>  License:	Boost
>  Group:		Development/C++
>  URL:		http://boost.org/
> -%if %cmake_build
> -Source0:	http://sodium.resophonic.com/boost-cmake/%{version}.cmake%{cmake_pl}/boost-%{version}.cmake%{cmake_pl}.tar.gz
> -BuildRequires:	cmake
> -%else
>  Source0:	http://umn.dl.sourceforge.net/sourceforge/boost/boost_%{packver}.tar.bz2
> -BuildRequires:	boost-jam
> -%endif
> -# (anssi) in bjam mode, use CXXFLAGS when optimization=speed
> -Patch0:		boost-use-cxxflags.patch
> -Patch1:		boost-serialize_nvp.patch
> +Patch0: boost-1.46.1-cmakeify-full.patch
> +Patch3: boost-1.46.1-signals-erase.patch
> +Patch5: boost-1.46.1-spirit.patch
>  BuildRequires:	bzip2-devel
>  BuildRequires:	python-devel
>  BuildRequires:	zlib-devel
>  BuildRequires:	icu-devel
> -#BuildRequires:	openmpi-devel
>  BuildRequires:	expat-devel
>  BuildRequires:	doxygen xsltproc
> +BuildRequires:	cmake
>  BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-buildroot
>  
>  %description
> @@ -44,11 +29,7 @@
>  Standard Library. This package contains only the shared libraries
>  needed for running programs using Boost.
>  
> -%ifarch %arm %mips
> -%define boostlibs date_time filesystem graph iostreams math_c99 math_c99f math_tr1 math_tr1f prg_exec_monitor program_options python regex serialization signals system thread unit_test_framework wave wserialization random
> -%else
> -%define boostlibs date_time filesystem graph iostreams math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l prg_exec_monitor program_options python regex serialization signals system thread unit_test_framework wave wserialization random
> -%endif
> +%define boostlibs date_time filesystem graph iostreams prg_exec_monitor program_options python random regex serialization signals system thread unit_test_framework wave wserialization
>  
>  # (Anssi 01/2010) dashes are converted to underscores for macros ($lib2);
>  # The sed script adds _ when library name ends in number.
> @@ -75,7 +56,7 @@
>  %%files -n %%{libname$lib2}
>  %%defattr(-,root,root)
>  %%doc LICENSE_1_0.txt
> -%{_libdir}/libboost_$lib.so.%{version}
> +%{_libdir}/libboost_$lib-mt.so.%{version}
>  EOF
>  done)}
>  
> @@ -132,12 +113,10 @@
>  same place as the documentation.
>  
>  %prep
> -%if %cmake_build
> -%setup -q -n boost-%{version}.cmake%{cmake_pl}
> -%else
>  %setup -q -n boost_%{packver}
> -%endif
> -%apply_patches
> +%patch0 -p1
> +%patch3 -p1
> +%patch5 -p0
>  
>  # Preparing the docs
>  mkdir packagedoc
> @@ -150,43 +129,16 @@
>  find libs -type f \( -name "*.?pp" ! -path "*test*" ! -path "*src*" ! -path "*tools*" -o -path "*example*" \) -exec cp --parents {} examples/ \;
>  
>  %build
> -%if %cmake_build
> -%cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_SINGLE_THREADED=NO \
> +%cmake -DENABLE_SINGLE_THREADED=NO -DENABLE_DEBUG=OFF \
>  	-DINSTALL_VERSIONED=OFF -DWITH_MPI=OFF
>  %make
>  
> -%else
> -
> -%define boost_jam_common_flags %{_smp_mflags} -d2 --layout=system --toolset=gcc variant=release threading=multi optimization=speed linkflags="%{ldflags} -lpython%{py_ver}" debug-symbols=on -sHAVE_ICU=1 -sEXPAT_INCLUDE=%{_includedir} -sEXPAT_LIBPATH=%{_libdir} -sCXXFLAGS="%{optflags} -O3"
> -%ifnarch %arm %mips
> -%define boost_bjam bjam %{boost_jam_common_flags}
> -%else
> -%define boost_bjam bjam %{boost_jam_common_flags} --disable-long-double
> -%endif
> -
> -%{boost_bjam} --prefix=%{_prefix} --libdir=%{_libdir}
> -%endif
> -
>  %install
>  rm -rf %{buildroot}
> -%if %cmake_build
>  %makeinstall_std -C build
> -%else
> -%{boost_bjam} --prefix=%{buildroot}%{_prefix} --libdir=%{buildroot}%{_libdir} install
> -%endif
>  
> -# (Anssi 01/2010) add compatibility symlinks:
> -for file in %{buildroot}%{_libdir}/*.so; do
> -	cp -a $file ${file%.so}-mt.so
> -done
> -for file in %{buildroot}%{_libdir}/*.a; do
> -	ln -s $(basename $file) ${file%.a}-mt.a
> -done
> -
> -# Kill any debug library versions that may show up un-invited.
> -rm -f %{buildroot}%{_libdir}/*-d.*
>  # Remove cmake configuration files used to build the Boost libraries
> -rm -f %{buildroot}%{_libdir}/Boost*.cmake 
> +rm -f %{buildroot}%{_libdir}/Boost*.cmake
>  
>  %clean
>  rm -rf %{buildroot}
> @@ -195,9 +147,8 @@
>  %defattr(644, root,root, 755)
>  %{_libdir}/libboost_*.so
>  %{_includedir}/boost
> -%if %cmake_build
> +%{_datadir}/cmake/boost/*.cmake
>  %{_datadir}/%{name}-%{version}/cmake/*.cmake
> -%endif
>  
>  %files -n %{libnamedevel}-doc
>  %defattr(-,root,root)
> @@ -210,8 +161,3 @@
>  %files -n %{name}-examples
>  %defattr(-,root,root)
>  %doc examples/*
> -
> -
> -
> -
> -
> 
> 


-- 
Anssi Hannula


More information about the Mageia-dev mailing list