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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20