commit:     ac079847af0dc04fd3837629266edd4dd8acd3a3
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 19 20:35:00 2024 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Wed Jun 19 20:35:00 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ac079847

app-i18n/freewnn: EAPI=8, refactor

Closes: https://bugs.gentoo.org/882695
Closes: https://bugs.gentoo.org/906006
Closes: https://bugs.gentoo.org/891481
Closes: https://bugs.gentoo.org/841434
Closes: https://bugs.gentoo.org/922572
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 .../files/freewnn-1.1.1-implicit-configure.patch   | 19 +++++++
 ...3-r1.ebuild => freewnn-1.1.1_alpha23-r2.ebuild} | 58 ++++++++++++++--------
 2 files changed, 55 insertions(+), 22 deletions(-)

diff --git a/app-i18n/freewnn/files/freewnn-1.1.1-implicit-configure.patch 
b/app-i18n/freewnn/files/freewnn-1.1.1-implicit-configure.patch
new file mode 100644
index 000000000000..a46f2f405e5d
--- /dev/null
+++ b/app-i18n/freewnn/files/freewnn-1.1.1-implicit-configure.patch
@@ -0,0 +1,19 @@
+--- a/configure.in     2024-06-19 23:14:54.243999953 +0300
++++ b/configure.in     2024-06-19 23:15:21.253961581 +0300
+@@ -549,6 +549,7 @@
+ #ifdef HAVE_TERMCAP_H
+ # include <termcap.h>
+ #endif
++#include <stdlib.h>
+ main() {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(0); }],
+       res="OK", res="FAIL", res="FAIL")
+       if test "$res" = "OK"; then
+@@ -571,6 +572,8 @@
+ #ifdef HAVE_TERMCAP_H
+ # include <termcap.h>
+ #endif
++#include <stdlib.h>
++#include <string.h>
+ main()
+ {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(!strcmp(s==0 ? "" : s, "1")); 
}],
+       [ AC_MSG_RESULT([no -- we are in termcap land])

diff --git a/app-i18n/freewnn/freewnn-1.1.1_alpha23-r1.ebuild 
b/app-i18n/freewnn/freewnn-1.1.1_alpha23-r2.ebuild
similarity index 50%
rename from app-i18n/freewnn/freewnn-1.1.1_alpha23-r1.ebuild
rename to app-i18n/freewnn/freewnn-1.1.1_alpha23-r2.ebuild
index 9aa3cdbb9b15..293df70e0050 100644
--- a/app-i18n/freewnn/freewnn-1.1.1_alpha23-r1.ebuild
+++ b/app-i18n/freewnn/freewnn-1.1.1_alpha23-r2.ebuild
@@ -1,59 +1,69 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI="6"
+EAPI=8
 
-inherit toolchain-funcs
+inherit autotools toolchain-funcs
 
 MY_P="FreeWnn-${PV/_alpha/-a0}"
 
 DESCRIPTION="Network-Extensible Kana-to-Kanji Conversion System"
 HOMEPAGE="http://freewnn.sourceforge.jp/ http://www.freewnn.org/";
 SRC_URI="mirror://sourceforge.jp/${PN}/63271/${MY_P}.tar.bz2"
+S=${WORKDIR}/${MY_P}
 
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="~alpha amd64 arm64 ~hppa ~ia64 ppc ppc64 ~riscv sparc x86"
-IUSE="ipv6 uum"
+IUSE="+uum"
 
-RDEPEND="virtual/libcrypt:=
-       uum? ( sys-libs/ncurses:= )"
-DEPEND="${RDEPEND}
-       uum? ( virtual/pkgconfig )"
-S="${WORKDIR}/${MY_P}"
+RDEPEND="
+       sys-apps/tcp-wrappers
+       virtual/libcrypt:=
+       uum? ( sys-libs/ncurses:= )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
 
 PATCHES=(
        "${FILESDIR}"/${PN}-uum-EUC-JP.patch
        "${FILESDIR}"/${PN}-Wformat-security.patch
+       "${FILESDIR}"/${PN}-1.1.1-implicit-configure.patch
 )
-DOCS="ChangeLog* CONTRIBUTORS"
+
+# linked for tests which we skip
+QA_CONFIG_IMPL_DECL_SKIP=( hosts_access )
 
 src_prepare() {
        sed -i \
                -e "s/WNNOWNER = wnn/WNNOWNER = root/" \
                -e "s|@mandir@/|@mandir@/ja/|" \
                -e "s/@INSTPGMFLAGS@//" \
-               makerule.mk.in
+               makerule.mk.in || die
 
        # bug #542534
        sed -i \
-               -e "s/egrep -v/egrep -av/" \
+               -e "s/egrep -v/grep -Eav/" \
                PubdicPlus/Makefile.in \
                Wnn/pubdicplus/Makefile.in \
                cWnn/[ct]dic/Makefile.in \
-               kWnn/kdic/Makefile.in
+               kWnn/kdic/Makefile.in  || die
 
        default
+       eautoreconf
 }
 
 src_configure() {
-       econf \
-               $(use_enable uum client) \
-               $(use_with ipv6) \
-               --disable-cWnn \
-               --disable-kWnn \
-               --disable-traditional-layout \
-               --with-term-libs="$($(tc-getPKG_CONFIG) --libs ncurses)"
+       local myeconfargs=(
+               $(use_enable uum client)
+               --enable-ipv6
+               --disable-cWnn
+               --disable-kWnn
+               --disable-traditional-layout
+               --enable-static # needed for correct compilation
+               --with-term-libs="$( $(tc-getPKG_CONFIG) --libs ncurses )"
+       )
+       econf "${myeconfargs[@]}"
 }
 
 src_compile() {
@@ -61,13 +71,17 @@ src_compile() {
 
        local m
        for m in $(find Wnn/man -name "*.man"); do
-               iconv -f EUC-JP -t UTF-8 "${m}" > "${m}".UTF-8 || die
+               iconv --from-code=EUC-JP --to-code=UTF-8 --output="${m}".UTF-8 
"${m}" || die
                mv "${m}"{.UTF-8,} || die
        done
 }
 
 src_install() {
-       emake DESTDIR="${D}" install install.man
+       emake DESTDIR="${ED}" install install.man
+
+       find "${ED}" \( -name "*.la" -o -name "*.a" \) -delete || die
+
+       local DOCS=( ChangeLog* CONTRIBUTORS )
        einstalldocs
 
        newconfd "${FILESDIR}"/${PN}.confd-r1 ${PN}

Reply via email to