From 490f11dbec781de92a0dcdfe6d47efddbf121d42 Mon Sep 17 00:00:00 2001 From: termux-pacman-bot Date: Tue, 2 Dec 2025 00:50:59 +0000 Subject: [PATCH] fix(main/zssh): fix build by applying patches from Arch Linux - Patches copied and pasted from https://gitlab.archlinux.org/archlinux/packaging/packages/zssh/-/tree/c0eba9c489345c61f83b880a1ae8b0fdfda2ddae/ --- packages/zssh/build.sh | 2 +- ...5c-Use-GNU-openpty-library-for-pty.h.patch | 53 +++++++++++++++++++ packages/zssh/zssh-1.5c-c99.patch | 22 ++++++++ ...ction-call-with-rl_completion_func_t.patch | 22 ++++++++ 4 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 packages/zssh/zssh-1.5c-Use-GNU-openpty-library-for-pty.h.patch create mode 100644 packages/zssh/zssh-1.5c-c99.patch create mode 100644 packages/zssh/zssh-1.5c-replace-CPPFunction-call-with-rl_completion_func_t.patch diff --git a/packages/zssh/build.sh b/packages/zssh/build.sh index 5c8dcd9d55..d507ab2222 100644 --- a/packages/zssh/build.sh +++ b/packages/zssh/build.sh @@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="A program for interactively transferring files to a remo TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="@termux" TERMUX_PKG_VERSION=1.5c -TERMUX_PKG_REVISION=1 +TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://downloads.sourceforge.net/zssh/zssh-${TERMUX_PKG_VERSION}.tgz TERMUX_PKG_SHA256=a2e840f82590690d27ea1ea1141af509ee34681fede897e58ae8d354701ce71b TERMUX_PKG_DEPENDS="libandroid-glob, lrzsz, openssh, readline" diff --git a/packages/zssh/zssh-1.5c-Use-GNU-openpty-library-for-pty.h.patch b/packages/zssh/zssh-1.5c-Use-GNU-openpty-library-for-pty.h.patch new file mode 100644 index 0000000000..be6f6f19f0 --- /dev/null +++ b/packages/zssh/zssh-1.5c-Use-GNU-openpty-library-for-pty.h.patch @@ -0,0 +1,53 @@ +From: Ben Wong +Date: Tue, 25 Sep 2007 01:48:30 -0700 +Subject: Use GNU openpty library for pty.h + +--- + configure.in | 11 +++++++++-- + openpty.c | 4 ++++ + 2 files changed, 13 insertions(+), 2 deletions(-) + +diff --git a/configure.in b/configure.in +index a8f1441..af2cad0 100644 +--- a/configure.in ++++ b/configure.in +@@ -57,7 +57,7 @@ AC_CONFIG_HEADER(config.h) + AC_HEADER_STDC + AC_HEADER_SYS_WAIT + AC_CHECK_HEADERS(fcntl.h paths.h sys/ioctl.h sys/time.h termios.h unistd.h \ +- err.h sys/cdefs.h sys/param.h util.h stropts.h) ++ err.h sys/cdefs.h sys/param.h util.h stropts.h pty.h) + + + +@@ -97,7 +97,14 @@ AC_CHECK_FUNCS(strdup getpt isastream tcsetpgrp) + + + dnl Check what is available for tty/pty allocation +-AC_CHECK_FUNCS(_getpty getpseudotty openpty grantpt unlockpt) ++AC_CHECK_FUNCS(_getpty getpseudotty grantpt unlockpt) ++AC_CHECK_FUNCS(openpty,, ++ [AC_CHECK_LIB(util,openpty, ++ [AC_DEFINE(HAVE_OPENPTY) ++ LIBS="$LIBS -lutil"] ++ )]) ++ ++ + AC_MSG_CHECKING(for pseudo ttys) + if test -c /dev/getpty && test $ac_cv_func_getpseudotty = yes + then +diff --git a/openpty.c b/openpty.c +index 42cb203..0b8a642 100644 +--- a/openpty.c ++++ b/openpty.c +@@ -25,6 +25,10 @@ static char gl_slavename[GL_SLAVENAMELEN + 1] = {0}; + #include + #endif + ++#ifdef HAVE_PTY_H ++#include ++#endif ++ + void getmaster() + { + #ifdef DEBUG diff --git a/packages/zssh/zssh-1.5c-c99.patch b/packages/zssh/zssh-1.5c-c99.patch new file mode 100644 index 0000000000..a051ba35f4 --- /dev/null +++ b/packages/zssh/zssh-1.5c-c99.patch @@ -0,0 +1,22 @@ +Add missing entry for HAVE_PTY_H in config.h. Without it, the +generated config.h will not define HAVE_PTY_H, and is not +included in openpty.c. This leads to an implicit declaration of the +openpty function, causing a C99 compatibility problem. + +This should go away on its own if upstream ever does a new upstream +release, as config.h.in is usually generated by autoheader. + +diff --git a/config.h.in b/config.h.in +index 2d863e29d64848bf..c2e0cc979dc0fa56 100644 +--- a/config.h.in ++++ b/config.h.in +@@ -79,6 +79,9 @@ + /* Define if you have the header file. */ + #undef HAVE_PATHS_H + ++/* Define if you have the header file. */ ++#undef HAVE_PTY_H ++ + /* Define if you have the header file. */ + #undef HAVE_READLINE_HISTORY_H + diff --git a/packages/zssh/zssh-1.5c-replace-CPPFunction-call-with-rl_completion_func_t.patch b/packages/zssh/zssh-1.5c-replace-CPPFunction-call-with-rl_completion_func_t.patch new file mode 100644 index 0000000000..b555a20fbb --- /dev/null +++ b/packages/zssh/zssh-1.5c-replace-CPPFunction-call-with-rl_completion_func_t.patch @@ -0,0 +1,22 @@ +From: YuanQing Su +Date: Mon, 21 Jul 2014 08:22:29 +0000 +Subject: replace CPPFunction call with rl_completion_func_t + +This closes #741761. +--- + completion.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/completion.c b/completion.c +index 98e714a..de44329 100644 +--- a/completion.c ++++ b/completion.c +@@ -53,7 +53,7 @@ void initialize_readline() + so that if zssh_completion() fails nothing is completed */ + rl_completion_entry_function = fake_generator; + /* Tell the completer that we want a crack first. */ +- rl_attempted_completion_function = (CPPFunction *) zssh_completion; ++ rl_attempted_completion_function = (rl_completion_func_t *) zssh_completion; + + } +