From 03eaa0cf8c05dc6b3398c08aef0101dcebb6e72a Mon Sep 17 00:00:00 2001 From: Kacper KoƂodziej Date: Sun, 25 Sep 2016 16:05:22 +0200 Subject: app-text/bact: fix cpp14 compilation errors; bug #594312 Closes: https://github.com/gentoo/gentoo/pull/2409 Signed-off-by: David Seifert --- app-text/bact/bact-0.13.ebuild | 6 ++++- app-text/bact/files/bact-0.13-cpp14.patch | 44 +++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 app-text/bact/files/bact-0.13-cpp14.patch (limited to 'app-text') diff --git a/app-text/bact/bact-0.13.ebuild b/app-text/bact/bact-0.13.ebuild index 98d29fb5500b..00cd99778b7c 100644 --- a/app-text/bact/bact-0.13.ebuild +++ b/app-text/bact/bact-0.13.ebuild @@ -4,7 +4,7 @@ EAPI=4 -inherit toolchain-funcs +inherit eutils toolchain-funcs DESCRIPTION="Boosting Algorithm for Classification of Trees" HOMEPAGE="http://chasen.org/~taku/software/bact/" @@ -18,6 +18,10 @@ IUSE="" DEPEND="" RDEPEND="${DEPEND}" +src_prepare() { + epatch "${FILESDIR}/${P}-cpp14.patch" # bug #594312 +} + src_compile() { emake CXX="$(tc-getCXX)" CXXFLAGS="${CXXFLAGS}" LDFLAGS="${LDFLAGS}" } diff --git a/app-text/bact/files/bact-0.13-cpp14.patch b/app-text/bact/files/bact-0.13-cpp14.patch new file mode 100644 index 000000000000..fa083c223b12 --- /dev/null +++ b/app-text/bact/files/bact-0.13-cpp14.patch @@ -0,0 +1,44 @@ +Fix C++14 compilation errors -- since C++11 make_pair is resolved to +make_pair(T1&&, T2&&). Types should be deduced. +Gentoo bug: https://bugs.gentoo.org/show_bug.cgi?id=594312 + +--- a/bact_classify.cpp ++++ b/bact_classify.cpp +@@ -86,7 +86,7 @@ + if (id == -2) continue; + if (id != -1) { + if (userule) +- rules.insert (std::make_pair (item, alpha[id])); ++ rules.insert (std::make_pair(item, alpha[id])); + result.push_back (id); + } + project (item, size+1, newdepth, l, new_trie_pos, new_str_pos); +@@ -138,7 +138,7 @@ + if (id == -2) continue; + if (id >= 0) { + if (userule) +- rules.insert (std::make_pair (tree[i].val.key(), alpha[id])); ++ rules.insert (std::make_pair(tree[i].val.key(), alpha[id])); + result.push_back (id); + } + project (tree[i].val.key(), 1, 0, i, 0, 0); +@@ -158,7 +158,7 @@ + + for (std::map ::iterator it = rules.begin(); + it != rules.end(); ++it) +- tmp.push_back (std::make_pair (it->first, it->second)); ++ tmp.push_back (std::make_pair(it->first, it->second)); + + std::sort (tmp.begin(), tmp.end(), pair_2nd_cmp()); + +--- a/bact_mkmodel.cpp ++++ b/bact_mkmodel.cpp +@@ -111,7 +111,7 @@ + + for (std::map::iterator it = rules.begin(); it != rules.end(); ++it) { + double a = it->second / alpha_sum; +- ary2.push_back (std::make_pair (it->first.c_str(), a)); ++ ary2.push_back (std::make_pair(it->first.c_str(), a)); + ary.push_back ((Darts::DoubleArray::key_type *)it->first.c_str()); + alpha.push_back (a); + } -- cgit v1.2.3-65-gdbad