public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: app-text/bact/, app-text/bact/files/
@ 2016-09-28 21:02 David Seifert
  0 siblings, 0 replies; 2+ messages in thread
From: David Seifert @ 2016-09-28 21:02 UTC (permalink / raw
  To: gentoo-commits

commit:     03eaa0cf8c05dc6b3398c08aef0101dcebb6e72a
Author:     Kacper Kołodziej <kacper <AT> kolodziej <DOT> in>
AuthorDate: Sun Sep 25 14:05:22 2016 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Wed Sep 28 21:02:06 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=03eaa0cf

app-text/bact: fix cpp14 compilation errors; bug #594312

Closes: https://github.com/gentoo/gentoo/pull/2409

Signed-off-by: David Seifert <soap <AT> gentoo.org>

 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(-)

diff --git a/app-text/bact/bact-0.13.ebuild b/app-text/bact/bact-0.13.ebuild
index 98d29fb..00cd997 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 00000000..fa083c2
--- /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<T1,T2> 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 <std::string, double> (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 <std::string, double> (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 <std::string, double>::iterator it = rules.begin();
+ 	 it != rules.end(); ++it) 
+-      tmp.push_back (std::make_pair <std::string, double> (it->first,  it->second));
++      tmp.push_back (std::make_pair(it->first,  it->second));
+       
+     std::sort (tmp.begin(), tmp.end(), pair_2nd_cmp<std::string, double>());
+ 
+--- a/bact_mkmodel.cpp
++++ b/bact_mkmodel.cpp
+@@ -111,7 +111,7 @@
+    
+   for (std::map<std::string, double>::iterator it = rules.begin(); it != rules.end(); ++it) {
+     double a = it->second / alpha_sum;
+-    ary2.push_back (std::make_pair <const char*, double>(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);
+   }


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/bact/, app-text/bact/files/
@ 2022-11-20 23:56 David Seifert
  0 siblings, 0 replies; 2+ messages in thread
From: David Seifert @ 2022-11-20 23:56 UTC (permalink / raw
  To: gentoo-commits

commit:     43494336a4a3b54200d3b480ea64a2bc472bdb46
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 20 23:55:52 2022 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sun Nov 20 23:55:52 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=43494336

app-text/bact: update EAPI 6 -> 8

Signed-off-by: David Seifert <soap <AT> gentoo.org>

 .../{bact-0.13-r1.ebuild => bact-0.13-r2.ebuild}   | 24 +++++------
 app-text/bact/files/bact-0.13-cpp14.patch          | 48 +++++++++++++++++++++-
 app-text/bact/files/bact-0.13-makefile.patch       | 38 +++++++++++++++++
 3 files changed, 95 insertions(+), 15 deletions(-)

diff --git a/app-text/bact/bact-0.13-r1.ebuild b/app-text/bact/bact-0.13-r2.ebuild
similarity index 58%
rename from app-text/bact/bact-0.13-r1.ebuild
rename to app-text/bact/bact-0.13-r2.ebuild
index aaf872d9bd2b..8c6381a627b2 100644
--- a/app-text/bact/bact-0.13-r1.ebuild
+++ b/app-text/bact/bact-0.13-r2.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
+EAPI=8
 
 inherit toolchain-funcs
 
@@ -12,23 +12,19 @@ SRC_URI="http://chasen.org/~taku/software/bact/${P}.tar.gz"
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
-IUSE=""
 
-RDEPEND=""
-DEPEND="${RDEPEND}"
+PATCHES=(
+	"${FILESDIR}"/${P}-makefile.patch
+	"${FILESDIR}"/${P}-cpp14.patch
+)
 
-HTML_DOCS=( index.html bact.css )
-PATCHES=( "${FILESDIR}/${P}-cpp14.patch" )
-
-src_compile() {
-	emake CXX="$(tc-getCXX)" CXXFLAGS="${CXXFLAGS}" LDFLAGS="${LDFLAGS}"
-}
-
-src_test() {
-	emake test
+src_configure() {
+	tc-export CXX
 }
 
 src_install() {
 	dobin bact_learn bact_mkmodel bact_classify
+
+	HTML_DOCS=( index.html bact.css )
 	einstalldocs
 }

diff --git a/app-text/bact/files/bact-0.13-cpp14.patch b/app-text/bact/files/bact-0.13-cpp14.patch
index fa083c223b12..a0f6edda1eed 100644
--- a/app-text/bact/files/bact-0.13-cpp14.patch
+++ b/app-text/bact/files/bact-0.13-cpp14.patch
@@ -1,6 +1,7 @@
 Fix C++14 compilation errors -- since C++11 make_pair<T1,T2> is resolved to
 make_pair(T1&&, T2&&). Types should be deduced.
-Gentoo bug: https://bugs.gentoo.org/show_bug.cgi?id=594312
+
+Bug: https://bugs.gentoo.org/594312
 
 --- a/bact_classify.cpp
 +++ b/bact_classify.cpp
@@ -42,3 +43,48 @@ Gentoo bug: https://bugs.gentoo.org/show_bug.cgi?id=594312
      ary.push_back  ((Darts::DoubleArray::key_type *)it->first.c_str());
      alpha.push_back (a);
    }
+--- a/darts.h
++++ b/darts.h
+@@ -394,10 +394,10 @@
+     {
+       if (! len) len = LengthFunc() (key);
+ 
+-      register ArrayType  b = array[pos].base;
+-      register ArrayUType p;
++      ArrayType  b = array[pos].base;
++      ArrayUType p;
+ 
+-      for (register size_t i = 0; i < len; ++i) {
++      for (size_t i = 0; i < len; ++i) {
+ 	p = b + (NodeUType)(key[i]) + 1;
+ 	if ((ArrayUType)b == array[p].check) b = array[p].base;
+ 	else return -2;
+@@ -414,8 +414,8 @@
+     {
+       if (! len) len = LengthFunc() (key);
+ 
+-      register ArrayType  b = array[pos].base;
+-      register ArrayUType p;       
++      ArrayType  b = array[pos].base;
++      ArrayUType p;       
+ 
+       for (; pos2 < len; ++pos2) {
+ 	p = b + (NodeUType)(key[pos2]) + 1;
+@@ -437,12 +437,12 @@
+     {
+       if (! len) len = LengthFunc() (key);
+ 
+-      register ArrayType  b   = array[pos].base;
+-      register size_t     num = 0;
+-      register ArrayType  n;
+-      register ArrayUType p;
++      ArrayType  b   = array[pos].base;
++      size_t     num = 0;
++      ArrayType  n;
++      ArrayUType p;
+ 
+-      for (register size_t i = 0; i < len; ++i) {
++      for (size_t i = 0; i < len; ++i) {
+ 	p = b; // + 0;
+ 	n = array[p].base;
+ 	if ((ArrayUType) b == array[p].check && n < 0) result[num++] = -n-1;

diff --git a/app-text/bact/files/bact-0.13-makefile.patch b/app-text/bact/files/bact-0.13-makefile.patch
new file mode 100644
index 000000000000..d27879559d1d
--- /dev/null
+++ b/app-text/bact/files/bact-0.13-makefile.patch
@@ -0,0 +1,38 @@
+--- a/Makefile
++++ b/Makefile
+@@ -1,8 +1,6 @@
+-CXX = c++
+ VERSION = 0.13
+-CXXFLAGS = -O3 -Wall -Wno-deprecated
++CXXFLAGS += -Wall -Wno-deprecated
+ EXECPREFIX =
+-LDFLAGS  = 
+ TARGETS1 = bact_learn${EXEC_PREFIX}
+ TARGETS2 = bact_classify${EXEC_PREFIX}
+ TARGETS3 = bact_mkmodel${EXEC_PREFIX}
+@@ -10,14 +8,11 @@
+ 
+ all: bact_learn bact_mkmodel bact_classify
+ 
+-bact_learn: bact_learn.o ${OBJ}
+-	${CXX} ${CFLAGS} ${LDFLAGS} -o ${TARGETS1} ${OBJ} bact_learn.o ${LDFLAGS}
++bact_learn: ${OBJ}
+ 
+-bact_classify: bact_classify.o ${OBJ}
+-	${CXX} ${CFLAGS} ${LDFLAGS} -o ${TARGETS2} ${OBJ} bact_classify.o ${LDFLAGS}
++bact_classify: ${OBJ}
+ 
+-bact_mkmodel: bact_mkmodel.o ${OBJ}
+-	${CXX} ${CFLAGS} ${LDFLAGS} -o ${TARGETS3} ${OBJ} bact_mkmodel.o ${LDFLAGS}
++bact_mkmodel: ${OBJ}
+ 
+ clean:
+ 	rm -f *.o ${TARGETS1} ${TARGETS2} ${TARGETS3} core *~ *.tar.gz *.exe core* med.model* jp.model*
+@@ -33,7 +28,6 @@
+ 	scp bact-${VERSION}.tar.gz index.html bact.css chasen.org:public_html/software/bact/
+ 
+ check:
+-test:	
+ 	./bact_learn -T1000 med.train med.model 
+ 	./bact_mkmodel -i med.model -o med.model.bin -O med.model.O
+ 	./bact_classify med.test med.model.bin


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-20 23:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-28 21:02 [gentoo-commits] repo/gentoo:master commit in: app-text/bact/, app-text/bact/files/ David Seifert
  -- strict thread matches above, loose matches on Subject: below --
2022-11-20 23:56 David Seifert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox