summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkinori Hattori <hattya@gentoo.org>2017-12-17 18:04:05 +0900
committerAkinori Hattori <hattya@gentoo.org>2017-12-17 18:18:34 +0900
commit96c854b1573f21c577f0dada5b24f7813bcf16f3 (patch)
tree5bb109ede80e4747d23646466a1ea1c8b2e5a02a /app-text/crf++
parentapp-text/crf++: update patch (diff)
downloadgentoo-96c854b1573f21c577f0dada5b24f7813bcf16f3.tar.gz
gentoo-96c854b1573f21c577f0dada5b24f7813bcf16f3.tar.bz2
gentoo-96c854b1573f21c577f0dada5b24f7813bcf16f3.zip
app-text/crf++: fix build with >=sys-devel/gcc-6
Package-Manager: Portage-2.3.13, Repoman-2.3.4
Diffstat (limited to 'app-text/crf++')
-rw-r--r--app-text/crf++/crf++-0.54.ebuild3
-rw-r--r--app-text/crf++/files/crf++-0.54-c++11.patch37
2 files changed, 39 insertions, 1 deletions
diff --git a/app-text/crf++/crf++-0.54.ebuild b/app-text/crf++/crf++-0.54.ebuild
index 204eda151148..e282ca87c965 100644
--- a/app-text/crf++/crf++-0.54.ebuild
+++ b/app-text/crf++/crf++-0.54.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI="3"
@@ -22,6 +22,7 @@ src_prepare() {
-e "/CXXFLAGS/s/-O3/${CXXFLAGS}/" \
configure.in || die
+ epatch "${FILESDIR}"/${P}-c++11.patch
# bug #365921
epatch "${FILESDIR}/${P}-gcc46.patch"
diff --git a/app-text/crf++/files/crf++-0.54-c++11.patch b/app-text/crf++/files/crf++-0.54-c++11.patch
new file mode 100644
index 000000000000..a71cd9071eba
--- /dev/null
+++ b/app-text/crf++/files/crf++-0.54-c++11.patch
@@ -0,0 +1,37 @@
+--- a/feature_index.cpp
++++ b/feature_index.cpp
+@@ -34,8 +34,9 @@
+ std::map <std::string, std::pair<int, unsigned int> >::iterator
+ it = dic_.find(key);
+ if (it == dic_.end()) {
+- dic_.insert(std::make_pair<std::string, std::pair<int, unsigned int> >
+- (key, std::make_pair<int, unsigned int>(maxid_, 1)));
++ dic_.insert(std::make_pair
++ (std::string(key),
++ std::make_pair(maxid_, static_cast<unsigned int>(1))));
+ int n = maxid_;
+ maxid_ += (key[0] == 'U' ? y_.size() : y_.size() * y_.size());
+ return n;
+@@ -171,7 +172,7 @@
+ const std::string &key = it->first;
+
+ if (it->second.second >= freq) {
+- old2new.insert(std::make_pair<int, int>(it->second.first, new_maxid));
++ old2new.insert(std::make_pair(it->second.first, new_maxid));
+ it->second.first = new_maxid;
+ new_maxid += (key[0] == 'U' ? y_.size() : y_.size() * y_.size());
+ ++it;
+@@ -264,9 +265,10 @@
+ size_t size = tokenize(line, "\t ", column, 2);
+ CHECK_FALSE(size == 2) << "format error: " << filename1;
+
+- dic_.insert(std::make_pair<std::string, std::pair<int, unsigned int> >
+- (column[1],
+- std::make_pair<int, unsigned int>(std::atoi(column[0]), 1)));
++ dic_.insert(std::make_pair
++ (std::string(column[1]),
++ std::make_pair(std::atoi(column[0]),
++ static_cast<unsigned int>(1))));
+ }
+
+ std::vector<double> alpha;