--- boost-1.55.0-r1.ebuild 2014-08-07 15:25:57.579767415 +0400 +++ boost-1.55.0-r2.ebuild 2014-08-07 15:25:25.132769333 +0400 @@ -5,7 +5,7 @@ EAPI="5" PYTHON_COMPAT=( python{2_6,2_7,3_2,3_3,3_4} ) -inherit eutils flag-o-matic multilib multiprocessing python-r1 toolchain-funcs versionator +inherit eutils flag-o-matic multiprocessing python-r1 toolchain-funcs versionator multilib-minimal MY_P="${PN}_$(replace_all_version_separators _)" MAJOR_V="$(get_version_component_range 1-2)" @@ -20,12 +20,12 @@ IUSE="context debug doc icu +nls mpi python static-libs +threads tools" -RDEPEND="icu? ( >=dev-libs/icu-3.6:= ) - !icu? ( virtual/libiconv ) +RDEPEND="icu? ( >=dev-libs/icu-3.6:=[${MULTILIB_USEDEP}] ) + !icu? ( virtual/libiconv[${MULTILIB_USEDEP}] ) mpi? ( || ( sys-cluster/openmpi[cxx] sys-cluster/mpich2[cxx,threads] ) ) python? ( ${PYTHON_DEPS} ) - app-arch/bzip2 - sys-libs/zlib + app-arch/bzip2[${MULTILIB_USEDEP}] + sys-libs/zlib[${MULTILIB_USEDEP}] !app-admin/eselect-boost" DEPEND="${RDEPEND} =dev-util/boost-build-${MAJOR_V}*" @@ -40,6 +40,19 @@ # there is no point in having them in the ebuild to begin with. RESTRICT="test" +python_bindings_needed() { + multilib_is_native_abi && use python +} + +tools_needed() { + multilib_is_native_abi && use tools +} + +# MPI stuff is not ported on multilib yet, disabling it for non-native ABIs +mpi_needed() { + multilib_is_native_abi && use mpi +} + create_user-config.jam() { local compiler compiler_version compiler_executable @@ -54,15 +67,15 @@ fi local mpi_configuration python_configuration - if use mpi; then + if mpi_needed; then mpi_configuration="using mpi ;" fi - if use python; then + if python_bindings_needed; then python_configuration="using python : : ${PYTHON} ;" fi - cat > user-config.jam << __EOF__ + cat > "${BOOST_ROOT}/user-config.jam" << __EOF__ using ${compiler} : ${compiler_version} : ${compiler_executable} : "${CFLAGS}" "${CXXFLAGS}" "${LDFLAGS}" ; ${mpi_configuration} ${python_configuration} @@ -95,18 +108,21 @@ "${FILESDIR}/${PN}-1.52.0-threads.patch" epatch_user + + multilib_copy_sources } ejam() { - echo b2 "$@" - b2 "$@" + local b2_opts="--user-config=${BOOST_ROOT}/user-config.jam $@" + echo b2 ${b2_opts} + b2 ${b2_opts} } src_configure() { # Workaround for too many parallel processes requested, bug #506064 [ "$(makeopts_jobs)" -gt 64 ] && MAKEOPTS="${MAKEOPTS} -j64" - OPTIONS="$(usex debug gentoodebug gentoorelease) -j$(makeopts_jobs) -q -d+2 --user-config=${S}/user-config.jam" + OPTIONS="$(usex debug gentoodebug gentoorelease) -j$(makeopts_jobs) -q -d+2" if [[ ${CHOST} == *-darwin* ]]; then # We need to add the prefix, and in two cases this exceeds, so prepare @@ -133,8 +149,7 @@ use icu && OPTIONS+=" -sICU_PATH=${EPREFIX}/usr" use icu || OPTIONS+=" --disable-icu boost.locale.icu=off" - use mpi || OPTIONS+=" --without-mpi" - use python || OPTIONS+=" --without-python" + mpi_needed || OPTIONS+=" --without-mpi" use nls || OPTIONS+=" --without-locale" use context || OPTIONS+=" --without-context --without-coroutine" @@ -146,19 +161,27 @@ [[ ${CHOST} == *-winnt* ]] && OPTIONS+=" -sNO_BZIP2=1" } -src_compile() { - export BOOST_ROOT="${S}" +multilib_src_compile() { + local -x BOOST_ROOT="${BUILD_DIR}" PYTHON_DIRS="" MPI_PYTHON_MODULE="" building() { create_user-config.jam - ejam ${OPTIONS} \ - $(use python && echo --python-buildid=${EPYTHON#python}) \ + local PYTHON_OPTIONS + if python_bindings_needed; then + PYTHON_OPTIONS=" --python-buildid=${EPYTHON#python}" + else + PYTHON_OPTIONS=" --without-python" + fi + + ejam \ + ${OPTIONS} \ + ${PYTHON_OPTIONS} \ || die "Building of Boost libraries failed" - if use python; then + if python_bindings_needed; then if [[ -z "${PYTHON_DIRS}" ]]; then PYTHON_DIRS="$(find bin.v2/libs -name python | sort)" else @@ -173,7 +196,7 @@ || die "Renaming of '${dir}' to '${dir}-${EPYTHON}' failed" done - if use mpi; then + if mpi_needed; then if [[ -z "${MPI_PYTHON_MODULE}" ]]; then MPI_PYTHON_MODULE="$(find bin.v2/libs/mpi/build/*/gentoo* -name mpi.so)" if [[ "$(echo "${MPI_PYTHON_MODULE}" | wc -l)" -ne 1 ]]; then @@ -190,52 +213,93 @@ fi fi } - if use python; then + if python_bindings_needed; then python_foreach_impl building else building fi - if use tools; then + if tools_needed; then pushd tools > /dev/null || die - ejam ${OPTIONS} \ + ejam \ + ${OPTIONS} \ + ${PYTHON_OPTIONS} \ || die "Building of Boost tools failed" popd > /dev/null || die fi } -src_install () { +multilib_src_install_all() { + if ! use python; then + rm -r "${ED}"/usr/include/boost/python* || die + fi + + if ! use nls; then + rm -r "${ED}"/usr/include/boost/locale || die + fi + + if ! use context; then + rm -r "${ED}"/usr/include/boost/context || die + rm -r "${ED}"/usr/include/boost/coroutine || die + fi + + if use doc; then + find libs/*/* -iname "test" -or -iname "src" | xargs rm -rf + dohtml \ + -A pdf,txt,cpp,hpp \ + *.{htm,html,png,css} \ + -r doc + dohtml -A pdf,txt -r tools + insinto /usr/share/doc/${PF}/html + doins -r libs + doins -r more + + # To avoid broken links + insinto /usr/share/doc/${PF}/html + doins LICENSE_1_0.txt + + dosym /usr/include/boost /usr/share/doc/${PF}/html/boost + fi +} + +multilib_src_install() { + local -x BOOST_ROOT="${BUILD_DIR}" installation() { create_user-config.jam - if use python; then + local PYTHON_OPTIONS + if python_bindings_needed; then local dir for dir in ${PYTHON_DIRS}; do cp -pr ${dir}-${EPYTHON} ${dir} \ || die "Copying of '${dir}-${EPYTHON}' to '${dir}' failed" done - if use mpi; then + if mpi_needed; then cp -p stage/lib/mpi.so-${EPYTHON} "${MPI_PYTHON_MODULE}" \ || die "Copying of 'stage/lib/mpi.so-${EPYTHON}' to '${MPI_PYTHON_MODULE}' failed" cp -p stage/lib/mpi.so-${EPYTHON} stage/lib/mpi.so \ || die "Copying of 'stage/lib/mpi.so-${EPYTHON}' to 'stage/lib/mpi.so' failed" fi + PYTHON_OPTIONS=" --python-buildid=${EPYTHON#python}" + else + PYTHON_OPTIONS=" --without-python" fi - ejam ${OPTIONS} \ + ejam \ + ${OPTIONS} \ + ${PYTHON_OPTIONS} \ --includedir="${ED}usr/include" \ --libdir="${ED}usr/$(get_libdir)" \ - $(use python && echo --python-buildid=${EPYTHON#python}) \ install || die "Installation of Boost libraries failed" - if use python; then + if python_bindings_needed; then rm -r ${PYTHON_DIRS} || die # Move mpi.so Python module to Python site-packages directory. # https://svn.boost.org/trac/boost/ticket/2838 - if use mpi; then + if mpi_needed; then local moddir=$(python_get_sitedir)/boost # moddir already includes eprefix mkdir -p "${D}${moddir}" || die @@ -258,43 +322,12 @@ python_optimize fi } - if use python; then + if python_bindings_needed; then python_foreach_impl installation else installation fi - if ! use python; then - rm -r "${ED}"/usr/include/boost/python* || die - fi - - if ! use nls; then - rm -r "${ED}"/usr/include/boost/locale || die - fi - - if ! use context; then - rm -r "${ED}"/usr/include/boost/context || die - rm -r "${ED}"/usr/include/boost/coroutine || die - fi - - if use doc; then - find libs/*/* -iname "test" -or -iname "src" | xargs rm -rf - dohtml \ - -A pdf,txt,cpp,hpp \ - *.{htm,html,png,css} \ - -r doc - dohtml -A pdf,txt -r tools - insinto /usr/share/doc/${PF}/html - doins -r libs - doins -r more - - # To avoid broken links - insinto /usr/share/doc/${PF}/html - doins LICENSE_1_0.txt - - dosym /usr/include/boost /usr/share/doc/${PF}/html/boost - fi - pushd "${ED}usr/$(get_libdir)" > /dev/null || die local ext=$(get_libname) @@ -307,7 +340,7 @@ popd > /dev/null || die - if use tools; then + if tools_needed; then dobin dist/bin/* insinto /usr/share