Gentoo Archives: gentoo-commits

From: "Richard Yao (ryao)" <ryao@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-devel/clang: clang-3.1-r4.ebuild ChangeLog clang-3.1-r3.ebuild
Date: Thu, 07 Jun 2012 00:28:13
Message-Id: 20120607002756.023542004B@flycatcher.gentoo.org
1 ryao 12/06/07 00:27:55
2
3 Modified: ChangeLog
4 Added: clang-3.1-r4.ebuild
5 Removed: clang-3.1-r3.ebuild
6 Log:
7 Fix bug #417913
8
9 (Portage version: 2.1.10.49/cvs/Linux x86_64)
10
11 Revision Changes Path
12 1.70 sys-devel/clang/ChangeLog
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/clang/ChangeLog?rev=1.70&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/clang/ChangeLog?rev=1.70&content-type=text/plain
16 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/clang/ChangeLog?r1=1.69&r2=1.70
17
18 Index: ChangeLog
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/sys-devel/clang/ChangeLog,v
21 retrieving revision 1.69
22 retrieving revision 1.70
23 diff -u -r1.69 -r1.70
24 --- ChangeLog 5 Jun 2012 02:03:46 -0000 1.69
25 +++ ChangeLog 7 Jun 2012 00:27:55 -0000 1.70
26 @@ -1,6 +1,14 @@
27 # ChangeLog for sys-devel/clang
28 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
29 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/ChangeLog,v 1.69 2012/06/05 02:03:46 ryao Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/ChangeLog,v 1.70 2012/06/07 00:27:55 ryao Exp $
31 +
32 +*clang-3.1-r4 (07 Jun 2012)
33 +
34 + 07 Jun 2012; Richard Yao <ryao@g.o> +clang-3.1-r4.ebuild,
35 + +files/clang-3.1-gentoo-freebsd-fix-cxx-paths-v2.patch,
36 + +files/clang-3.1-gentoo-runtime-gcc-detection-v3.patch, -clang-3.1-r3.ebuild,
37 + -files/clang-3.1-gentoo-runtime-gcc-detection-v2.patch:
38 + Fix bug #417913
39
40 *clang-3.1-r3 (05 Jun 2012)
41
42
43
44
45 1.1 sys-devel/clang/clang-3.1-r4.ebuild
46
47 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/clang/clang-3.1-r4.ebuild?rev=1.1&view=markup
48 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/clang/clang-3.1-r4.ebuild?rev=1.1&content-type=text/plain
49
50 Index: clang-3.1-r4.ebuild
51 ===================================================================
52 # Copyright 1999-2012 Gentoo Foundation
53 # Distributed under the terms of the GNU General Public License v2
54 # $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/clang-3.1-r4.ebuild,v 1.1 2012/06/07 00:27:55 ryao Exp $
55
56 EAPI=4
57
58 RESTRICT_PYTHON_ABIS="3.*"
59 SUPPORT_PYTHON_ABIS="1"
60
61 inherit eutils multilib python
62
63 DESCRIPTION="C language family frontend for LLVM"
64 HOMEPAGE="http://clang.llvm.org/"
65 # Fetching LLVM as well: see http://llvm.org/bugs/show_bug.cgi?id=4840
66 SRC_URI="http://llvm.org/releases/${PV}/llvm-${PV}.src.tar.gz
67 http://llvm.org/releases/${PV}/compiler-rt-${PV}.src.tar.gz
68 http://llvm.org/releases/${PV}/${P}.src.tar.gz"
69
70 LICENSE="UoI-NCSA"
71 SLOT="0"
72 KEYWORDS="~amd64 ~arm ~x86 ~amd64-fbsd ~amd64-linux ~x86-linux ~ppc-macos"
73 IUSE="debug kernel_FreeBSD multitarget +static-analyzer test"
74
75 DEPEND="static-analyzer? ( dev-lang/perl )"
76 RDEPEND="~sys-devel/llvm-${PV}[multitarget=]"
77
78 S=${WORKDIR}/llvm-${PV}.src
79
80 src_prepare() {
81 mv "${WORKDIR}"/clang-${PV}.src "${S}"/tools/clang \
82 || die "clang source directory move failed"
83 mv "${WORKDIR}"/compiler-rt-${PV}.src "${S}"/projects/compiler-rt \
84 || die "compiler-rt source directory move failed"
85
86 # Same as llvm doc patches
87 epatch "${FILESDIR}"/${PN}-2.7-fixdoc.patch
88
89 # multilib-strict
90 sed -e "/PROJ_headers/s#lib/clang#$(get_libdir)/clang#" \
91 -i tools/clang/lib/Headers/Makefile \
92 || die "clang Makefile failed"
93 sed -e "/PROJ_resources/s#lib/clang#$(get_libdir)/clang#" \
94 -i tools/clang/runtime/compiler-rt/Makefile \
95 || die "compiler-rt Makefile failed"
96 # fix the static analyzer for in-tree install
97 sed -e 's/import ScanView/from clang \0/' \
98 -i tools/clang/tools/scan-view/scan-view \
99 || die "scan-view sed failed"
100 sed -e "/scanview.css\|sorttable.js/s#\$RealBin#${EPREFIX}/usr/share/${PN}#" \
101 -i tools/clang/tools/scan-build/scan-build \
102 || die "scan-build sed failed"
103 # Set correct path for gold plugin
104 sed -e "/LLVMgold.so/s#lib/#$(get_libdir)/llvm/#" \
105 -i tools/clang/lib/Driver/Tools.cpp \
106 || die "gold plugin path sed failed"
107 # Specify python version
108 python_convert_shebangs 2 tools/clang/tools/scan-view/scan-view
109 python_convert_shebangs -r 2 test/Scripts
110 python_convert_shebangs 2 projects/compiler-rt/lib/asan/scripts/asan_symbolize.py
111
112 # From llvm src_prepare
113 einfo "Fixing install dirs"
114 sed -e 's,^PROJ_docsdir.*,PROJ_docsdir := $(PROJ_prefix)/share/doc/'${PF}, \
115 -e 's,^PROJ_etcdir.*,PROJ_etcdir := '"${EPREFIX}"'/etc/llvm,' \
116 -e 's,^PROJ_libdir.*,PROJ_libdir := $(PROJ_prefix)/'$(get_libdir)/llvm, \
117 -i Makefile.config.in || die "Makefile.config sed failed"
118
119 einfo "Fixing rpath and CFLAGS"
120 sed -e 's,\$(RPATH) -Wl\,\$(\(ToolDir\|LibDir\)),$(RPATH) -Wl\,'"${EPREFIX}"/usr/$(get_libdir)/llvm, \
121 -e '/OmitFramePointer/s/-fomit-frame-pointer//' \
122 -i Makefile.rules || die "rpath sed failed"
123
124 # Use system llc (from llvm ebuild) for tests
125 sed -e "/^llc_props =/s/os.path.join(llvm_tools_dir, 'llc')/'llc'/" \
126 -i tools/clang/test/lit.cfg || die "test path sed failed"
127
128 # Automatically select active system GCC's libraries, bugs #406163 and #417913
129 epatch "${FILESDIR}"/${P}-gentoo-runtime-gcc-detection-v3.patch
130
131 # Fix search paths on FreeBSD, bug #409269
132 epatch "${FILESDIR}"/${P}-gentoo-freebsd-fix-lib-path.patch
133
134 # Fix regression caused by removal of USE=system-cxx-headers, bug #417541
135 epatch "${FILESDIR}"/${P}-gentoo-freebsd-fix-cxx-paths-v2.patch
136
137 # Increase recursion limit, bug #417545, upstream r155737
138 epatch "${FILESDIR}"/${P}-increase-parser-recursion-limit.patch
139
140 # User patches
141 epatch_user
142 }
143
144 src_configure() {
145 local CONF_FLAGS="--enable-shared
146 --with-optimize-option=
147 $(use_enable !debug optimized)
148 $(use_enable debug assertions)
149 $(use_enable debug expensive-checks)"
150
151 # Setup the search path to include the Prefix includes
152 if use prefix ; then
153 CONF_FLAGS="${CONF_FLAGS} \
154 --with-c-include-dirs=${EPREFIX}/usr/include:/usr/include"
155 fi
156
157 if use multitarget; then
158 CONF_FLAGS="${CONF_FLAGS} --enable-targets=all"
159 else
160 CONF_FLAGS="${CONF_FLAGS} --enable-targets=host-only"
161 fi
162
163 if use amd64; then
164 CONF_FLAGS="${CONF_FLAGS} --enable-pic"
165 fi
166
167 econf ${CONF_FLAGS}
168 }
169
170 src_compile() {
171 emake VERBOSE=1 KEEP_SYMBOLS=1 REQUIRES_RTTI=1 clang-only
172 }
173
174 src_test() {
175 cd "${S}"/test || die "cd failed"
176 emake site.exp
177
178 cd "${S}"/tools/clang || die "cd clang failed"
179
180 echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
181
182 testing() {
183 if ! emake -j1 VERBOSE=1 test; then
184 has test $FEATURES && die "Make test failed. See above for details."
185 has test $FEATURES || eerror "Make test failed. See above for details."
186 fi
187 }
188 python_execute_function testing
189 }
190
191 src_install() {
192 cd "${S}"/tools/clang || die "cd clang failed"
193 emake KEEP_SYMBOLS=1 DESTDIR="${D}" install
194
195 if use static-analyzer ; then
196 dobin tools/scan-build/ccc-analyzer
197 dosym ccc-analyzer /usr/bin/c++-analyzer
198 dobin tools/scan-build/scan-build
199
200 insinto /usr/share/${PN}
201 doins tools/scan-build/scanview.css
202 doins tools/scan-build/sorttable.js
203
204 cd tools/scan-view || die "cd scan-view failed"
205 dobin scan-view
206 install-scan-view() {
207 insinto "$(python_get_sitedir)"/clang
208 doins Reporter.py Resources ScanView.py startfile.py
209 touch "${ED}"/"$(python_get_sitedir)"/clang/__init__.py
210 }
211 python_execute_function install-scan-view
212 fi
213
214 # Fix install_names on Darwin. The build system is too complicated
215 # to just fix this, so we correct it post-install
216 if [[ ${CHOST} == *-darwin* ]] ; then
217 for lib in libclang.dylib ; do
218 ebegin "fixing install_name of $lib"
219 install_name_tool -id "${EPREFIX}"/usr/lib/llvm/${lib} \
220 "${ED}"/usr/lib/llvm/${lib}
221 eend $?
222 done
223 for f in usr/bin/{c-index-test,clang} usr/lib/llvm/libclang.dylib ; do
224 ebegin "fixing references in ${f##*/}"
225 install_name_tool \
226 -change "@rpath/libclang.dylib" \
227 "${EPREFIX}"/usr/lib/llvm/libclang.dylib \
228 -change "@executable_path/../lib/libLLVM-${PV}.dylib" \
229 "${EPREFIX}"/usr/lib/llvm/libLLVM-${PV}.dylib \
230 -change "${S}"/Release/lib/libclang.dylib \
231 "${EPREFIX}"/usr/lib/llvm/libclang.dylib \
232 "${ED}"/$f
233 eend $?
234 done
235 fi
236
237 # Remove unnecessary headers on FreeBSD, bug #417171
238 use kernel_FreeBSD && rm "${ED}"usr/$(get_libdir)/clang/${PV}/include/{arm_neon,std,float,iso,limits,tgmath,varargs}*.h
239 }
240
241 pkg_postinst() {
242 python_mod_optimize clang
243 }
244
245 pkg_postrm() {
246 python_mod_cleanup clang
247 }