diff -Nru xneur-0.20.0/debian/changelog xneur-0.20.0/debian/changelog --- xneur-0.20.0/debian/changelog 2021-01-08 16:42:41.000000000 +0100 +++ xneur-0.20.0/debian/changelog 2024-04-24 23:52:01.000000000 +0200 @@ -1,3 +1,16 @@ +xneur (0.20.0-3.1) unstable; urgency=medium + + [ Andreas Rönnquist ] + * Non-maintainer upload. + * Add patch to port to PCRE2 - Thanks to Yavor Doganov + (Closes: #999922) + * Build depend on pcre2 + + [ Bastian Germann ] + * Build with -Wno-error=stringop-overflow (Closes: #1037902) + + -- Andreas Rönnquist Wed, 24 Apr 2024 23:52:01 +0200 + xneur (0.20.0-3) unstable; urgency=medium * Add enchant2.patch: build with libenchant2, thanks Laurent Bigonville diff -Nru xneur-0.20.0/debian/control xneur-0.20.0/debian/control --- xneur-0.20.0/debian/control 2021-01-08 16:42:29.000000000 +0100 +++ xneur-0.20.0/debian/control 2024-04-24 23:51:21.000000000 +0200 @@ -7,7 +7,7 @@ libx11-dev, libxmu-headers, libxt-dev, - libpcre3-dev, + libpcre2-dev, pkg-config, libenchant-2-dev, libgstreamer1.0-dev, @@ -46,7 +46,7 @@ Architecture: any Section: libdevel Depends: ${shlibs:Depends}, ${misc:Depends}, - libpcre3-dev, + libpcre2-dev, libenchant-2-dev, libxneur (= ${binary:Version}) Description: development files for xneur frontends and plugins. diff -Nru xneur-0.20.0/debian/patches/0004-Port-to-PCRE2.patch xneur-0.20.0/debian/patches/0004-Port-to-PCRE2.patch --- xneur-0.20.0/debian/patches/0004-Port-to-PCRE2.patch 1970-01-01 01:00:00.000000000 +0100 +++ xneur-0.20.0/debian/patches/0004-Port-to-PCRE2.patch 2024-04-24 23:44:13.000000000 +0200 @@ -0,0 +1,114 @@ +From: Yavor Doganov +Bug-Debian: https://bugs.debian.org/999922 +Date: Wed, 24 Apr 2024 23:42:01 +0200 +Subject: Port to PCRE2 +Last-Update: 2023-12-20 + +--- + configure.ac | 2 +- + lib/misc/regexp.c | 50 ++++++++++++++++++++++++++++++++------------------ + 2 files changed, 33 insertions(+), 19 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 5cae4f4..dcb6207 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -143,7 +143,7 @@ if test "x$with_debug" == "xyes"; then + AC_DEFINE(WITH_DEBUG, 1, [Define if you want debug support]) + fi + +-PKG_CHECK_MODULES(PCRE, [libpcre >= 5.0]) ++PKG_CHECK_MODULES(PCRE, [libpcre2-8]) + + AC_ARG_WITH(keylogger, [ --without-keylogger Compile without keylogger function]) + if test "x$with_keylogger" != "xno"; then +diff --git a/lib/misc/regexp.c b/lib/misc/regexp.c +index 728036e..aea6029 100644 +--- a/lib/misc/regexp.c ++++ b/lib/misc/regexp.c +@@ -21,7 +21,8 @@ + # include "config.h" + #endif + +-#include ++#define PCRE2_CODE_UNIT_WIDTH 8 ++#include + + #include + #include +@@ -31,45 +32,58 @@ + + int check_regexp_match(const char *str, const char *pattern) + { +- int options = PCRE_UTF8; +- const char *error; +- int erroffset; ++ pcre2_compile_context *ctxt; ++ uint32_t options = PCRE2_UTF; ++ int error; ++ PCRE2_SIZE erroffset; + + //log_message(DEBUG, "Processing word '%s' against regular expression '%s'", str, pattern); + +- const unsigned char *tables = pcre_maketables(); +- pcre *re = pcre_compile(pattern, options, &error, &erroffset, tables); ++ ctxt = pcre2_compile_context_create(NULL); ++ const uint8_t *tables = pcre2_maketables(NULL); ++ pcre2_set_character_tables(ctxt, tables); ++ pcre2_code *re = pcre2_compile((PCRE2_SPTR)pattern, strlen(pattern), ++ options, &error, &erroffset, ctxt); ++ pcre2_maketables_free(NULL, tables); ++ pcre2_compile_context_free(ctxt); + if (!re) + { + log_message(ERROR, _("Can't compile regular expression '%s'"), pattern); + return FALSE; + } + +- int str_len = strlen(str); ++ PCRE2_SIZE str_len = strlen(str); + +- int ovector[50]; +- int count = pcre_exec(re, NULL, str, str_len, 0, 0, ovector, 50); +- if (count <= 0 && count != PCRE_ERROR_NOMATCH) ++ pcre2_match_data *ovector; ++ ovector = pcre2_match_data_create(50, NULL); ++ int count = pcre2_match(re, (PCRE2_SPTR)str, str_len, 0, 0, ovector, NULL); ++ if (count <= 0 && count != PCRE2_ERROR_NOMATCH) + { + log_message(ERROR, _("Can't exec regular expression '%s', eror code %d"), pattern, count); +- pcre_free(re); +- pcre_free((void*)tables); ++ pcre2_code_free(re); ++ pcre2_match_data_free(ovector); + return FALSE; + } + +- pcre_free(re); +- pcre_free((void*)tables); ++ pcre2_code_free(re); + +- if (count == PCRE_ERROR_NOMATCH) ++ if (count == PCRE2_ERROR_NOMATCH) ++ { ++ pcre2_match_data_free(ovector); + return FALSE; ++ } + +- const char *pcre_string = NULL; +- if(pcre_get_substring(str, ovector, count, 0, &pcre_string) < 0) ++ PCRE2_UCHAR *pcre_string; ++ if(pcre2_substring_get_bynumber(ovector, 0, &pcre_string, &str_len) < 0) ++ { ++ pcre2_match_data_free(ovector); + return FALSE; ++ } + + //log_message(TRACE, _("Match word '%s' and PERL pattern '%s'"), str, pattern); + +- pcre_free_substring(pcre_string); ++ pcre2_substring_free(pcre_string); ++ pcre2_match_data_free(ovector); + + return TRUE; + } diff -Nru xneur-0.20.0/debian/patches/series xneur-0.20.0/debian/patches/series --- xneur-0.20.0/debian/patches/series 2021-01-08 16:12:02.000000000 +0100 +++ xneur-0.20.0/debian/patches/series 2024-04-24 23:43:04.000000000 +0200 @@ -1,3 +1,4 @@ 01-fix-arg-parsing.patch enchant2.patch gcc-10.patch +0004-Port-to-PCRE2.patch diff -Nru xneur-0.20.0/debian/rules xneur-0.20.0/debian/rules --- xneur-0.20.0/debian/rules 2021-01-08 16:42:29.000000000 +0100 +++ xneur-0.20.0/debian/rules 2024-04-24 23:39:13.000000000 +0200 @@ -1,5 +1,6 @@ #!/usr/bin/make -f export DH_VERBOSE=1 +export DEB_CFLAGS_MAINT_APPEND = -Wno-error=stringop-overflow %: dh $@