net-misc/tn5250: Fix building against sys-libs/ncurses[tinfo] (bug #596314).
authorJeroen Roovers <jer@gentoo.org>
Fri, 2 Mar 2018 10:49:00 +0000 (11:49 +0100)
committerJeroen Roovers <jer@gentoo.org>
Fri, 2 Mar 2018 10:49:20 +0000 (11:49 +0100)
- Drop USE=X (configure: WARNING: unrecognized options: --with-x)
- Drop weird build-time only dependency on x11-libs/libXt
- Name patches properly.
- Add IUSE=static-libs instead of --disable-static
- Add linux/Makefile.am patch instead of sedding Makefile.in
- Use ltprune.eclass instead of eutils.eclass

Package-Manager: Portage-2.3.24, Repoman-2.3.6

net-misc/tn5250/files/tn5250-0.17.4-disable-sslv2-and-sslv3.patch [moved from net-misc/tn5250/files/disable-sslv2-and-sslv3.patch with 100% similarity]
net-misc/tn5250/files/tn5250-0.17.4-fix-Wformat-security-warnings.patch [moved from net-misc/tn5250/files/fix-Wformat-security-warnings.patch with 100% similarity]
net-misc/tn5250/files/tn5250-0.17.4-tinfo.patch [new file with mode: 0644]
net-misc/tn5250/files/tn5250-0.17.4-whoami.patch [new file with mode: 0644]
net-misc/tn5250/tn5250-0.17.4-r2.ebuild

diff --git a/net-misc/tn5250/files/tn5250-0.17.4-tinfo.patch b/net-misc/tn5250/files/tn5250-0.17.4-tinfo.patch
new file mode 100644 (file)
index 0000000..46469c4
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -64,6 +64,7 @@
+                       AC_MSG_ERROR([** You need a curses-compatible library installed.])
+               fi
+       fi
++      AC_SEARCH_LIBS(stdscr, tinfo, [CURSES_LIB="$CURSES_LIB -ltinfo"])
+       AC_SUBST([CURSES_LIB])
+         if test "$ac_cv_use_old_keys" != "yes";
+         then
diff --git a/net-misc/tn5250/files/tn5250-0.17.4-whoami.patch b/net-misc/tn5250/files/tn5250-0.17.4-whoami.patch
new file mode 100644 (file)
index 0000000..fbcece2
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/linux/Makefile.am
++++ b/linux/Makefile.am
+@@ -18,10 +18,6 @@
+         if [ "$$(uname -s)" = "Linux" ]; then \
+             if which tic >/dev/null 2>&1 ; then \
+             if [ "`whoami`" = "root" ]; then \
+-              rm -f /usr/share/terminfo/x/xterm-5250 ; \
+-              rm -f /usr/share/terminfo/5/5250 ; \
+-              rm -f /usr/lib/terminfo/x/xterm-5250 ; \
+-              rm -f /usr/lib/terminfo/5/5250 ; \
+               good=yes ; \
+               tic $(srcdir)/5250.terminfo || good=no ; \
+             else \
index 3bcbdbd72cb69352a60502fb4d29f3f5840e1757..f3cfbf0f6174a32b34ebd1d847e7511c6e50d664 100644 (file)
@@ -1,8 +1,8 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
-inherit eutils
+inherit autotools ltprune
 
 DESCRIPTION="IBM AS/400 telnet client which emulates 5250 terminals/printers"
 HOMEPAGE="http://tn5250.sourceforge.net/"
@@ -11,7 +11,7 @@ SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
 LICENSE="LGPL-2.1"
 SLOT="0"
 KEYWORDS="~amd64 ~ppc ~sparc ~x86"
-IUSE="X libressl ssl"
+IUSE="libressl ssl static-libs"
 
 RDEPEND="
        sys-libs/ncurses:=
@@ -21,32 +21,27 @@ RDEPEND="
        )
 "
 
-DEPEND="${RDEPEND}
-       X? ( x11-libs/libXt )
+DEPEND="
+       ${RDEPEND}
 "
 
 PATCHES=(
-       "${FILESDIR}/disable-sslv2-and-sslv3.patch"
-       "${FILESDIR}/fix-Wformat-security-warnings.patch"
+       "${FILESDIR}"/${PN}-0.17.4-disable-sslv2-and-sslv3.patch
+       "${FILESDIR}"/${PN}-0.17.4-fix-Wformat-security-warnings.patch
+       "${FILESDIR}"/${PN}-0.17.4-tinfo.patch
+       "${FILESDIR}"/${PN}-0.17.4-whoami.patch
 )
 
 src_prepare() {
        default
-
-       # Next, the Makefile for the terminfo settings tries to remove
-       # some files it doesn't have access to.  We can just remove those
-       # lines.
-       sed -i \
-               -e "/rm -f \/usr\/.*\/terminfo.*5250/d" linux/Makefile.in \
-               || die "sed Makefile.in failed"
+       eautoreconf
 }
 
 src_configure() {
        econf \
-               --disable-static \
-               --without-python \
-               $(use_with X x) \
-               $(use_with ssl)
+               $(use_enable static-libs static) \
+               $(use_with ssl) \
+               --without-python
 }
 
 src_install() {