commit:     43ad380a25a27ea8cac777033cede7e1545e3761
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 30 07:46:07 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jun 30 08:22:56 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=43ad380a

net-misc/suite3270: add 4.4_p6

Made a start on tests but restricted.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-misc/suite3270/Manifest                        |   1 +
 .../suite3270-4.4_p6-ncurses-pkg-config.patch      |  48 +++++++++
 net-misc/suite3270/suite3270-4.4_p6.ebuild         | 115 +++++++++++++++++++++
 3 files changed, 164 insertions(+)

diff --git a/net-misc/suite3270/Manifest b/net-misc/suite3270/Manifest
index 879333091cc0..12ecec4d02e3 100644
--- a/net-misc/suite3270/Manifest
+++ b/net-misc/suite3270/Manifest
@@ -1 +1,2 @@
 DIST suite3270-4.3ga6-src.tgz 13188235 BLAKE2B 
2ca334b82cc42818ac9d0733a8d93f3b73e598f9de94e7166972d88079cfcf98877eb08587ac24e096f9b6457c96344abd37c4bb9d7af4f7e50c3ef191f82714
 SHA512 
5250d382185acb7f89cb2a6ff5050aa05be809e7bd2bbe25cf74bd3177ebba8ea24d990b3f20e308a5cffa8bdbd5d1c82ba956db76a2812b5ae42ea57602d2bd
+DIST suite3270-4.4ga6-src.tgz 14241642 BLAKE2B 
e156c7e2a79b60071ab32d9a3e30e6e287789e5941247abd9f93b03eccc4f21b182a9125fe192a0500f2cad4d5648d064406ab5f02958d597d0f04731ae60415
 SHA512 
5709fdb97057ceeb0b8fcc67153a8eeee1943595df7a2aeed48b9db43c067a2107df3bbe8fcf6e9a12b2d1d23d6ec7cd522dcbc974eef7419d59593199782321

