From 43494336a4a3b54200d3b480ea64a2bc472bdb46 Mon Sep 17 00:00:00 2001 From: David Seifert Date: Mon, 21 Nov 2022 00:55:52 +0100 Subject: app-text/bact: update EAPI 6 -> 8 Signed-off-by: David Seifert --- app-text/bact/bact-0.13-r1.ebuild | 34 -------------------- app-text/bact/bact-0.13-r2.ebuild | 30 +++++++++++++++++ app-text/bact/files/bact-0.13-cpp14.patch | 48 +++++++++++++++++++++++++++- app-text/bact/files/bact-0.13-makefile.patch | 38 ++++++++++++++++++++++ 4 files changed, 115 insertions(+), 35 deletions(-) delete mode 100644 app-text/bact/bact-0.13-r1.ebuild create mode 100644 app-text/bact/bact-0.13-r2.ebuild create mode 100644 app-text/bact/files/bact-0.13-makefile.patch diff --git a/app-text/bact/bact-0.13-r1.ebuild b/app-text/bact/bact-0.13-r1.ebuild deleted file mode 100644 index aaf872d9bd2b..000000000000 --- a/app-text/bact/bact-0.13-r1.ebuild +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright 1999-2016 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -inherit toolchain-funcs - -DESCRIPTION="Boosting Algorithm for Classification of Trees" -HOMEPAGE="http://chasen.org/~taku/software/bact/" -SRC_URI="http://chasen.org/~taku/software/bact/${P}.tar.gz" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~x86" -IUSE="" - -RDEPEND="" -DEPEND="${RDEPEND}" - -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_install() { - dobin bact_learn bact_mkmodel bact_classify - einstalldocs -} diff --git a/app-text/bact/bact-0.13-r2.ebuild b/app-text/bact/bact-0.13-r2.ebuild new file mode 100644 index 000000000000..8c6381a627b2 --- /dev/null +++ b/app-text/bact/bact-0.13-r2.ebuild @@ -0,0 +1,30 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit toolchain-funcs + +DESCRIPTION="Boosting Algorithm for Classification of Trees" +HOMEPAGE="http://chasen.org/~taku/software/bact/" +SRC_URI="http://chasen.org/~taku/software/bact/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +PATCHES=( + "${FILESDIR}"/${P}-makefile.patch + "${FILESDIR}"/${P}-cpp14.patch +) + +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 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 -- cgit v1.2.3-65-gdbad