Gentoo Archives: gentoo-commits

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