public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: app-text/mecab/files/, app-text/mecab/
@ 2023-02-14 23:04 Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2023-02-14 23:04 UTC (permalink / raw
  To: gentoo-commits

commit:     f9a9748f86abc864e6b23b2526b0e66dd9e30899
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 14 22:54:02 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Feb 14 23:03:54 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f9a9748f

app-text/mecab: fix build w/ clang 16

Closes: https://bugs.gentoo.org/894362
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/mecab-0.996-clang-16-register.patch      | 89 ++++++++++++++++++++++
 app-text/mecab/mecab-0.996-r1.ebuild               | 24 ++++--
 2 files changed, 105 insertions(+), 8 deletions(-)

diff --git a/app-text/mecab/files/mecab-0.996-clang-16-register.patch b/app-text/mecab/files/mecab-0.996-clang-16-register.patch
new file mode 100644
index 000000000000..5e782e61fb0c
--- /dev/null
+++ b/app-text/mecab/files/mecab-0.996-clang-16-register.patch
@@ -0,0 +1,89 @@
+https://bugs.gentoo.org/894362
+https://github.com/taku910/mecab/pull/66
+
+From 731d738f33dcf62dc9da93104ca1dd6f4c7c9c5f Mon Sep 17 00:00:00 2001
+From: Yuriy Chernyshov <thegeorg@yandex-team.ru>
+Date: Fri, 11 Feb 2022 12:31:33 +0300
+Subject: [PATCH 1/2] Remove register storage specifier
+
+register does not work in modern C / C++.
+--- a/src/char_property.h
++++ b/src/char_property.h
+@@ -37,7 +37,7 @@ class CharProperty {
+   inline const char *seekToOtherType(const char *begin, const char *end,
+                                      CharInfo c, CharInfo *fail,
+                                      size_t *mblen, size_t *clen) const {
+-    register const char *p =  begin;
++    const char *p =  begin;
+     *clen = 0;
+     while (p != end && c.isKindOf(*fail = getCharInfo(p, end, mblen))) {
+       p += *mblen;
+
+From 82fd6424fde64c77f49695883a18f368ba96850e Mon Sep 17 00:00:00 2001
+From: Yuriy Chernyshov <thegeorg@yandex-team.ru>
+Date: Sat, 12 Feb 2022 14:31:03 +0300
+Subject: [PATCH 2/2] More fixes
+
+--- a/src/darts.h
++++ b/src/darts.h
+@@ -404,10 +404,10 @@ class DoubleArrayImpl {
+     T result;
+     set_result(result, -1, 0);
+ 
+-    register array_type_  b = array_[node_pos].base;
+-    register array_u_type_ p;
++    array_type_  b = array_[node_pos].base;
++    array_u_type_ p;
+ 
+-    for (register size_t i = 0; i < len; ++i) {
++    for (size_t i = 0; i < len; ++i) {
+       p = b +(node_u_type_)(key[i]) + 1;
+       if (static_cast<array_u_type_>(b) == array_[p].check)
+         b = array_[p].base;
+@@ -431,12 +431,12 @@ class DoubleArrayImpl {
+                             size_t node_pos = 0) const {
+     if (!len) len = length_func_()(key);
+ 
+-    register array_type_  b   = array_[node_pos].base;
+-    register size_t     num = 0;
+-    register array_type_  n;
+-    register array_u_type_ p;
++    array_type_  b   = array_[node_pos].base;
++    size_t     num = 0;
++    array_type_  n;
++    array_u_type_ 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 ((array_u_type_) b == array_[p].check && n < 0) {
+@@ -469,8 +469,8 @@ class DoubleArrayImpl {
+                       size_t len = 0) const {
+     if (!len) len = length_func_()(key);
+ 
+-    register array_type_  b = array_[node_pos].base;
+-    register array_u_type_ p;
++    array_type_  b = array_[node_pos].base;
++    array_u_type_ p;
+ 
+     for (; key_pos < len; ++key_pos) {
+       p = b +(node_u_type_)(key[key_pos]) + 1;
+--- a/src/viterbi.cpp
++++ b/src/viterbi.cpp
+@@ -318,11 +318,11 @@ template <bool IsAllPath> bool connect(size_t pos, Node *rnode,
+                                        const Connector *connector,
+                                        Allocator<Node, Path> *allocator) {
+   for (;rnode; rnode = rnode->bnext) {
+-    register long best_cost = 2147483647;
++    long best_cost = 2147483647;
+     Node* best_node = 0;
+     for (Node *lnode = end_node_list[pos]; lnode; lnode = lnode->enext) {
+-      register int lcost = connector->cost(lnode, rnode);  // local cost
+-      register long cost = lnode->cost + lcost;
++      int lcost = connector->cost(lnode, rnode);  // local cost
++      long cost = lnode->cost + lcost;
+ 
+       if (cost < best_cost) {
+         best_node  = lnode;
+

diff --git a/app-text/mecab/mecab-0.996-r1.ebuild b/app-text/mecab/mecab-0.996-r1.ebuild
index cc47b0f8bc48..9eb02cee3b92 100644
--- a/app-text/mecab/mecab-0.996-r1.ebuild
+++ b/app-text/mecab/mecab-0.996-r1.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI="6"
+EAPI=8
 
 inherit autotools
 
@@ -14,16 +14,24 @@ KEYWORDS="amd64 arm arm64 ~hppa ~ia64 ~loong ppc ppc64 ~riscv ~s390 sparc x86"
 SLOT="0"
 IUSE="static-libs unicode"
 
-DEPEND="dev-lang/perl
+BDEPEND="
+	dev-lang/perl
 	sys-devel/gettext
-	virtual/libiconv"
-RDEPEND=""
-PDEPEND="|| (
+"
+DEPEND="virtual/libiconv"
+RDEPEND="${DEPEND}"
+PDEPEND="
+	|| (
 		app-dicts/mecab-ipadic[unicode=]
 		app-dicts/mecab-naist-jdic[unicode=]
-	)"
+	)
+"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-0.98-iconv.patch
+	"${FILESDIR}"/${PN}-0.996-clang-16-register.patch
+)
 
-PATCHES=( "${FILESDIR}"/${PN}-0.98-iconv.patch )
 HTML_DOCS=( doc/. )
 
 src_prepare() {


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

* [gentoo-commits] repo/gentoo:master commit in: app-text/mecab/files/, app-text/mecab/
@ 2023-08-19 12:51 Joonas Niilola
  0 siblings, 0 replies; 2+ messages in thread
From: Joonas Niilola @ 2023-08-19 12:51 UTC (permalink / raw
  To: gentoo-commits

commit:     957db3f2129168918147c91c23114508b0f40931
Author:     Brahmajit Das <brahmajit.xyz <AT> gmail <DOT> com>
AuthorDate: Wed Aug  2 16:16:26 2023 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Sat Aug 19 12:51:08 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=957db3f2

app-text/mecab: Fix no template named binary_function

Signed-off-by: Brahmajit Das <brahmajit.xyz <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/32144
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 .../mecab-0.996-clang-16-binary_function.patch     | 16 ++++++
 app-text/mecab/mecab-0.996-r2.ebuild               | 60 ++++++++++++++++++++++
 2 files changed, 76 insertions(+)

diff --git a/app-text/mecab/files/mecab-0.996-clang-16-binary_function.patch b/app-text/mecab/files/mecab-0.996-clang-16-binary_function.patch
new file mode 100644
index 000000000000..5776cf5b2aa5
--- /dev/null
+++ b/app-text/mecab/files/mecab-0.996-clang-16-binary_function.patch
@@ -0,0 +1,16 @@
+Dropping usage of binary_function
+--- a/src/dictionary.cpp
++++ b/src/dictionary.cpp
+@@ -65,7 +65,11 @@ int progress_bar_darts(size_t current, size_t total) {
+ }
+ 
+ template <typename T1, typename T2>
+-struct pair_1st_cmp: public std::binary_function<bool, T1, T2> {
++struct pair_1st_cmp {
++  public:
++  using first_argument_type = bool;
++  using second_argument_type = T1;
++  using result_type = T2;
+   bool operator()(const std::pair<T1, T2> &x1,
+                   const std::pair<T1, T2> &x2)  {
+     return x1.first < x2.first;

diff --git a/app-text/mecab/mecab-0.996-r2.ebuild b/app-text/mecab/mecab-0.996-r2.ebuild
new file mode 100644
index 000000000000..078cd4f66a9d
--- /dev/null
+++ b/app-text/mecab/mecab-0.996-r2.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools
+
+DESCRIPTION="Yet Another Part-of-Speech and Morphological Analyzer"
+HOMEPAGE="https://taku910.github.io/mecab/"
+SRC_URI="https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/${PN}/${P}.tar.gz"
+
+LICENSE="|| ( BSD LGPL-2.1 GPL-2 )"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+SLOT="0"
+IUSE="static-libs unicode"
+
+BDEPEND="
+	dev-lang/perl
+	sys-devel/gettext
+"
+DEPEND="virtual/libiconv"
+RDEPEND="${DEPEND}"
+PDEPEND="
+	|| (
+		app-dicts/mecab-ipadic[unicode=]
+		app-dicts/mecab-naist-jdic[unicode=]
+	)
+"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-0.98-iconv.patch
+	"${FILESDIR}"/${PN}-0.996-clang-16-register.patch
+	"${FILESDIR}"/${PN}-0.996-clang-16-binary_function.patch
+)
+
+HTML_DOCS=( doc/. )
+
+src_prepare() {
+	default
+	sed -i \
+		-e "/CFLAGS/s/-O3/${CFLAGS}/" \
+		-e "/CXXFLAGS/s/-O3/${CXXFLAGS}/" \
+		configure.in
+	sed -i "s:/lib:/$(get_libdir):" ${PN}rc.in
+
+	mv configure.{in,ac} || die
+	eautoreconf
+}
+
+src_configure() {
+	econf \
+		$(use_enable static-libs static) \
+		$(use_with unicode charset UTF-8)
+}
+
+src_install() {
+	default
+	find "${ED}" -name 'Makefile*' -delete || die
+	use static-libs || find "${ED}" -name '*.la' -delete || die
+}


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

end of thread, other threads:[~2023-08-19 12:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-14 23:04 [gentoo-commits] repo/gentoo:master commit in: app-text/mecab/files/, app-text/mecab/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2023-08-19 12:51 Joonas Niilola

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