diff options
author | 2025-02-07 22:14:42 +0400 | |
---|---|---|
committer | 2025-02-10 08:47:42 +0000 | |
commit | a63b08303a493422bb7ecad7a1802a8b5ebb534f (patch) | |
tree | 57131c2c753b78c2da1aadad8d0765a5ddfce17a /app-text | |
parent | net-analyzer/ippl: update EAPI 7 -> 8, fix musl build, Modern C Porting (diff) | |
download | gentoo-a63b08303a493422bb7ecad7a1802a8b5ebb534f.tar.gz gentoo-a63b08303a493422bb7ecad7a1802a8b5ebb534f.tar.bz2 gentoo-a63b08303a493422bb7ecad7a1802a8b5ebb534f.zip |
app-text/chasen: port to C23
Closes: https://bugs.gentoo.org/944011
Signed-off-by: NHOrus <jy6x2b32pie9@yahoo.com>
Closes: https://github.com/gentoo/gentoo/pull/40477
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'app-text')
-rw-r--r-- | app-text/chasen/chasen-2.4.5-r1.ebuild | 62 | ||||
-rw-r--r-- | app-text/chasen/files/chasen-2.4.5-c23.patch | 79 |
2 files changed, 141 insertions, 0 deletions
diff --git a/app-text/chasen/chasen-2.4.5-r1.ebuild b/app-text/chasen/chasen-2.4.5-r1.ebuild new file mode 100644 index 000000000000..80f4f4f89e8a --- /dev/null +++ b/app-text/chasen/chasen-2.4.5-r1.ebuild @@ -0,0 +1,62 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="8" + +inherit perl-module + +DESCRIPTION="Japanese Morphological Analysis System, ChaSen" +HOMEPAGE="https://chasen-legacy.osdn.jp/" +SRC_URI="mirror://sourceforge.jp/${PN}-legacy/56305/${P}.tar.xz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~ppc64 ~riscv ~x86" +IUSE="perl static-libs" + +RDEPEND="virtual/libiconv" +DEPEND=">=dev-libs/darts-0.32" +PDEPEND=">=app-dicts/ipadic-2.7.0" + +PATCHES=( + "${FILESDIR}"/${PN}-uar.patch + "${FILESDIR}"/${P}-c23.patch + ) + +src_configure() { + econf $(use_enable static-libs static) + + if use perl; then + cd "${S}"/perl || die + perl-module_src_configure + fi +} + +src_compile() { + default + + if use perl; then + cd "${S}"/perl || die + perl-module_src_compile + fi +} + +src_test() { + default + + if use perl; then + cd "${S}"/perl || die + perl-module_src_test + fi +} + +src_install() { + default + find "${ED}" -name '*.la' -delete || die + + if use perl; then + cd "${S}"/perl || die + perl-module_src_install + newdoc README README.perl + fi +} diff --git a/app-text/chasen/files/chasen-2.4.5-c23.patch b/app-text/chasen/files/chasen-2.4.5-c23.patch new file mode 100644 index 000000000000..d1804b1a906e --- /dev/null +++ b/app-text/chasen/files/chasen-2.4.5-c23.patch @@ -0,0 +1,79 @@ +Ports program to C23 and allows it to compile with GCC-15. +Fix function declarations with no arguments, delete dubious extern of +library function +Fix comparators for quicksort/binary search +https://bugs.gentoo.org/944011 +--- a/lib/connect.c ++++ b/lib/connect.c +@@ -45,9 +45,11 @@ + * rensetu table + */ + static int +-cmp_pair(rensetu_pair_t * pair1, rensetu_pair_t * pair2) ++cmp_pair(const void * pair1_void, const void * pair2_void) + { + int ret; ++ rensetu_pair_t *pair1 = (rensetu_pair_t *)pair1_void; ++ rensetu_pair_t *pair2 = (rensetu_pair_t *)pair2_void; + + /* + * 見出し語 surface form +@@ -166,9 +168,11 @@ + } + + static int +-find_table(lexicon_t * mrph, rensetu_pair_t * pair) ++find_table(const void * mrph_void, const void * pair_void) + { + int ret; ++ lexicon_t * mrph = (lexicon_t*)mrph_void; ++ rensetu_pair_t * pair = (rensetu_pair_t*)pair_void; + + /* + * 品詞分類 POS +@@ -202,12 +206,11 @@ + rensetu_pair_t *ret; + + if (rensetu_tbl[0].hinsi == 0) +- qsort(rensetu_tbl, tbl_num, sizeof(rensetu_pair_t), +- (int (*)()) cmp_pair); ++ qsort(rensetu_tbl, tbl_num, sizeof(rensetu_pair_t), cmp_pair); + + ret = (rensetu_pair_t *) + bsearch(mrph, rensetu_tbl, tbl_num_goi, +- sizeof(rensetu_pair_t), (int (*)()) find_table); ++ sizeof(rensetu_pair_t), find_table); + if (ret) { + mrph->con_tbl = ret->index; + return 1; +@@ -215,7 +218,7 @@ + + ret = (rensetu_pair_t *) + bsearch(mrph, rensetu_tbl + tbl_num_goi, tbl_num - tbl_num_goi, +- sizeof(rensetu_pair_t), (int (*)()) find_table); ++ sizeof(rensetu_pair_t), find_table); + if (ret) { + mrph->con_tbl = ret->index; + return 1; /* if no error, return 1 */ +--- a/lib/iotool.c ++++ b/lib/iotool.c +@@ -362,7 +362,7 @@ + cha_fopen_rcfile(void) + { + FILE *fp; +- char *home_dir, *rc_env, *getenv(); ++ char *home_dir, *rc_env; + + /* + * -R option (standard alone) +--- a/lib/print.c ++++ b/lib/print.c +@@ -47,7 +47,7 @@ + static int path_buffer[CHA_INPUT_SIZE]; + static int pos_end = 0; + +-static void (*cha_putc) (), (*cha_puts) (), (*cha_printf) (), (*cha_write) (); ++static void (*cha_putc) (int, char*), (*cha_puts) (char*, char*), (*cha_printf) (char*, char*, ...), (*cha_write) (void*, size_t, size_t, char*); + + void + cha_print_reset(void) |