/[gentoo-x86]/dev-libs/boost/boost-1.56.0-r1.ebuild
Gentoo

Contents of /dev-libs/boost/boost-1.56.0-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.15 - (show annotations) (download)
Sun Aug 2 08:54:57 2015 UTC (3 years, 10 months ago) by pacho
Branch: MAIN
CVS Tags: HEAD
Changes since 1.14: +2 -2 lines
sparc stable wrt bug #554712

(Portage version: 2.2.20/cvs/Linux x86_64, RepoMan options: --include-arches="sparc", signed Manifest commit with key A188FBD4)

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-libs/boost/boost-1.56.0-r1.ebuild,v 1.14 2015/07/30 16:44:08 maekke Exp $
4
5 EAPI="5"
6 PYTHON_COMPAT=( python{2_7,3_3,3_4} )
7
8 inherit eutils flag-o-matic multilib multiprocessing python-r1 toolchain-funcs versionator multilib-minimal
9
10 MY_P="${PN}_$(replace_all_version_separators _)"
11 MAJOR_V="$(get_version_component_range 1-2)"
12
13 DESCRIPTION="Boost Libraries for C++"
14 HOMEPAGE="http://www.boost.org/"
15 SRC_URI="mirror://sourceforge/boost/${MY_P}.tar.bz2"
16
17 LICENSE="Boost-1.0"
18 SLOT="0/${PV}" # ${PV} instead ${MAJOR_V} due to bug 486122
19 KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x86-solaris ~x86-winnt"
20
21 IUSE="context debug doc icu +nls mpi python static-libs +threads tools"
22
23 RDEPEND="abi_x86_32? ( !app-emulation/emul-linux-x86-cpplibs[-abi_x86_32(-)] )
24 icu? ( >=dev-libs/icu-3.6:=[${MULTILIB_USEDEP}] )
25 !icu? ( virtual/libiconv[${MULTILIB_USEDEP}] )
26 mpi? ( virtual/mpi[cxx,threads] )
27 python? ( ${PYTHON_DEPS} )
28 app-arch/bzip2[${MULTILIB_USEDEP}]
29 sys-libs/zlib[${MULTILIB_USEDEP}]
30 !app-admin/eselect-boost"
31 DEPEND="${RDEPEND}
32 =dev-util/boost-build-${MAJOR_V}*"
33 REQUIRED_USE="
34 mpi? ( threads )
35 python? ( ${PYTHON_REQUIRED_USE} )"
36
37 S="${WORKDIR}/${MY_P}"
38
39 # the tests will never fail because these are not intended as sanity
40 # tests at all. They are more a way for upstream to check their own code
41 # on new compilers. Since they would either be completely unreliable
42 # (failing for no good reason) or completely useless (never failing)
43 # there is no point in having them in the ebuild to begin with.
44 RESTRICT="test"
45
46 python_bindings_needed() {
47 multilib_is_native_abi && use python
48 }
49
50 tools_needed() {
51 multilib_is_native_abi && use tools
52 }
53
54 # MPI stuff is not ported on multilib yet, disabling it for non-native ABIs
55 mpi_needed() {
56 multilib_is_native_abi && use mpi
57 }
58
59 create_user-config.jam() {
60 local compiler compiler_version compiler_executable
61
62 if [[ ${CHOST} == *-darwin* ]]; then
63 compiler="darwin"
64 compiler_version="$(gcc-fullversion)"
65 compiler_executable="$(tc-getCXX)"
66 else
67 compiler="gcc"
68 compiler_version="$(gcc-version)"
69 compiler_executable="$(tc-getCXX)"
70 fi
71 local mpi_configuration python_configuration
72
73 if mpi_needed; then
74 mpi_configuration="using mpi ;"
75 fi
76
77 if python_bindings_needed; then
78 if tc-is-cross-compiler; then
79 python_configuration="using python : ${EPYTHON#python} : : ${SYSROOT:-${EROOT}}/usr/include/${EPYTHON} : ${SYSROOT:-${EROOT}}/usr/$(get_libdir) ;"
80 else
81 python_configuration="using python : : ${PYTHON} ;"
82 fi
83 fi
84
85 cat > "${BOOST_ROOT}/user-config.jam" << __EOF__
86 using ${compiler} : ${compiler_version} : ${compiler_executable} : <cflags>"${CFLAGS}" <cxxflags>"${CXXFLAGS}" <linkflags>"${LDFLAGS}" ;
87 ${mpi_configuration}
88 ${python_configuration}
89 __EOF__
90 }
91
92 pkg_setup() {
93 # Bail out on unsupported build configuration, bug #456792
94 if [[ -f "${EROOT}etc/site-config.jam" ]]; then
95 grep -q gentoorelease "${EROOT}etc/site-config.jam" && grep -q gentoodebug "${EROOT}etc/site-config.jam" ||
96 (
97 eerror "You are using custom ${EROOT}etc/site-config.jam without defined gentoorelease/gentoodebug targets."
98 eerror "Boost can not be built in such configuration."
99 eerror "Please, either remove this file or add targets from ${EROOT}usr/share/boost-build/site-config.jam to it."
100 die
101 )
102 fi
103 }
104
105 src_prepare() {
106 epatch \
107 "${FILESDIR}/${PN}-1.51.0-respect_python-buildid.patch" \
108 "${FILESDIR}/${PN}-1.51.0-support_dots_in_python-buildid.patch" \
109 "${FILESDIR}/${PN}-1.48.0-no_strict_aliasing_python2.patch" \
110 "${FILESDIR}/${PN}-1.48.0-disable_libboost_python3.patch" \
111 "${FILESDIR}/${PN}-1.48.0-python_linking.patch" \
112 "${FILESDIR}/${PN}-1.48.0-disable_icu_rpath.patch" \
113 "${FILESDIR}/${PN}-1.55.0-context-x32.patch" \
114 "${FILESDIR}/${PN}-1.55.0-tools-c98-compat.patch" \
115 "${FILESDIR}/${PN}-1.52.0-threads.patch" \
116 "${FILESDIR}/${PN}-1.56.0-build-auto_index-tool.patch" \
117 "${FILESDIR}/${PN}-1.55.0-variadic-templates.patch"
118
119 # Do not try to build missing 'wave' tool, bug #522682
120 # Upstream bugreport - https://svn.boost.org/trac/boost/ticket/10507
121 sed -i -e 's:wave/build//wave::' tools/Jamfile.v2 || die
122
123 epatch_user
124
125 multilib_copy_sources
126 }
127
128 ejam() {
129 local b2_opts="--user-config=${BOOST_ROOT}/user-config.jam $@"
130 echo b2 ${b2_opts}
131 b2 ${b2_opts}
132 }
133
134 src_configure() {
135 # Workaround for too many parallel processes requested, bug #506064
136 [ "$(makeopts_jobs)" -gt 64 ] && MAKEOPTS="${MAKEOPTS} -j64"
137
138 OPTIONS="$(usex debug gentoodebug gentoorelease) -j$(makeopts_jobs) -q -d+2"
139
140 if [[ ${CHOST} == *-darwin* ]]; then
141 # We need to add the prefix, and in two cases this exceeds, so prepare
142 # for the largest possible space allocation.
143 append-ldflags -Wl,-headerpad_max_install_names
144 elif [[ ${CHOST} == *-winnt* ]]; then
145 compiler=parity
146 if [[ $($(tc-getCXX) -v) == *trunk* ]]; then
147 compilerVersion=trunk
148 else
149 compilerVersion=$($(tc-getCXX) -v | sed '1q' \
150 | sed -e 's,\([a-z]*\) \([0-9]\.[0-9]\.[0-9][^ \t]*\) .*,\2,')
151 fi
152 compilerExecutable=$(tc-getCXX)
153 fi
154
155 # bug 298489
156 if use ppc || use ppc64; then
157 [[ $(gcc-version) > 4.3 ]] && append-flags -mno-altivec
158 fi
159
160 # Do _not_ use C++11 yet, make sure to force GNU C++ 98 standard.
161 append-cxxflags -std=gnu++98
162
163 use icu && OPTIONS+=" -sICU_PATH=${EPREFIX}/usr"
164 use icu || OPTIONS+=" --disable-icu boost.locale.icu=off"
165 mpi_needed || OPTIONS+=" --without-mpi"
166 use nls || OPTIONS+=" --without-locale"
167 use context || OPTIONS+=" --without-context --without-coroutine"
168
169 OPTIONS+=" pch=off"
170 OPTIONS+=" --boost-build=${EPREFIX}/usr/share/boost-build --prefix=\"${ED}usr\""
171 OPTIONS+=" --layout=system"
172 OPTIONS+=" threading=$(usex threads multi single) link=$(usex static-libs shared,static shared)"
173
174 [[ ${CHOST} == *-winnt* ]] && OPTIONS+=" -sNO_BZIP2=1"
175 }
176
177 multilib_src_compile() {
178 local -x BOOST_ROOT="${BUILD_DIR}"
179 PYTHON_DIRS=""
180 MPI_PYTHON_MODULE=""
181
182 building() {
183 create_user-config.jam
184
185 local PYTHON_OPTIONS
186 if python_bindings_needed; then
187 PYTHON_OPTIONS=" --python-buildid=${EPYTHON#python}"
188 else
189 PYTHON_OPTIONS=" --without-python"
190 fi
191
192 ejam \
193 ${OPTIONS} \
194 ${PYTHON_OPTIONS} \
195 || die "Building of Boost libraries failed"
196
197 if python_bindings_needed; then
198 if [[ -z "${PYTHON_DIRS}" ]]; then
199 PYTHON_DIRS="$(find bin.v2/libs -name python | sort)"
200 else
201 if [[ "${PYTHON_DIRS}" != "$(find bin.v2/libs -name python | sort)" ]]; then
202 die "Inconsistent structure of build directories"
203 fi
204 fi
205
206 local dir
207 for dir in ${PYTHON_DIRS}; do
208 mv ${dir} ${dir}-${EPYTHON} \
209 || die "Renaming of '${dir}' to '${dir}-${EPYTHON}' failed"
210 done
211
212 if mpi_needed; then
213 if [[ -z "${MPI_PYTHON_MODULE}" ]]; then
214 MPI_PYTHON_MODULE="$(find bin.v2/libs/mpi/build/*/gentoo* -name mpi.so)"
215 if [[ "$(echo "${MPI_PYTHON_MODULE}" | wc -l)" -ne 1 ]]; then
216 die "Multiple mpi.so files found"
217 fi
218 else
219 if [[ "${MPI_PYTHON_MODULE}" != "$(find bin.v2/libs/mpi/build/*/gentoo* -name mpi.so)" ]]; then
220 die "Inconsistent structure of build directories"
221 fi
222 fi
223
224 mv stage/lib/mpi.so stage/lib/mpi.so-${EPYTHON} \
225 || die "Renaming of 'stage/lib/mpi.so' to 'stage/lib/mpi.so-${EPYTHON}' failed"
226 fi
227 fi
228 }
229 if python_bindings_needed; then
230 python_foreach_impl building
231 else
232 building
233 fi
234
235 if tools_needed; then
236 pushd tools > /dev/null || die
237
238 ejam \
239 ${OPTIONS} \
240 ${PYTHON_OPTIONS} \
241 || die "Building of Boost tools failed"
242 popd > /dev/null || die
243 fi
244 }
245
246 multilib_src_install_all() {
247 if ! use python; then
248 rm -r "${ED}"/usr/include/boost/python* || die
249 fi
250
251 if ! use nls; then
252 rm -r "${ED}"/usr/include/boost/locale || die
253 fi
254
255 if ! use context; then
256 rm -r "${ED}"/usr/include/boost/context || die
257 rm -r "${ED}"/usr/include/boost/coroutine || die
258 fi
259
260 if use doc; then
261 find libs/*/* -iname "test" -or -iname "src" | xargs rm -rf
262 dohtml \
263 -A pdf,txt,cpp,hpp \
264 *.{htm,html,png,css} \
265 -r doc
266 dohtml -A pdf,txt -r tools
267 insinto /usr/share/doc/${PF}/html
268 doins -r libs
269 doins -r more
270
271 # To avoid broken links
272 insinto /usr/share/doc/${PF}/html
273 doins LICENSE_1_0.txt
274
275 dosym /usr/include/boost /usr/share/doc/${PF}/html/boost
276 fi
277 }
278
279 multilib_src_install() {
280 local -x BOOST_ROOT="${BUILD_DIR}"
281 installation() {
282 create_user-config.jam
283
284 local PYTHON_OPTIONS
285 if python_bindings_needed; then
286 local dir
287 for dir in ${PYTHON_DIRS}; do
288 cp -pr ${dir}-${EPYTHON} ${dir} \
289 || die "Copying of '${dir}-${EPYTHON}' to '${dir}' failed"
290 done
291
292 if mpi_needed; then
293 cp -p stage/lib/mpi.so-${EPYTHON} "${MPI_PYTHON_MODULE}" \
294 || die "Copying of 'stage/lib/mpi.so-${EPYTHON}' to '${MPI_PYTHON_MODULE}' failed"
295 cp -p stage/lib/mpi.so-${EPYTHON} stage/lib/mpi.so \
296 || die "Copying of 'stage/lib/mpi.so-${EPYTHON}' to 'stage/lib/mpi.so' failed"
297 fi
298 PYTHON_OPTIONS=" --python-buildid=${EPYTHON#python}"
299 else
300 PYTHON_OPTIONS=" --without-python"
301 fi
302
303 ejam \
304 ${OPTIONS} \
305 ${PYTHON_OPTIONS} \
306 --includedir="${ED}usr/include" \
307 --libdir="${ED}usr/$(get_libdir)" \
308 install || die "Installation of Boost libraries failed"
309
310 if python_bindings_needed; then
311 rm -r ${PYTHON_DIRS} || die
312
313 # Move mpi.so Python module to Python site-packages directory.
314 # https://svn.boost.org/trac/boost/ticket/2838
315 if mpi_needed; then
316 local moddir=$(python_get_sitedir)/boost
317 # moddir already includes eprefix
318 mkdir -p "${D}${moddir}" || die
319 mv "${ED}usr/$(get_libdir)/mpi.so" "${D}${moddir}" || die
320 cat << EOF > "${D}${moddir}/__init__.py" || die
321 import sys
322 if sys.platform.startswith('linux'):
323 import DLFCN
324 flags = sys.getdlopenflags()
325 sys.setdlopenflags(DLFCN.RTLD_NOW | DLFCN.RTLD_GLOBAL)
326 from . import mpi
327 sys.setdlopenflags(flags)
328 del DLFCN, flags
329 else:
330 from . import mpi
331 del sys
332 EOF
333 fi
334
335 python_optimize
336 fi
337 }
338 if python_bindings_needed; then
339 python_foreach_impl installation
340 else
341 installation
342 fi
343
344 pushd "${ED}usr/$(get_libdir)" > /dev/null || die
345
346 local ext=$(get_libname)
347 if use threads; then
348 local f
349 for f in *${ext}; do
350 dosym ${f} /usr/$(get_libdir)/${f/${ext}/-mt${ext}}
351 done
352 fi
353
354 popd > /dev/null || die
355
356 if tools_needed; then
357 dobin dist/bin/*
358
359 insinto /usr/share
360 doins -r dist/share/boostbook
361 fi
362
363 # boost's build system truely sucks for not having a destdir. Because for
364 # this reason we are forced to build with a prefix that includes the
365 # DESTROOT, dynamic libraries on Darwin end messed up, referencing the
366 # DESTROOT instread of the actual EPREFIX. There is no way out of here
367 # but to do it the dirty way of manually setting the right install_names.
368 if [[ ${CHOST} == *-darwin* ]]; then
369 einfo "Working around completely broken build-system(tm)"
370 local d
371 for d in "${ED}"usr/lib/*.dylib; do
372 if [[ -f ${d} ]]; then
373 # fix the "soname"
374 ebegin " correcting install_name of ${d#${ED}}"
375 install_name_tool -id "/${d#${D}}" "${d}"
376 eend $?
377 # fix references to other libs
378 refs=$(otool -XL "${d}" | \
379 sed -e '1d' -e 's/^\t//' | \
380 grep "^libboost_" | \
381 cut -f1 -d' ')
382 local r
383 for r in ${refs}; do
384 ebegin " correcting reference to ${r}"
385 install_name_tool -change \
386 "${r}" \
387 "${EPREFIX}/usr/lib/${r}" \
388 "${d}"
389 eend $?
390 done
391 fi
392 done
393 fi
394 }
395
396 pkg_preinst() {
397 # Yai for having symlinks that are nigh-impossible to remove without
398 # resorting to dirty hacks like these. Removes lingering symlinks
399 # from the slotted versions.
400 local symlink
401 for symlink in "${EROOT}usr/include/boost" "${EROOT}usr/share/boostbook"; do
402 [[ -L ${symlink} ]] && rm -f "${symlink}"
403 done
404 }

  ViewVC Help
Powered by ViewVC 1.1.20