From: sgn <sgn@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] expect: cross compile
Date: Fri, 03 Apr 2020 18:20:09 +0200 [thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-20605@inbox.vuxu.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 311 bytes --]
There is a new pull request by sgn against master on the void-packages repository
https://github.com/sgn/void-packages expect-cross-compile
https://github.com/void-linux/void-packages/pull/20605
expect: cross compile
A patch file from https://github.com/void-linux/void-packages/pull/20605.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-expect-cross-compile-20605.patch --]
[-- Type: text/x-diff, Size: 9725 bytes --]
From bc8e6a2db86b4df1e708a594121fefd7e941c77a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
<congdanhqx+sgn@gmail.com>
Date: Fri, 3 Apr 2020 23:01:46 +0700
Subject: [PATCH] expect: cross compile
---
srcpkgs/expect/patches/0001-init-CC.patch | 21 ++
...-cross-WNOHANG-requires-POSIX_SOURCE.patch | 41 ++++
.../patches/0003-cross-wnohang-value.patch | 56 +++++
srcpkgs/expect/patches/0004-cross-misc.patch | 195 ++++++++++++++++++
srcpkgs/expect/template | 8 +-
5 files changed, 320 insertions(+), 1 deletion(-)
create mode 100644 srcpkgs/expect/patches/0001-init-CC.patch
create mode 100644 srcpkgs/expect/patches/0002-cross-WNOHANG-requires-POSIX_SOURCE.patch
create mode 100644 srcpkgs/expect/patches/0003-cross-wnohang-value.patch
create mode 100644 srcpkgs/expect/patches/0004-cross-misc.patch
diff --git a/srcpkgs/expect/patches/0001-init-CC.patch b/srcpkgs/expect/patches/0001-init-CC.patch
new file mode 100644
index 00000000000..1069798a0de
--- /dev/null
+++ b/srcpkgs/expect/patches/0001-init-CC.patch
@@ -0,0 +1,21 @@
+From: Đoàn Trần Công Danh <congdanhqx@gmail.com>
+---
+ configure.in | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git configure.in configure.in
+index aa6fd6e..ad8db32 100755
+--- configure.in
++++ configure.in
+@@ -9,6 +9,8 @@ TEA_INIT([3.9])
+
+ AC_CONFIG_AUX_DIR(tclconfig)
+
++AC_PROG_CC([cc gcc])
++
+ #--------------------------------------------------------------------
+ # Configure script for package 'Expect'.
+ # TEA compliant.
+--
+2.26.0.292.g33ef6b2f38
+
diff --git a/srcpkgs/expect/patches/0002-cross-WNOHANG-requires-POSIX_SOURCE.patch b/srcpkgs/expect/patches/0002-cross-WNOHANG-requires-POSIX_SOURCE.patch
new file mode 100644
index 00000000000..b1fb36b53ae
--- /dev/null
+++ b/srcpkgs/expect/patches/0002-cross-WNOHANG-requires-POSIX_SOURCE.patch
@@ -0,0 +1,41 @@
+From: Đoàn Trần Công Danh <congdanhqx@gmail.com>
+---
+ configure.in | 16 +++++++---------
+ 1 file changed, 7 insertions(+), 9 deletions(-)
+
+diff --git configure.in configure.in
+index ad8db32..6570a07 100755
+--- configure.in
++++ configure.in
+@@ -469,21 +469,19 @@ memcpy(s1,s2,0);
+ # and if so that WNOHANG is not defined. The only place I've
+ # seen this is ISC.
+ AC_MSG_CHECKING([if WNOHANG requires _POSIX_SOURCE])
+-AC_TRY_RUN([
++AC_COMPILE_IFELSE([
++AC_LANG_PROGRAM([[
+ #include <sys/wait.h>
+-main() {
+-#ifndef WNOHANG
+- return 0;
+-#else
+- return 1;
++]],[[
++#ifdef WNOHANG
++ #error WNOHANG
+ #endif
+-}],
++]])]
++,
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(WNOHANG_REQUIRES_POSIX_SOURCE)
+ ,
+ AC_MSG_RESULT(no)
+-,
+- AC_MSG_ERROR([Expect can't be cross compiled])
+ )
+
+ AC_MSG_CHECKING([if any value exists for WNOHANG])
+--
+2.26.0.292.g33ef6b2f38
+
diff --git a/srcpkgs/expect/patches/0003-cross-wnohang-value.patch b/srcpkgs/expect/patches/0003-cross-wnohang-value.patch
new file mode 100644
index 00000000000..c735f2f5237
--- /dev/null
+++ b/srcpkgs/expect/patches/0003-cross-wnohang-value.patch
@@ -0,0 +1,56 @@
+From: Đoàn Trần Công Danh <congdanhqx@gmail.com>
+---
+ configure.in | 24 ++++++++++++++++++++++--
+ 1 file changed, 22 insertions(+), 2 deletions(-)
+
+diff --git configure.in configure.in
+index 6570a07..0e4c9d1 100755
+--- configure.in
++++ configure.in
+@@ -486,6 +486,25 @@ AC_LANG_PROGRAM([[
+
+ AC_MSG_CHECKING([if any value exists for WNOHANG])
+ rm -rf wnohang
++AC_COMPILE_IFELSE([
++AC_LANG_PROGRAM([[
++#include <sys/wait.h>
++]],[[
++#ifdef WNOHANG
++ int wnohang_value = WNOHANG;
++#else
++ #error no value
++#endif
++]])],
++ AC_MSG_RESULT(yes)
++,
++ AC_MSG_RESULT(no)
++ expect_cv_wnohang_value=1
++)
++
++AC_CACHE_CHECK([value of WNOHANG], [expect_cv_wnohang_value],
++[
++rm -rf wnohang
+ AC_TRY_RUN([
+ #include <stdio.h>
+ #include <sys/wait.h>
+@@ -500,14 +519,15 @@ main() {
+ #endif
+ }],
+ AC_MSG_RESULT(yes)
+- AC_DEFINE_UNQUOTED(WNOHANG_BACKUP_VALUE, `cat wnohang`)
+ rm -f wnohang
+ ,
+ AC_MSG_RESULT(no)
+- AC_DEFINE(WNOHANG_BACKUP_VALUE, 1)
+ ,
+ AC_MSG_ERROR([Expect can't be cross compiled])
+ )
++])
++
++AC_DEFINE_UNQUOTED(WNOHANG_BACKUP_VALUE, $expect_cv_wnohang_value)
+
+ #
+ # check how signals work
+--
+2.26.0.292.g33ef6b2f38
+
diff --git a/srcpkgs/expect/patches/0004-cross-misc.patch b/srcpkgs/expect/patches/0004-cross-misc.patch
new file mode 100644
index 00000000000..f0e08bdc7e3
--- /dev/null
+++ b/srcpkgs/expect/patches/0004-cross-misc.patch
@@ -0,0 +1,195 @@
+From: Đoàn Trần Công Danh <congdanhqx@gmail.com>
+---
+ configure.in | 79 +++++++++++++++++++++-------------------------------
+ 1 file changed, 32 insertions(+), 47 deletions(-)
+
+diff --git configure.in configure.in
+index 0e4c9d1..d41a7a4 100755
+--- configure.in
++++ configure.in
+@@ -732,20 +732,17 @@ fi
+
+ # first check for the pure bsd
+ AC_MSG_CHECKING([for struct sgttyb])
+-AC_TRY_RUN([
++AC_COMPILE_IFELSE([
++AC_LANG_PROGRAM([[
+ #include <sgtty.h>
+-main()
+-{
++]],[[
+ struct sgttyb tmp;
+- exit(0);
+-}],
++]])],
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_SGTTYB)
+ PTY_TYPE=sgttyb
+ ,
+ AC_MSG_RESULT(no)
+-,
+- AC_MSG_ERROR([Expect can't be cross compiled])
+ )
+
+ # mach systems have include files for unimplemented features
+@@ -757,107 +754,99 @@ if test $mach -eq 0 ; then
+ # since that just controls which of pty_XXXX.c file is use and
+ # pty_termios.c is set up to handle pty_termio.
+ AC_MSG_CHECKING([for struct termio])
+- AC_TRY_RUN([#include <termio.h>
+- main()
+- {
++ AC_COMPILE_IFELSE([
++ AC_LANG_PROGRAM([[
++ #include <termio.h>
++ ]],[[
+ struct termio tmp;
+- exit(0);
+- }],
++ ]])],
+ AC_DEFINE(HAVE_TERMIO)
+ PTY_TYPE=termios
+ AC_MSG_RESULT(yes)
+ ,
+ AC_MSG_RESULT(no)
+-,
+- AC_MSG_ERROR([Expect can't be cross compiled])
+ )
+
+ # now check for the new style ttys (not yet posix)
+ AC_MSG_CHECKING([for struct termios])
+- AC_TRY_RUN([
++ AC_COMPILE_IFELSE([
++ AC_LANG_PROGRAM([[
+ /* including termios.h on Solaris 5.6 fails unless inttypes.h included */
+ # ifdef HAVE_INTTYPES_H
+ # include <inttypes.h>
+ # endif
+ # include <termios.h>
+- main()
+- {
++ ]],[[
+ struct termios tmp;
+- exit(0);
+- }],
++ ]])],
+ AC_DEFINE(HAVE_TERMIOS)
+ PTY_TYPE=termios
+ AC_MSG_RESULT(yes)
+ ,
+ AC_MSG_RESULT(no)
+- ,
+- AC_MSG_ERROR([Expect can't be cross compiled])
+ )
+ fi
+
+ AC_MSG_CHECKING([if TCGETS or TCGETA in termios.h])
+-AC_TRY_RUN([
++AC_COMPILE_IFELSE([
++AC_LANG_PROGRAM([[
+ /* including termios.h on Solaris 5.6 fails unless inttypes.h included */
+ #ifdef HAVE_INTTYPES_H
+ #include <inttypes.h>
+ #endif
+ #include <termios.h>
+-main() {
++]],[[
+ #if defined(TCGETS) || defined(TCGETA)
+ return 0;
+ #else
+- return 1;
++ #error no TCGETS or TCGETA
+ #endif
+-}],
++]])],
+ AC_DEFINE(HAVE_TCGETS_OR_TCGETA_IN_TERMIOS_H)
+ AC_MSG_RESULT(yes)
+ ,
+ AC_MSG_RESULT(no)
+-,
+- AC_MSG_ERROR([Expect can't be cross compiled])
+ )
+
+ AC_MSG_CHECKING([if TIOCGWINSZ in termios.h])
+-AC_TRY_RUN([
++AC_COMPILE_IFELSE([
++AC_LANG_PROGRAM([[
+ /* 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
+ return 0;
+ #else
+- return 1;
++ #error no TIOCGWINSZ
+ #endif
+-}],
++]])],
+ AC_DEFINE(HAVE_TIOCGWINSZ_IN_TERMIOS_H)
+ AC_MSG_RESULT(yes)
+ ,
+ AC_MSG_RESULT(no)
+-,
+- AC_MSG_ERROR([Expect can't be cross compiled])
+ )
+
+ # finally check for Cray style ttys
+ AC_MSG_CHECKING([for Cray-style ptys])
+ SETUID=":"
+-AC_TRY_RUN([
+-main(){
++AC_COMPILE_IFELSE([
++AC_LANG_PROGRAM([[
++]],[[
+ #ifdef CRAY
+ return 0;
+ #else
+- return 1;
++ #error no CRAY
+ #endif
+-}
++]])
+ ],
+ PTY_TYPE=unicos
+ SETUID="chmod u+s"
+ AC_MSG_RESULT(yes)
+ ,
+ AC_MSG_RESULT(no)
+-,
+- AC_MSG_ERROR([Expect can't be cross compiled])
+ )
+
+ #
+@@ -895,21 +884,17 @@ AC_FUNC_SETPGRP
+ # check for timezones
+ #
+ AC_MSG_CHECKING([for SV-style timezone])
+-AC_TRY_RUN([
++AC_COMPILE_IFELSE([
++AC_LANG_PROGRAM([[
+ extern char *tzname[2];
+ extern int daylight;
+-main()
+-{
++]],[[
+ int *x = &daylight;
+ char **y = tzname;
+-
+- exit(0);
+-}],
++]])],
+ AC_DEFINE(HAVE_SV_TIMEZONE)
+ AC_MSG_RESULT(yes),
+ AC_MSG_RESULT(no)
+-,
+- AC_MSG_ERROR([Expect can't be cross compiled])
+ )
+
+
+--
+2.26.0.292.g33ef6b2f38
+
diff --git a/srcpkgs/expect/template b/srcpkgs/expect/template
index 66936f261e7..664f91cdb40 100644
--- a/srcpkgs/expect/template
+++ b/srcpkgs/expect/template
@@ -4,7 +4,9 @@ version=5.45.4
revision=2
wrksrc=${pkgname}${version}
build_style=gnu-configure
+configure_args="expect_cv_wnohang_value=1"
make_check_target="test"
+hostmakedepends="automake libtool tcl-devel"
makedepends="tcl-devel"
short_desc="Programmed dialogue with interactive programs"
maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -12,7 +14,6 @@ license="Public Domain"
homepage="http://www.nist.gov/el/msid/expect.cfm"
distfiles="${SOURCEFORGE_SITE}/${pkgname}/Expect/${version}/${pkgname}${version}.tar.gz"
checksum=49a7da83b0bdd9f46d04a04deec19c7767bb9a323e40c4781f89caf760b92c34
-nocross=yes
alternatives="
mkpasswd:mkpasswd:/usr/bin/expect-mkpasswd
@@ -20,11 +21,16 @@ alternatives="
LDFLAGS+=" -Wl,-rpath=/usr/lib:/usr/lib/${pkgname}${version}"
+pre_configure() {
+ autoreconf -fi
+}
+
post_install() {
rm ${DESTDIR}/usr/bin/weather
mv ${DESTDIR}/usr/bin/{,expect-}mkpasswd
mv ${DESTDIR}/usr/share/man/man1/{,expect-}mkpasswd.1
}
+
expect-devel_package() {
depends="${sourcepkg}>=${version}_${revision}"
short_desc+=" -- development files"
next reply other threads:[~2020-04-03 16:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-03 16:20 sgn [this message]
2020-04-05 1:08 ` [PR PATCH] [Updated] " sgn
2020-04-05 1:09 ` sgn
2020-04-07 10:12 ` sgn
2020-04-07 14:48 ` [PR PATCH] [Merged]: " Piraty
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-20605@inbox.vuxu.org \
--to=sgn@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).