/[gentoo-x86]/sys-devel/clang/clang-2.6.ebuild
Gentoo

Contents of /sys-devel/clang/clang-2.6.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Tue Oct 27 12:12:35 2009 UTC (4 years, 5 months ago) by voyageur
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
Install missing files for static analyzer, bug #290697
(Portage version: 2.2_rc46/cvs/Linux x86_64)

1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/clang-2.6.ebuild,v 1.3 2009/10/26 20:08:58 voyageur Exp $
4
5 EAPI=2
6 inherit eutils python
7
8 DESCRIPTION="C language family frontend for LLVM"
9 HOMEPAGE="http://clang.llvm.org/"
10 # Fetching LLVM as well: see http://llvm.org/bugs/show_bug.cgi?id=4840
11 SRC_URI="http://llvm.org/releases/${PV}/llvm-${PV}.tar.gz
12 http://llvm.org/releases/${PV}/${P}.tar.gz"
13
14 LICENSE="UoI-NCSA"
15 SLOT="0"
16 KEYWORDS="~amd64 ~x86"
17 IUSE="debug +static-analyzer test"
18
19 # Note: for LTO support, clang will depend on binutils with gold plugins, and LLVM built after that - http://llvm.org/docs/GoldPlugin.html
20 DEPEND="static-analyzer? ( dev-lang/perl )
21 test? ( dev-util/dejagnu )"
22 RDEPEND="~sys-devel/llvm-${PV}"
23
24 S="${WORKDIR}/llvm-2.6"
25
26 src_prepare() {
27 mv "${WORKDIR}"/clang-2.6 "${S}"/tools/clang || die "clang source directory not found"
28
29 # Same as llvm doc patches
30 epatch "${FILESDIR}"/${PN}-2.6-fixdoc.patch
31
32 # multilib-strict
33 sed -e "s#lib/clang/1.0#$(get_libdir)/clang/1.0#" \
34 -i "${S}"/tools/clang/lib/Headers/Makefile \
35 || die "clang Makefile failed"
36 # install python files as module
37 sed -e 's/import ScanView/from clang \0/' \
38 -i "${S}"/tools/clang/tools/scan-view/scan-view \
39 || die "scan-view sed failed"
40
41 # From llvm src_prepare
42 einfo "Fixing install dirs"
43 sed -e 's,^PROJ_docsdir.*,PROJ_docsdir := $(DESTDIR)$(PROJ_prefix)/share/doc/'${PF}, \
44 -e 's,^PROJ_etcdir.*,PROJ_etcdir := $(DESTDIR)/etc/llvm,' \
45 -e 's,^PROJ_libdir.*,PROJ_libdir := $(DESTDIR)/usr/'$(get_libdir), \
46 -i Makefile.config.in || die "Makefile.config sed failed"
47
48 einfo "Fixing rpath"
49 sed -e 's/\$(RPATH) -Wl,\$(\(ToolDir\|LibDir\))//g' -i Makefile.rules \
50 || die "rpath sed failed"
51 }
52
53 src_configure() {
54 local CONF_FLAGS=""
55
56 if use debug; then
57 CONF_FLAGS="${CONF_FLAGS} --disable-optimized"
58 einfo "Note: Compiling LLVM in debug mode will create huge and slow binaries"
59 # ...and you probably shouldn't use tmpfs, unless it can hold 900MB
60 else
61 CONF_FLAGS="${CONF_FLAGS} \
62 --enable-optimized \
63 --disable-assertions \
64 --disable-expensive-checks"
65 fi
66
67 if use amd64; then
68 CONF_FLAGS="${CONF_FLAGS} --enable-pic"
69 fi
70
71 econf ${CONF_FLAGS} || die "econf failed"
72 }
73
74 src_compile() {
75 emake VERBOSE=1 KEEP_SYMBOLS=1 clang-only || die "emake failed"
76 }
77
78 src_test() {
79 cd "${S}"/tools/clang || die "cd clang failed"
80
81 # 20091026: many tests fail not finding headers?
82 vecho ">>> Test phase [test]: ${CATEGORY}/${PF}"
83 if ! emake -j1 VERBOSE=1 test; then
84 hasq test $FEATURES && die "Make test failed. See above for details."
85 hasq test $FEATURES || eerror "Make test failed. See above for details."
86 fi
87 }
88
89 src_install() {
90 cd "${S}"/tools/clang || die "cd clang failed"
91 emake KEEP_SYMBOLS=1 DESTDIR="${D}" install || die "install failed"
92
93 if use static-analyzer ; then
94 dobin utils/ccc-analyzer
95 dobin utils/scan-build
96
97 cd tools/scan-view || "die cd scan-view failed"
98 dobin scan-view
99 python_version
100 insinto /usr/$(get_libdir)/python${PYVER}/site-packages/clang
101 doins Reporter.py Resources ScanView.py startfile.py
102 touch "${D}"/usr/$(get_libdir)/python${PYVER}/site-packages/clang/__init__.py
103 fi
104 }
105
106 pkg_postinst() {
107 python_version
108 python_mod_optimize /usr/$(get_libdir)/python${PYVER}/site-packages/clang
109 }
110
111 pkg_postrm() {
112 python_mod_cleanup
113 }

  ViewVC Help
Powered by ViewVC 1.1.20