summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-11-17 20:29:00 +0000
committerSam James <sam@gentoo.org>2022-11-17 20:37:41 +0000
commit0af114cd7cd6a228aaf9c6b370e3614c671fab42 (patch)
tree1f0fbd1b6c0bcd8dc0bf55062b5935da91c5c465 /dev-tcltk
parentpackage.mask: Last rite dev-python/gevent* (diff)
downloadgentoo-0af114cd7cd6a228aaf9c6b370e3614c671fab42.tar.gz
gentoo-0af114cd7cd6a228aaf9c6b370e3614c671fab42.tar.bz2
gentoo-0af114cd7cd6a228aaf9c6b370e3614c671fab42.zip
dev-tcltk/expect: fix clang 16; EAPI 8; fix test deps
Closes: https://bugs.gentoo.org/881687 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-tcltk')
-rw-r--r--dev-tcltk/expect/expect-5.45.4-r4.ebuild79
-rw-r--r--dev-tcltk/expect/files/expect-5.45.4-configure-clang16.patch223
2 files changed, 302 insertions, 0 deletions
diff --git a/dev-tcltk/expect/expect-5.45.4-r4.ebuild b/dev-tcltk/expect/expect-5.45.4-r4.ebuild
new file mode 100644
index 000000000000..0241b8c3bc92
--- /dev/null
+++ b/dev-tcltk/expect/expect-5.45.4-r4.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools edo flag-o-matic
+
+MY_P="${PN}${PV}"
+DESCRIPTION="tool for automating interactive applications"
+HOMEPAGE="https://core.tcl-lang.org/expect/"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
+S="${WORKDIR}"/${MY_P}
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris ~x86-solaris"
+IUSE="debug doc test threads"
+RESTRICT="!test? ( test )"
+
+DEPEND=">=dev-lang/tcl-8.2:=[threads?]"
+RDEPEND="${DEPEND}"
+BDEPEND="test? ( dev-util/dejagnu )"
+
+PATCHES=( "${FILESDIR}"/${P}-examples.patch )
+
+src_prepare() {
+ default
+ sed -i "s:/usr/local/bin:${EPREFIX}/usr/bin:" expect.man || die
+
+ eapply "${FILESDIR}"/${PN}-5.45-gfbsd.patch
+ eapply "${FILESDIR}"/${PN}-5.44.1.15-ldflags.patch
+ eapply "${FILESDIR}"/${PN}-5.45-headers.patch #337943
+ eapply "${FILESDIR}"/${PN}-5.45-format-security.patch
+ eapply "${FILESDIR}"/${PN}-5.45.4-configure-in.patch
+ eapply "${FILESDIR}"/${PN}-5.45.4-configure-clang16.patch || die
+
+ sed -i 's:ifdef HAVE_SYS_WAIT_H:ifndef NO_SYS_WAIT_H:' *.c || die
+
+ # fix install_name on darwin
+ [[ ${CHOST} == *-darwin* ]] && \
+ eapply "${FILESDIR}"/${P}-darwin-install_name.patch
+
+ mv configure.{in,ac} || die
+
+ eautoconf
+}
+
+src_configure() {
+ # bug #881687
+ append-flags -std=gnu89
+
+ # the 64bit flag is useless ... it only adds 64bit compiler flags
+ # (like -m64) which the target toolchain should already handle
+ econf \
+ --with-tcl="${EPREFIX}/usr/$(get_libdir)" \
+ --disable-64bit \
+ --enable-shared \
+ $(use_enable threads) \
+ $(use_enable debug symbols mem)
+}
+
+expect_make_var() {
+ touch pkgIndex.tcl-hand || die
+ printf 'all:;echo $('$1')\ninclude Makefile' | emake --no-print-directory -s -f -
+ rm -f pkgIndex.tcl-hand || die
+}
+
+src_install() {
+ default
+
+ if use doc ; then
+ docinto examples
+
+ edo dodoc \
+ example/README \
+ $(printf 'example/%s ' $(expect_make_var _SCRIPTS)) \
+ $(printf 'example/%s.man ' $(expect_make_var _SCRIPTS_MANPAGES))
+ fi
+}
diff --git a/dev-tcltk/expect/files/expect-5.45.4-configure-clang16.patch b/dev-tcltk/expect/files/expect-5.45.4-configure-clang16.patch
new file mode 100644
index 000000000000..5d40e5ddf684
--- /dev/null
+++ b/dev-tcltk/expect/files/expect-5.45.4-configure-clang16.patch
@@ -0,0 +1,223 @@
+From 4c3a5051aa9706eea42dab31f9e121d975c08521 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Thu, 17 Nov 2022 20:20:45 +0000
+Subject: [PATCH] Fix configure with clang 16
+
+Bug: https://bugs.gentoo.org/881687
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/configure.in
++++ b/configure.in
+@@ -454,7 +454,7 @@ AC_CHECK_FUNC(siglongjmp, AC_DEFINE(HAVE_SIGLONGJMP))
+ # 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([#include <string.h>],[
+ char *s1, *s2;
+ memcpy(s1,s2,0);
+ ],
+@@ -471,7 +471,7 @@ memcpy(s1,s2,0);
+ AC_MSG_CHECKING([if WNOHANG requires _POSIX_SOURCE])
+ AC_TRY_RUN([
+ #include <sys/wait.h>
+-main() {
++int main(void) {
+ #ifndef WNOHANG
+ return 0;
+ #else
+@@ -491,7 +491,7 @@ rm -rf wnohang
+ AC_TRY_RUN([
+ #include <stdio.h>
+ #include <sys/wait.h>
+-main() {
++int main(void) {
+ #ifdef WNOHANG
+ FILE *fp = fopen("wnohang","w");
+ fprintf(fp,"%d",WNOHANG);
+@@ -540,24 +540,23 @@ dnl AC_HEADER_EGREP([(void|sighandler_t).*signal], signal.h, retsigtype=void,AC_
+ AC_MSG_CHECKING([if signals need to be re-armed])
+ AC_TRY_RUN([
+ #include <signal.h>
+-#define RETSIGTYPE $retsigtype
+-
++#include <stdlib.h>
++#include <sys/wait.h>
++#include <unistd.h>
+ int signal_rearms = 0;
+
+ RETSIGTYPE
+-child_sigint_handler(n)
+-int n;
++child_sigint_handler(int n)
+ {
+ }
+
+ RETSIGTYPE
+-parent_sigint_handler(n)
+-int n;
++parent_sigint_handler(int n)
+ {
+ signal_rearms++;
+ }
+
+-main()
++int main(void)
+ {
+ signal(SIGINT,parent_sigint_handler);
+
+@@ -719,7 +718,8 @@ fi
+ AC_MSG_CHECKING([for struct sgttyb])
+ AC_TRY_RUN([
+ #include <sgtty.h>
+-main()
++#include <stdlib.h>
++int main(void)
+ {
+ struct sgttyb tmp;
+ exit(0);
+@@ -745,7 +745,8 @@ if test $mach -eq 0 ; then
+ # pty_termios.c is set up to handle pty_termio.
+ AC_MSG_CHECKING([for struct termio])
+ AC_TRY_RUN([#include <termio.h>
+- main()
++ #include <stdlib.h>
++ int main(void)
+ {
+ struct termio tmp;
+ exit(0);
+@@ -769,7 +770,8 @@ if test $mach -eq 0 ; then
+ # include <inttypes.h>
+ # endif
+ # include <termios.h>
+- main()
++# include <stdlib.h>
++ int main(void)
+ {
+ struct termios tmp;
+ exit(0);
+@@ -793,7 +795,7 @@ AC_TRY_RUN([
+ #include <inttypes.h>
+ #endif
+ #include <termios.h>
+-main() {
++int main(void) {
+ #if defined(TCGETS) || defined(TCGETA)
+ return 0;
+ #else
+@@ -815,7 +817,7 @@ AC_TRY_RUN([
+ #include <inttypes.h>
+ #endif
+ #include <termios.h>
+-main() {
++int main(void) {
+ #ifdef TIOCGWINSZ
+ return 0;
+ #else
+@@ -834,7 +836,7 @@ main() {
+ AC_MSG_CHECKING([for Cray-style ptys])
+ SETUID=":"
+ AC_TRY_RUN([
+-main(){
++int main(void) {
+ #ifdef CRAY
+ return 0;
+ #else
+@@ -887,9 +889,10 @@ AC_FUNC_SETPGRP
+ #
+ AC_MSG_CHECKING([for SV-style timezone])
+ AC_TRY_RUN([
++#include <stdlib.h>
+ extern char *tzname[2];
+ extern int daylight;
+-main()
++int main(void)
+ {
+ int *x = &daylight;
+ char **y = tzname;
+--- a/tclconfig/tcl.m4
++++ b/tclconfig/tcl.m4
+@@ -2029,7 +2029,7 @@ AC_DEFUN([TEA_SERIAL_PORT], [
+ AC_TRY_RUN([
+ #include <termios.h>
+
+-int main() {
++int main(void) {
+ struct termios t;
+ if (tcgetattr(0, &t) == 0) {
+ cfsetospeed(&t, 0);
+@@ -2042,7 +2042,7 @@ int main() {
+ AC_TRY_RUN([
+ #include <termio.h>
+
+-int main() {
++int main(void) {
+ struct termio t;
+ if (ioctl(0, TCGETA, &t) == 0) {
+ t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
+@@ -2055,7 +2055,7 @@ int main() {
+ AC_TRY_RUN([
+ #include <sgtty.h>
+
+-int main() {
++int main(void) {
+ struct sgttyb t;
+ if (ioctl(0, TIOCGETP, &t) == 0) {
+ t.sg_ospeed = 0;
+@@ -2070,7 +2070,7 @@ int main() {
+ #include <termios.h>
+ #include <errno.h>
+
+-int main() {
++int main(void) {
+ struct termios t;
+ if (tcgetattr(0, &t) == 0
+ || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
+@@ -2086,7 +2086,7 @@ int main() {
+ #include <termio.h>
+ #include <errno.h>
+
+-int main() {
++int main(void) {
+ struct termio t;
+ if (ioctl(0, TCGETA, &t) == 0
+ || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
+@@ -2101,7 +2101,7 @@ int main() {
+ #include <sgtty.h>
+ #include <errno.h>
+
+-int main() {
++int main(void) {
+ struct sgttyb t;
+ if (ioctl(0, TIOCGETP, &t) == 0
+ || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
+@@ -2392,7 +2392,9 @@ AC_DEFUN([TEA_TIME_HANDLER], [
+ # (like convex) have timezone functions, etc.
+ #
+ AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long, [
+- AC_TRY_COMPILE([#include <time.h>],
++ AC_TRY_COMPILE([#include <time.h>
++ #include <stdlib.h>
++ ],
+ [extern long timezone;
+ timezone += 1;
+ exit (0);],
+@@ -2404,7 +2406,9 @@ AC_DEFUN([TEA_TIME_HANDLER], [
+ # On some systems (eg IRIX 6.2), timezone is a time_t and not a long.
+ #
+ AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time, [
+- AC_TRY_COMPILE([#include <time.h>],
++ AC_TRY_COMPILE([#include <time.h>
++ #include <stdlib.h>
++ ],
+ [extern time_t timezone;
+ timezone += 1;
+ exit (0);],
+@@ -2441,7 +2445,7 @@ AC_DEFUN([TEA_BUGGY_STRTOD], [
+ AC_CACHE_CHECK([for Solaris2.4/Tru64 strtod bugs], tcl_cv_strtod_buggy,[
+ AC_TRY_RUN([
+ extern double strtod();
+- int main() {
++ int main(void) {
+ char *infString="Inf", *nanString="NaN", *spaceString=" ";
+ char *term;
+ double value;