Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-text/bact/, app-text/bact/files/
Date: Wed, 28 Sep 2016 21:02:32
Message-Id: 1475096526.03eaa0cf8c05dc6b3398c08aef0101dcebb6e72a.soap@gentoo
1 commit: 03eaa0cf8c05dc6b3398c08aef0101dcebb6e72a
2 Author: Kacper KoƂodziej <kacper <AT> kolodziej <DOT> in>
3 AuthorDate: Sun Sep 25 14:05:22 2016 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Wed Sep 28 21:02:06 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=03eaa0cf
7
8 app-text/bact: fix cpp14 compilation errors; bug #594312
9
10 Closes: https://github.com/gentoo/gentoo/pull/2409
11
12 Signed-off-by: David Seifert <soap <AT> gentoo.org>
13
14 app-text/bact/bact-0.13.ebuild | 6 ++++-
15 app-text/bact/files/bact-0.13-cpp14.patch | 44 +++++++++++++++++++++++++++++++
16 2 files changed, 49 insertions(+), 1 deletion(-)
17
18 diff --git a/app-text/bact/bact-0.13.ebuild b/app-text/bact/bact-0.13.ebuild
19 index 98d29fb..00cd997 100644
20 --- a/app-text/bact/bact-0.13.ebuild
21 +++ b/app-text/bact/bact-0.13.ebuild
22 @@ -4,7 +4,7 @@
23
24 EAPI=4
25
26 -inherit toolchain-funcs
27 +inherit eutils toolchain-funcs
28
29 DESCRIPTION="Boosting Algorithm for Classification of Trees"
30 HOMEPAGE="http://chasen.org/~taku/software/bact/"
31 @@ -18,6 +18,10 @@ IUSE=""
32 DEPEND=""
33 RDEPEND="${DEPEND}"
34
35 +src_prepare() {
36 + epatch "${FILESDIR}/${P}-cpp14.patch" # bug #594312
37 +}
38 +
39 src_compile() {
40 emake CXX="$(tc-getCXX)" CXXFLAGS="${CXXFLAGS}" LDFLAGS="${LDFLAGS}"
41 }
42
43 diff --git a/app-text/bact/files/bact-0.13-cpp14.patch b/app-text/bact/files/bact-0.13-cpp14.patch
44 new file mode 100644
45 index 00000000..fa083c2
46 --- /dev/null
47 +++ b/app-text/bact/files/bact-0.13-cpp14.patch
48 @@ -0,0 +1,44 @@
49 +Fix C++14 compilation errors -- since C++11 make_pair<T1,T2> is resolved to
50 +make_pair(T1&&, T2&&). Types should be deduced.
51 +Gentoo bug: https://bugs.gentoo.org/show_bug.cgi?id=594312
52 +
53 +--- a/bact_classify.cpp
54 ++++ b/bact_classify.cpp
55 +@@ -86,7 +86,7 @@
56 + if (id == -2) continue;
57 + if (id != -1) {
58 + if (userule)
59 +- rules.insert (std::make_pair <std::string, double> (item, alpha[id]));
60 ++ rules.insert (std::make_pair(item, alpha[id]));
61 + result.push_back (id);
62 + }
63 + project (item, size+1, newdepth, l, new_trie_pos, new_str_pos);
64 +@@ -138,7 +138,7 @@
65 + if (id == -2) continue;
66 + if (id >= 0) {
67 + if (userule)
68 +- rules.insert (std::make_pair <std::string, double> (tree[i].val.key(), alpha[id]));
69 ++ rules.insert (std::make_pair(tree[i].val.key(), alpha[id]));
70 + result.push_back (id);
71 + }
72 + project (tree[i].val.key(), 1, 0, i, 0, 0);
73 +@@ -158,7 +158,7 @@
74 +
75 + for (std::map <std::string, double>::iterator it = rules.begin();
76 + it != rules.end(); ++it)
77 +- tmp.push_back (std::make_pair <std::string, double> (it->first, it->second));
78 ++ tmp.push_back (std::make_pair(it->first, it->second));
79 +
80 + std::sort (tmp.begin(), tmp.end(), pair_2nd_cmp<std::string, double>());
81 +
82 +--- a/bact_mkmodel.cpp
83 ++++ b/bact_mkmodel.cpp
84 +@@ -111,7 +111,7 @@
85 +
86 + for (std::map<std::string, double>::iterator it = rules.begin(); it != rules.end(); ++it) {
87 + double a = it->second / alpha_sum;
88 +- ary2.push_back (std::make_pair <const char*, double>(it->first.c_str(), a));
89 ++ ary2.push_back (std::make_pair(it->first.c_str(), a));
90 + ary.push_back ((Darts::DoubleArray::key_type *)it->first.c_str());
91 + alpha.push_back (a);
92 + }