diff --git a/net-misc/suite3270/files/suite3270-4.4_p6-ncurses-pkg-config.patch 
b/net-misc/suite3270/files/suite3270-4.4_p6-ncurses-pkg-config.patch
new file mode 100644
index 000000000000..78b714001e9d
--- /dev/null
+++ b/net-misc/suite3270/files/suite3270-4.4_p6-ncurses-pkg-config.patch
@@ -0,0 +1,48 @@
+Needed to ensure we pick up definitions from ncurses' pkg-config file
+like -DNCURSES_WIDECHAR (issue is observable on say, musl).
+--- a/x3270if/Makefile.obj.in
++++ b/x3270if/Makefile.obj.in
+@@ -51,9 +51,9 @@ INSTALL_DATA = @INSTALL_DATA@
+ 
+ CCOPTIONS = @CCOPTIONS@
+ XCPPFLAGS = -I$(THIS) -I$(TOP)/include -I$(TOP)/Common/x3270if @CPPFLAGS@
+-override CFLAGS += $(CCOPTIONS) $(CDEBUGFLAGS) $(XCPPFLAGS) @CFLAGS@
++override CFLAGS += $(CCOPTIONS) $(CDEBUGFLAGS) $(XCPPFLAGS) @ncurses_CFLAGS@ 
@CFLAGS@
+ LDFLAGS = @LDFLAGS@
+-LIBS = @LIBS@
++LIBS = @LIBS@ @ncurses_LIBS@
+ 
+ XVERSION = xversion.c
+ version.o: mkversion.py $(VOBJS) version.txt
+--- a/x3270if/configure.in
++++ b/x3270if/configure.in
+@@ -76,6 +76,9 @@ if test "$with_readline" != no; then
+  fi
+  AC_CHECK_HEADERS(readline/history.h)
+ fi
++
++dnl Try pkg-config first, and if it fails, try the traditional methods.
++PKG_CHECK_MODULES([ncurses], [ncursesw], [AC_DEFINE([HAVE_NCURSESW_NCURSES_H] 
,[1]) AC_DEFINE([HAVE_NCURSESW_TERM_H], [1])], [
+ dnl Find the best curses header file and hope it's consistent with the library
+ dnl we found.
+ AC_CHECK_HEADERS(ncursesw/ncurses.h, ,
+@@ -86,15 +89,16 @@ AC_CHECK_HEADERS(ncursesw/term.h, ,
+  [AC_CHECK_HEADERS(ncurses/term.h, ,
+   [AC_CHECK_HEADERS(term.h)])])
+ 
++AC_SEARCH_LIBS(newterm, ncursesw ncurses curses, , [AC_MSG_ERROR(Can't find 
libncurses or new-enough libcurses)])
++AC_SEARCH_LIBS(setupterm, tinfow tinfo, , [AC_MSG_ERROR(Can't find terminfo 
library)])
++AC_CHECK_FUNCS(tiparm)])
++
+ dnl Check for --without-readline
+ AC_ARG_WITH(readline, [  --without-readline      Don't use the readline 
library]) 
+ 
+ dnl Checks for library functions.
+ AC_CHECK_FUNCS(vasprintf)
+ AC_FUNC_FSEEKO
+-AC_SEARCH_LIBS(newterm, ncursesw ncurses curses)
+-AC_SEARCH_LIBS(setupterm, tinfow tinfo)
+-AC_CHECK_FUNCS(tiparm)
+ if test "$with_readline" != no; then
+  if test -n "$with_readline" -a "$with_readline" != yes; then
+   dnl Use the speficied readline install path.

diff --git a/net-misc/suite3270/suite3270-4.4_p6.ebuild 
b/net-misc/suite3270/suite3270-4.4_p6.ebuild
new file mode 100644
index 000000000000..956f1aadef02
--- /dev/null
+++ b/net-misc/suite3270/suite3270-4.4_p6.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MY_PV=${PV/_p/ga}
+MY_P=${PN}-${MY_PV}
+SUB_PV=${PV:0:3}
+S="${WORKDIR}"/${PN}-${SUB_PV}
+
+# Only the x3270 package installs fonts
+FONT_PN="x3270"
+FONT_S="${S}"/${FONT_PN}
+
+PYTHON_COMPAT=( python3_{11..14} )
+inherit autotools font python-any-r1
+
+DESCRIPTION="Complete 3270 (S390) access package"
+HOMEPAGE="http://x3270.bgp.nu/";
+SRC_URI="https://downloads.sourceforge.net/x3270/${MY_P}-src.tgz";
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~s390 ~sparc ~x86"
+IUSE="cjk doc gui ncurses ssl tcl"
+# json_test fails on an obvious assert?
+RESTRICT="test"
+
+RDEPEND="
+       gui? (
+               x11-libs/libX11
+               x11-libs/libXaw
+               x11-libs/libXmu
+               x11-libs/libXt
+       )
+       ssl? ( dev-libs/openssl:= )
+       ncurses? (
+               sys-libs/ncurses:=
+               sys-libs/readline:=
+       )
+       tcl? ( dev-lang/tcl:= )
+"
+DEPEND="
+       ${RDEPEND}
+       gui? ( x11-base/xorg-proto )
+"
+BDEPEND="
+       ${PYTHON_DEPS}
+       gui? (
+               x11-apps/bdftopcf
+               >=x11-apps/mkfontscale-1.2.0
+               x11-misc/xbitmaps
+       )
+"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-4.1-musl-wint-t-fix.patch
+       "${FILESDIR}"/${PN}-4.4_p6-ncurses-pkg-config.patch
+)
+
+src_prepare() {
+       default
+
+       # Some subdirs (like c3270/x3270/s3270) install the same set of data 
files
+       # (they have the same contents).  Wrap that in a retry to avoid errors.
+       cat <<-EOF > _install || die
+       #!/bin/sh
+       for n in 1 2 3 4 5; do
+               install "\$@" && exit
+               echo "retrying ..."
+       done
+       exit 1
+       EOF
+       chmod a+rx _install || die
+       # Can't use the ${INSTALL} var as top level configure also uses it.
+       # https://sourceforge.net/p/x3270/bugs/15/
+       export ac_cv_path_install="${S}"/_install
+
+       AT_NOEAUTOHEADER=yes eautoreconf
+}
+
+src_configure() {
+       econf \
+               --cache-file="${S}"/config.cache \
+               --enable-s3270 \
+               --enable-pr3287 \
+               $(use_enable ncurses c3270) \
+               $(use_enable tcl tcl3270) \
+               $(use_enable gui x3270) \
+               $(use_with gui x) \
+               $(use_with gui fontdir "${FONTDIR}")
+}
+
+src_test() {
+       # https://x3270.miraheze.org/wiki/Build/Tests
+       # TODO: Try switch to the generic 'test' target but tests hang
+       # with that.
+       emake unix-lib-test
+}
+
+src_install() {
+       use gui && dodir "${FONTDIR}"
+
+       emake DESTDIR="${D}" install{,.man}
+
+       use gui && font_src_install
+}
+
+pkg_postinst() {
+       use gui && font_pkg_postinst
+}
+
+pkg_postrm() {
+       use gui && font_pkg_postrm
+}

Reply via email to