From 90fc5ac9cdeac5f0200f4322a7c350b05da05536 Mon Sep 17 00:00:00 2001 From: Enno Boland Date: Wed, 21 Apr 2021 20:28:52 +0200 Subject: [PATCH] libsigsegv: update to 2.13. * remove post_configure hook. It builds fine without it. * add upstream patch to fix tests. See bug [1]. Fixed with [2] [1] https://bugs.gnunet.org/view.php?id=6613 [2] https://git.gnunet.org/libextractor.git/commit/?id=7a6a7f54d1f27c6b3520fe8cffebeebc6c272ca0 --- .../patches/fix-tests-from-upstream.patch | 173 ++++++++++++++++++ srcpkgs/libextractor/template | 2 +- srcpkgs/libsigsegv/template | 16 +- 3 files changed, 176 insertions(+), 15 deletions(-) create mode 100644 srcpkgs/libextractor/patches/fix-tests-from-upstream.patch diff --git a/srcpkgs/libextractor/patches/fix-tests-from-upstream.patch b/srcpkgs/libextractor/patches/fix-tests-from-upstream.patch new file mode 100644 index 000000000000..c44b972f2e97 --- /dev/null +++ b/srcpkgs/libextractor/patches/fix-tests-from-upstream.patch @@ -0,0 +1,173 @@ +Imported from https://git.gnunet.org/libextractor.git/commit/?id=7a6a7f54d1f27c6b3520fe8cffebeebc6c272ca0 + +* Removed changes in changelog. + +From 7a6a7f54d1f27c6b3520fe8cffebeebc6c272ca0 Mon Sep 17 00:00:00 2001 +From: Christian Grothoff +Date: Thu, 29 Oct 2020 21:22:05 +0100 +Subject: fix #6613 + +--- + ChangeLog | 9 ++++++-- + src/plugins/fuzz_default.sh | 17 ++++++++++++--- + src/plugins/test_exiv2.c | 14 +++++++------ + src/plugins/test_lib.c | 50 +++++++++++++++++++++++++++++++++++++-------- + src/plugins/test_lib.h | 5 +++++ + 5 files changed, 75 insertions(+), 20 deletions(-) + +diff --git a/src/plugins/fuzz_default.sh b/src/plugins/fuzz_default.sh +index 8b64539..67292cf 100755 +--- a/src/plugins/fuzz_default.sh ++++ b/src/plugins/fuzz_default.sh +@@ -14,6 +14,17 @@ then + bindir="$bindir/bin" + fi + ++if test -x `which zzuf` ++then ++ exit 77 ++fi ++ ++if test -x `which timeout` ++then ++ TIMEOUT=timeout 15 ++else ++ TIMEOUT="" ++fi + + for file in $testdatadir/test* + do +@@ -26,11 +37,11 @@ do + do + echo "file $file seed $seed" + zzuf -c -s $seed cat "$file" > "$tmpfile" +- if ! "$bindir/extract" -i "$tmpfile" > /dev/null ++ if ! "$TIMEOUT $bindir/extract" -i "$tmpfile" > /dev/null + then + echo "$tmpfile with seed $seed failed" +- mv $tmpfile $tmpfile.keep +- ret=1 ++ mv $tmpfile $tmpfile.keep ++ ret=1 + fi + seed=`expr $seed + 1` + done +diff --git a/src/plugins/test_exiv2.c b/src/plugins/test_exiv2.c +index e4e5319..f3dae0a 100644 +--- a/src/plugins/test_exiv2.c ++++ b/src/plugins/test_exiv2.c +@@ -49,9 +49,10 @@ main (int argc, char *argv[]) + EXTRACTOR_METATYPE_GPS_LATITUDE, + EXTRACTOR_METAFORMAT_UTF8, + "text/plain", +- "28deg 8' 17.585\" ", +- strlen ("28deg 8' 17.585\" ") + 1, +- 0 ++ "28deg 8' (18|17.585)\" ?", ++ strlen ("28deg 8' (18|17.585)\" ?") + 1, ++ 0, ++ .regex = 1 + }, + { + EXTRACTOR_METATYPE_GPS_LONGITUDE_REF, +@@ -65,9 +66,10 @@ main (int argc, char *argv[]) + EXTRACTOR_METATYPE_GPS_LONGITUDE, + EXTRACTOR_METAFORMAT_UTF8, + "text/plain", +- "14deg 14' 21.713\" ", +- strlen ("14deg 14' 21.713\" ") + 1, +- 0 ++ "14deg 14' (22|21.713)\" ?", ++ strlen ("14deg 14' (22|21.713)\" ?"), ++ 0, ++ .regex = 1 + }, + { + EXTRACTOR_METATYPE_CAMERA_MAKE, +diff --git a/src/plugins/test_lib.c b/src/plugins/test_lib.c +index efbe2cf..97d4dc5 100644 +--- a/src/plugins/test_lib.c ++++ b/src/plugins/test_lib.c +@@ -24,7 +24,8 @@ + */ + #include "platform.h" + #include "test_lib.h" +- ++#include ++#include + + /** + * Function that libextractor calls for each +@@ -57,14 +58,45 @@ process_replies (void *cls, + (sd[i].type != type) || + (sd[i].format != format) ) + continue; +- if ( (EXTRACTOR_METAFORMAT_BINARY != format) && +- ( (sd[i].data_len != data_len) || +- (0 != memcmp (sd[i].data, data, data_len)) ) ) +- continue; +- if ( (EXTRACTOR_METAFORMAT_BINARY == format) && +- ( (sd[i].data_len > data_len) || +- (0 != memcmp (sd[i].data, data, sd[i].data_len)) ) ) +- continue; ++ if ( (sd[i].regex) && ++ (EXTRACTOR_METAFORMAT_BINARY != format) ) ++ { ++ regex_t re; ++ regmatch_t match; ++ ++ if (0 != ++ regcomp (&re, ++ sd[i].data, ++ REG_EXTENDED)) ++ { ++ fprintf (stderr, ++ "Not a valid regex: %s\n", ++ sd[i].data); ++ abort (); ++ } ++ if ( ('\0' != data[data_len - 1]) || ++ (0 != regexec (&re, ++ data, ++ 1, ++ &match, ++ 0)) ) ++ { ++ regfree (&re); ++ continue; ++ } ++ regfree (&re); ++ } ++ else ++ { ++ if ( (EXTRACTOR_METAFORMAT_BINARY != format) && ++ ( (sd[i].data_len != data_len) || ++ (0 != memcmp (sd[i].data, data, data_len)) ) ) ++ continue; ++ if ( (EXTRACTOR_METAFORMAT_BINARY == format) && ++ ( (sd[i].data_len > data_len) || ++ (0 != memcmp (sd[i].data, data, sd[i].data_len)) ) ) ++ continue; ++ } + + if (NULL != sd[i].data_mime_type) + { +diff --git a/src/plugins/test_lib.h b/src/plugins/test_lib.h +index 9400314..cea36fc 100644 +--- a/src/plugins/test_lib.h ++++ b/src/plugins/test_lib.h +@@ -63,6 +63,11 @@ struct SolutionData + * terminate the list. + */ + int solved; ++ ++ /** ++ * Treat solution as a regex that must match. ++ */ ++ int regex; + }; + + +-- +cgit v1.2.1 + diff --git a/srcpkgs/libextractor/template b/srcpkgs/libextractor/template index bd7af6f78dec..62541fcc7792 100644 --- a/srcpkgs/libextractor/template +++ b/srcpkgs/libextractor/template @@ -8,7 +8,7 @@ hostmakedepends="pkg-config" #FIXME: Build without gsf support for now, ole2_extractor.c causes GCC sigfault makedepends="zlib-devel bzip2-devel exiv2-devel tiff-devel libpng-devel libjpeg-turbo-devel libvorbis-devel libflac-devel giflib-devel libmpeg2-devel - ffmpeg-devel gtk+3-devel libltdl-devel libarchive-devel file-devel" + ffmpeg-devel gtk+3-devel libltdl-devel libarchive-devel file-devel libgsf-devel" short_desc="Library used to extract meta data from files" maintainer="Martin Riese " license="GPL-3.0-or-later" diff --git a/srcpkgs/libsigsegv/template b/srcpkgs/libsigsegv/template index 13352c58bc46..fa3087e531b6 100644 --- a/srcpkgs/libsigsegv/template +++ b/srcpkgs/libsigsegv/template @@ -1,6 +1,6 @@ # Template file for 'libsigsegv' pkgname=libsigsegv -version=2.12 +version=2.13 revision=1 build_style=gnu-configure short_desc="Handling page faults in user mode" @@ -8,21 +8,9 @@ maintainer="Martin Riese " license="GPL-2" homepage="https://www.gnu.org/software/libsigsegv/" distfiles="https://ftpmirror.gnu.org/libsigsegv/libsigsegv-${version}.tar.gz" -checksum=3ae1af359eebaa4ffc5896a1aee3568c052c99879316a1ab57f8fe1789c390b6 +checksum=be78ee4176b05f7c75ff03298d84874db90f4b6c9d5503f0da1226b3a3c48119 configure_args="--enable-shared" -post_configure() { - case "$XBPS_TARGET_MACHINE" in - arm*-musl) - # Avoid double include of signal.h - sed -e "s;#define HAVE_SYS_SIGNAL_H 1;#undef HAVE_SYS_SIGNAL_H;" \ - -i ${wrksrc}/config.h - # struct sigcontext already defined through sigsegv.h - sed -e "s;#include ;;" \ - -i ${wrksrc}/src/fault-linux-arm-old.h - ;; - esac -} libsigsegv-devel_package() { short_desc+=" - development files" depends="${sourcepkg}>=${version}_${revision}"