summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Cafarelli <voyageur@gentoo.org>2009-10-05 13:19:28 +0000
committerBernard Cafarelli <voyageur@gentoo.org>2009-10-05 13:19:28 +0000
commit5455a4381f12b26b68d64d026814d5690c9370e7 (patch)
treee9975ec813388c1928ef6af07f4952d76a8f49b1 /sys-devel/clang
parentx86 stable, bug 282290 (diff)
downloadgentoo-2-5455a4381f12b26b68d64d026814d5690c9370e7.tar.gz
gentoo-2-5455a4381f12b26b68d64d026814d5690c9370e7.tar.bz2
gentoo-2-5455a4381f12b26b68d64d026814d5690c9370e7.zip
Initial commit, based on ebuild by Ravi Pinjala <ravi@p-static.net> in bug #269651
(Portage version: 2.2_rc43/cvs/Linux x86_64)
Diffstat (limited to 'sys-devel/clang')
-rw-r--r--sys-devel/clang/ChangeLog11
-rw-r--r--sys-devel/clang/clang-2.6_pre2.ebuild97
-rw-r--r--sys-devel/clang/metadata.xml34
3 files changed, 142 insertions, 0 deletions
diff --git a/sys-devel/clang/ChangeLog b/sys-devel/clang/ChangeLog
new file mode 100644
index 000000000000..f60b8c8e0e87
--- /dev/null
+++ b/sys-devel/clang/ChangeLog
@@ -0,0 +1,11 @@
+# ChangeLog for sys-devel/clang
+# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/ChangeLog,v 1.1 2009/10/05 13:19:28 voyageur Exp $
+
+*clang-2.6_pre2 (05 Oct 2009)
+
+ 05 Oct 2009; Bernard Cafarelli <voyageur@gentoo.org>
+ +clang-2.6_pre2.ebuild, +metadata.xml:
+ Initial commit, based on ebuild by Ravi Pinjala <ravi@p-static.net> in bug
+ #269651
+
diff --git a/sys-devel/clang/clang-2.6_pre2.ebuild b/sys-devel/clang/clang-2.6_pre2.ebuild
new file mode 100644
index 000000000000..09394b0bcab0
--- /dev/null
+++ b/sys-devel/clang/clang-2.6_pre2.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/clang-2.6_pre2.ebuild,v 1.1 2009/10/05 13:19:28 voyageur Exp $
+
+EAPI=2
+inherit eutils python
+
+DESCRIPTION="C language family frontend for LLVM"
+HOMEPAGE="http://clang.llvm.org/"
+# Fetching LLVM as well: see http://llvm.org/bugs/show_bug.cgi?id=4840
+SRC_URI="http://llvm.org/prereleases/${PV/_pre*}/pre-release${PV/*_pre}/llvm-${PV/_pre*}.tar.gz -> llvm-${PV}.tar.gz
+ http://llvm.org/prereleases/${PV/_pre*}/pre-release${PV/*_pre}/${PN}-${PV/_pre*}.tar.gz -> ${P}.tar.gz"
+
+# See http://www.opensource.org/licenses/UoI-NCSA.php
+LICENSE="UoI-NCSA"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+static-analyzer test"
+
+# Note: for LTO support, clang will depend on binutils with gold plugins, and LLVM built after that - http://llvm.org/docs/GoldPlugin.html
+DEPEND="static-analyzer? ( dev-lang/perl )
+ test? ( dev-util/dejagnu )"
+RDEPEND="~sys-devel/llvm-${PV}"
+
+S="${WORKDIR}/llvm-2.6"
+
+src_prepare() {
+ mv "${WORKDIR}"/clang-2.6 "${S}"/tools/clang || die "clang source directory not found"
+ sed -e "s#lib/clang/1.0#$(get_libdir)/clang/1.0#" \
+ -i "${S}"/tools/clang/lib/Headers/Makefile \
+ || die "clang Makefile failed"
+ sed -e 's/import ScanView/from clang \0/' \
+ -i "${S}"/tools/clang/tools/scan-view/scan-view \
+ || die "scan-view sed failed"
+
+ # From llvm src_prepare
+ einfo "Fixing install dirs"
+ sed -e 's,^PROJ_docsdir.*,PROJ_docsdir := $(DESTDIR)$(PROJ_prefix)/share/doc/'${PF}, \
+ -e 's,^PROJ_etcdir.*,PROJ_etcdir := $(DESTDIR)/etc/llvm,' \
+ -e 's,^PROJ_libdir.*,PROJ_libdir := $(DESTDIR)/usr/'$(get_libdir), \
+ -i Makefile.config.in || die "Makefile.config sed failed"
+
+ einfo "Fixing rpath"
+ sed -e 's/\$(RPATH) -Wl,\$(\(ToolDir\|LibDir\))//g' -i Makefile.rules \
+ || die "rpath sed failed"
+}
+
+src_configure() {
+ local CONF_FLAGS=""
+
+ if use debug; then
+ CONF_FLAGS="${CONF_FLAGS} --disable-optimized"
+ einfo "Note: Compiling LLVM in debug mode will create huge and slow binaries"
+ # ...and you probably shouldn't use tmpfs, unless it can hold 900MB
+ else
+ CONF_FLAGS="${CONF_FLAGS} \
+ --enable-optimized \
+ --disable-assertions \
+ --disable-expensive-checks"
+ fi
+
+ if use amd64; then
+ CONF_FLAGS="${CONF_FLAGS} --enable-pic"
+ fi
+
+ econf ${CONF_FLAGS} || die "econf failed"
+}
+
+src_compile() {
+ emake VERBOSE=1 KEEP_SYMBOLS=1 clang-only || die "emake failed"
+}
+
+src_install() {
+ cd "${S}"/tools/clang || die "cd clang failed"
+ emake KEEP_SYMBOLS=1 DESTDIR="${D}" install || die "install failed"
+
+ if use static-analyzer ; then
+ dobin utils/ccc-analyzer
+ dobin utils/scan-build
+
+ cd tools/scan-view || "die cd scan-view failed"
+ dobin scan-view
+ python_version
+ insinto /usr/$(get_libdir)/python${PYVER}/site-packages/clang
+ doins Reporter.py Resources ScanView.py startfile.py
+ touch "${D}"/usr/$(get_libdir)/python${PYVER}/site-packages/clang/__init__.py
+ fi
+}
+
+pkg_postinst() {
+ python_version
+ python_mod_optimize /usr/$(get_libdir)/python${PYVER}/site-packages/clang
+}
+
+pkg_postrm() {
+ python_mod_cleanup
+}
diff --git a/sys-devel/clang/metadata.xml b/sys-devel/clang/metadata.xml
new file mode 100644
index 000000000000..4527f3eb8502
--- /dev/null
+++ b/sys-devel/clang/metadata.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>no-herd</herd>
+ <maintainer>
+ <email>voyageur@gentoo.org</email>
+ <name>Bernard Cafarelli</name>
+ </maintainer>
+ <longdescription>The goal of the Clang project is to create a new C, C++, Objective C and Objective C++ front-end for the LLVM compiler.
+
+Features and Goals
+
+Some of the goals for the project include the following:
+
+End-User Features:
+Fast compiles and low memory use
+Expressive diagnostics
+GCC compatibility
+Utility and Applications:
+
+Modular library based architecture
+Support diverse clients (refactoring, static analysis, code generation, etc)
+Allow tight integration with IDEs
+Use the LLVM BSD License
+Internal Design and Implementation:
+
+A real-world, production quality compiler
+A simple and hackable code base
+A single unified parser for C, Objective C, C++, and Objective C++
+Conformance with C/C++/ObjC and their variants</longdescription>
+ <use>
+ <flag name='static-analyzer'>Install the Clang static analyzer</flag>
+ </use>
+</pkgmetadata>