expect: add v5.45.4 and fix build with Apple Clang (#21232)
This commit is contained in:
parent
3893ce8f71
commit
37bbe21692
@ -13,9 +13,11 @@ class Expect(AutotoolsPackage):
|
||||
telnet, ftp, passwd, fsck, rlogin, tip, etc."""
|
||||
|
||||
homepage = "http://expect.sourceforge.net/"
|
||||
url = "https://sourceforge.net/projects/expect/files/Expect/5.45/expect5.45.tar.gz/download"
|
||||
url = "https://sourceforge.net/projects/expect/files/Expect/5.45.4/expect5.45.4.tar.gz/download"
|
||||
|
||||
version('5.45', sha256='b28dca90428a3b30e650525cdc16255d76bb6ccd65d448be53e620d95d5cc040')
|
||||
version('5.45.4', sha256='49a7da83b0bdd9f46d04a04deec19c7767bb9a323e40c4781f89caf760b92c34')
|
||||
version('5.45.3', sha256='c520717b7195944a69ce1492ec82ca0ac3f3baf060804e6c5ee6d505ea512be9')
|
||||
version('5.45', sha256='b28dca90428a3b30e650525cdc16255d76bb6ccd65d448be53e620d95d5cc040')
|
||||
|
||||
depends_on('tcl')
|
||||
|
||||
@ -24,12 +26,10 @@ class Expect(AutotoolsPackage):
|
||||
depends_on('libtool', type='build')
|
||||
depends_on('m4', type='build')
|
||||
|
||||
# https://github.com/spack/spack/issues/19767
|
||||
conflicts('%apple-clang@12:')
|
||||
|
||||
force_autoreconf = True
|
||||
|
||||
patch('expect_detect_tcl_private_header_os_x_mountain_lion.patch', when='@5.45')
|
||||
patch('xcode_12.patch', when='%apple-clang@12:')
|
||||
patch('expect_detect_tcl_private_header_os_x_mountain_lion.patch', when='@5.45:5.45.0')
|
||||
|
||||
def configure_args(self):
|
||||
spec = self.spec
|
||||
|
282
var/spack/repos/builtin/packages/expect/xcode_12.patch
Normal file
282
var/spack/repos/builtin/packages/expect/xcode_12.patch
Normal file
@ -0,0 +1,282 @@
|
||||
https://core.tcl-lang.org/expect/tktview/0d5b33c00e5b4bbedb835498b0360d7115e832a0
|
||||
--- expect5.45.4/configure.in.ORIG 2020-12-05 17:26:55.000000000 +0000
|
||||
+++ expect5.45.4/configure.in 2020-12-05 18:39:00.000000000 +0000
|
||||
@@ -452,7 +452,11 @@
|
||||
# because Unixware 2.0 handles it specially and refuses to compile
|
||||
# autoconf's automatic test that is a call with no arguments
|
||||
AC_MSG_CHECKING([for memcpy])
|
||||
-AC_TRY_LINK(,[
|
||||
+AC_TRY_LINK([
|
||||
+#ifdef HAVE_STRING_H
|
||||
+#include <string.h>
|
||||
+#endif
|
||||
+],[
|
||||
char *s1, *s2;
|
||||
memcpy(s1,s2,0);
|
||||
],
|
||||
@@ -469,7 +473,7 @@
|
||||
AC_MSG_CHECKING([if WNOHANG requires _POSIX_SOURCE])
|
||||
AC_TRY_RUN([
|
||||
#include <sys/wait.h>
|
||||
-main() {
|
||||
+int main() {
|
||||
#ifndef WNOHANG
|
||||
return 0;
|
||||
#else
|
||||
@@ -489,7 +493,7 @@
|
||||
AC_TRY_RUN([
|
||||
#include <stdio.h>
|
||||
#include <sys/wait.h>
|
||||
-main() {
|
||||
+int main() {
|
||||
#ifdef WNOHANG
|
||||
FILE *fp = fopen("wnohang","w");
|
||||
fprintf(fp,"%d",WNOHANG);
|
||||
@@ -536,6 +540,13 @@
|
||||
AC_MSG_CHECKING([if signals need to be re-armed])
|
||||
AC_TRY_RUN([
|
||||
#include <signal.h>
|
||||
+#ifdef HAVE_UNISTD_H
|
||||
+#include <unistd.h>
|
||||
+#endif
|
||||
+#ifndef NO_SYS_WAIT_H
|
||||
+#include <sys/wait.h>
|
||||
+#endif
|
||||
+
|
||||
#define RETSIGTYPE $retsigtype
|
||||
|
||||
int signal_rearms = 0;
|
||||
@@ -553,7 +564,7 @@
|
||||
signal_rearms++;
|
||||
}
|
||||
|
||||
-main()
|
||||
+int main()
|
||||
{
|
||||
signal(SIGINT,parent_sigint_handler);
|
||||
|
||||
@@ -567,8 +578,9 @@
|
||||
|
||||
wait(&status);
|
||||
unlink("core");
|
||||
- exit(signal_rearms);
|
||||
+ return signal_rearms;
|
||||
}
|
||||
+ return -1;
|
||||
}],
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(REARM_SIG)
|
||||
@@ -714,10 +726,10 @@
|
||||
AC_MSG_CHECKING([for struct sgttyb])
|
||||
AC_TRY_RUN([
|
||||
#include <sgtty.h>
|
||||
-main()
|
||||
+int main()
|
||||
{
|
||||
struct sgttyb tmp;
|
||||
- exit(0);
|
||||
+ return 0;
|
||||
}],
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_SGTTYB)
|
||||
@@ -738,10 +750,10 @@
|
||||
# pty_termios.c is set up to handle pty_termio.
|
||||
AC_MSG_CHECKING([for struct termio])
|
||||
AC_TRY_RUN([#include <termio.h>
|
||||
- main()
|
||||
+ int main()
|
||||
{
|
||||
struct termio tmp;
|
||||
- exit(0);
|
||||
+ return 0;
|
||||
}],
|
||||
AC_DEFINE(HAVE_TERMIO)
|
||||
PTY_TYPE=termios
|
||||
@@ -760,10 +772,10 @@
|
||||
# include <inttypes.h>
|
||||
# endif
|
||||
# include <termios.h>
|
||||
- main()
|
||||
+ int main()
|
||||
{
|
||||
struct termios tmp;
|
||||
- exit(0);
|
||||
+ return 0;
|
||||
}],
|
||||
AC_DEFINE(HAVE_TERMIOS)
|
||||
PTY_TYPE=termios
|
||||
@@ -782,7 +794,7 @@
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
#include <termios.h>
|
||||
-main() {
|
||||
+int main() {
|
||||
#if defined(TCGETS) || defined(TCGETA)
|
||||
return 0;
|
||||
#else
|
||||
@@ -797,21 +809,18 @@
|
||||
AC_MSG_ERROR([Expect can't be cross compiled])
|
||||
)
|
||||
|
||||
-AC_MSG_CHECKING([if TIOCGWINSZ in termios.h])
|
||||
+AC_MSG_CHECKING([if termios.h and sys/ioctl.h may both be included])
|
||||
AC_TRY_RUN([
|
||||
/* including termios.h on Solaris 5.6 fails unless inttypes.h included */
|
||||
#ifdef HAVE_INTTYPES_H
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
#include <termios.h>
|
||||
-main() {
|
||||
-#ifdef TIOCGWINSZ
|
||||
+#include <sys/ioctl.h>
|
||||
+int main() {
|
||||
return 0;
|
||||
-#else
|
||||
- return 1;
|
||||
-#endif
|
||||
}],
|
||||
- AC_DEFINE(HAVE_TIOCGWINSZ_IN_TERMIOS_H)
|
||||
+ AC_DEFINE(HAVE_TERMIOS_AND_IOCTL_H_TOGETHER)
|
||||
AC_MSG_RESULT(yes)
|
||||
,
|
||||
AC_MSG_RESULT(no)
|
||||
@@ -823,7 +832,7 @@
|
||||
AC_MSG_CHECKING([for Cray-style ptys])
|
||||
SETUID=":"
|
||||
AC_TRY_RUN([
|
||||
-main(){
|
||||
+int main(){
|
||||
#ifdef CRAY
|
||||
return 0;
|
||||
#else
|
||||
@@ -878,12 +887,12 @@
|
||||
AC_TRY_RUN([
|
||||
extern char *tzname[2];
|
||||
extern int daylight;
|
||||
-main()
|
||||
+int main()
|
||||
{
|
||||
int *x = &daylight;
|
||||
char **y = tzname;
|
||||
|
||||
- exit(0);
|
||||
+ return 0;
|
||||
}],
|
||||
AC_DEFINE(HAVE_SV_TIMEZONE)
|
||||
AC_MSG_RESULT(yes),
|
||||
--- expect5.45.4/tclconfig/tcl.m4.ORIG 2020-12-05 17:31:41.000000000 +0000
|
||||
+++ expect5.45.4/tclconfig/tcl.m4 2020-12-05 17:32:39.000000000 +0000
|
||||
@@ -2400,7 +2400,7 @@
|
||||
AC_TRY_COMPILE([#include <time.h>],
|
||||
[extern long timezone;
|
||||
timezone += 1;
|
||||
- exit (0);],
|
||||
+ return 0;],
|
||||
tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no)])
|
||||
if test $tcl_cv_timezone_long = yes ; then
|
||||
AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?])
|
||||
@@ -2412,7 +2412,7 @@
|
||||
AC_TRY_COMPILE([#include <time.h>],
|
||||
[extern time_t timezone;
|
||||
timezone += 1;
|
||||
- exit (0);],
|
||||
+ return 0;],
|
||||
tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no)])
|
||||
if test $tcl_cv_timezone_time = yes ; then
|
||||
AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?])
|
||||
@@ -2452,17 +2452,17 @@
|
||||
double value;
|
||||
value = strtod(infString, &term);
|
||||
if ((term != infString) && (term[-1] == 0)) {
|
||||
- exit(1);
|
||||
+ return 1;
|
||||
}
|
||||
value = strtod(nanString, &term);
|
||||
if ((term != nanString) && (term[-1] == 0)) {
|
||||
- exit(1);
|
||||
+ return 1;
|
||||
}
|
||||
value = strtod(spaceString, &term);
|
||||
if (term == (spaceString+1)) {
|
||||
- exit(1);
|
||||
+ return 1;
|
||||
}
|
||||
- exit(0);
|
||||
+ return 0;
|
||||
}], tcl_cv_strtod_buggy=ok, tcl_cv_strtod_buggy=buggy,
|
||||
tcl_cv_strtod_buggy=buggy)])
|
||||
if test "$tcl_cv_strtod_buggy" = buggy; then
|
||||
--- expect5.45.4/exp_tty.h.ORIG 2020-12-05 18:25:06.000000000 +0000
|
||||
+++ expect5.45.4/exp_tty.h 2020-12-05 18:24:14.000000000 +0000
|
||||
@@ -19,6 +19,7 @@
|
||||
void exp_tty_echo(int set);
|
||||
void exp_tty_break(Tcl_Interp *interp, int fd);
|
||||
int exp_tty_raw_noecho(Tcl_Interp *interp, exp_tty *tty_old, int *was_raw, int *was_echo);
|
||||
+int exp_tty_cooked_echo(Tcl_Interp *interp, exp_tty *tty_old, int *was_raw, int *was_echo);
|
||||
int exp_israw(void);
|
||||
int exp_isecho(void);
|
||||
|
||||
--- expect5.45.4/exp_chan.c.ORIG 2020-12-05 18:42:14.000000000 +0000
|
||||
+++ expect5.45.4/exp_chan.c 2020-12-05 18:42:36.000000000 +0000
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "exp_prog.h"
|
||||
#include "exp_command.h"
|
||||
#include "exp_log.h"
|
||||
+#include "exp_event.h"
|
||||
#include "tcldbg.h" /* Dbg_StdinMode */
|
||||
|
||||
extern int expSetBlockModeProc _ANSI_ARGS_((int fd, int mode));
|
||||
--- expect5.45.4/exp_clib.c.ORIG 2020-12-05 18:40:52.000000000 +0000
|
||||
+++ expect5.45.4/exp_clib.c 2020-12-05 18:41:18.000000000 +0000
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "expect_cf.h"
|
||||
+#include "exp_command.h"
|
||||
#include <stdio.h>
|
||||
#include <setjmp.h>
|
||||
#ifdef HAVE_INTTYPES_H
|
||||
--- expect5.45.4/exp_win.c.ORIG 2020-12-05 18:27:20.000000000 +0000
|
||||
+++ expect5.45.4/exp_win.c 2020-12-05 18:33:24.000000000 +0000
|
||||
@@ -32,17 +32,13 @@
|
||||
|
||||
#ifdef HAVE_TERMIOS
|
||||
# include <termios.h>
|
||||
+# ifdef HAVE_TERMIOS_AND_IOCTL_H_TOGETHER
|
||||
+# include <sys/ioctl.h>
|
||||
+# endif
|
||||
#else
|
||||
# include <sys/ioctl.h>
|
||||
#endif
|
||||
|
||||
-/* Sigh. On AIX 2.3, termios.h exists but does not define TIOCGWINSZ */
|
||||
-/* Instead, it has to come from ioctl.h. However, As I said above, this */
|
||||
-/* can't be cavalierly included on all machines, even when it exists. */
|
||||
-#if defined(HAVE_TERMIOS) && !defined(HAVE_TIOCGWINSZ_IN_TERMIOS_H)
|
||||
-# include <sys/ioctl.h>
|
||||
-#endif
|
||||
-
|
||||
/* SCO defines window size structure in PTEM and TIOCGWINSZ in termio.h */
|
||||
/* Sigh... */
|
||||
#if defined(HAVE_SYS_PTEM_H)
|
||||
--- expect5.45.4/pty_termios.c.ORIG 2020-12-05 18:43:05.000000000 +0000
|
||||
+++ expect5.45.4/pty_termios.c 2020-12-05 18:45:20.000000000 +0000
|
||||
@@ -77,6 +77,10 @@
|
||||
#include <sys/sysmacros.h>
|
||||
#endif
|
||||
|
||||
+#ifdef HAVE_OPENPTY
|
||||
+#include <util.h>
|
||||
+#endif
|
||||
+
|
||||
#ifdef HAVE_PTYTRAP
|
||||
#include <sys/ptyio.h>
|
||||
#endif
|
||||
@@ -102,6 +106,7 @@
|
||||
#include "exp_tty_in.h"
|
||||
#include "exp_rename.h"
|
||||
#include "exp_pty.h"
|
||||
+#include "exp_int.h"
|
||||
|
||||
void expDiagLog();
|
||||
void expDiagLogPtr();
|
Loading…
Reference in New Issue
Block a user