Skip to content

Commit 48d3400

Browse files
thesamesamflint2
authored andcommitted
net-misc/suite3270: add 4.4_p6
Made a start on tests but restricted. Signed-off-by: Sam James <[email protected]>
1 parent c8c7e73 commit 48d3400

File tree

3 files changed

+164
-0
lines changed

3 files changed

+164
-0
lines changed

net-misc/suite3270/Manifest

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
DIST suite3270-4.3ga6-src.tgz 13188235 BLAKE2B 2ca334b82cc42818ac9d0733a8d93f3b73e598f9de94e7166972d88079cfcf98877eb08587ac24e096f9b6457c96344abd37c4bb9d7af4f7e50c3ef191f82714 SHA512 5250d382185acb7f89cb2a6ff5050aa05be809e7bd2bbe25cf74bd3177ebba8ea24d990b3f20e308a5cffa8bdbd5d1c82ba956db76a2812b5ae42ea57602d2bd
2+
DIST suite3270-4.4ga6-src.tgz 14241642 BLAKE2B e156c7e2a79b60071ab32d9a3e30e6e287789e5941247abd9f93b03eccc4f21b182a9125fe192a0500f2cad4d5648d064406ab5f02958d597d0f04731ae60415 SHA512 5709fdb97057ceeb0b8fcc67153a8eeee1943595df7a2aeed48b9db43c067a2107df3bbe8fcf6e9a12b2d1d23d6ec7cd522dcbc974eef7419d59593199782321
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
Needed to ensure we pick up definitions from ncurses' pkg-config file
2+
like -DNCURSES_WIDECHAR (issue is observable on say, musl).
3+
--- a/x3270if/Makefile.obj.in
4+
+++ b/x3270if/Makefile.obj.in
5+
@@ -51,9 +51,9 @@ INSTALL_DATA = @INSTALL_DATA@
6+
7+
CCOPTIONS = @CCOPTIONS@
8+
XCPPFLAGS = -I$(THIS) -I$(TOP)/include -I$(TOP)/Common/x3270if @CPPFLAGS@
9+
-override CFLAGS += $(CCOPTIONS) $(CDEBUGFLAGS) $(XCPPFLAGS) @CFLAGS@
10+
+override CFLAGS += $(CCOPTIONS) $(CDEBUGFLAGS) $(XCPPFLAGS) @ncurses_CFLAGS@ @CFLAGS@
11+
LDFLAGS = @LDFLAGS@
12+
-LIBS = @LIBS@
13+
+LIBS = @LIBS@ @ncurses_LIBS@
14+
15+
XVERSION = xversion.c
16+
version.o: mkversion.py $(VOBJS) version.txt
17+
--- a/x3270if/configure.in
18+
+++ b/x3270if/configure.in
19+
@@ -76,6 +76,9 @@ if test "$with_readline" != no; then
20+
fi
21+
AC_CHECK_HEADERS(readline/history.h)
22+
fi
23+
+
24+
+dnl Try pkg-config first, and if it fails, try the traditional methods.
25+
+PKG_CHECK_MODULES([ncurses], [ncursesw], [AC_DEFINE([HAVE_NCURSESW_NCURSES_H] ,[1]) AC_DEFINE([HAVE_NCURSESW_TERM_H], [1])], [
26+
dnl Find the best curses header file and hope it's consistent with the library
27+
dnl we found.
28+
AC_CHECK_HEADERS(ncursesw/ncurses.h, ,
29+
@@ -86,15 +89,16 @@ AC_CHECK_HEADERS(ncursesw/term.h, ,
30+
[AC_CHECK_HEADERS(ncurses/term.h, ,
31+
[AC_CHECK_HEADERS(term.h)])])
32+
33+
+AC_SEARCH_LIBS(newterm, ncursesw ncurses curses, , [AC_MSG_ERROR(Can't find libncurses or new-enough libcurses)])
34+
+AC_SEARCH_LIBS(setupterm, tinfow tinfo, , [AC_MSG_ERROR(Can't find terminfo library)])
35+
+AC_CHECK_FUNCS(tiparm)])
36+
+
37+
dnl Check for --without-readline
38+
AC_ARG_WITH(readline, [ --without-readline Don't use the readline library])
39+
40+
dnl Checks for library functions.
41+
AC_CHECK_FUNCS(vasprintf)
42+
AC_FUNC_FSEEKO
43+
-AC_SEARCH_LIBS(newterm, ncursesw ncurses curses)
44+
-AC_SEARCH_LIBS(setupterm, tinfow tinfo)
45+
-AC_CHECK_FUNCS(tiparm)
46+
if test "$with_readline" != no; then
47+
if test -n "$with_readline" -a "$with_readline" != yes; then
48+
dnl Use the speficied readline install path.
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# Copyright 1999-2025 Gentoo Authors
2+
# Distributed under the terms of the GNU General Public License v2
3+
4+
EAPI=8
5+
6+
MY_PV=${PV/_p/ga}
7+
MY_P=${PN}-${MY_PV}
8+
SUB_PV=${PV:0:3}
9+
S="${WORKDIR}"/${PN}-${SUB_PV}
10+
11+
# Only the x3270 package installs fonts
12+
FONT_PN="x3270"
13+
FONT_S="${S}"/${FONT_PN}
14+
15+
PYTHON_COMPAT=( python3_{11..14} )
16+
inherit autotools font python-any-r1
17+
18+
DESCRIPTION="Complete 3270 (S390) access package"
19+
HOMEPAGE="http://x3270.bgp.nu/"
20+
SRC_URI="https://downloads.sourceforge.net/x3270/${MY_P}-src.tgz"
21+
22+
LICENSE="GPL-2"
23+
SLOT="0"
24+
KEYWORDS="~amd64 ~ppc ~s390 ~sparc ~x86"
25+
IUSE="cjk doc gui ncurses ssl tcl"
26+
# json_test fails on an obvious assert?
27+
RESTRICT="test"
28+
29+
RDEPEND="
30+
gui? (
31+
x11-libs/libX11
32+
x11-libs/libXaw
33+
x11-libs/libXmu
34+
x11-libs/libXt
35+
)
36+
ssl? ( dev-libs/openssl:= )
37+
ncurses? (
38+
sys-libs/ncurses:=
39+
sys-libs/readline:=
40+
)
41+
tcl? ( dev-lang/tcl:= )
42+
"
43+
DEPEND="
44+
${RDEPEND}
45+
gui? ( x11-base/xorg-proto )
46+
"
47+
BDEPEND="
48+
${PYTHON_DEPS}
49+
gui? (
50+
x11-apps/bdftopcf
51+
>=x11-apps/mkfontscale-1.2.0
52+
x11-misc/xbitmaps
53+
)
54+
"
55+
56+
PATCHES=(
57+
"${FILESDIR}"/${PN}-4.1-musl-wint-t-fix.patch
58+
"${FILESDIR}"/${PN}-4.4_p6-ncurses-pkg-config.patch
59+
)
60+
61+
src_prepare() {
62+
default
63+
64+
# Some subdirs (like c3270/x3270/s3270) install the same set of data files
65+
# (they have the same contents). Wrap that in a retry to avoid errors.
66+
cat <<-EOF > _install || die
67+
#!/bin/sh
68+
for n in 1 2 3 4 5; do
69+
install "\$@" && exit
70+
echo "retrying ..."
71+
done
72+
exit 1
73+
EOF
74+
chmod a+rx _install || die
75+
# Can't use the ${INSTALL} var as top level configure also uses it.
76+
# https://sourceforge.net/p/x3270/bugs/15/
77+
export ac_cv_path_install="${S}"/_install
78+
79+
AT_NOEAUTOHEADER=yes eautoreconf
80+
}
81+
82+
src_configure() {
83+
econf \
84+
--cache-file="${S}"/config.cache \
85+
--enable-s3270 \
86+
--enable-pr3287 \
87+
$(use_enable ncurses c3270) \
88+
$(use_enable tcl tcl3270) \
89+
$(use_enable gui x3270) \
90+
$(use_with gui x) \
91+
$(use_with gui fontdir "${FONTDIR}")
92+
}
93+
94+
src_test() {
95+
# https://x3270.miraheze.org/wiki/Build/Tests
96+
# TODO: Try switch to the generic 'test' target but tests hang
97+
# with that.
98+
emake unix-lib-test
99+
}
100+
101+
src_install() {
102+
use gui && dodir "${FONTDIR}"
103+
104+
emake DESTDIR="${D}" install{,.man}
105+
106+
use gui && font_src_install
107+
}
108+
109+
pkg_postinst() {
110+
use gui && font_pkg_postinst
111+
}
112+
113+
pkg_postrm() {
114+
use gui && font_pkg_postrm
115+
}

0 commit comments

Comments
 (0)