summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Cafarelli <voyageur@gentoo.org>2010-10-12 09:24:54 +0000
committerBernard Cafarelli <voyageur@gentoo.org>2010-10-12 09:24:54 +0000
commitaf93ae78c9ed7bcd31af05e843ddc2c4e82f7834 (patch)
tree92550d83609a2fb4898c38a034f234975fb166e4 /sys-devel
parentx86 stable wrt bug #340587 (diff)
downloadhistorical-af93ae78c9ed7bcd31af05e843ddc2c4e82f7834.tar.gz
historical-af93ae78c9ed7bcd31af05e843ddc2c4e82f7834.tar.bz2
historical-af93ae78c9ed7bcd31af05e843ddc2c4e82f7834.zip
Re-enable shared lib, it works now with alltargets USE flag (in sync with llvm one)
Package-Manager: portage-2.2_rc92/cvs/Linux x86_64
Diffstat (limited to 'sys-devel')
-rw-r--r--sys-devel/clang/ChangeLog9
-rw-r--r--sys-devel/clang/Manifest5
-rw-r--r--sys-devel/clang/clang-2.8-r1.ebuild172
-rw-r--r--sys-devel/clang/metadata.xml1
4 files changed, 184 insertions, 3 deletions
diff --git a/sys-devel/clang/ChangeLog b/sys-devel/clang/ChangeLog
index 75aa2f6ef42e..b4c569357e60 100644
--- a/sys-devel/clang/ChangeLog
+++ b/sys-devel/clang/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sys-devel/clang
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/ChangeLog,v 1.27 2010/10/08 13:56:52 voyageur Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/ChangeLog,v 1.28 2010/10/12 09:24:54 voyageur Exp $
+
+*clang-2.8-r1 (12 Oct 2010)
+
+ 12 Oct 2010; Bernard Cafarelli <voyageur@gentoo.org> +clang-2.8-r1.ebuild,
+ metadata.xml:
+ Re-enable shared lib, it works now with alltargets USE flag (in sync with
+ llvm one)
08 Oct 2010; Bernard Cafarelli <voyageur@gentoo.org> clang-2.8.ebuild:
Use new llvm 2.8 tarball, just in case
diff --git a/sys-devel/clang/Manifest b/sys-devel/clang/Manifest
index 902a90c33b8f..730d324fab65 100644
--- a/sys-devel/clang/Manifest
+++ b/sys-devel/clang/Manifest
@@ -6,7 +6,8 @@ DIST llvm-2.7.tgz 8374297 RMD160 0fa2f362dd6a45efec35ce8fa0f8d36d98f32c8f SHA1 0
DIST llvm-2.8-r1.tgz 9112527 RMD160 3f5a71d07e105a7cf46eafc7a9006a927035012c SHA1 6d49fe039d28e8664de25491c775cb2c599e30c1 SHA256 25addb742f1c6cc12877ed0ee924dda962d848368ee095be8e48342ae613d43b
EBUILD clang-2.7-r2.ebuild 5583 RMD160 2cfcd080c54db32aff6490e4319e5f98a3554eff SHA1 cb7b437e296dddb12580d7acb05fea88e819accb SHA256 f315ed11c7a0b3a3e3f5b8f057bbc68c67dc539fa1651fc01631247ecee2810e
EBUILD clang-2.7-r4.ebuild 5698 RMD160 3696f22da1c248567a23f7d93c074f20e4b18647 SHA1 3d68f473c04054bbed11c4397925f1bbc5fcf0e5 SHA256 ccbb47c31340d22ed2f3e78f162d6e68975107609b2dcee3bf4e61c8f29b5c3b
+EBUILD clang-2.8-r1.ebuild 5557 RMD160 8bfc20e270118f636cc653c6077f57744910a45f SHA1 820b2e58a0858462127481674d434306ce0b9d54 SHA256 21c9c19e4f61c1541112dee465e236390437230d88ef8433e5a8b1d5d30f9871
EBUILD clang-2.8.ebuild 5423 RMD160 bfe687328240b9c0fde725ef476fba0f88382181 SHA1 320780b1416e324f41c2c2a90412c97a2ac6e307 SHA256 dccff5b36f9a87cdf70ec999110ed9b43bdb9a1db0e22012bc21e5006feffca9
EBUILD clang-9999.ebuild 5344 RMD160 be0a3f8dc4ffb0d8e4a9ac5da2fb54283cadf95f SHA1 c551213b089348cae03a40ec341a99551be46e05 SHA256 3542307d01c6acc54baccd228ce159b36deea9670577ed22a5608ad4f52d28ff
-MISC ChangeLog 4787 RMD160 a3979b497356d4aef675c6a5fb1295d806118774 SHA1 b39fdb9747d751d0796c430f834863e010dc97f8 SHA256 393fe49f19882bbc9e755b4fcdd4c6adfc16855e8767480f369c4d4d942c32ab
-MISC metadata.xml 1283 RMD160 f9c1bc71ac9c387f558cb4c08c7e16c73cd9e63e SHA1 0bff06a0d4a5e3435cd95864a70e931adc2b50b7 SHA256 c5e5ad2fb8f07fdb458e423f8546cf4002fbd11241c50f7efa8b4975836c50a4
+MISC ChangeLog 4998 RMD160 6e76928648e8d4f04c0c52e449fd57e1a0284f64 SHA1 6cff8d40df2bed82e2fe7ad7daad02ac63942346 SHA256 6d5c76fec5d9a0537b97fcb7367425ff41bfa250e72d2b6d9208196d55f725ca
+MISC metadata.xml 1360 RMD160 73b894c5108dd5d2d3b49f82353920da7f2adc4c SHA1 6808434002d0109de4ef8f52ad4a9cc4f4a2fbfc SHA256 14c80bf0afbebde4ec5bc2332865762d3dcd98db842cf52fc78617b4889dae38
diff --git a/sys-devel/clang/clang-2.8-r1.ebuild b/sys-devel/clang/clang-2.8-r1.ebuild
new file mode 100644
index 000000000000..4515ae9359ac
--- /dev/null
+++ b/sys-devel/clang/clang-2.8-r1.ebuild
@@ -0,0 +1,172 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/clang-2.8-r1.ebuild,v 1.1 2010/10/12 09:24:54 voyageur Exp $
+
+EAPI=3
+
+RESTRICT_PYTHON_ABIS="3.*"
+SUPPORT_PYTHON_ABIS="1"
+
+inherit eutils multilib 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
+# Drop the -> on 2.9
+SRC_URI="http://llvm.org/releases/${PV}/llvm-${PV}.tgz -> llvm-${PV}-r1.tgz
+ http://llvm.org/releases/${PV}/${P}.tgz"
+
+LICENSE="UoI-NCSA"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~ppc-macos"
+IUSE="alltargets debug +static-analyzer system-cxx-headers 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 )"
+RDEPEND="~sys-devel/llvm-${PV}[alltargets=]"
+
+S="${WORKDIR}/llvm-${PV}"
+
+src_prepare() {
+ mv "${WORKDIR}"/clang-${PV} "${S}"/tools/clang || die "clang source directory not found"
+
+ # Same as llvm doc patches
+ epatch "${FILESDIR}"/${PN}-2.7-fixdoc.patch
+
+ # multilib-strict
+ sed -e "/PROJ_headers/s#lib/clang#$(get_libdir)/clang#" \
+ -i tools/clang/lib/Headers/Makefile \
+ || die "clang Makefile failed"
+ # fix the static analyzer for in-tree install
+ sed -e 's/import ScanView/from clang \0/' \
+ -i tools/clang/tools/scan-view/scan-view \
+ || die "scan-view sed failed"
+ sed -e "/scanview.css\|sorttable.js/s#\$RealBin#/usr/share/${PN}#" \
+ -i tools/clang/tools/scan-build/scan-build \
+ || die "scan-build sed failed"
+ # Specify python version
+ python_convert_shebangs 2 tools/clang/tools/scan-view/scan-view
+
+ # From llvm src_prepare
+ einfo "Fixing install dirs"
+ sed -e 's,^PROJ_docsdir.*,PROJ_docsdir := $(PROJ_prefix)/share/doc/'${PF}, \
+ -e 's,^PROJ_etcdir.*,PROJ_etcdir := '"${EPREFIX}"'/etc/llvm,' \
+ -e 's,^PROJ_libdir.*,PROJ_libdir := $(PROJ_prefix)/'$(get_libdir)/llvm, \
+ -i Makefile.config.in || die "Makefile.config sed failed"
+
+ einfo "Fixing rpath"
+ sed -e 's,\$(RPATH) -Wl\,\$(\(ToolDir\|LibDir\)),$(RPATH) -Wl\,'"${EPREFIX}"/usr/$(get_libdir)/llvm, \
+ -i Makefile.rules || die "rpath sed failed"
+}
+
+src_configure() {
+ local CONF_FLAGS="--enable-shared"
+
+ 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
+
+ # Setup the search path to include the Prefix includes
+ if use prefix ; then
+ CONF_FLAGS="${CONF_FLAGS} \
+ --with-c-include-dirs=${EPREFIX}/usr/include:/usr/include"
+ fi
+
+ if use alltargets; then
+ CONF_FLAGS="${CONF_FLAGS} --enable-targets=all"
+ else
+ CONF_FLAGS="${CONF_FLAGS} --enable-targets=host-only"
+ fi
+
+ if use amd64; then
+ CONF_FLAGS="${CONF_FLAGS} --enable-pic"
+ fi
+
+ # Skip llvm-gcc parts even if installed
+ CONF_FLAGS="${CONF_FLAGS} --with-llvmgccdir=/dev/null"
+
+ if use system-cxx-headers; then
+ # Try to get current C++ headers path
+ CONF_FLAGS="${CONF_FLAGS} --with-cxx-include-root=$(gcc-config -X| cut -d: -f1 | sed '/-v4$/! s,$,/include/g++-v4,')"
+ CONF_FLAGS="${CONF_FLAGS} --with-cxx-include-arch=$CHOST"
+ if has_multilib_profile; then
+ CONF_FLAGS="${CONF_FLAGS} --with-cxx-include-32bit-dir=32"
+ fi
+ fi
+
+ econf ${CONF_FLAGS} || die "econf failed"
+}
+
+src_compile() {
+ emake VERBOSE=1 KEEP_SYMBOLS=1 REQUIRES_RTTI=1 clang-only || die "emake failed"
+}
+
+src_test() {
+ cd "${S}"/test || die "cd failed"
+ emake site.exp || die "updating llvm site.exp failed"
+
+ cd "${S}"/tools/clang || die "cd clang failed"
+
+ echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
+ if ! emake -j1 VERBOSE=1 test; then
+ hasq test $FEATURES && die "Make test failed. See above for details."
+ hasq test $FEATURES || eerror "Make test failed. See above for details."
+ fi
+}
+
+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 tools/scan-build/ccc-analyzer
+ dosym ccc-analyzer /usr/bin/c++-analyzer
+ dobin tools/scan-build/scan-build
+
+ insinto /usr/share/${PN}
+ doins tools/scan-build/scanview.css
+ doins tools/scan-build/sorttable.js
+
+ cd tools/scan-view || die "cd scan-view failed"
+ dobin scan-view
+ install-scan-view() {
+ insinto "$(python_get_sitedir)"/clang
+ doins Reporter.py Resources ScanView.py startfile.py
+ touch "${ED}"/"$(python_get_sitedir)"/clang/__init__.py
+ }
+ python_execute_function install-scan-view
+ fi
+
+ # Fix install_names on Darwin. The build system is too complicated
+ # to just fix this, so we correct it post-install
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ for lib in libCIndex.dylib ; do
+ install_name_tool -id "${EPREFIX}"/usr/lib/llvm/${lib} \
+ "${ED}"/usr/lib/llvm/${lib}
+ done
+ fi
+}
+
+pkg_postinst() {
+ python_mod_optimize clang
+ if use system-cxx-headers; then
+ elog "C++ headers search path is hardcoded to the active gcc profile one"
+ elog "If you change the active gcc profile, or update gcc to a new version,"
+ elog "you will have to remerge this package to update the search path"
+ else
+ elog "If clang++ fails to find C++ headers on your system,"
+ elog "you can remerge clang with USE=system-cxx-headers to use C++ headers"
+ elog "from the active gcc profile"
+ fi
+}
+
+pkg_postrm() {
+ python_mod_cleanup clang
+}
diff --git a/sys-devel/clang/metadata.xml b/sys-devel/clang/metadata.xml
index d6429cc3d137..2aa6b42d7e63 100644
--- a/sys-devel/clang/metadata.xml
+++ b/sys-devel/clang/metadata.xml
@@ -29,6 +29,7 @@ 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='alltargets'>Build all host targets (default: host only)</flag>
<flag name='static-analyzer'>Install the Clang static analyzer</flag>
<flag name='system-cxx-headers'>By default, clang++ searchs for C++ headers in a series of hardcoded paths. Enabling this flag will force it to use the active gcc profile ones</flag>
</use>