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

Contents of /dev-libs/boost/boost-1.52.0-r7.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.15 - (show annotations) (download)
Wed Jun 3 01:53:41 2015 UTC (4 years ago) by pinkbyte
Branch: MAIN
CVS Tags: HEAD
Changes since 1.14: +2 -2 lines
Transfer older Boost ebuilds to virtual/mpi to resolve bug #547212

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

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

  ViewVC Help
Powered by ViewVC 1.1.20