Gentoo Archives: gentoo-commits

From: "Diego Petteno (flameeyes)" <flameeyes@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-libs/boost: boost-1.52.0-r4.ebuild ChangeLog boost-1.52.0-r3.ebuild
Date: Thu, 22 Nov 2012 03:38:11
Message-Id: 20121122033759.1949520C65@flycatcher.gentoo.org
1 flameeyes 12/11/22 03:37:58
2
3 Modified: ChangeLog
4 Added: boost-1.52.0-r4.ebuild
5 Removed: boost-1.52.0-r3.ebuild
6 Log:
7 Add patch to fix boost's tuple library. Thanks to Alex in bug #443992.
8
9 (Portage version: 2.2.0_alpha142/cvs/Linux x86_64, signed Manifest commit with key 1CD13C8AD4301342)
10
11 Revision Changes Path
12 1.283 dev-libs/boost/ChangeLog
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/boost/ChangeLog?rev=1.283&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/boost/ChangeLog?rev=1.283&content-type=text/plain
16 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/boost/ChangeLog?r1=1.282&r2=1.283
17
18 Index: ChangeLog
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/dev-libs/boost/ChangeLog,v
21 retrieving revision 1.282
22 retrieving revision 1.283
23 diff -u -r1.282 -r1.283
24 --- ChangeLog 18 Nov 2012 16:10:49 -0000 1.282
25 +++ ChangeLog 22 Nov 2012 03:37:58 -0000 1.283
26 @@ -1,6 +1,12 @@
27 # ChangeLog for dev-libs/boost
28 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
29 -# $Header: /var/cvsroot/gentoo-x86/dev-libs/boost/ChangeLog,v 1.282 2012/11/18 16:10:49 flameeyes Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/dev-libs/boost/ChangeLog,v 1.283 2012/11/22 03:37:58 flameeyes Exp $
31 +
32 +*boost-1.52.0-r4 (22 Nov 2012)
33 +
34 + 22 Nov 2012; Diego E. Pettenò <flameeyes@g.o> +boost-1.52.0-r4.ebuild,
35 + +files/boost-1.52.0-tuple.patch, -boost-1.52.0-r3.ebuild:
36 + Add patch to fix boost's tuple library. Thanks to Alex in bug #443992.
37
38 *boost-1.52.0-r3 (18 Nov 2012)
39
40
41
42
43 1.1 dev-libs/boost/boost-1.52.0-r4.ebuild
44
45 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/boost/boost-1.52.0-r4.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/boost/boost-1.52.0-r4.ebuild?rev=1.1&content-type=text/plain
47
48 Index: boost-1.52.0-r4.ebuild
49 ===================================================================
50 # Copyright 1999-2012 Gentoo Foundation
51 # Distributed under the terms of the GNU General Public License v2
52 # $Header: /var/cvsroot/gentoo-x86/dev-libs/boost/boost-1.52.0-r4.ebuild,v 1.1 2012/11/22 03:37:58 flameeyes Exp $
53
54 EAPI="5"
55 PYTHON_DEPEND="python? *"
56 SUPPORT_PYTHON_ABIS="1"
57 RESTRICT_PYTHON_ABIS="*-jython *-pypy-*"
58
59 inherit flag-o-matic multilib multiprocessing python toolchain-funcs versionator
60
61 MY_P=${PN}_$(replace_all_version_separators _)
62
63 DESCRIPTION="Boost Libraries for C++"
64 HOMEPAGE="http://www.boost.org/"
65 SRC_URI="mirror://sourceforge/boost/${MY_P}.tar.bz2"
66
67 LICENSE="Boost-1.0"
68 SLOT=0
69 MAJOR_V="$(get_version_component_range 1-2)"
70 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
71 IUSE="debug doc icu +nls mpi python static-libs +threads tools"
72
73 RDEPEND="icu? ( >=dev-libs/icu-3.6:= )
74 !icu? ( virtual/libiconv )
75 mpi? ( || ( sys-cluster/openmpi[cxx] sys-cluster/mpich2[cxx,threads] ) )
76 sys-libs/zlib
77 !app-admin/eselect-boost"
78 DEPEND="${RDEPEND}
79 =dev-util/boost-build-${MAJOR_V}*"
80
81 S=${WORKDIR}/${MY_P}
82
83 create_user-config.jam() {
84 local compiler compiler_version compiler_executable
85
86 if [[ ${CHOST} == *-darwin* ]]; then
87 compiler="darwin"
88 compiler_version="$(gcc-fullversion)"
89 compiler_executable="$(tc-getCXX)"
90 else
91 compiler="gcc"
92 compiler_version="$(gcc-version)"
93 compiler_executable="$(tc-getCXX)"
94 fi
95 local mpi_configuration python_configuration
96
97 if use mpi; then
98 mpi_configuration="using mpi ;"
99 fi
100
101 if use python; then
102 python_configuration="using python : $(python_get_version) : /usr : $(python_get_includedir) : /usr/$(get_libdir) ;"
103 fi
104
105 cat > user-config.jam << __EOF__
106 using ${compiler} : ${compiler_version} : ${compiler_executable} : <cflags>"${CFLAGS}" <cxxflags>"${CXXFLAGS}" <linkflags>"${LDFLAGS}" ;
107 ${mpi_configuration}
108 ${python_configuration}
109 __EOF__
110 }
111
112 pkg_setup() {
113 if use python; then
114 python_pkg_setup
115 fi
116 }
117
118 src_prepare() {
119 epatch \
120 "${FILESDIR}/${PN}-1.48.0-mpi_python3.patch" \
121 "${FILESDIR}/${PN}-1.51.0-respect_python-buildid.patch" \
122 "${FILESDIR}/${PN}-1.51.0-support_dots_in_python-buildid.patch" \
123 "${FILESDIR}/${PN}-1.48.0-no_strict_aliasing_python2.patch" \
124 "${FILESDIR}/${PN}-1.48.0-disable_libboost_python3.patch" \
125 "${FILESDIR}/${PN}-1.48.0-python_linking.patch" \
126 "${FILESDIR}/${PN}-1.48.0-disable_icu_rpath.patch" \
127 "${FILESDIR}/remove-toolset-1.48.0.patch" \
128 "${FILESDIR}/${PN}-1.52.0-tuple.patch"
129
130 # Avoid a patch for now
131 for file in libs/context/src/asm/*.S; do
132 cat - >> $file <<EOF
133
134 #if defined(__linux__) && defined(__ELF__)
135 .section .note.GNU-stack,"",%progbits
136 #endif
137 EOF
138 done
139 }
140
141 ejam() {
142 echo b2 "$@"
143 b2 "$@"
144 }
145
146 src_configure() {
147 OPTIONS="$(usex debug gentoodebug gentoorelease) -j$(makeopts_jobs) -q -d+2 --user-config=${S}/user-config.jam"
148
149 if [[ ${CHOST} == *-darwin* ]]; then
150 # We need to add the prefix, and in two cases this exceeds, so prepare
151 # for the largest possible space allocation.
152 append-ldflags -Wl,-headerpad_max_install_names
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=/usr"
164 use icu || OPTIONS+=" --disable-icu boost.locale.icu=off"
165 use mpi || OPTIONS+=" --without-mpi"
166 use python || OPTIONS+=" --without-python"
167 use nls || OPTIONS+=" --without-locale"
168
169 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"
170 }
171
172 src_compile() {
173 export BOOST_ROOT="${S}"
174 PYTHON_DIRS=""
175 MPI_PYTHON_MODULE=""
176
177 building() {
178 create_user-config.jam
179
180 ejam ${OPTIONS} \
181 $(use python && echo --python-buildid=${PYTHON_ABI}) \
182 || die "Building of Boost libraries failed"
183
184 if use python; then
185 if [[ -z "${PYTHON_DIRS}" ]]; then
186 PYTHON_DIRS="$(find bin.v2/libs -name python | sort)"
187 else
188 if [[ "${PYTHON_DIRS}" != "$(find bin.v2/libs -name python | sort)" ]]; then
189 die "Inconsistent structure of build directories"
190 fi
191 fi
192
193 local dir
194 for dir in ${PYTHON_DIRS}; do
195 mv ${dir} ${dir}-${PYTHON_ABI} || die "Renaming of '${dir}' to '${dir}-${PYTHON_ABI}' failed"
196 done
197
198 if use mpi; then
199 if [[ -z "${MPI_PYTHON_MODULE}" ]]; then
200 MPI_PYTHON_MODULE="$(find bin.v2/libs/mpi/build/*/gentoo* -name mpi.so)"
201 if [[ "$(echo "${MPI_PYTHON_MODULE}" | wc -l)" -ne 1 ]]; then
202 die "Multiple mpi.so files found"
203 fi
204 else
205 if [[ "${MPI_PYTHON_MODULE}" != "$(find bin.v2/libs/mpi/build/*/gentoo* -name mpi.so)" ]]; then
206 die "Inconsistent structure of build directories"
207 fi
208 fi
209
210 mv stage/lib/mpi.so stage/lib/mpi.so-${PYTHON_ABI} || die "Renaming of 'stage/lib/mpi.so' to 'stage/lib/mpi.so-${PYTHON_ABI}' failed"
211 fi
212 fi
213 }
214 if use python; then
215 python_execute_function building
216 else
217 building
218 fi
219
220 if use tools; then
221 pushd tools > /dev/null || die
222
223 ejam ${OPTIONS} \
224 || die "Building of Boost tools failed"
225 popd > /dev/null || die
226 fi
227 }
228
229 src_install () {
230 installation() {
231 create_user-config.jam
232
233 if use python; then
234 local dir
235 for dir in ${PYTHON_DIRS}; do
236 cp -pr ${dir}-${PYTHON_ABI} ${dir} || die "Copying of '${dir}-${PYTHON_ABI}' to '${dir}' failed"
237 done
238
239 if use mpi; then
240 cp -p stage/lib/mpi.so-${PYTHON_ABI} "${MPI_PYTHON_MODULE}" || die "Copying of 'stage/lib/mpi.so-${PYTHON_ABI}' to '${MPI_PYTHON_MODULE}' failed"
241 cp -p stage/lib/mpi.so-${PYTHON_ABI} stage/lib/mpi.so || die "Copying of 'stage/lib/mpi.so-${PYTHON_ABI}' to 'stage/lib/mpi.so' failed"
242 fi
243 fi
244
245 ejam ${OPTIONS} \
246 --includedir="${D}usr/include" \
247 --libdir="${D}usr/$(get_libdir)" \
248 $(use python && echo --python-buildid=${PYTHON_ABI}) \
249 install || die "Installation of Boost libraries failed"
250
251 if use python; then
252 rm -r ${PYTHON_DIRS} || die
253
254 # Move mpi.so Python module to Python site-packages directory.
255 # https://svn.boost.org/trac/boost/ticket/2838
256 if use mpi; then
257 dodir $(python_get_sitedir)/boost
258 mv "${D}usr/$(get_libdir)/mpi.so" "${D}$(python_get_sitedir)/boost" || die
259 cat << EOF > "${D}$(python_get_sitedir)/boost/__init__.py" || die
260 import sys
261 if sys.platform.startswith('linux'):
262 import DLFCN
263 flags = sys.getdlopenflags()
264 sys.setdlopenflags(DLFCN.RTLD_NOW | DLFCN.RTLD_GLOBAL)
265 from . import mpi
266 sys.setdlopenflags(flags)
267 del DLFCN, flags
268 else:
269 from . import mpi
270 del sys
271 EOF
272 fi
273 fi
274 }
275 if use python; then
276 python_execute_function installation
277 else
278 installation
279 fi
280
281 if ! use python; then
282 rm -r "${D}"/usr/include/boost/python* || die
283 fi
284
285 if ! use nls; then
286 rm -r "${D}"/usr/include/boost/locale || die
287 fi
288
289 rm -r "${D}"/usr/include/boost/context || die
290
291 if use doc; then
292 find libs/*/* -iname "test" -or -iname "src" | xargs rm -rf
293 dohtml \
294 -A pdf,txt,cpp,hpp \
295 *.{htm,html,png,css} \
296 -r doc
297 dohtml -A pdf,txt -r tools
298 insinto /usr/share/doc/${PF}/html
299 doins -r libs
300 doins -r more
301
302 # To avoid broken links
303 insinto /usr/share/doc/${PF}/html
304 doins LICENSE_1_0.txt
305
306 dosym /usr/include/boost /usr/share/doc/${PF}/html/boost
307 fi
308
309 pushd "${D}usr/$(get_libdir)" > /dev/null || die
310
311 local ext=$(get_libname)
312 if use threads; then
313 local f
314 for f in *${ext}; do
315 dosym ${f} /usr/$(get_libdir)/${f/${ext}/-mt${ext}}
316 done
317 fi
318
319 popd > /dev/null || die
320
321 if use tools; then
322 dobin dist/bin/*
323
324 insinto /usr/share
325 doins -r dist/share/boostbook
326 fi
327
328 # boost's build system truely sucks for not having a destdir. Because for
329 # this reason we are forced to build with a prefix that includes the
330 # DESTROOT, dynamic libraries on Darwin end messed up, referencing the
331 # DESTROOT instread of the actual EPREFIX. There is no way out of here
332 # but to do it the dirty way of manually setting the right install_names.
333 if [[ ${CHOST} == *-darwin* ]]; then
334 einfo "Working around completely broken build-system(tm)"
335 local d
336 for d in "${ED}"usr/lib/*.dylib; do
337 if [[ -f ${d} ]]; then
338 # fix the "soname"
339 ebegin " correcting install_name of ${d#${ED}}"
340 install_name_tool -id "/${d#${D}}" "${d}"
341 eend $?
342 # fix references to other libs
343 refs=$(otool -XL "${d}" | \
344 sed -e '1d' -e 's/^\t//' | \
345 grep "^libboost_" | \
346 cut -f1 -d' ')
347 local r
348 for r in ${refs}; do
349 ebegin " correcting reference to ${r}"
350 install_name_tool -change \
351 "${r}" \
352 "${EPREFIX}/usr/lib/${r}" \
353 "${d}"
354 eend $?
355 done
356 fi
357 done
358 fi
359 }
360
361 pkg_preinst() {
362 # Yai for having symlinks that are nigh-impossible to remove without
363 # resorting to dirty hacks like these. Removes lingering symlinks
364 # from the slotted versions.
365 local symlink
366 for symlink in "${EROOT}usr/include/boost" "${EROOT}usr/share/boostbook"; do
367 [[ -L ${symlink} ]] && rm -f "${symlink}"
368 done
369 }
370
371 pkg_postinst() {
372 if use mpi && use python; then
373 python_mod_optimize boost
374 fi
375 }
376
377 pkg_postrm() {
378 if use mpi && use python; then
379 python_mod_cleanup boost
380 fi
381 }
382
383 # the tests will never fail because these are not intended as sanity
384 # tests at all. They are more a way for upstream to check their own code
385 # on new compilers. Since they would either be completely unreliable
386 # (failing for no good reason) or completely useless (never failing)
387 # there is no point in having them in the ebuild to begin with.
388 src_test() { :; }