From 2128f7dce899efbdcaccab41a2271b1c9586f179 Mon Sep 17 00:00:00 2001 From: Marcin Puc Date: Tue, 27 Sep 2022 22:41:48 +0200 Subject: [PATCH] New package: boxes-2.2.0 --- .../0001-fix-missing-argument-tests.patch | 24 ++++++++++++++++++ srcpkgs/boxes/patches/0002-fix-segfault.patch | 17 +++++++++++++ srcpkgs/boxes/template | 25 +++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 srcpkgs/boxes/patches/0001-fix-missing-argument-tests.patch create mode 100644 srcpkgs/boxes/patches/0002-fix-segfault.patch create mode 100644 srcpkgs/boxes/template diff --git a/srcpkgs/boxes/patches/0001-fix-missing-argument-tests.patch b/srcpkgs/boxes/patches/0001-fix-missing-argument-tests.patch new file mode 100644 index 000000000000..18d3e4cc3fdc --- /dev/null +++ b/srcpkgs/boxes/patches/0001-fix-missing-argument-tests.patch @@ -0,0 +1,24 @@ +diff --git a/test/004_missing_option_argument.txt b/test/004_missing_option_argument.txt +index 8222bbb..bfaba56 100644 +--- a/test/004_missing_option_argument.txt ++++ b/test/004_missing_option_argument.txt +@@ -2,6 +2,7 @@ + -s + :INPUT + :OUTPUT-FILTER ++1s/argument:/argument --/ + 1s/^.+?: /boxes: / + 1s/-- s$/-- 's'/ + :EXPECTED-ERROR 1 +diff --git a/test/065_size_missing_argument.txt b/test/065_size_missing_argument.txt +index 6dad5ae..5a00967 100644 +--- a/test/065_size_missing_argument.txt ++++ b/test/065_size_missing_argument.txt +@@ -3,6 +3,7 @@ + :INPUT + foo + :OUTPUT-FILTER ++1s/argument:/argument --/ + 1s/^.+?: /boxes: / + 1s/-- s$/-- 's'/ + :EXPECTED-ERROR 1 diff --git a/srcpkgs/boxes/patches/0002-fix-segfault.patch b/srcpkgs/boxes/patches/0002-fix-segfault.patch new file mode 100644 index 000000000000..deb134063d7c --- /dev/null +++ b/srcpkgs/boxes/patches/0002-fix-segfault.patch @@ -0,0 +1,17 @@ +diff --git a/src/remove.c b/src/remove.c +index c4dae4b..bed7bd0 100644 +--- a/src/remove.c ++++ b/src/remove.c +@@ -983,10 +983,10 @@ int remove_box() + fprintf(stderr, "u32_move(\"%s\", \"%s\", %d); // posmap[c]=%d\n", + u32_strconv_to_output(input.lines[j].mbtext), + u32_strconv_to_output(input.lines[j].mbtext + input.lines[j].posmap[c]), +- (int) (input.lines[j].num_chars - c + 1), (int) input.lines[j].posmap[c]); ++ (int) (input.lines[j].num_chars - input.lines[j].posmap[c] + 1), (int) input.lines[j].posmap[c]); + #endif + u32_move(input.lines[j].mbtext, input.lines[j].mbtext + input.lines[j].posmap[c], +- input.lines[j].num_chars - c + 1); /* +1 for zero byte */ ++ input.lines[j].num_chars - input.lines[j].posmap[c] + 1); /* +1 for zero byte */ + input.lines[j].num_chars -= c; + } + } diff --git a/srcpkgs/boxes/template b/srcpkgs/boxes/template new file mode 100644 index 000000000000..a5dbd6efe67a --- /dev/null +++ b/srcpkgs/boxes/template @@ -0,0 +1,25 @@ +# Template file for 'boxes' +pkgname=boxes +version=2.2.0 +revision=1 +build_style=gnu-makefile +make_build_args="GLOBALCONF=/etc/boxes" +make_check_target="test utest" +hostmakedepends="bison flex" +makedepends="libunistring-devel pcre2-devel" +checkdepends="cmocka-devel xxd" +short_desc="Command line ASCII boxes unlimited" +maintainer="Marcin Puc " +license="GPL-3.0-only" +homepage="https://boxes.thomasjensen.com/" +distfiles="https://github.com/ascii-boxes/boxes/archive/refs/tags/v${version}.tar.gz" +checksum=98b8e3cf5008f46f096d5775d129c34db9f718728bffb0f5d67ae89bb494102e +conf_files="/etc/boxes" + +CFLAGS="-I. -I../src" + +do_install() { + vbin out/boxes + vconf boxes-config boxes + vman doc/boxes.1 +}