From fe6ddfb957db61211a3cc74af7b87d133e037c60 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 23 May 2012 12:06:40 -0400 Subject: [PATCH] ctemplate: sync with upstream Gentoo This includes a fix for building with gcc-4.7. BUG=None TEST=`emerge ctemplate` works TEST=`emerge-amd64-generic ctemplate` works TEST=`emerge-arm-generic ctemplate` works TEST=`emerge-x86-generic ctemplate` works Change-Id: I8752fc23fc1e636c59fc11eee2ee75a5f826ab7b Reviewed-on: https://gerrit.chromium.org/gerrit/23543 Reviewed-by: Han Shen Reviewed-by: Yunlian Jiang Reviewed-by: Han Shen Tested-by: Mike Frysinger Commit-Ready: Mike Frysinger Reviewed-by: asharif --- .../dev-cpp/ctemplate/ctemplate-1.0.ebuild | 12 +++++--- .../files/ctemplate-1.0-gcc-4.7.patch | 29 +++++++++++++++++++ 2 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 sdk_container/src/third_party/portage-stable/dev-cpp/ctemplate/files/ctemplate-1.0-gcc-4.7.patch diff --git a/sdk_container/src/third_party/portage-stable/dev-cpp/ctemplate/ctemplate-1.0.ebuild b/sdk_container/src/third_party/portage-stable/dev-cpp/ctemplate/ctemplate-1.0.ebuild index fca558dfff..f6c2b810e1 100644 --- a/sdk_container/src/third_party/portage-stable/dev-cpp/ctemplate/ctemplate-1.0.ebuild +++ b/sdk_container/src/third_party/portage-stable/dev-cpp/ctemplate/ctemplate-1.0.ebuild @@ -1,10 +1,10 @@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-cpp/ctemplate/ctemplate-1.0.ebuild,v 1.5 2012/02/11 05:11:44 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-cpp/ctemplate/ctemplate-1.0.ebuild,v 1.7 2012/05/24 19:27:18 vapier Exp $ EAPI="4" -inherit elisp-common python +inherit elisp-common python eutils DESCRIPTION="A simple but powerful template language for C++" HOMEPAGE="http://code.google.com/p/google-ctemplate/" @@ -28,6 +28,10 @@ pkg_setup() { fi } +src_prepare() { + epatch "${FILESDIR}"/${P}-gcc-4.7.patch +} + src_configure() { econf \ --enable-shared \ @@ -43,7 +47,7 @@ src_compile() { } src_install() { - emake DESTDIR="${D}" install + default # Installs just every piece rm -rf "${ED}/usr/share/doc" @@ -64,7 +68,7 @@ src_install() { elisp-site-file-install "${FILESDIR}/${SITEFILE}" fi - find "${ED}" -name '*.la' -exec rm -f {} + + find "${ED}"/usr -name '*.la' -delete } pkg_postinst() { diff --git a/sdk_container/src/third_party/portage-stable/dev-cpp/ctemplate/files/ctemplate-1.0-gcc-4.7.patch b/sdk_container/src/third_party/portage-stable/dev-cpp/ctemplate/files/ctemplate-1.0-gcc-4.7.patch new file mode 100644 index 0000000000..a8eaaa6fa1 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-cpp/ctemplate/files/ctemplate-1.0-gcc-4.7.patch @@ -0,0 +1,29 @@ +backported fix from ctemplate-2.2 for building with gcc-4.7+ + +--- ctemplate-1.0/src/base/small_map.h ++++ ctemplate-1.0/src/base/small_map.h +@@ -360,20 +360,20 @@ class small_map { + if (size_ >= 0) { + for (int i = 0; i < size_; i++) { + if (compare(array_[i]->first, x.first)) { +- return make_pair(iterator(array_ + i), false); ++ return std::make_pair(iterator(array_ + i), false); + } + } + if (size_ == kArraySize) { + ConvertToRealMap(); // Invalidates all iterators! + std::pair ret = map_->insert(x); +- return make_pair(iterator(ret.first), ret.second); ++ return std::make_pair(iterator(ret.first), ret.second); + } else { + array_[size_].Init(x); +- return make_pair(iterator(array_ + size_++), true); ++ return std::make_pair(iterator(array_ + size_++), true); + } + } else { + std::pair ret = map_->insert(x); +- return make_pair(iterator(ret.first), ret.second); ++ return std::make_pair(iterator(ret.first), ret.second); + } + } +