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

Contents of /dev-libs/boost/boost-1.57.0.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Wed Apr 8 17:51:55 2015 UTC (4 years, 2 months ago) by mgorny
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +2 -2 lines
Drop old Python implementations

(Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key EFB4464E!)

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.57.0.ebuild,v 1.3 2015/03/10 21:02:41 vapier 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
118 # Do not try to build missing 'wave' tool, bug #522682
119 # Upstream bugreport - https://svn.boost.org/trac/boost/ticket/10507
120 sed -i -e 's:wave/build//wave::' tools/Jamfile.v2 || die
121
122 epatch_user
123
124 multilib_copy_sources
125 }
126
127 ejam() {
128 local b2_opts="--user-config=${BOOST_ROOT}/user-config.jam $@"
129 echo b2 ${b2_opts}
130 b2 ${b2_opts}
131 }
132
133 src_configure() {
134 # Workaround for too many parallel processes requested, bug #506064
135 [ "$(makeopts_jobs)" -gt 64 ] && MAKEOPTS="${MAKEOPTS} -j64"
136
137 OPTIONS="$(usex debug gentoodebug gentoorelease) -j$(makeopts_jobs) -q -d+2"
138
139 if [[ ${CHOST} == *-darwin* ]]; then
140 # We need to add the prefix, and in two cases this exceeds, so prepare
141 # for the largest possible space allocation.
142 append-ldflags -Wl,-headerpad_max_install_names
143 elif [[ ${CHOST} == *-winnt* ]]; then
144 compiler=parity
145 if [[ $($(tc-getCXX) -v) == *trunk* ]]; then
146 compilerVersion=trunk
147 else
148 compilerVersion=$($(tc-getCXX) -v | sed '1q' \
149 | sed -e 's,\([a-z]*\) \([0-9]\.[0-9]\.[0-9][^ \t]*\) .*,\2,')
150 fi
151 compilerExecutable=$(tc-getCXX)
152 fi
153
154 # bug 298489
155 if use ppc || use ppc64; then
156 [[ $(gcc-version) > 4.3 ]] && append-flags -mno-altivec
157 fi
158
159 # Do _not_ use C++11 yet, make sure to force GNU C++ 98 standard.
160 append-cxxflags -std=gnu++98
161
162 use icu && OPTIONS+=" -sICU_PATH=${EPREFIX}/usr"
163 use icu || OPTIONS+=" --disable-icu boost.locale.icu=off"
164 mpi_needed || OPTIONS+=" --without-mpi"
165 use nls || OPTIONS+=" --without-locale"
166 use context || OPTIONS+=" --without-context --without-coroutine"
167
168 OPTIONS+=" pch=off"
169 OPTIONS+=" --boost-build=${EPREFIX}/usr/share/boost-build --prefix=\"${ED}usr\""
170 OPTIONS+=" --layout=system"
171 OPTIONS+=" threading=$(usex threads multi single) link=$(usex static-libs shared,static shared)"
172
173 [[ ${CHOST} == *-winnt* ]] && OPTIONS+=" -sNO_BZIP2=1"
174 }
175
176 multilib_src_compile() {
177 local -x BOOST_ROOT="${BUILD_DIR}"
178 PYTHON_DIRS=""
179 MPI_PYTHON_MODULE=""
180
181 building() {
182 create_user-config.jam
183
184 local PYTHON_OPTIONS
185 if python_bindings_needed; then
186 PYTHON_OPTIONS=" --python-buildid=${EPYTHON#python}"
187 else
188 PYTHON_OPTIONS=" --without-python"
189 fi
190
191 ejam \
192 ${OPTIONS} \
193 ${PYTHON_OPTIONS} \
194 || die "Building of Boost libraries failed"
195
196 if python_bindings_needed; then
197 if [[ -z "${PYTHON_DIRS}" ]]; then
198 PYTHON_DIRS="$(find bin.v2/libs -name python | sort)"
199 else
200 if [[ "${PYTHON_DIRS}" != "$(find bin.v2/libs -name python | sort)" ]]; then
201 die "Inconsistent structure of build directories"
202 fi
203 fi
204
205 local dir
206 for dir in ${PYTHON_DIRS}; do
207 mv ${dir} ${dir}-${EPYTHON} \
208 || die "Renaming of '${dir}' to '${dir}-${EPYTHON}' failed"
209 done
210
211 if mpi_needed; then
212 if [[ -z "${MPI_PYTHON_MODULE}" ]]; then
213 MPI_PYTHON_MODULE="$(find bin.v2/libs/mpi/build/*/gentoo* -name mpi.so)"
214 if [[ "$(echo "${MPI_PYTHON_MODULE}" | wc -l)" -ne 1 ]]; then
215 die "Multiple mpi.so files found"
216 fi
217 else
218 if [[ "${MPI_PYTHON_MODULE}" != "$(find bin.v2/libs/mpi/build/*/gentoo* -name mpi.so)" ]]; then
219 die "Inconsistent structure of build directories"
220 fi
221 fi
222
223 mv stage/lib/mpi.so stage/lib/mpi.so-${EPYTHON} \
224 || die "Renaming of 'stage/lib/mpi.so' to 'stage/lib/mpi.so-${EPYTHON}' failed"
225 fi
226 fi
227 }
228 if python_bindings_needed; then
229 python_foreach_impl building
230 else
231 building
232 fi
233
234 if tools_needed; then
235 pushd tools > /dev/null || die
236
237 ejam \
238 ${OPTIONS} \
239 ${PYTHON_OPTIONS} \
240 || die "Building of Boost tools failed"
241 popd > /dev/null || die
242 fi
243 }
244
245 multilib_src_install_all() {
246 if ! use python; then
247 rm -r "${ED}"/usr/include/boost/python* || die
248 fi
249
250 if ! use nls; then
251 rm -r "${ED}"/usr/include/boost/locale || die
252 fi
253
254 if ! use context; then
255 rm -r "${ED}"/usr/include/boost/context || die
256 rm -r "${ED}"/usr/include/boost/coroutine || die
257 fi
258
259 if use doc; then
260 find libs/*/* -iname "test" -or -iname "src" | xargs rm -rf
261 dohtml \
262 -A pdf,txt,cpp,hpp \
263 *.{htm,html,png,css} \
264 -r doc
265 dohtml -A pdf,txt -r tools
266 insinto /usr/share/doc/${PF}/html
267 doins -r libs
268 doins -r more
269
270 # To avoid broken links
271 insinto /usr/share/doc/${PF}/html
272 doins LICENSE_1_0.txt
273
274 dosym /usr/include/boost /usr/share/doc/${PF}/html/boost
275 fi
276 }
277
278 multilib_src_install() {
279 local -x BOOST_ROOT="${BUILD_DIR}"
280 installation() {
281 create_user-config.jam
282
283 local PYTHON_OPTIONS
284 if python_bindings_needed; then
285 local dir
286 for dir in ${PYTHON_DIRS}; do
287 cp -pr ${dir}-${EPYTHON} ${dir} \
288 || die "Copying of '${dir}-${EPYTHON}' to '${dir}' failed"
289 done
290
291 if mpi_needed; then
292 cp -p stage/lib/mpi.so-${EPYTHON} "${MPI_PYTHON_MODULE}" \
293 || die "Copying of 'stage/lib/mpi.so-${EPYTHON}' to '${MPI_PYTHON_MODULE}' failed"
294 cp -p stage/lib/mpi.so-${EPYTHON} stage/lib/mpi.so \
295 || die "Copying of 'stage/lib/mpi.so-${EPYTHON}' to 'stage/lib/mpi.so' failed"
296 fi
297 PYTHON_OPTIONS=" --python-buildid=${EPYTHON#python}"
298 else
299 PYTHON_OPTIONS=" --without-python"
300 fi
301
302 ejam \
303 ${OPTIONS} \
304 ${PYTHON_OPTIONS} \
305 --includedir="${ED}usr/include" \
306 --libdir="${ED}usr/$(get_libdir)" \
307 install || die "Installation of Boost libraries failed"
308
309 if python_bindings_needed; then
310 rm -r ${PYTHON_DIRS} || die
311
312 # Move mpi.so Python module to Python site-packages directory.
313 # https://svn.boost.org/trac/boost/ticket/2838
314 if mpi_needed; then
315 local moddir=$(python_get_sitedir)/boost
316 # moddir already includes eprefix
317 mkdir -p "${D}${moddir}" || die
318 mv "${ED}usr/$(get_libdir)/mpi.so" "${D}${moddir}" || die
319 cat << EOF > "${D}${moddir}/__init__.py" || die
320 import sys
321 if sys.platform.startswith('linux'):
322 import DLFCN
323 flags = sys.getdlopenflags()
324 sys.setdlopenflags(DLFCN.RTLD_NOW | DLFCN.RTLD_GLOBAL)
325 from . import mpi
326 sys.setdlopenflags(flags)
327 del DLFCN, flags
328 else:
329 from . import mpi
330 del sys
331 EOF
332 fi
333
334 python_optimize
335 fi
336 }
337 if python_bindings_needed; then
338 python_foreach_impl installation
339 else
340 installation
341 fi
342
343 pushd "${ED}usr/$(get_libdir)" > /dev/null || die
344
345 local ext=$(get_libname)
346 if use threads; then
347 local f
348 for f in *${ext}; do
349 dosym ${f} /usr/$(get_libdir)/${f/${ext}/-mt${ext}}
350 done
351 fi
352
353 popd > /dev/null || die
354
355 if tools_needed; then
356 dobin dist/bin/*
357
358 insinto /usr/share
359 doins -r dist/share/boostbook
360 fi
361
362 # boost's build system truely sucks for not having a destdir. Because for
363 # this reason we are forced to build with a prefix that includes the
364 # DESTROOT, dynamic libraries on Darwin end messed up, referencing the
365 # DESTROOT instread of the actual EPREFIX. There is no way out of here
366 # but to do it the dirty way of manually setting the right install_names.
367 if [[ ${CHOST} == *-darwin* ]]; then
368 einfo "Working around completely broken build-system(tm)"
369 local d
370 for d in "${ED}"usr/lib/*.dylib; do
371 if [[ -f ${d} ]]; then
372 # fix the "soname"
373 ebegin " correcting install_name of ${d#${ED}}"
374 install_name_tool -id "/${d#${D}}" "${d}"
375 eend $?
376 # fix references to other libs
377 refs=$(otool -XL "${d}" | \
378 sed -e '1d' -e 's/^\t//' | \
379 grep "^libboost_" | \
380 cut -f1 -d' ')
381 local r
382 for r in ${refs}; do
383 ebegin " correcting reference to ${r}"
384 install_name_tool -change \
385 "${r}" \
386 "${EPREFIX}/usr/lib/${r}" \
387 "${d}"
388 eend $?
389 done
390 fi
391 done
392 fi
393 }
394
395 pkg_preinst() {
396 # Yai for having symlinks that are nigh-impossible to remove without
397 # resorting to dirty hacks like these. Removes lingering symlinks
398 # from the slotted versions.
399 local symlink
400 for symlink in "${EROOT}usr/include/boost" "${EROOT}usr/share/boostbook"; do
401 [[ -L ${symlink} ]] && rm -f "${symlink}"
402 done
403 }

  ViewVC Help
Powered by ViewVC 1.1.20