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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sun Oct 25 20:21:33 2009 UTC (5 years, 10 months ago) by voyageur
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Bump to final 2.6 release
(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_pre2.ebuild,v 1.1 2009/10/05 13:19:28 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/prereleases/${PV/_pre*}/pre-release${PV/*_pre}/llvm-${PV/_pre*}.tar.gz -> llvm-${PV}.tar.gz
12 http://llvm.org/prereleases/${PV/_pre*}/pre-release${PV/*_pre}/${PN}-${PV/_pre*}.tar.gz -> ${P}.tar.gz"
13
14 # See http://www.opensource.org/licenses/UoI-NCSA.php
15 LICENSE="UoI-NCSA"
16 SLOT="0"
17 KEYWORDS="~amd64 ~x86"
18 IUSE="+static-analyzer test"
19
20 # Note: for LTO support, clang will depend on binutils with gold plugins, and LLVM built after that - http://llvm.org/docs/GoldPlugin.html
21 DEPEND="static-analyzer? ( dev-lang/perl )
22 test? ( dev-util/dejagnu )"
23 RDEPEND="~sys-devel/llvm-${PV}"
24
25 S="${WORKDIR}/llvm-2.6"
26
27 src_prepare() {
28 mv "${WORKDIR}"/clang-2.6 "${S}"/tools/clang || die "clang source directory not found"
29 sed -e "s#lib/clang/1.0#$(get_libdir)/clang/1.0#" \
30 -i "${S}"/tools/clang/lib/Headers/Makefile \
31 || die "clang Makefile failed"
32 sed -e 's/import ScanView/from clang \0/' \
33 -i "${S}"/tools/clang/tools/scan-view/scan-view \
34 || die "scan-view sed failed"
35
36 # From llvm src_prepare
37 einfo "Fixing install dirs"
38 sed -e 's,^PROJ_docsdir.*,PROJ_docsdir := $(DESTDIR)$(PROJ_prefix)/share/doc/'${PF}, \
39 -e 's,^PROJ_etcdir.*,PROJ_etcdir := $(DESTDIR)/etc/llvm,' \
40 -e 's,^PROJ_libdir.*,PROJ_libdir := $(DESTDIR)/usr/'$(get_libdir), \
41 -i Makefile.config.in || die "Makefile.config sed failed"
42
43 einfo "Fixing rpath"
44 sed -e 's/\$(RPATH) -Wl,\$(\(ToolDir\|LibDir\))//g' -i Makefile.rules \
45 || die "rpath sed failed"
46 }
47
48 src_configure() {
49 local CONF_FLAGS=""
50
51 if use debug; then
52 CONF_FLAGS="${CONF_FLAGS} --disable-optimized"
53 einfo "Note: Compiling LLVM in debug mode will create huge and slow binaries"
54 # ...and you probably shouldn't use tmpfs, unless it can hold 900MB
55 else
56 CONF_FLAGS="${CONF_FLAGS} \
57 --enable-optimized \
58 --disable-assertions \
59 --disable-expensive-checks"
60 fi
61
62 if use amd64; then
63 CONF_FLAGS="${CONF_FLAGS} --enable-pic"
64 fi
65
66 econf ${CONF_FLAGS} || die "econf failed"
67 }
68
69 src_compile() {
70 emake VERBOSE=1 KEEP_SYMBOLS=1 clang-only || die "emake failed"
71 }
72
73 src_install() {
74 cd "${S}"/tools/clang || die "cd clang failed"
75 emake KEEP_SYMBOLS=1 DESTDIR="${D}" install || die "install failed"
76
77 if use static-analyzer ; then
78 dobin utils/ccc-analyzer
79 dobin utils/scan-build
80
81 cd tools/scan-view || "die cd scan-view failed"
82 dobin scan-view
83 python_version
84 insinto /usr/$(get_libdir)/python${PYVER}/site-packages/clang
85 doins Reporter.py Resources ScanView.py startfile.py
86 touch "${D}"/usr/$(get_libdir)/python${PYVER}/site-packages/clang/__init__.py
87 fi
88 }
89
90 pkg_postinst() {
91 python_version
92 python_mod_optimize /usr/$(get_libdir)/python${PYVER}/site-packages/clang
93 }
94
95 pkg_postrm() {
96 python_mod_cleanup
97 }

  ViewVC Help
Powered by ViewVC 1.1.20