Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] dev/mgorny:split-boost commit in: dev-cpp/boost-headers/, eclass/
Date: Fri, 24 Aug 2012 18:36:05
Message-Id: 1345552043.7648dbc1061be07023c4ed6a69f67b1e76a0bc14.mgorny@gentoo
1 commit: 7648dbc1061be07023c4ed6a69f67b1e76a0bc14
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Tue Aug 21 10:36:43 2012 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Tue Aug 21 12:27:23 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=7648dbc1
7
8 Initial part of split boost: headers.
9
10 ---
11 dev-cpp/boost-headers/Manifest | 1 +
12 dev-cpp/boost-headers/boost-headers-1.50.0.ebuild | 25 +++++
13 eclass/boost.eclass | 98 +++++++++++++++++++++
14 3 files changed, 124 insertions(+), 0 deletions(-)
15
16 diff --git a/dev-cpp/boost-headers/Manifest b/dev-cpp/boost-headers/Manifest
17 new file mode 100644
18 index 0000000..5cea877
19 --- /dev/null
20 +++ b/dev-cpp/boost-headers/Manifest
21 @@ -0,0 +1 @@
22 +DIST boost_1_50_0.tar.bz2 50786885 SHA256 c9ace2b8c81fa6703d1d17c7e478de3bc51101c5adbdeb3f6cb72cf3045a8529 SHA512 5909a2eca520a28af31de6a36c51f57b11fddcc0a51493a1e500ade00d9c4e78175c4892c04857ee385f3874f96e561b74b6427e1a155102e926421067d889fe WHIRLPOOL f5f5d9bc2e321da270dbaab04e0ec898240010720e77b362fac7266896a67b1eaa2e71a1d0e948057f55578dca5998e4faf8dc300e2c92608ee06316092bd08c
23
24 diff --git a/dev-cpp/boost-headers/boost-headers-1.50.0.ebuild b/dev-cpp/boost-headers/boost-headers-1.50.0.ebuild
25 new file mode 100644
26 index 0000000..d4eab99
27 --- /dev/null
28 +++ b/dev-cpp/boost-headers/boost-headers-1.50.0.ebuild
29 @@ -0,0 +1,25 @@
30 +# Copyright 1999-2012 Gentoo Foundation
31 +# Distributed under the terms of the GNU General Public License v2
32 +# $Header: $
33 +
34 +EAPI=4
35 +
36 +inherit boost eutils
37 +
38 +DESCRIPTION="Boost header-only libraries"
39 +
40 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
41 +#IUSE="doc"
42 +
43 +src_unpack() {
44 + local exclude_libs=(
45 + chrono date_time exception filesystem graph graph_parallel iostreams
46 + locale math mpi program_options python random regex serialization
47 + signals system test thread timer wave
48 + )
49 +
50 + ebegin "Unpacking (parts of) ${A}"
51 + # ${A} is quoted so it will fail horribly if it contains two files
52 + tar -xf "${DISTDIR}"/"${A}" ${exclude_libs[@]/#/--exclude libs/} \
53 + || die 'Boost unpack failed.'
54 +}
55
56 diff --git a/eclass/boost.eclass b/eclass/boost.eclass
57 new file mode 100644
58 index 0000000..6953747
59 --- /dev/null
60 +++ b/eclass/boost.eclass
61 @@ -0,0 +1,98 @@
62 +# Copyright 1999-2012 Gentoo Foundation
63 +# Distributed under the terms of the GNU General Public License v2
64 +# $Header: $
65 +
66 +# @ECLASS: boost.eclass
67 +# @MAINTAINER:
68 +# mgorny@g.o
69 +# @BLURB: common definitions and functions for split boost ebuilds
70 +# @DESCRIPTION:
71 +# This eclass is intended to be used in boost only.
72 +
73 +# TODO:
74 +# - tests
75 +
76 +case ${EAPI:-0} in
77 + 4) ;;
78 + 0|1|2|3) die "${ECLASS}.eclass does not support EAPI ${EAPI}." ;;
79 + *) die "${ECLASS}.eclass API in EAPI ${EAPI} not yet established."
80 +esac
81 +
82 +inherit multilib multiprocessing toolchain-funcs versionator
83 +
84 +EXPORT_FUNCTIONS src_configure src_compile src_install
85 +
86 +BOOST_P=boost_$(replace_all_version_separators _)
87 +
88 +HOMEPAGE="http://www.boost.org/"
89 +SRC_URI="mirror://sourceforge/boost/${BOOST_P}.tar.bz2"
90 +LICENSE="Boost-1.0"
91 +SLOT="$(get_version_component_range 1-2)"
92 +
93 +# XXX: add <= sometime
94 +RDEPEND="!dev-libs/boost:1.50"
95 +DEPEND=">=dev-util/boost-build-1.50.0-r2:${SLOT}"
96 +
97 +S=${WORKDIR}/${BOOST_P}
98 +
99 +BOOST_MAJOR_PV=$(replace_all_version_separators _ ${SLOT})
100 +BOOST_BJAM=b2-${BOOST_MAJOR_PV}
101 +
102 +boost_create_user-config.jam() {
103 + local compiler compiler_version compiler_executable
104 +
105 + if [[ ${CHOST} == *-darwin* ]]; then
106 + compiler="darwin"
107 + compiler_version="$(gcc-fullversion)"
108 + compiler_executable="$(tc-getCXX)"
109 + else
110 + compiler="gcc"
111 + compiler_version="$(gcc-version)"
112 + compiler_executable="$(tc-getCXX)"
113 + fi
114 +
115 + cat > user-config.jam << __EOF__
116 +using ${compiler} : ${compiler_version} : ${compiler_executable} : <cflags>"${CFLAGS}" <cxxflags>"${CXXFLAGS}" <linkflags>"${LDFLAGS}" ;
117 +__EOF__
118 +}
119 +
120 +boost_src_configure() {
121 + BOOST_OPTIONS+=(
122 + --boost-build=/usr/share/boost-build-${BOOST_MAJOR_PV}
123 + --layout=versioned
124 + --prefix="${D}usr"
125 +
126 + pch=off
127 + )
128 +
129 + boost_create_user-config.jam
130 +}
131 +
132 +boost_src_compile() {
133 + export BOOST_ROOT="${S}"
134 +
135 + local args=(
136 + ${BOOST_BJAM} -j$(makeopts_jobs) -q -d+2
137 + gentoorelease
138 + --user-config=user-config.jam
139 + "${BOOST_OPTIONS[@]}" threading=single,multi
140 + )
141 +
142 + einfo "${args[@]}"
143 + "${args[@]}" || die "Build of boost libraries failed"
144 +}
145 +
146 +boost_src_install() {
147 + local args=(
148 + ${BOOST_BJAM} -q -d+2
149 + gentoorelease
150 + --user-config=user-config.jam
151 + "${BOOST_OPTIONS[@]}" threading=single,multi
152 + --includedir="${D}usr/include"
153 + --libdir="${D}usr/$(get_libdir)"
154 + install
155 + )
156 +
157 + einfo "${args[@]}"
158 + "${args[@]}" || die "Install of boost libraries failed"
159 +}