1 |
voyageur 10/07/27 13:06:47 |
2 |
|
3 |
Modified: metadata.xml ChangeLog clang-9999.ebuild |
4 |
Added: clang-2.7-r2.ebuild |
5 |
Removed: clang-2.7-r1.ebuild |
6 |
Log: |
7 |
Add a USE-flag for system CXX headers, fix for x86. llvm-gcc users should leave the flag off |
8 |
(Portage version: 2.2_rc67/cvs/Linux x86_64) |
9 |
|
10 |
Revision Changes Path |
11 |
1.2 sys-devel/clang/metadata.xml |
12 |
|
13 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/clang/metadata.xml?rev=1.2&view=markup |
14 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/clang/metadata.xml?rev=1.2&content-type=text/plain |
15 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/clang/metadata.xml?r1=1.1&r2=1.2 |
16 |
|
17 |
Index: metadata.xml |
18 |
=================================================================== |
19 |
RCS file: /var/cvsroot/gentoo-x86/sys-devel/clang/metadata.xml,v |
20 |
retrieving revision 1.1 |
21 |
retrieving revision 1.2 |
22 |
diff -u -r1.1 -r1.2 |
23 |
--- metadata.xml 5 Oct 2009 13:19:28 -0000 1.1 |
24 |
+++ metadata.xml 27 Jul 2010 13:06:47 -0000 1.2 |
25 |
@@ -30,5 +30,6 @@ |
26 |
Conformance with C/C++/ObjC and their variants</longdescription> |
27 |
<use> |
28 |
<flag name='static-analyzer'>Install the Clang static analyzer</flag> |
29 |
+ <flag name='system-cxx-headers'>By default, clang++ searchs for C++ headers in a series of hardcoded paths. Enabling this flag will force it to use the active gcc profile ones</flag> |
30 |
</use> |
31 |
</pkgmetadata> |
32 |
|
33 |
|
34 |
|
35 |
1.18 sys-devel/clang/ChangeLog |
36 |
|
37 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/clang/ChangeLog?rev=1.18&view=markup |
38 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/clang/ChangeLog?rev=1.18&content-type=text/plain |
39 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/clang/ChangeLog?r1=1.17&r2=1.18 |
40 |
|
41 |
Index: ChangeLog |
42 |
=================================================================== |
43 |
RCS file: /var/cvsroot/gentoo-x86/sys-devel/clang/ChangeLog,v |
44 |
retrieving revision 1.17 |
45 |
retrieving revision 1.18 |
46 |
diff -u -r1.17 -r1.18 |
47 |
--- ChangeLog 20 Jul 2010 09:35:43 -0000 1.17 |
48 |
+++ ChangeLog 27 Jul 2010 13:06:47 -0000 1.18 |
49 |
@@ -1,6 +1,13 @@ |
50 |
# ChangeLog for sys-devel/clang |
51 |
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 |
52 |
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/ChangeLog,v 1.17 2010/07/20 09:35:43 voyageur Exp $ |
53 |
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/ChangeLog,v 1.18 2010/07/27 13:06:47 voyageur Exp $ |
54 |
+ |
55 |
+*clang-2.7-r2 (27 Jul 2010) |
56 |
+ |
57 |
+ 27 Jul 2010; Bernard Cafarelli <voyageur@g.o> -clang-2.7-r1.ebuild, |
58 |
+ +clang-2.7-r2.ebuild, clang-9999.ebuild, metadata.xml: |
59 |
+ Add a USE-flag for system CXX headers, fix for x86. llvm-gcc users should |
60 |
+ leave the flag off |
61 |
|
62 |
*clang-2.7-r1 (20 Jul 2010) |
63 |
|
64 |
|
65 |
|
66 |
|
67 |
1.4 sys-devel/clang/clang-9999.ebuild |
68 |
|
69 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/clang/clang-9999.ebuild?rev=1.4&view=markup |
70 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/clang/clang-9999.ebuild?rev=1.4&content-type=text/plain |
71 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/clang/clang-9999.ebuild?r1=1.3&r2=1.4 |
72 |
|
73 |
Index: clang-9999.ebuild |
74 |
=================================================================== |
75 |
RCS file: /var/cvsroot/gentoo-x86/sys-devel/clang/clang-9999.ebuild,v |
76 |
retrieving revision 1.3 |
77 |
retrieving revision 1.4 |
78 |
diff -u -r1.3 -r1.4 |
79 |
--- clang-9999.ebuild 20 Jul 2010 09:35:43 -0000 1.3 |
80 |
+++ clang-9999.ebuild 27 Jul 2010 13:06:47 -0000 1.4 |
81 |
@@ -1,6 +1,6 @@ |
82 |
# Copyright 1999-2010 Gentoo Foundation |
83 |
# Distributed under the terms of the GNU General Public License v2 |
84 |
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/clang-9999.ebuild,v 1.3 2010/07/20 09:35:43 voyageur Exp $ |
85 |
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/clang-9999.ebuild,v 1.4 2010/07/27 13:06:47 voyageur Exp $ |
86 |
|
87 |
EAPI=2 |
88 |
|
89 |
@@ -83,12 +83,15 @@ |
90 |
# Skip llvm-gcc parts even if installed |
91 |
CONF_FLAGS="${CONF_FLAGS} --with-llvmgccdir=/dev/null" |
92 |
|
93 |
- # Try to get current C++ headers path |
94 |
- CONF_FLAGS="${CONF_FLAGS} --with-cxx-include-root=$(gcc-config -X| cut -d: -f1)/include/g++-v4" |
95 |
- CONF_FLAGS="${CONF_FLAGS} --with-cxx-include-arch=$CHOST" |
96 |
- if has_multilib_profile; then |
97 |
- CONF_FLAGS="${CONF_FLAGS} --with-cxx-include-32bit-dir=32" |
98 |
+ if use system-cxx-headers; then |
99 |
+ # Try to get current C++ headers path |
100 |
+ CONF_FLAGS="${CONF_FLAGS} --with-cxx-include-root=$(gcc-config -X| cut -d: -f1 | sed '/-v4$/! s,$,/include/g++-v4,')" |
101 |
+ CONF_FLAGS="${CONF_FLAGS} --with-cxx-include-arch=$CHOST" |
102 |
+ if has_multilib_profile; then |
103 |
+ CONF_FLAGS="${CONF_FLAGS} --with-cxx-include-32bit-dir=32" |
104 |
+ fi |
105 |
fi |
106 |
+ |
107 |
econf ${CONF_FLAGS} || die "econf failed" |
108 |
} |
109 |
|
110 |
@@ -135,9 +138,15 @@ |
111 |
|
112 |
pkg_postinst() { |
113 |
python_mod_optimize clang |
114 |
- elog "C++ headers search path is hardcoded to the active gcc profile one" |
115 |
- elog "If you change the active gcc profile, or update gcc to a new version," |
116 |
- elog "you will have to remerge this package to update the search path" |
117 |
+ if use system-cxx-headers; then |
118 |
+ elog "C++ headers search path is hardcoded to the active gcc profile one" |
119 |
+ elog "If you change the active gcc profile, or update gcc to a new version," |
120 |
+ elog "you will have to remerge this package to update the search path" |
121 |
+ else |
122 |
+ elog "If clang++ fails to find C++ headers on your system," |
123 |
+ elog "you can remerge clang with USE=system-cxx-headers to use C++ headers" |
124 |
+ elog "from the active gcc profile" |
125 |
+ fi |
126 |
} |
127 |
|
128 |
pkg_postrm() { |
129 |
|
130 |
|
131 |
|
132 |
1.1 sys-devel/clang/clang-2.7-r2.ebuild |
133 |
|
134 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/clang/clang-2.7-r2.ebuild?rev=1.1&view=markup |
135 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/clang/clang-2.7-r2.ebuild?rev=1.1&content-type=text/plain |
136 |
|
137 |
Index: clang-2.7-r2.ebuild |
138 |
=================================================================== |
139 |
# Copyright 1999-2010 Gentoo Foundation |
140 |
# Distributed under the terms of the GNU General Public License v2 |
141 |
# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/clang-2.7-r2.ebuild,v 1.1 2010/07/27 13:06:47 voyageur Exp $ |
142 |
|
143 |
EAPI=2 |
144 |
|
145 |
RESTRICT_PYTHON_ABIS="3.*" |
146 |
SUPPORT_PYTHON_ABIS="1" |
147 |
|
148 |
inherit eutils multilib python |
149 |
|
150 |
DESCRIPTION="C language family frontend for LLVM" |
151 |
HOMEPAGE="http://clang.llvm.org/" |
152 |
# Fetching LLVM as well: see http://llvm.org/bugs/show_bug.cgi?id=4840 |
153 |
SRC_URI="http://llvm.org/releases/${PV}/llvm-${PV}.tgz |
154 |
http://llvm.org/releases/${PV}/${P}.tgz" |
155 |
|
156 |
LICENSE="UoI-NCSA" |
157 |
SLOT="0" |
158 |
KEYWORDS="~amd64 ~x86" |
159 |
IUSE="debug +static-analyzer system-cxx-headers test" |
160 |
|
161 |
# Note: for LTO support, clang will depend on binutils with gold plugins, and LLVM built after that - http://llvm.org/docs/GoldPlugin.html |
162 |
DEPEND="static-analyzer? ( dev-lang/perl ) |
163 |
test? ( dev-util/dejagnu )" |
164 |
RDEPEND="~sys-devel/llvm-${PV}" |
165 |
|
166 |
S="${WORKDIR}/llvm-2.7" |
167 |
|
168 |
src_prepare() { |
169 |
mv "${WORKDIR}"/clang-2.7 "${S}"/tools/clang || die "clang source directory not found" |
170 |
|
171 |
# Same as llvm doc patches |
172 |
epatch "${FILESDIR}"/${PN}-2.7-fixdoc.patch |
173 |
|
174 |
# multilib-strict |
175 |
sed -e "/PROJ_headers/s#lib/clang#$(get_libdir)/clang#" \ |
176 |
-i tools/clang/lib/Headers/Makefile \ |
177 |
|| die "clang Makefile failed" |
178 |
# fix the static analyzer for in-tree install |
179 |
sed -e 's/import ScanView/from clang \0/' \ |
180 |
-i tools/clang/tools/scan-view/scan-view \ |
181 |
|| die "scan-view sed failed" |
182 |
sed -e "/scanview.css\|sorttable.js/s#\$RealBin#/usr/share/${PN}#" \ |
183 |
-i tools/clang/tools/scan-build/scan-build \ |
184 |
|| die "scan-build sed failed" |
185 |
# Specify python version |
186 |
python_convert_shebangs 2 tools/clang/tools/scan-view/scan-view |
187 |
|
188 |
# From llvm src_prepare |
189 |
einfo "Fixing install dirs" |
190 |
sed -e 's,^PROJ_docsdir.*,PROJ_docsdir := $(PROJ_prefix)/share/doc/'${PF}, \ |
191 |
-e 's,^PROJ_etcdir.*,PROJ_etcdir := /etc/llvm,' \ |
192 |
-e 's,^PROJ_libdir.*,PROJ_libdir := $(PROJ_prefix)/'$(get_libdir), \ |
193 |
-i Makefile.config.in || die "Makefile.config sed failed" |
194 |
|
195 |
einfo "Fixing rpath" |
196 |
sed -e 's/\$(RPATH) -Wl,\$(\(ToolDir\|LibDir\))//g' -i Makefile.rules \ |
197 |
|| die "rpath sed failed" |
198 |
} |
199 |
|
200 |
src_configure() { |
201 |
local CONF_FLAGS="" |
202 |
|
203 |
if use debug; then |
204 |
CONF_FLAGS="${CONF_FLAGS} --disable-optimized" |
205 |
einfo "Note: Compiling LLVM in debug mode will create huge and slow binaries" |
206 |
# ...and you probably shouldn't use tmpfs, unless it can hold 900MB |
207 |
else |
208 |
CONF_FLAGS="${CONF_FLAGS} \ |
209 |
--enable-optimized \ |
210 |
--disable-assertions \ |
211 |
--disable-expensive-checks" |
212 |
fi |
213 |
|
214 |
if use amd64; then |
215 |
CONF_FLAGS="${CONF_FLAGS} --enable-pic" |
216 |
fi |
217 |
|
218 |
# Skip llvm-gcc parts even if installed |
219 |
CONF_FLAGS="${CONF_FLAGS} --with-llvmgccdir=/dev/null" |
220 |
|
221 |
if use system-cxx-headers; then |
222 |
# Try to get current C++ headers path |
223 |
CONF_FLAGS="${CONF_FLAGS} --with-cxx-include-root=$(gcc-config -X| cut -d: -f1 | sed '/-v4$/! s,$,/include/g++-v4,')" |
224 |
CONF_FLAGS="${CONF_FLAGS} --with-cxx-include-arch=$CHOST" |
225 |
if has_multilib_profile; then |
226 |
CONF_FLAGS="${CONF_FLAGS} --with-cxx-include-32bit-dir=32" |
227 |
fi |
228 |
fi |
229 |
|
230 |
econf ${CONF_FLAGS} || die "econf failed" |
231 |
} |
232 |
|
233 |
src_compile() { |
234 |
emake VERBOSE=1 KEEP_SYMBOLS=1 REQUIRES_RTTI=1 clang-only || die "emake failed" |
235 |
} |
236 |
|
237 |
src_test() { |
238 |
cd "${S}"/test || die "cd failed" |
239 |
emake site.exp || die "updating llvm site.exp failed" |
240 |
|
241 |
cd "${S}"/tools/clang || die "cd clang failed" |
242 |
|
243 |
echo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
244 |
if ! emake -j1 VERBOSE=1 test; then |
245 |
hasq test $FEATURES && die "Make test failed. See above for details." |
246 |
hasq test $FEATURES || eerror "Make test failed. See above for details." |
247 |
fi |
248 |
} |
249 |
|
250 |
src_install() { |
251 |
cd "${S}"/tools/clang || die "cd clang failed" |
252 |
emake KEEP_SYMBOLS=1 DESTDIR="${D}" install || die "install failed" |
253 |
|
254 |
if use static-analyzer ; then |
255 |
dobin tools/scan-build/ccc-analyzer |
256 |
dosym ccc-analyzer /usr/bin/c++-analyzer |
257 |
dobin tools/scan-build/scan-build |
258 |
|
259 |
insinto /usr/share/${PN} |
260 |
doins tools/scan-build/scanview.css |
261 |
doins tools/scan-build/sorttable.js |
262 |
|
263 |
cd tools/scan-view || die "cd scan-view failed" |
264 |
dobin scan-view |
265 |
install-scan-view() { |
266 |
insinto "$(python_get_sitedir)"/clang |
267 |
doins Reporter.py Resources ScanView.py startfile.py |
268 |
touch "${D}"/"$(python_get_sitedir)"/clang/__init__.py |
269 |
} |
270 |
python_execute_function install-scan-view |
271 |
fi |
272 |
} |
273 |
|
274 |
pkg_postinst() { |
275 |
python_mod_optimize clang |
276 |
if use system-cxx-headers; then |
277 |
elog "C++ headers search path is hardcoded to the active gcc profile one" |
278 |
elog "If you change the active gcc profile, or update gcc to a new version," |
279 |
elog "you will have to remerge this package to update the search path" |
280 |
else |
281 |
elog "If clang++ fails to find C++ headers on your system," |
282 |
elog "you can remerge clang with USE=system-cxx-headers to use C++ headers" |
283 |
elog "from the active gcc profile" |
284 |
fi |
285 |
} |
286 |
|
287 |
pkg_postrm() { |
288 |
python_mod_cleanup clang |
289 |
} |