From 2d5320beea6fdbfec6430a6cd71370128dc9c04a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Fri, 3 Apr 2020 23:01:46 +0700 Subject: [PATCH 1/3] 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 +--- + 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 +--- + 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 +-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 +--- + 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 ++]],[[ ++#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 + #include +@@ -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 +--- + 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 +-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 +- main() +- { ++ AC_COMPILE_IFELSE([ ++ AC_LANG_PROGRAM([[ ++ #include ++ ]],[[ + 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 + # endif + # include +- 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 + #endif + #include +-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 + #endif + #include +-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 " @@ -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" From 8c4b55f9a7fe3fa3546a06099fab98c9f7c70d20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Fri, 3 Apr 2020 23:59:35 +0700 Subject: [PATCH 2/3] deepin-terminal: fix build with latest vala --- srcpkgs/deepin-terminal/template | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/srcpkgs/deepin-terminal/template b/srcpkgs/deepin-terminal/template index e1dc0494ddc..57feb0bd3f8 100644 --- a/srcpkgs/deepin-terminal/template +++ b/srcpkgs/deepin-terminal/template @@ -1,7 +1,7 @@ # Template file for 'deepin-terminal' pkgname=deepin-terminal version=5.0.0 -revision=1 +revision=2 build_style=cmake configure_args="-DTEST_BUILD=OFF -DUSE_VENDOR_LIB=OFF" hostmakedepends="glib-devel gobject-introspection gperf intltool pkg-config @@ -21,3 +21,12 @@ nocross=yes case $XBPS_TARGET_MACHINE in *-musl) CFLAGS="-DREG_NOERROR=REG_OK" esac + +post_patch() { + # latest vala string#to_utf8() return char[] + # but term.feed_child expects "unowned uint8[]" + vsed -i 's/[.]to_utf8()/.data/g' \ + widget/command_panel.vala \ + widget/terminal.vala \ + widget/workspace.vala +} From 3ea49b0f30ab8f1a4c8f61c58630eff8ac5cbb03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Sat, 4 Apr 2020 00:07:41 +0700 Subject: [PATCH 3/3] deeping-terminal: fix cross-compile --- srcpkgs/deepin-terminal/template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcpkgs/deepin-terminal/template b/srcpkgs/deepin-terminal/template index 57feb0bd3f8..ac614fcfc2b 100644 --- a/srcpkgs/deepin-terminal/template +++ b/srcpkgs/deepin-terminal/template @@ -3,6 +3,7 @@ pkgname=deepin-terminal version=5.0.0 revision=2 build_style=cmake +build_helper="gir" configure_args="-DTEST_BUILD=OFF -DUSE_VENDOR_LIB=OFF" hostmakedepends="glib-devel gobject-introspection gperf intltool pkg-config vala" @@ -16,7 +17,6 @@ homepage="https://github.com/linuxdeepin/deepin-terminal" changelog="https://github.com/linuxdeepin/deepin-terminal/blob/master/CHANGELOG.md" distfiles="https://github.com/linuxdeepin/deepin-terminal/archive/${version}.tar.gz" checksum=fc0586a48f85a8151602c205004118429f22c504cd25881eecfd553849fe35f2 -nocross=yes case $XBPS_TARGET_MACHINE in *-musl) CFLAGS="-DREG_NOERROR=REG_OK"