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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Tue Apr 27 12:08:55 2010 UTC (4 years, 4 months ago) by voyageur
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
2.7 official release version bump
(Portage version: 2.2_rc67/cvs/Linux x86_64)

1 # Copyright 1999-2010 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-r2.ebuild,v 1.1 2010/03/18 21:33:10 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 "/PROJ_headers/s#lib/clang/1.0#$(get_libdir)/clang/1.0#" \
34 -i tools/clang/lib/Headers/Makefile \
35 || die "clang Makefile failed"
36 # fix the static analyzer for in-tree install
37 sed -e 's/import ScanView/from clang \0/' \
38 -i tools/clang/tools/scan-view/scan-view \
39 || die "scan-view sed failed"
40 sed -e "/scanview.css\|sorttable.js/s#\$RealBin#/usr/share/${PN}#" \
41 -i tools/clang/utils/scan-build \
42 || die "scan-build sed failed"
43 # Broken test in 2.6, http://llvm.org/bugs/show_bug.cgi?id=5111
44 rm tools/clang/test/Analysis/retain-release.m
45
46 # From llvm src_prepare
47 einfo "Fixing install dirs"
48 sed -e 's,^PROJ_docsdir.*,PROJ_docsdir := $(DESTDIR)$(PROJ_prefix)/share/doc/'${PF}, \
49 -e 's,^PROJ_etcdir.*,PROJ_etcdir := $(DESTDIR)/etc/llvm,' \
50 -e 's,^PROJ_libdir.*,PROJ_libdir := $(DESTDIR)/usr/'$(get_libdir), \
51 -i Makefile.config.in || die "Makefile.config sed failed"
52
53 einfo "Fixing rpath"
54 sed -e 's/\$(RPATH) -Wl,\$(\(ToolDir\|LibDir\))//g' -i Makefile.rules \
55 || die "rpath sed failed"
56
57 # Do not force -O3 -fomit-frame-pointer on users, from llvm ebuild
58 epatch "${FILESDIR}"/llvm-2.6-cflags.patch
59 }
60
61 src_configure() {
62 local CONF_FLAGS=""
63
64 if use debug; then
65 CONF_FLAGS="${CONF_FLAGS} --disable-optimized"
66 einfo "Note: Compiling LLVM in debug mode will create huge and slow binaries"
67 # ...and you probably shouldn't use tmpfs, unless it can hold 900MB
68 else
69 CONF_FLAGS="${CONF_FLAGS} \
70 --enable-optimized \
71 --disable-assertions \
72 --disable-expensive-checks"
73 fi
74
75 if use amd64; then
76 CONF_FLAGS="${CONF_FLAGS} --enable-pic"
77 fi
78
79 # Skip llvm-gcc parts even if installed
80 CONF_FLAGS="${CONF_FLAGS} --with-llvmgccdir=/dev/null"
81
82 econf ${CONF_FLAGS} || die "econf failed"
83 }
84
85 src_compile() {
86 emake VERBOSE=1 KEEP_SYMBOLS=1 clang-only || die "emake failed"
87 }
88
89 src_test() {
90 cd "${S}"/tools/clang || die "cd clang failed"
91
92 echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
93 if ! emake -j1 VERBOSE=1 test; then
94 hasq test $FEATURES && die "Make test failed. See above for details."
95 hasq test $FEATURES || eerror "Make test failed. See above for details."
96 fi
97 }
98
99 src_install() {
100 cd "${S}"/tools/clang || die "cd clang failed"
101 emake KEEP_SYMBOLS=1 DESTDIR="${D}" install || die "install failed"
102
103 if use static-analyzer ; then
104 dobin utils/ccc-analyzer
105 dobin utils/scan-build
106
107 insinto /usr/share/${PN}
108 doins utils/scanview.css
109 doins utils/sorttable.js
110
111 cd tools/scan-view || die "cd scan-view failed"
112 dobin scan-view
113 python_version
114 insinto /usr/$(get_libdir)/python${PYVER}/site-packages/clang
115 doins Reporter.py Resources ScanView.py startfile.py
116 touch "${D}"/usr/$(get_libdir)/python${PYVER}/site-packages/clang/__init__.py
117 fi
118 }
119
120 pkg_postinst() {
121 python_version
122 python_mod_optimize /usr/$(get_libdir)/python${PYVER}/site-packages/clang
123 }
124
125 pkg_postrm() {
126 python_mod_cleanup
127 }

  ViewVC Help
Powered by ViewVC 1.1.20