diff -Nru termrec-0.18/acinclude.m4 termrec-0.19/acinclude.m4 --- termrec-0.18/acinclude.m4 2018-09-30 11:43:33.000000000 +0000 +++ termrec-0.19/acinclude.m4 2020-04-19 07:15:09.000000000 +0000 @@ -9,3 +9,4 @@ m4_include([m4/ax_lib_socket_nsl.m4]) m4_include([m4/ac_sco.m4]) m4_include([m4/ac_c_try_flag.m4]) +m4_include([m4/ac_zstd.m4]) diff -Nru termrec-0.18/ChangeLog termrec-0.19/ChangeLog --- termrec-0.18/ChangeLog 2018-09-30 11:43:33.000000000 +0000 +++ termrec-0.19/ChangeLog 2020-04-19 07:15:09.000000000 +0000 @@ -1,3 +1,7 @@ +0.19 +* Fix build failure with gcc-10 (-fno-common). +* A bunch of minor and warning fixes. + 0.18 * library API is now declared stable, ABI at soname 1. + include file is (not ) @@ -40,7 +44,7 @@ * proxyrec: IPv6 support for outgoing connections. * If you specify a format, you need to append requested compression type to it (like, .nh.gz). This allows disabling compression, before it was - always .bz2 unless a file name was explicitely set. + always .bz2 unless a file name was explicitly set. 0.13 * New format: RealLogs (write-only). diff -Nru termrec-0.18/common/rec_args.c termrec-0.19/common/rec_args.c --- termrec-0.18/common/rec_args.c 2018-09-30 11:43:33.000000000 +0000 +++ termrec-0.19/common/rec_args.c 2020-04-19 07:15:09.000000000 +0000 @@ -17,6 +17,11 @@ #include "gettext.h" #include "common.h" +const char *command, *format, *format_ext; +int lport,rport; +char *record_name; +int raw; +int append; #ifdef HAVE_GETOPT_LONG static struct option rec_opts[]={ diff -Nru termrec-0.18/common/rec_args.h termrec-0.19/common/rec_args.h --- termrec-0.18/common/rec_args.h 2018-09-30 11:43:33.000000000 +0000 +++ termrec-0.19/common/rec_args.h 2020-04-19 07:15:09.000000000 +0000 @@ -1,7 +1,7 @@ -const char *command, *format, *format_ext; -int lport,rport; -char *record_name; -int raw; -int append; +extern const char *command, *format, *format_ext; +extern int lport,rport; +extern char *record_name; +extern int raw; +extern int append; void get_rec_parms(int argc, char **argv); diff -Nru termrec-0.18/configure.ac termrec-0.19/configure.ac --- termrec-0.18/configure.ac 2018-09-30 11:43:33.000000000 +0000 +++ termrec-0.19/configure.ac 2020-04-19 07:15:09.000000000 +0000 @@ -65,6 +65,7 @@ CURL is not available: support for http/etc URLs will be disabled. ])]) AC_CHECK_HEADERS([curl/curl.h]) +AC_ZSTD # Checks for Winblows. AC_CHECK_WIN32 diff -Nru termrec-0.18/debian/changelog termrec-0.19/debian/changelog --- termrec-0.18/debian/changelog 2019-09-05 11:12:57.000000000 +0000 +++ termrec-0.19/debian/changelog 2020-04-19 07:33:54.000000000 +0000 @@ -1,8 +1,11 @@ -termrec (0.18-2build1) eoan; urgency=medium +termrec (0.19-1) unstable; urgency=medium - * No-change upload with strops.h and sys/strops.h removed in glibc. + * New upstream release. + + Fixes FTBFS with gcc-10 (closes: #957868) + * Fix VERSION being unset. + * Multi-Arch settings. - -- Matthias Klose Thu, 05 Sep 2019 11:12:57 +0000 + -- Adam Borowski Sun, 19 Apr 2020 09:33:54 +0200 termrec (0.18-2) unstable; urgency=medium diff -Nru termrec-0.18/debian/clean termrec-0.19/debian/clean --- termrec-0.18/debian/clean 1970-01-01 00:00:00.000000000 +0000 +++ termrec-0.19/debian/clean 2020-04-19 07:32:11.000000000 +0000 @@ -0,0 +1 @@ +VERSION diff -Nru termrec-0.18/debian/control termrec-0.19/debian/control --- termrec-0.18/debian/control 2019-07-14 12:58:54.000000000 +0000 +++ termrec-0.19/debian/control 2020-04-19 07:23:12.000000000 +0000 @@ -4,7 +4,7 @@ Maintainer: Adam Borowski Build-Depends: debhelper-compat (= 12), libbz2-dev, zlib1g-dev, liblzma-dev, libzstd-dev, libcurl4-gnutls-dev -Standards-Version: 4.4.0 +Standards-Version: 4.5.0 Rules-Requires-Root: no Homepage: http://angband.pl/termrec.html Vcs-Git: https://github.com/kilobyte/termrec.git -b debian @@ -13,6 +13,7 @@ Package: termrec Section: misc Architecture: any +Multi-Arch: foreign Depends: libtty1 (>= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} Description: terminal videos/scripts recorder and player This package contains "termrec", a program which can record a terminal @@ -24,6 +25,7 @@ Package: libtty-dev Section: libdevel Architecture: any +Multi-Arch: same Depends: libtty1 (= ${binary:Version}), ${misc:Depends} Description: terminal/ttyrec library -- development libtty is a library for handling terminal output. It is kind of "reverse diff -Nru termrec-0.18/debian/patches/debian-changes termrec-0.19/debian/patches/debian-changes --- termrec-0.18/debian/patches/debian-changes 2019-09-05 11:12:57.000000000 +0000 +++ termrec-0.19/debian/patches/debian-changes 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -Description: - TODO: Put a short summary on the line above and replace this paragraph - with a longer explanation of this change. Complete the meta-information - with other relevant fields (see below for details). To make it easier, the - information below has been extracted from the changelog. Adjust it or drop - it. - . - termrec (0.18-2) unstable; urgency=medium - . - * Fix missing zstd and curl support (B-Deps). - * Add VCS links. - * dh 12. -Author: Adam Borowski - ---- -The information above should follow the Patch Tagging Guidelines, please -checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here -are templates for supplementary fields that you might want to add: - -Origin: , -Bug: -Bug-Debian: https://bugs.debian.org/ -Bug-Ubuntu: https://launchpad.net/bugs/ -Forwarded: -Reviewed-By: -Last-Update: 2019-07-14 - ---- termrec-0.18.orig/doc/libtty.pod -+++ termrec-0.18/doc/libtty.pod -@@ -1,4 +1,5 @@ - =encoding utf8 -+ - =head1 NAME - - libtty - a library for handling vt100-like pseudo-terminals diff -Nru termrec-0.18/debian/patches/series termrec-0.19/debian/patches/series --- termrec-0.18/debian/patches/series 2019-07-14 13:01:37.000000000 +0000 +++ termrec-0.19/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -debian-changes diff -Nru termrec-0.18/debian/rules termrec-0.19/debian/rules --- termrec-0.18/debian/rules 2019-07-14 13:05:55.000000000 +0000 +++ termrec-0.19/debian/rules 2020-04-19 07:32:11.000000000 +0000 @@ -6,6 +6,10 @@ %: dh $@ +override_dh_autoreconf: + dpkg-parsechangelog -SVersion|rev|cut -d- -f2-|rev >VERSION + dh_autoreconf ./autogen.sh + override_dh_auto_test: ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) LC_ALL=C.UTF-8 $(MAKE) check || debian/rules testfail diff -Nru termrec-0.18/doc/libtty.pod termrec-0.19/doc/libtty.pod --- termrec-0.18/doc/libtty.pod 2018-09-30 11:43:33.000000000 +0000 +++ termrec-0.19/doc/libtty.pod 2020-04-19 07:15:09.000000000 +0000 @@ -1,4 +1,5 @@ =encoding utf8 + =head1 NAME libtty - a library for handling vt100-like pseudo-terminals diff -Nru termrec-0.18/libstream/compress.c termrec-0.19/libstream/compress.c --- termrec-0.18/libstream/compress.c 2018-09-30 11:43:33.000000000 +0000 +++ termrec-0.19/libstream/compress.c 2020-04-19 07:15:09.000000000 +0000 @@ -268,7 +268,7 @@ } #endif -#if (defined HAVE_LIBZSTD) || (defined SHIPPED_LIBZSTD) +#ifdef WORKING_ZSTD static void read_zstd(int f, int fd, const char *arg) { ZSTD_inBuffer zin; @@ -371,7 +371,7 @@ #if (defined HAVE_LIBLZMA) || (defined SHIPPED_LIBLZMA) {"xz", ".xz", write_xz}, #endif -#if (defined HAVE_LIBZSTD) || (defined SHIPPED_LIBZSTD) +#ifdef WORKING_ZSTD {"zstd", ".zst", write_zstd}, #endif {0, 0, 0}, @@ -387,7 +387,7 @@ #if (defined HAVE_LIBLZMA) || (defined SHIPPED_LIBLZMA) {"xz", ".xz", read_xz}, #endif -#if (defined HAVE_LIBZSTD) || (defined SHIPPED_LIBZSTD) +#ifdef WORKING_ZSTD {"zstd", ".zst", read_zstd}, #endif {0, 0, 0}, diff -Nru termrec-0.18/libtty/asciicast.c termrec-0.19/libtty/asciicast.c --- termrec-0.18/libtty/asciicast.c 2018-09-30 11:43:33.000000000 +0000 +++ termrec-0.19/libtty/asciicast.c 2020-04-19 07:15:09.000000000 +0000 @@ -181,37 +181,37 @@ | eat_hexdigit(f)<<4 | eat_hexdigit(f); - if (c >= 0) - { - if (c < 0x80) - OUT(c); - else if (c < 0x800) - { - OUT(0xc0|c>>6); - OUT(0x80|c&0x3f); - } - else if (c < 0xD800 || c > 0xDFFF) - { - OUT(0xe0|c>>12); - OUT(0x80|c>>6&0x3f); - OUT(0x80|c&0x3f); - } - // Note: we allow erroneous surrogate pairs separated by - // something, silently ignore lone lead or trailing ones. - else if (c < 0xDC00) - surrogate = c; - else if (surrogate) - { - c=((uint32_t)surrogate)<<10&0xffc00|c&0x3ff; - c+=0x10000; - OUT(0xf0|c>>18); - OUT(0x80|c>>12&0x3f); - OUT(0x80|c>>6&0x3f); - OUT(0x80|c&0x3f); - surrogate=0; - } + if (c < 0) // not a valid 16-bit hex value break; + + if (c < 0x80) + OUT(c); + else if (c < 0x800) + { + OUT(0xc0|c>>6); + OUT(0x80|c&0x3f); + } + else if (c < 0xD800 || c > 0xDFFF) + { + OUT(0xe0|c>>12); + OUT(0x80|c>>6&0x3f); + OUT(0x80|c&0x3f); + } + // Note: we allow erroneous surrogate pairs separated by + // something, silently ignore lone lead or trailing ones. + else if (c < 0xDC00) + surrogate = c; + else if (surrogate) + { + c=((uint32_t)surrogate)<<10&0xffc00|c&0x3ff; + c+=0x10000; + OUT(0xf0|c>>18); + OUT(0x80|c>>12&0x3f); + OUT(0x80|c>>6&0x3f); + OUT(0x80|c&0x3f); + surrogate=0; } + break; case '"': case '\\': case '/': default: OUT(c); break; diff -Nru termrec-0.18/libtty/colors.c termrec-0.19/libtty/colors.c --- termrec-0.18/libtty/colors.c 2018-09-30 11:43:33.000000000 +0000 +++ termrec-0.19/libtty/colors.c 2020-04-19 07:15:09.000000000 +0000 @@ -2,9 +2,9 @@ #include "tty.h" #include "export.h" -#define R(x) (((x)>>16)&0xff) -#define G(x) (((x)>> 8)&0xff) -#define B(x) ( (x) &0xff) +#define R(x) ((uint8_t)((x)>>16)) +#define G(x) ((uint8_t)((x)>> 8)) +#define B(x) ((uint8_t) (x) ) static uint32_t col256_to_rgb(uint32_t i) { diff -Nru termrec-0.18/libtty/files.c termrec-0.19/libtty/files.c --- termrec-0.18/libtty/files.c 2018-09-30 11:43:33.000000000 +0000 +++ termrec-0.19/libtty/files.c 2020-04-19 07:15:09.000000000 +0000 @@ -31,7 +31,7 @@ { int nf; - // given explicitely + // given explicitly if (format) { for (nf=0; rec[nf].name; nf++) @@ -148,7 +148,7 @@ { int nf; - // given explicitely + // given explicitly if (format) { for (nf=0; play[nf].name; nf++) diff -Nru termrec-0.18/libtty/formats.c termrec-0.19/libtty/formats.c --- termrec-0.18/libtty/formats.c 2018-09-30 11:43:33.000000000 +0000 +++ termrec-0.19/libtty/formats.c 2020-04-19 07:15:09.000000000 +0000 @@ -375,6 +375,8 @@ if (i0scr[CY*SX+CX-1], c); + // on CJK, attach to left side not to the fillet + int cjk=(vt->scr[CY*SX+CX-1].ch==VT100_CJK_RIGHT); + return tty_add_comb(vt, &vt->scr[CY*SX+CX-1-cjk], c); } if (c<128 && vt->G&(1<curG)) @@ -574,7 +576,7 @@ /* The following code deals with malformed UTF-16 * surrogates encoded in UTF-8 text. While the - * standard explicitely forbids this, some (usually + * standard explicitly forbids this, some (usually * Windows) programs generate them, and thus we'll * better support such encapsulation anyway. * We don't go out of our way to detect unpaired @@ -802,6 +804,7 @@ FG(RGB, (vt->tok[i+1]&0xff)<<16 | (vt->tok[i+2]&0xff)<<8 | (vt->tok[i+3]&0xff)); + // fallthru case 3: i+=3; break; @@ -832,6 +835,7 @@ BG(RGB, (vt->tok[i+1]&0xff)<<16 | (vt->tok[i+2]&0xff)<<8 | (vt->tok[i+3]&0xff)); + // fallthru case 3: i+=3; break; diff -Nru termrec-0.18/libtty/wcwidth.c termrec-0.19/libtty/wcwidth.c --- termrec-0.18/libtty/wcwidth.c 2018-09-30 11:43:33.000000000 +0000 +++ termrec-0.19/libtty/wcwidth.c 2020-04-19 07:15:09.000000000 +0000 @@ -65,15 +65,15 @@ struct interval { - int first; - int last; + uint32_t first; + uint32_t last; }; /* auxiliary function for binary search in interval table */ -static int bisearch(uint32_t ucs, const struct interval *table, int max) +static int bisearch(uint32_t ucs, const struct interval *table, uint32_t max) { - int min = 0; - int mid; + uint32_t min = 0; + uint32_t mid; if (ucs < table[0].first || ucs > table[max].last) return 0; diff -Nru termrec-0.18/m4/ac_zstd.m4 termrec-0.19/m4/ac_zstd.m4 --- termrec-0.18/m4/ac_zstd.m4 1970-01-01 00:00:00.000000000 +0000 +++ termrec-0.19/m4/ac_zstd.m4 2020-04-19 07:15:09.000000000 +0000 @@ -0,0 +1,18 @@ +dnl Ancient versions of zstd lack interfaces we use. + +AC_DEFUN([AC_ZSTD], [ + AC_MSG_CHECKING([for working zstd]) + AC_COMPILE_IFELSE([AC_LANG_SOURCE([#include +int main() +{ + size_t const inbufsz = ZSTD_DStreamInSize(); + ZSTD_DStream* const stream = ZSTD_createDStream(); + ZSTD_freeDStream(stream); + return inbufsz; +} +])], [AC_MSG_RESULT([yes]) + AC_DEFINE([WORKING_ZSTD], [1], [Set to 1 if new enough])], [ + AC_MSG_RESULT([no, missing or no good]) + ]) + ]) +]) diff -Nru termrec-0.18/play/player.c termrec-0.19/play/player.c --- termrec-0.18/play/player.c 2018-09-30 11:43:33.000000000 +0000 +++ termrec-0.19/play/player.c 2020-04-19 07:15:09.000000000 +0000 @@ -12,6 +12,14 @@ static ttyrec_frame fr; static struct timeval t0, tc; +ttyrec tr; + +int speed; +tty term; + +int waiting, loaded; +mutex_t waitm; +cond_t waitc; static void waitm_unlock(void *arg) { diff -Nru termrec-0.18/play/player.h termrec-0.19/play/player.h --- termrec-0.18/play/player.h 2018-09-30 11:43:33.000000000 +0000 +++ termrec-0.19/play/player.h 2020-04-19 07:15:09.000000000 +0000 @@ -1,10 +1,10 @@ -ttyrec tr; +extern ttyrec tr; -int speed; -tty term; +extern int speed; +extern tty term; -int waiting, loaded; -mutex_t waitm; -cond_t waitc; +extern int waiting, loaded; +extern mutex_t waitm; +extern cond_t waitc; void replay(void); diff -Nru termrec-0.18/sys/error.h termrec-0.19/sys/error.h --- termrec-0.18/sys/error.h 2018-09-30 11:43:33.000000000 +0000 +++ termrec-0.19/sys/error.h 2020-04-19 07:15:09.000000000 +0000 @@ -1 +1,2 @@ -void die(const char *txt, ...) __attribute__((format (printf, 1, 2))); +void die(const char *txt, ...) __attribute__((format (printf, 1, 2))) + __attribute__((nonnull(1))); diff -Nru termrec-0.18/sys/unix/ttysize.c termrec-0.19/sys/unix/ttysize.c --- termrec-0.18/sys/unix/ttysize.c 2018-09-30 11:43:33.000000000 +0000 +++ termrec-0.19/sys/unix/ttysize.c 2020-04-19 07:15:09.000000000 +0000 @@ -15,7 +15,7 @@ if (!isatty(fd)) return 0; - if (!ioctl(1,TIOCGWINSZ,&ts) && ts.ws_row>0 && ts.ws_col>0) + if (!ioctl(fd,TIOCGWINSZ,&ts) && ts.ws_row>0 && ts.ws_col>0) { *x=ts.ws_col; *y=ts.ws_row; diff -Nru termrec-0.18/tests/testsuite.at termrec-0.19/tests/testsuite.at --- termrec-0.18/tests/testsuite.at 2018-09-30 11:43:33.000000000 +0000 +++ termrec-0.19/tests/testsuite.at 2020-04-19 07:15:09.000000000 +0000 @@ -37,7 +37,7 @@ AT_CHECK([rec test.ttyrec.xz && loadsave test.ttyrec.xz out.ttyrec.xz && cmp test.ttyrec.xz out.ttyrec.xz]) AT_CLEANUP AT_SETUP([loading and saving ttyrecs to memory (.zst)]) -AT_SKIP_IF([! grep -q "^#define \\(HAVE_ZSTD_H\\|SHIPPED_LIBZSTD\\) 1" $abs_top_builddir/config.h]) +AT_SKIP_IF([! grep -q "^#define WORKING_ZSTD 1" $abs_top_builddir/config.h]) AT_CHECK([rec test.ttyrec.zst && loadsave test.ttyrec.zst out.ttyrec.zst && cmp test.ttyrec.zst out.ttyrec.zst]) AT_CLEANUP diff -Nru termrec-0.18/tests/vt.in/cjk-comb termrec-0.19/tests/vt.in/cjk-comb --- termrec-0.18/tests/vt.in/cjk-comb 1970-01-01 00:00:00.000000000 +0000 +++ termrec-0.19/tests/vt.in/cjk-comb 2020-04-19 07:15:09.000000000 +0000 @@ -0,0 +1 @@ +a\u0300 diff -Nru termrec-0.18/tests/vt.out/cjk-comb termrec-0.19/tests/vt.out/cjk-comb --- termrec-0.18/tests/vt.out/cjk-comb 1970-01-01 00:00:00.000000000 +0000 +++ termrec-0.19/tests/vt.out/cjk-comb 2020-04-19 07:15:09.000000000 +0000 @@ -0,0 +1,7 @@ ++====================+ +|{cjk}[FF41]<0300>[CJK]{} | +| | +| | +| | +| | ++-[ cursor at 2,0 ]--+ diff -Nru termrec-0.18/.travis.yml termrec-0.19/.travis.yml --- termrec-0.18/.travis.yml 2018-09-30 11:43:33.000000000 +0000 +++ termrec-0.19/.travis.yml 2020-04-19 07:15:09.000000000 +0000 @@ -1,7 +1,8 @@ language: c matrix: include: - - os: linux + - name: "Ubuntu amd64" + os: linux dist: bionic addons: apt: @@ -11,9 +12,25 @@ - liblzma-dev - libzstd-dev - libcurl4-gnutls-dev - - os: osx + script: ./autogen.sh && ./configure && make check + after_failure: cat tests/testsuite.log + - name: "OSX" + os: osx before_install: brew update && brew install libtool - -script: ./autogen.sh && ./configure && make check -after_failure: cat tests/testsuite.log + script: ./autogen.sh && ./configure && make check + after_failure: cat tests/testsuite.log + - name: "Windows i386" + os: linux + dist: bionic + before_install: + - sudo apt-get update -qq + - sudo apt-get install g++-mingw-w64-i686 + addons: + apt: + packages: + - g++-mingw-w64-i686 + env: + WCC: i686-w64-mingw32-gcc + script: ./autogen.sh && ./configure --host=i686-w64-mingw32 CC=$WCC && make + after_failure: cat config.log