Bug#999931: virtuoso-opensource: depends on obsolete pcre3 library

2024-03-04 Thread Yavor Doganov
Hi Andreas,

On Wed, 28 Feb 2024 18:36:04 +0200,
Andreas Beckmann wrote:
> On Wed, 20 Dec 2023 21:18:20 +0200 Yavor Doganov  wrote:
> > Please find attached a patch;
> 
> Thanks for the patch, I uploaded it to Debian and so far noone
> complained ;-)

Thanks!  Complaints usually come a bit later...
 
> But the patch doesn't apply cleanly on newer virtuoso-opensource
> versions, there are actually changes in pcre usage in
> libsrc/Wi/sqlbif.h that require adjustments.

Right; there's a new function.

> Could you take a look again and update the patch?

Attached is a patch (commit made to the try-7.2.12 branch) that
updates pcre2.patch so that it applies cleanly and restores the
build-dependency on libpcre2-dev.

> I've never worked with (any version of) pcre (from the programmer
> persepective,

Likewise, I'm a complete novice here.  It would be nice to finish this
transition, though.
>From 82b97264413540aa72d96297a93a6fd24f56adc2 Mon Sep 17 00:00:00 2001
From: Yavor Doganov 
Date: Mon, 4 Mar 2024 16:29:34 +0200
Subject: [PATCH] pcre2.patch: Update for the new upstream release

---
 debian/changelog   |   4 +
 debian/control |   2 +-
 debian/patches/pcre2.patch | 152 -
 debian/patches/series  |   2 +-
 4 files changed, 107 insertions(+), 53 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 907e89fc6..a566f67f2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,12 @@
 virtuoso-opensource (7.2.12+dfsg-0.1) UNRELEASED; urgency=medium
 
+  [ Andreas Beckmann ]
   * Non-maintainer upload.
   * New upstream release.
 
+  [ Yavor Doganov ]
+  * debian/patches/pcre2.patch: Update for the new upstream release.
+
  -- Andreas Beckmann   Wed, 28 Feb 2024 15:19:59 +0100
 
 virtuoso-opensource (7.2.5.1+dfsg1-0.6) unstable; urgency=medium
diff --git a/debian/control b/debian/control
index 5fd05fab9..db9b573c4 100644
--- a/debian/control
+++ b/debian/control
@@ -14,7 +14,7 @@ Build-Depends: debhelper-compat (= 13),
gperf,
libldap2-dev,
libmagickwand-dev,
-   libpcre3-dev,
+   libpcre2-dev,
libreadline-dev,
libssl-dev,
libtirpc-dev,
diff --git a/debian/patches/pcre2.patch b/debian/patches/pcre2.patch
index 98c06be51..104c1abc9 100644
--- a/debian/patches/pcre2.patch
+++ b/debian/patches/pcre2.patch
@@ -2,12 +2,12 @@ Description: Port to PCRE2.
 Bug-Debian: https://bugs.debian.org/31
 Author: Yavor Doganov 
 Forwarded: no
-Last-Update: 2023-12-20
+Last-Update: 2024-03-04
 ---
 
 --- virtuoso-opensource.orig/libsrc/Wi/Makefile.am
 +++ virtuoso-opensource/libsrc/Wi/Makefile.am
-@@ -559,7 +559,7 @@
+@@ -563,7 +563,7 @@
$(libwi_base_la_sources)
  
  libwi_la_CFLAGS  = $(libwi_base_la_cflags)
@@ -18,7 +18,7 @@ Last-Update: 2023-12-20
  libwi_odbc_la_SOURCES += \
 --- virtuoso-opensource.orig/libsrc/Wi/bif_regexp.c
 +++ virtuoso-opensource/libsrc/Wi/bif_regexp.c
-@@ -30,7 +30,8 @@
+@@ -31,7 +31,8 @@
  
  // Debian maintainer: replaced by external PCRE
  // #include "util/pcrelib/pcre.h"
@@ -28,7 +28,7 @@ Last-Update: 2023-12-20
  
  /*
 typedef struct rx_query_s {
-@@ -66,15 +67,16 @@
+@@ -65,16 +66,17 @@
  typedef struct compiled_regexp_s
  {
int refctr;
@@ -42,14 +42,16 @@ Last-Update: 2023-12-20
  
 -int32 c_pcre_match_limit_recursion = 500;
 -int32 c_pcre_match_limit = 10;
+-int32 pcre_max_cache_sz = 2;
 +static pcre2_match_context *match_ctxt = NULL;
 +
 +uint32 c_pcre_match_limit_recursion = 500;
 +uint32 c_pcre_match_limit = 10;
- int32 pcre_max_cache_sz = 2;
++uint32 pcre_max_cache_sz = 2;
  int32 pcre_rnd_seed;
  
-@@ -97,6 +99,23 @@
+ id_hashed_key_t
+@@ -96,6 +98,23 @@
  }
  
  void
@@ -73,7 +75,7 @@ Last-Update: 2023-12-20
  release_compiled_regexp (id_hash_t *c_r, compiled_regexp_t *data)
  {
int delete_data;
-@@ -112,9 +131,7 @@
+@@ -111,9 +130,7 @@
if (!delete_data)
  return;
if (NULL != data->code)
@@ -84,7 +86,7 @@ Last-Update: 2023-12-20
dk_free (data, sizeof (compiled_regexp_t));
  }
  
-@@ -137,10 +154,11 @@
+@@ -136,10 +153,11 @@
  }
  
  static compiled_regexp_t *
@@ -99,9 +101,9 @@ Last-Update: 2023-12-20
regexp_key_t key;
compiled_regexp_t **val = NULL;
compiled_regexp_t tmp, *new_val;
-@@ -156,46 +174,18 @@
+@@ -155,46 +173,18 @@
  }
-   HT_LEAVE (c_r);
+   HT_UNLOCK (c_r);
dbg_printf (("regex compiling (%s) with options %x ...\n", pattern, 
options));
 -  tmp.code = pcre_compile (pattern, options, , , 0);
 +  tmp.code = pcre2_compile ((PCRE2_SPTR) pattern, strlen (pattern),
@@ -149,9 +151,9 @@ Last-Update: 2023-12-20
new_val->code = tmp.code;
 -  new_val->code_x = tmp.code_x;
new_val->refctr = 1;
-   HT_ENTER (c_r);
+   HT_WRLOCK (c_r);
pcre_cache_check (c_r);
-@@ -302,18 +292,18 @@
+@@ -301,18 +291,18 @@
  }
  
  
@@ -175,7 +177,7 @

Bug#999921: xymon: depends on obsolete pcre3 library

2024-02-12 Thread Yavor Doganov
Hi Roland,

Roland Rosenfeld wrote:
> Oh, now I see the problem: pcre_copy_substring() returns the length of
> the string on match, while pcre2_substring_copy_bynumber() returns 0
> on success.  So the above has to be changed from "> 0" to "== 0".

Of course...  Many thanks for finding and fixing my mistakes!

> For showgraph.c this fixes the issue, but there are more places where
> the return code of pcre2_substring_copy_bynumber() is checked, which
> also may need adoption.  I found the following places:

Right, thanks again.  Have you found some other issues?  I tried to
trigger as much PCRE-related code as possible but as I'm not familiar
with this program I'm afraid I couldn't manage.



Bug#1000093: mysql-workbench: depends on obsolete pcre3 library

2024-01-09 Thread Yavor Doganov
Control: tags -1 + patch

Please find attached a patch, basically only build-tested (I also ran
it but I find it difficult to test specifically the affected code).
Description: Port to PCRE2.
Bug-Debian: https://bugs.debian.org/193
Author: Yavor Doganov 
Forwarded: no
Last-Update: 2024-01-09
---

--- mysql-workbench-8.0.32+dfsg.orig/CMakeLists.txt
+++ mysql-workbench-8.0.32+dfsg/CMakeLists.txt
@@ -119,7 +119,7 @@
 endif(UNIX)
 
 
-pkg_check_modules(PCRE REQUIRED libpcre libpcrecpp)
+pkg_check_modules(PCRE REQUIRED libpcre2-8)
 pkg_check_modules(CAIRO REQUIRED cairo>=1.5.12)
 pkg_check_modules(UUID REQUIRED uuid)
 pkg_check_modules(LIBZIP REQUIRED libzip)
--- mysql-workbench-8.0.32+dfsg.orig/library/grt/src/grtpp_shell.cpp
+++ mysql-workbench-8.0.32+dfsg/library/grt/src/grtpp_shell.cpp
@@ -21,7 +21,8 @@
  * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 
  */
 
-#include 
+#define PCRE2_CODE_UNIT_WIDTH 8
+#include 
 #include "grtpp_shell.h"
 
 using namespace grt;
@@ -30,28 +31,34 @@
 
 char *get_value_from_text_ex_opt(const char *txt, int txt_length, const char 
*regexpr, unsigned int substring_nr,
  int options_for_exec) {
-  pcre *pcre_exp;
-  const char *error_str;
-  int erroffset;
-  int o_vector[O_VECTOR_COUNT];
-  int rc;
-  const char *ret_val;
+  pcre2_code *pcre_exp;
+  pcre2_match_data *md;
+  int error;
+  PCRE2_SIZE erroffset;
+  PCRE2_SIZE *o_vector;
+  PCRE2_UCHAR *ret_val;
   char *value = NULL;
 
   if (txt && *txt) {
-pcre_exp = pcre_compile(regexpr, PCRE_CASELESS, _str, , 
NULL);
+pcre_exp = pcre2_compile(reinterpret_cast(regexpr),
+ PCRE2_ZERO_TERMINATED, PCRE2_CASELESS,
+ , , NULL);
 if (pcre_exp) {
-  if ((rc = pcre_exec(pcre_exp, NULL, txt, txt_length, 0, 
options_for_exec, o_vector, O_VECTOR_COUNT)) > 0) {
-if (o_vector[substring_nr * 2] != -1) {
-  pcre_get_substring(txt, o_vector, rc, substring_nr, _val);
+  md = pcre2_match_data_create(O_VECTOR_COUNT, NULL);
+  if (pcre2_match(pcre_exp, reinterpret_cast(txt),
+  txt_length, 0, options_for_exec, md, NULL) > 0) {
+o_vector = pcre2_get_ovector_pointer(md);
+if ((int)o_vector[substring_nr * 2] > 0) {
+  pcre2_substring_get_bynumber(md, substring_nr, _val, );
 
-  value = g_strdup(ret_val);
+  value = g_strdup(reinterpret_cast(ret_val));
 
-  pcre_free_substring((char *)ret_val);
+  pcre2_substring_free(ret_val);
 }
   }
 
-  pcre_free(pcre_exp);
+  pcre2_code_free(pcre_exp);
+  pcre2_match_data_free(md);
 }
   }
 
--- 
mysql-workbench-8.0.32+dfsg.orig/backend/wbprivate/sqlide/db_sql_editor_history_be.cpp
+++ 
mysql-workbench-8.0.32+dfsg/backend/wbprivate/sqlide/db_sql_editor_history_be.cpp
@@ -26,7 +26,6 @@
 #include 
 
 #include 
-#include 
 
 #include "db_sql_editor_history_be.h"
 #include "sqlide/recordset_data_storage.h"
--- 
mysql-workbench-8.0.32+dfsg.orig/backend/wbpublic/grt/grt_string_list_model.cpp
+++ mysql-workbench-8.0.32+dfsg/backend/wbpublic/grt/grt_string_list_model.cpp
@@ -22,7 +22,8 @@
  */
 
 #include "grt_string_list_model.h"
-#include 
+#define PCRE2_CODE_UNIT_WIDTH 8
+#include 
 #include "grtpp_util.h"
 
 using namespace bec;
@@ -266,33 +267,43 @@
   }
 
   // compile regexp
-  pcre *patre;
+  pcre2_code *patre;
+  pcre2_match_data *md;
   {
-const char *error;
-int erroffset;
-patre = pcre_compile(regexp.c_str(), PCRE_UTF8 | PCRE_EXTRA, , 
, NULL);
-if (!patre)
+char error[120];
+PCRE2_SIZE erroffset;
+int err;
+patre = pcre2_compile(reinterpret_cast(regexp.c_str()),
+  PCRE2_ZERO_TERMINATED, PCRE2_UTF,
+  , , NULL);
+if (!patre) {
+  pcre2_get_error_message(err, reinterpret_cast(error),
+  sizeof(error));
   throw std::logic_error("error compiling regex " + std::string(error));
+}
   }
 
   // sift items
   size_t n = 0;
+  md = pcre2_match_data_create_from_pattern(patre, NULL);
   for (std::vector::iterator i = items.begin(); i != items.end(); ++i, 
++n) {
 if (*i) {
   const Item_handler  = _items[n];
-  int patres[2];
+  PCRE2_SIZE *patres;
 
-  int substr_count = pcre_exec(patre, NULL, item.val.c_str(), 
static_cast(item.val.size()), 0, 0, patres,
-   sizeof(patres) / sizeof(int));
+  int substr_count = pcre2_match(patre, 
reinterpret_cast(item.val.c_str()),
+ item.val.size(), 0, 0, md, NULL);
+  patres = pcre2_get_ovector_pointer(md);
 
-  if (substr_count > 0 && patres[1] == (int)item.val.size())
+  if (substr_count > 0 && patres[1] == item.val.size())
 *i = match_means_visible;
   else
 *i = !match_means_visible;

Bug#1000113: kodi: depends on obsolete pcre3 library

2024-01-07 Thread Yavor Doganov
Control: tags -1 + patch

Please find attached a patch; I did my best to test it.

I believe the changes to the CRegExp class (xbmc/utils/RegExp.*) are
sane; they are tested in xbmc/utils/test/TestRegexp.cpp and some other
test programs that use CRegExp.  I added three more test cases:
invalid pattern, UTF-8 compilation/matching, and JIT.  The latter two
should pass on all the buildds since PCRE2 is built everywhere with
Unicode support, and on those architectures where JIT support is not
available, m_JitSupported will be false so the related functions in
the methods RegComp and PrivateRegFind will not be invoked.
Furthermore, according to the PCRE2 documentation, an application
doesn't need to check explicitly for JIT support because all of the
PCRE2 JIT-related functions have dummy placeholders and silently do
nothing if JIT support is not available.

The changes to CFTPParse (xbmc/filesystem/FTPParse.cpp) are clumsy,
overly verbose code; I'm not proud of it at all.  I tried to minimize
casting as much as possible.  AFAICS it's used only to obtain an ftp
directory contents.  I tried adding some directories from
ftp.gnustep.org as source, but of course there are no media files
there.  Then I installed an FTP server and populated /srv/ftp/ with
some video files.  Kodi displays their properties and plays them, but
I cannot be sure that CFTPParse methods are actually used.  I can't
put breakpoints in gdb as the app runs in fullscreen mode and I don't
know how to switch to normal mode.  (In hindsight, I guess I could
have added some printf statements but it's too late now and the beast
takes nearly 4 hours to build on my machine.)  An unpleasant obstacle
was that Kodi frequently crashes my videocard driver (nouveau) which
made testing very frustrating.

I guess the patch needs more testing and a closer look by someone
familiar with this package (ideally both as a user and maintainer), on
a machine that is capable of running Kodi.

Please let me know if there are problems that require correction.
Description: Port to PCRE2.
Bug-Debian: https://bugs.debian.org/1000113
Author: Yavor Doganov 
Forwarded: no
Last-Update: 2024-01-07
---

--- kodi-20.2+dfsg.orig/cmake/modules/FindPCRE.cmake
+++ kodi-20.2+dfsg/cmake/modules/FindPCRE.cmake
@@ -77,45 +77,34 @@
 
 else()
   # Populate paths for find_package_handle_standard_args
-  find_path(PCRE_INCLUDE_DIR pcre.h)
+  find_path(PCRE_INCLUDE_DIR pcre2.h)
 
-  find_library(PCRECPP_LIBRARY_RELEASE NAMES pcrecpp)
-  find_library(PCRECPP_LIBRARY_DEBUG NAMES pcrecppd)
-
-  find_library(PCRE_LIBRARY_RELEASE NAMES pcre)
-  find_library(PCRE_LIBRARY_DEBUG NAMES pcred)
+  find_library(PCRE_LIBRARY_RELEASE NAMES pcre2-8)
 endif()
   else()
 
 if(PKG_CONFIG_FOUND)
-  pkg_check_modules(PC_PCRE libpcrecpp QUIET)
+  pkg_check_modules(PC_PCRE libpcre2-8 QUIET)
 endif()
 
-find_path(PCRE_INCLUDE_DIR pcrecpp.h
+find_path(PCRE_INCLUDE_DIR pcre2.h
PATHS ${PC_PCRE_INCLUDEDIR})
-find_library(PCRECPP_LIBRARY_RELEASE NAMES pcrecpp
- PATHS ${PC_PCRE_LIBDIR})
-find_library(PCRE_LIBRARY_RELEASE NAMES pcre
+find_library(PCRE_LIBRARY_RELEASE NAMES pcre2-8
   PATHS ${PC_PCRE_LIBDIR})
-find_library(PCRECPP_LIBRARY_DEBUG NAMES pcrecppd
-   PATHS ${PC_PCRE_LIBDIR})
-find_library(PCRE_LIBRARY_DEBUG NAMES pcred
-   PATHS ${PC_PCRE_LIBDIR})
 set(PCRE_VERSION ${PC_PCRE_VERSION})
 
   endif()
 
   include(SelectLibraryConfigurations)
-  select_library_configurations(PCRECPP)
   select_library_configurations(PCRE)
 
   include(FindPackageHandleStandardArgs)
   find_package_handle_standard_args(PCRE
-REQUIRED_VARS PCRECPP_LIBRARY PCRE_LIBRARY 
PCRE_INCLUDE_DIR
+REQUIRED_VARS PCRE_LIBRARY PCRE_INCLUDE_DIR
 VERSION_VAR PCRE_VERSION)
 
   if(PCRE_FOUND)
-set(PCRE_LIBRARIES ${PCRECPP_LIBRARY} ${PCRE_LIBRARY})
+set(PCRE_LIBRARIES ${PCRE_LIBRARY})
 set(PCRE_INCLUDE_DIRS ${PCRE_INCLUDE_DIR})
 if(WIN32)
   set(PCRE_DEFINITIONS -DPCRE_STATIC=1)
@@ -166,5 +155,5 @@
 endif()
   endif()
 
-  mark_as_advanced(PCRE_INCLUDE_DIR PCRECPP_LIBRARY PCRE_LIBRARY)
+  mark_as_advanced(PCRE_INCLUDE_DIR PCRE_LIBRARY)
 endif()
--- kodi-20.2+dfsg.orig/xbmc/utils/RegExp.h
+++ kodi-20.2+dfsg/xbmc/utils/RegExp.h
@@ -13,16 +13,8 @@
 #include 
 #include 
 
-/* make sure stdlib.h is included before including pcre.h inside the
-   namespace; this works around stdlib.h definitions also living in
-   the PCRE namespace */
-#include 
-
-namespace PCRE {
-struct real_pcre_jit_stack; // forward declaration for PCRE without JIT
-typedef struct real_pcre_jit_stack pcre_jit_stack;
-#include 
-}
+#define PCRE2_CODE_UNIT_WIDTH 8
+#include 
 
 class CRegExp

Bug#1000100: eiskaltdcpp: depends on obsolete pcre3 library

2024-01-02 Thread Yavor Doganov
Control: tags -1 + patch

Please find a patch attached; build-tested only.
Description: Port to PCRE2.
Bug-Debian: https://bugs.debian.org/1000100
Author: Yavor Doganov 
Forwarded: no
Last-Update: 2024-01-02
---

--- eiskaltdcpp-2.4.2.orig/cmake/FindPCRE.cmake
+++ eiskaltdcpp-2.4.2/cmake/FindPCRE.cmake
@@ -4,23 +4,22 @@
 #  PCRE_INCLUDE_DIR - the PCRE include directory
 #  PCRE_LIBRARIES - link these to use PCRE
 
-if(PCRE_INCLUDE_DIR AND PCRE_LIBRARY AND PCRECPP_LIBRARY)
+if(PCRE_INCLUDE_DIR AND PCRE_LIBRARY)
   set(PCRE_FIND_QUIETLY TRUE)
-endif(PCRE_INCLUDE_DIR AND PCRE_LIBRARY AND PCRECPP_LIBRARY)
+endif(PCRE_INCLUDE_DIR AND PCRE_LIBRARY)
 
 # Include dir
-find_path(PCRE_INCLUDE_DIR NAMES pcre.h)
+find_path(PCRE_INCLUDE_DIR NAMES pcre2.h)
 
 # Libraries
-find_library(PCRE_LIBRARY NAMES pcre)
-find_library(PCRECPP_LIBRARY NAMES pcrecpp)
+find_library(PCRE_LIBRARY NAMES pcre2-8)
 
-if(PCRE_LIBRARY AND PCRECPP_LIBRARY)
-  set(PCRE_LIBRARIES ${PCRECPP_LIBRARY} ${PCRE_LIBRARY})
-endif(PCRE_LIBRARY AND PCRECPP_LIBRARY)
+if(PCRE_LIBRARY)
+  set(PCRE_LIBRARIES ${PCRE_LIBRARY})
+endif(PCRE_LIBRARY)
 
 INCLUDE(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCRE DEFAULT_MSG PCRE_LIBRARIES 
PCRE_INCLUDE_DIR)
 
-MARK_AS_ADVANCED(PCRE_LIBRARIES PCRE_INCLUDE_DIR PCRE_LIBRARY PCRECPP_LIBRARY)
+MARK_AS_ADVANCED(PCRE_LIBRARIES PCRE_INCLUDE_DIR PCRE_LIBRARY)
 
--- eiskaltdcpp-2.4.2.orig/dcpp/ADLSearch.cpp
+++ eiskaltdcpp-2.4.2/dcpp/ADLSearch.cpp
@@ -32,7 +32,8 @@
 #include "StringTokenizer.h"
 
 #ifdef USE_PCRE
-#include "pcrecpp.h"
+#define PCRE2_CODE_UNIT_WIDTH 8
+#include 
 #endif
 
 namespace dcpp {
@@ -172,11 +173,28 @@
 bool ADLSearch::searchAll(const string& s) {
 #ifdef USE_PCRE
 if(bUseRegexp){
-pcrecpp::RE_Options options;
-options.set_utf8(true);
-options.set_caseless(true);
-pcrecpp::RE regexp(regexpstring, options);
-if(regexp.FullMatch(s))
+pcre2_code *re;
+pcre2_match_data *md;
+PCRE2_SPTR pat, subj;
+PCRE2_SIZE offset;
+uint32_t utf = 0, options = 0;
+int rc;
+
+pcre2_config(PCRE2_CONFIG_UNICODE, );
+if(utf)
+options |= PCRE2_UTF;
+options |= PCRE2_CASELESS;
+pat = reinterpret_cast(regexpstring.c_str());
+subj = reinterpret_cast(s.c_str());
+re = pcre2_compile(pat, PCRE2_ZERO_TERMINATED, options,
+   , , nullptr);
+if(offset != 0)
+return false;
+md = pcre2_match_data_create_from_pattern(re, nullptr);
+rc = pcre2_match(re, subj, s.size(), 0, 0, md, nullptr);
+pcre2_code_free(re);
+pcre2_match_data_free(md);
+if(rc >= 0)
 return true;
 else
 return false;


Bug#1000005: passwordmaker-cli: depends on obsolete pcre3 library

2024-01-02 Thread Yavor Doganov
Control: tags -1 + patch

Please find a patch attached.
Description: Port to PCRE2.
Bug-Debian: https://bugs.debian.org/105
Bug: https://forums.passwordmaker.org/index.php?topic=1834.0
Author: Yavor Doganov 
Forwarded: no
Last-Update: 2024-01-02
---

--- passwordmaker-cli-1.5+dfsg.orig/unix.mak
+++ passwordmaker-cli-1.5+dfsg/unix.mak
@@ -34,7 +34,7 @@
 LDFLAGS += $(shell dpkg-buildflags --get LDFLAGS)
 CPPFLAGS += $(shell dpkg-buildflags --get CPPFLAGS)
 INCPATH = -I.
-LIBS = -lmhash -lpcrecpp
+LIBS = -lmhash -lpcre2-8
 
 ifeq ($(USE_MAC), 1)
CFLAGS := $(CFLAGS) -m32
--- passwordmaker-cli-1.5+dfsg.orig/urlsearch.cpp
+++ passwordmaker-cli-1.5+dfsg/urlsearch.cpp
@@ -24,7 +24,8 @@
 #include 
 #include 
 #include 
-#include 
+#define PCRE2_CODE_UNIT_WIDTH 8
+#include 
 #include "stdafx.h"
 #include "tinyxml.h"
 #include "urlsearch.h"
@@ -32,9 +33,24 @@
 using namespace std;
 
 int UrlSearch::regexCmp(const char *regexp, const char *string) {
-   pcrecpp::RE re(regexp);
+   pcre2_code *re;
+   pcre2_match_data *md;
+   PCRE2_SPTR pat, subj;
+   PCRE2_SIZE offset;
+   int rc;
 
-   if(re.FullMatch(string)) {
+   pat = reinterpret_cast(regexp);
+   subj = reinterpret_cast(string);
+   re = pcre2_compile(pat, PCRE2_ZERO_TERMINATED, 0,
+  , , nullptr);
+   if(offset != 0) {
+   return 0;
+   }
+   md = pcre2_match_data_create_from_pattern(re, nullptr);
+   rc = pcre2_match(re, subj, PCRE2_ZERO_TERMINATED, 0, 0, md, nullptr);
+   pcre2_code_free(re);
+   pcre2_match_data_free(md);
+   if(rc >= 0) {
return 1;
}
else {


Bug#999956: snort: depends on obsolete pcre3 library

2024-01-02 Thread Yavor Doganov
Control: tags -1 + patch

Please find attached a patch (it applies to the latest upstream
release 2.9.20 as well but not to the 3.x series).
Description: Port to PCRE2.
Bug-Debian: https://bugs.debian.org/56
Author: Yavor Doganov 
Forwarded: no
Last-Update: 2024-01-02
---

--- snort-2.9.15.1.orig/configure.in
+++ snort-2.9.15.1/configure.in
@@ -465,19 +465,21 @@
 CPPFLAGS="${CPPFLAGS} -I${with_libpcre_includes}"
 ICONFIGFLAGS="${ICONFIGFLAGS} -I${with_libpcre_includes}"
 else
-CPPFLAGS="${CPPFLAGS} `pcre-config --cflags`"
+CPPFLAGS="${CPPFLAGS} `pcre2-config --cflags`"
 fi
 
 if test "x$with_libpcre_libraries" != "xno"; then
 LDFLAGS="${LDFLAGS}  -L${with_libpcre_libraries}"
 else
-LDFLAGS="${LDFLAGS} `pcre-config --libs`"
+LDFLAGS="${LDFLAGS} `pcre2-config --libs8`"
 fi
 
 # PCRE configuration (required)
 # Verify that we have the headers
 PCRE_H=""
-AC_CHECK_HEADERS(pcre.h,, PCRE_H="no")
+AC_CHECK_HEADERS([pcre2.h], [], [PCRE_H="no"], [[
+#define PCRE2_CODE_UNIT_WIDTH 8
+]])
 if test "x$PCRE_H" = "xno"; then
   echo
   echo "   ERROR!  Libpcre header not found."
@@ -487,36 +489,13 @@
 
 # Verify that we have the library
 PCRE_L=""
-pcre_version_six=""
-AC_CHECK_LIB(pcre, pcre_compile, ,PCRE_L="no")
+AC_CHECK_LIB([pcre2-8], [pcre2_compile_8], [], [PCRE_L="no"])
 if test "x$PCRE_L" = "xno"; then
 echo
 echo "   ERROR!  Libpcre library not found."
 echo "   Get it from http://www.pcre.org;
 echo
 exit 1
-else
-AC_MSG_CHECKING(for libpcre version 6.0 or greater)
-AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[
-   #if (PCRE_MAJOR < 6)
-   #error "Version failure"
-   #else
-   int a, b = 0, c = 0, d = 0;
-   pcre *tmp = NULL;
-   a = pcre_copy_named_substring(tmp, "", , c, "", "", d);
-   #endif
-  ]])],[pcre_version_six="yes"],[pcre_version_six="no"])
-fi
-
-if test "x$pcre_version_six" != "xyes"; then
-AC_MSG_RESULT(no)
-echo
-echo "ERROR!  Libpcre library version >= 6.0 not found."
-echo "Get it from http://www.pcre.org;
-echo
-exit 1
-else
-AC_MSG_RESULT(yes)
 fi
 
 # OPENSSL SHA configuration (optional)
--- snort-2.9.15.1.orig/src/dynamic-plugins/sf_engine/sf_snort_plugin_api.h
+++ snort-2.9.15.1/src/dynamic-plugins/sf_engine/sf_snort_plugin_api.h
@@ -30,7 +30,8 @@
 #ifndef SF_SNORT_PLUGIN_API_H_
 #define SF_SNORT_PLUGIN_API_H_
 
-#include "pcre.h"
+#define PCRE2_CODE_UNIT_WIDTH 8
+#include 
 #include "stdio.h"
 
 #ifndef WIN32
@@ -226,7 +227,7 @@
 {
 char *expr;
 void *compiled_expr;
-void *compiled_extra;
+void *ctxt;
 uint32_t compile_flags;
 uint32_t flags; /* must include a CONTENT_BUF_X */
 int32_t   offset;
@@ -507,7 +508,7 @@
 ENGINE_LINKAGE void setAltDetect(uint8_t *buf, uint16_t altLen);
 
 ENGINE_LINKAGE int pcreExecWrapper(const PCREInfo *pcre_info, const char *buf, 
int len, int start_offset,
-int options, int *ovector, int ovecsize);
+int options, size_t *ovector, int 
ovecsize);
 
 static inline int invertMatchResult(int retVal)
 {
--- snort-2.9.15.1.orig/src/detection-plugins/sp_pcre.h
+++ snort-2.9.15.1/src/detection-plugins/sp_pcre.h
@@ -49,17 +49,18 @@
 
 void SetupPcre(void);
 
-#include 
+#define PCRE2_CODE_UNIT_WIDTH 8
+#include 
 typedef struct _PcreData
 {
-pcre *re;   /* compiled regex */
-pcre_extra *pe; /* studied regex foo */
-int options;/* sp_pcre specfic options (relative & inverse) */
+pcre2_code *re; /* compiled regex */
+pcre2_match_context *ctxt;
+uint32_t options;   /* sp_pcre specfic options (relative & inverse) */
 char *expression;
-uint32_t search_offset;
+PCRE2_SIZE search_offset;
 } PcreData;
 
-void PcreCapture(struct _SnortConfig *sc, const void *code, const void *extra);
+void PcreCapture(struct _SnortConfig *sc, const void *code);
 void PcreFree(void *d);
 uint32_t PcreHash(void *d);
 int PcreCompare(void *l, void *r);
--- snort-2.9.15.1.orig/src/detection-plugins/sp_pcre.c
+++ snort-2.9.15.1/src/detection-plugins/sp_pcre.c
@@ -46,7 +46,8 @@
 
 #include "sp_pcre.h"
 
-#include 
+#define PCRE2_CODE_UNIT_WIDTH 8
+#include 
 
 #include "snort.h"
 #include "profiler.h"
@@ -77,8 +78,8 @@
 PcreData *data = (PcreData *)d;
 
 free(data->expression);
-free(data->re);
-free(data->pe);
+pcre2_code_free(data->re);
+pcre2_match_context_free(data->ctxt);
 free(data);
 }
 
@@ -161,8 +162,8 @@
 pcre_dup->expression = pcre_src->expression;
   

Bug#1000126: gpt: depends on obsolete pcre3 library

2024-01-02 Thread Yavor Doganov
Control: tags -1 + patch

Please find a patch attached.
Description: Port to PCRE2.
Bug-Debian: https://bugs.debian.org/1000126
Author: Yavor Doganov 
Forwarded: no
Last-Update: 2024-01-02
---

--- gpt.orig/configure.ac
+++ gpt/configure.ac
@@ -109,10 +109,10 @@
 
 # AC_MSG_CHECKING(for pcre)
 
-AC_CHECK_PROG(has_pcre, pcre-config, yes)
+AC_CHECK_PROG(has_pcre, pcre2-config, yes)
 
 if test "x$has_pcre" = "xyes"; then
-  PCRE_CONFIG="pcre-config"
+  PCRE_CONFIG="pcre2-config"
 else
   AC_MSG_ERROR(
   [
@@ -123,8 +123,8 @@
 
 #pcrecpp
 
-PCRE_INC=`${PCRE_CONFIG} --cglags`
-PCRE_LIB="-L`${PCRE_CONFIG} --prefix`/lib -lpcrecpp"
+PCRE_INC=`${PCRE_CONFIG} --cflags`
+PCRE_LIB=`${PCRE_CONFIG} --libs8`
 AC_SUBST(PCRE_INC)
 AC_SUBST(PCRE_LIB)
 
--- gpt.orig/src/modules/interpreter/InterpreterDBG.cpp
+++ gpt/src/modules/interpreter/InterpreterDBG.cpp
@@ -33,7 +33,8 @@
   #include 
 #endif
 
-#include 
+#define PCRE2_CODE_UNIT_WIDTH 8
+#include 
 #include 
 
 #ifndef WIN32
@@ -403,15 +404,40 @@
 void InterpreterDBG::processBreakpointCMD(string& bpcommand) {
  //cerr << "process breakpoint " << bpcommand << endl;
 
-  string cmd;
-  string file;
-  int line;
-  pcrecpp::RE re("breakpoint 
cmd=(add|remove).*file=\"([^\"]*)\".*line=(\\d+)");
-  if(!re.FullMatch(bpcommand, , , )) {
+  pcre2_code *re;
+  pcre2_match_data *md;
+  PCRE2_UCHAR *str;
+  PCRE2_SPTR pat, subj;
+  PCRE2_SIZE offset;
+  int line, rc;
+
+  pat = reinterpret_cast("breakpoint 
cmd=(add|remove).*file=\"([^\"]*)\".*line=(\\d+)");
+  subj = reinterpret_cast(bpcommand.c_str());
+  re = pcre2_compile(pat, PCRE2_ZERO_TERMINATED, 0, , , nullptr);
+  if(offset != 0) {
+return;
+  }
+
+  md = pcre2_match_data_create_from_pattern(re, nullptr);
+  rc = pcre2_match(re, subj, bpcommand.length(), 0, 0, md, nullptr);
+  pcre2_code_free(re);
+  if(rc != 4) {
 //cerr << PACKAGE << ": comando invalido (2): \"" << cmd << "\"" << endl;
+pcre2_match_data_free(md);
 return;
   }
 
+  pcre2_substring_get_bynumber(md, 1, , );
+  string cmd(reinterpret_cast(str));
+  pcre2_substring_free(str);
+  pcre2_substring_get_bynumber(md, 2, , );
+  string file(reinterpret_cast(str));
+  pcre2_substring_free(str);
+  pcre2_substring_get_bynumber(md, 3, , );
+  line = atoi((const char *)str);
+  pcre2_substring_free(str);
+  pcre2_match_data_free(md);
+
   //cerr << PACKAGE << ": capturado:" << cmd << ":" << file << ":" << line << 
endl;
 
   if(cmd == "add") {


Bug#999938: trafficserver: depends on obsolete pcre3 library

2023-12-29 Thread Yavor Doganov
Control: tags -1 + patch sid trixie

Please find attached a patch which I admit I could not test properly.

This package is fairly specialized and I'm absolutely unfamiliar with
it.  It requires some extra knowledge and right configuration in order
to expose the functionality that has to be tested.  Also, some of the
affected plugins fail to load due to #1020989.

The testsuite passes, and the server runs and loads some of the
pcre-based global plugins.  I also tested loading of the remap plugins
with a hack to workaround #1020989 (I'll follow-up there with more
details).
Description: Port to PCRE2.
Bug-Debian: https://bugs.debian.org/bug=38
Bug: https://github.com/apache/trafficserver/issues/8780
Author: Yavor Doganov 
Forwarded: no
Last-Update: 2023-12-29
---

--- trafficserver-9.2.3+ds.orig/build/pcre.m4
+++ trafficserver-9.2.3+ds/build/pcre.m4
@@ -45,12 +45,12 @@
   fi
 ],
 [
-  AC_CHECK_PROG(PCRE_CONFIG, pcre-config, pcre-config)
+  AC_CHECK_PROG(PCRE_CONFIG, pcre2-config, pcre2-config)
   if test "x$PCRE_CONFIG" != "x"; then
 enable_pcre=yes
 pcre_base_dir="`$PCRE_CONFIG --prefix`"
 pcre_include="`$PCRE_CONFIG --cflags | sed -es/-I//`"
-pcre_ldflags="`$PCRE_CONFIG --libs | sed -es/-lpcre// -es/-L//`"
+pcre_ldflags="`$PCRE_CONFIG --libs8 | sed -es/-lpcre2-8// -es/-L//`"
   fi
 ])
 
@@ -58,7 +58,7 @@
   AC_MSG_CHECKING([for pcre location])
   AC_CACHE_VAL(ats_cv_pcre_dir,[
   for dir in /usr/local /usr ; do
-if test -d $dir && ( test -f $dir/include/pcre.h || test -f 
$dir/include/pcre/pcre.h ); then
+if test -d $dir && ( test -f $dir/include/pcre2.h ); then
   ats_cv_pcre_dir=$dir
   break
 fi
@@ -76,7 +76,7 @@
   fi
 else
   AC_MSG_CHECKING(for pcre headers in $pcre_include)
-  if test -d $pcre_include && test -d $pcre_ldflags && ( test -f 
$pcre_include/pcre.h || test -f $pcre_include/pcre/pcre.h ); then
+  if test -d $pcre_include && test -d $pcre_ldflags && ( test -f 
$pcre_include/pcre2.h ); then
 AC_MSG_RESULT([ok])
   else
 AC_MSG_RESULT([not found])
@@ -93,14 +93,15 @@
 TS_ADDTO(LDFLAGS, [-L${pcre_ldflags}])
 TS_ADDTO_RPATH(${pcre_ldflags})
   fi
-  AC_CHECK_LIB([pcre], [pcre_exec], [pcre_have_libs=1])
+  AC_CHECK_LIB([pcre2-8], [pcre2_match_8], [pcre_have_libs=1])
   if test "$pcre_have_libs" != "0"; then
-AC_CHECK_HEADERS(pcre.h, [pcre_have_headers=1])
-AC_CHECK_HEADERS(pcre/pcre.h, [pcre_have_headers=1])
+AC_CHECK_HEADERS([pcre2.h], [pcre_have_headers=1], [], [[
+#define PCRE2_CODE_UNIT_WIDTH 8
+]])
   fi
   if test "$pcre_have_headers" != "0"; then
 AC_DEFINE(HAVE_LIBPCRE,1,[Compiling with pcre support])
-AC_SUBST(LIBPCRE, [-lpcre])
+AC_SUBST(LIBPCRE, [-lpcre2-8])
   else
 enable_pcre=no
 CPPFLAGS=$saved_cppflags
--- trafficserver-9.2.3+ds.orig/include/tscore/Regex.h
+++ trafficserver-9.2.3+ds/include/tscore/Regex.h
@@ -30,11 +30,8 @@
 
 #include "tscore/ink_config.h"
 
-#ifdef HAVE_PCRE_PCRE_H
-#include 
-#else
-#include 
-#endif
+#define PCRE2_CODE_UNIT_WIDTH 8
+#include 
 
 /// Match flags for regular expression evaluation.
 enum REFlags {
@@ -94,8 +91,7 @@
   int get_capture_count();
 
 private:
-  pcre *regex = nullptr;
-  pcre_extra *regex_extra = nullptr;
+  pcre2_code *regex   = nullptr;
 };
 
 /** Deterministic Finite state Automata container.
--- trafficserver-9.2.3+ds.orig/include/tscore/ink_memory.h
+++ trafficserver-9.2.3+ds/include/tscore/ink_memory.h
@@ -22,6 +22,7 @@
  */
 #pragma once
 
+#ifdef __cplusplus
 #include 
 #include 
 #include 
@@ -29,6 +30,7 @@
 #include 
 #include 
 #include 
+#endif
 
 #include "tscore/ink_config.h"
 
@@ -56,6 +58,9 @@
 #include 
 #endif // ! TS_HAS_JEMALLOC
 
+#define PCRE2_CODE_UNIT_WIDTH 8
+#include 
+
 #ifndef MADV_NORMAL
 #define MADV_NORMAL 0
 #endif
@@ -80,18 +85,9 @@
 extern "C" {
 #endif /* __cplusplus */
 
-struct IOVec : public iovec {
-  IOVec()
-  {
-iov_base = nullptr;
-iov_len  = 0;
-  }
-  IOVec(void *base, size_t len)
-  {
-iov_base = base;
-iov_len  = len;
-  }
-};
+extern pcre2_general_context *gen_ctxt;
+extern pcre2_compile_context *comp_ctxt;
+extern pcre2_match_context *match_ctxt;
 
 void *ats_malloc(size_t size);
 void *ats_calloc(size_t nelem, size_t elsize);
@@ -100,6 +96,10 @@
 void ats_free(void *ptr);
 void *ats_free_null(void *ptr);
 
+void pcre_init(void);
+void *pcre_malloc(PCRE2_SIZE size, void *data);
+void pcre_free(void *ptr, void *data);
+
 int ats_msync(caddr_t addr, size_t len, caddr_t end, int flags);
 int ats_madvise(caddr_t addr, size_t len, int flags);
 int ats_mlock(caddr_t addr, size_t len);
@@ -142,6 +142,19 @@
 
 #include 
 
+struct IOVec : public iovec {
+  IOVec()
+  {
+iov_base = nullptr;
+iov_len  = 0;
+  }
+  IOVec(void *base, size_t len)
+  {
+iov_base = base;
+iov

Bug#1000044: ccze: depends on obsolete pcre3 library

2023-12-24 Thread Yavor Doganov
Axel Beckert wrote:
> sorry for the late reply, but I only managed to continue on this now
> as I'm on holidays now.

No problem at all, we are all busy.  And it's not late according to my
standards.  :)

> I though got another crash on this line:
> 
> Dec 24 06:43:16 c6 kernel: net_ratelimit: 1 callbacks suppressed

Good catch!  This is a case when process is allocated by
pcre2_substring_get_bynumber but since there are no square brackets
around, the strdup call at line 68 doesn't happen.

> I think I managed to fix it and will also upload, but I'd be happy for
> a short review of yours:

Removing the free call avoids the abort but leads to a memory leak.
Attached is a better fix, I think (tested with your line above and my
syslog, and of course with valgrind).
diff --git a/debian/patches/pcre2.patch b/debian/patches/pcre2.patch
index a5ee6b3..334d4e3 100644
--- a/debian/patches/pcre2.patch
+++ b/debian/patches/pcre2.patch
@@ -2473,7 +2473,7 @@ Last-Update: 2023-12-24
  {
char *date = NULL, *host = NULL, *send = NULL, *process = NULL;
char *msg = NULL, *pid = NULL, *tmp = NULL, *toret;
-+  int use_free = 0;
++  int msg_use_free = 0, process_use_free = 0;
 +  size_t l;

 -  pcre_get_substring (str, offsets, match, 1, (const char **));
@@ -2488,7 +2488,7 @@ Last-Update: 2023-12-24
 -msg = strdup (send);
 +{
 +  msg = strdup (send);
-+  use_free = 1;
++  msg_use_free = 1;
 +}
else
  {
@@ -2499,7 +2499,7 @@ Last-Update: 2023-12-24
  }

if (process)
-@@ -60,8 +64,8 @@
+@@ -60,8 +64,9 @@
  
  pid = strndup ([1], (size_t)(t2 - t - 1));
  tmp = strndup (process, (size_t)(t - process));
@@ -2507,10 +2507,11 @@ Last-Update: 2023-12-24
 -process = tmp;
 +pcre2_substring_free (process);
 +process = strdup (tmp);
++process_use_free = 1;
}
  }
  
-@@ -87,12 +91,17 @@
+@@ -87,12 +92,20 @@
else
  toret = strdup (send);
  
@@ -2522,18 +2523,21 @@ Last-Update: 2023-12-24
 +  pcre2_substring_free (date);
 +  pcre2_substring_free (host);
 +  pcre2_substring_free (send);
-+  /* free (process); */
free (pid);
 +  free (tmp);
 +
-+  if (use_free)
++  if (process_use_free)
++free (process);
++  else
++pcre2_substring_free (process);
++  if (msg_use_free)
 +free (msg);
 +  else
 +pcre2_substring_free (msg);
  
return toret;
  }
-@@ -100,33 +109,34 @@
+@@ -100,33 +113,34 @@
  static void
  ccze_syslog_setup (void)
  {


Bug#1000112: kjs: depends on obsolete pcre3 library

2023-12-23 Thread Yavor Doganov
Control: tags -1 + patch

Please find attached a patch; build-tested only.

I was unsure what to do with the recursion limit code in the match
method.  In the old PCRE3, PCRE_CONFIG_STACKRECURSE is 1 because of
the recursion implementation, which is stack-based.  In PCRE2, the
corresponding parameter PCRE2_CONFIG_STACKRECURSE is obsolete and
always 0.

Furthermore, according to pcre2api(3), if the recursion is great
enough, workspace vectors are allocated on the heap from version 10.32
onwards.  It also says that only local variables are allocated on the
stack and even a small stack can support a lot of recursion.  So I
concluded that limiting the stack space is unnecessary with PCRE2.  I
guess that only runtime tests can show if this is true, but as I am
not a Qt/KDE person I am unable to perform them, I'm afraid.

In any case, it is trivial to limit both the stack and the heap via a
match context -- just let me know and I'll make the required
modifications.

P.S.  This patch applies cleanly to the latest upstream release
  (5.113.0) but I haven't made a build test with it.
Description: Port to PCRE2.
Bug-Debian: https://bugs.debian.org/1000112
Bug: https://bugs.kde.org/show_bug.cgi?id=457338
Author: Yavor Doganov 
Forwarded: no
Last-Update: 2023-12-23
---

--- kjs-5.107.0.orig/cmake/FindPCRE.cmake
+++ kjs-5.107.0/cmake/FindPCRE.cmake
@@ -11,10 +11,10 @@
 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
 
 
-if (PCRE_INCLUDE_DIR AND PCRE_PCREPOSIX_LIBRARY AND PCRE_PCRE_LIBRARY)
+if (PCRE_INCLUDE_DIR AND PCRE_PCRE_LIBRARY)
   # Already in cache, be silent
   set(PCRE_FIND_QUIETLY TRUE)
-endif (PCRE_INCLUDE_DIR AND PCRE_PCREPOSIX_LIBRARY AND PCRE_PCRE_LIBRARY)
+endif (PCRE_INCLUDE_DIR AND PCRE_PCRE_LIBRARY)
 
 
 if (NOT WIN32)
@@ -22,23 +22,21 @@
   # in the FIND_PATH() and FIND_LIBRARY() calls
   find_package(PkgConfig)
 
-  pkg_check_modules(PC_PCRE QUIET libpcre)
+  pkg_check_modules(PC_PCRE QUIET libpcre2-8)
 
   set(PCRE_DEFINITIONS ${PC_PCRE_CFLAGS_OTHER})
 
 endif (NOT WIN32)
 
-find_path(PCRE_INCLUDE_DIR pcre.h 
+find_path(PCRE_INCLUDE_DIR pcre2.h
   HINTS ${PC_PCRE_INCLUDEDIR} ${PC_PCRE_INCLUDE_DIRS} 
-  PATH_SUFFIXES pcre)
+  )
 
-find_library(PCRE_PCRE_LIBRARY NAMES pcre pcred HINTS ${PC_PCRE_LIBDIR} 
${PC_PCRE_LIBRARY_DIRS})
-
-find_library(PCRE_PCREPOSIX_LIBRARY NAMES pcreposix pcreposixd HINTS 
${PC_PCRE_LIBDIR} ${PC_PCRE_LIBRARY_DIRS})
+find_library(PCRE_PCRE_LIBRARY NAMES pcre2-8 HINTS ${PC_PCRE_LIBDIR} 
${PC_PCRE_LIBRARY_DIRS})
 
 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(PCRE DEFAULT_MSG PCRE_INCLUDE_DIR 
PCRE_PCRE_LIBRARY PCRE_PCREPOSIX_LIBRARY )
+find_package_handle_standard_args(PCRE DEFAULT_MSG PCRE_INCLUDE_DIR 
PCRE_PCRE_LIBRARY)
 
-set(PCRE_LIBRARIES ${PCRE_PCRE_LIBRARY} ${PCRE_PCREPOSIX_LIBRARY})
+set(PCRE_LIBRARIES ${PCRE_PCRE_LIBRARY})
 
-mark_as_advanced(PCRE_INCLUDE_DIR PCRE_LIBRARIES PCRE_PCREPOSIX_LIBRARY 
PCRE_PCRE_LIBRARY)
+mark_as_advanced(PCRE_INCLUDE_DIR PCRE_LIBRARIES PCRE_PCRE_LIBRARY)
--- kjs-5.107.0.orig/src/kjs/regexp.h
+++ kjs-5.107.0/src/kjs/regexp.h
@@ -26,7 +26,8 @@
 #include "global.h"
 
 #if HAVE_PCREPOSIX
-#include 
+#define PCRE2_CODE_UNIT_WIDTH 8
+#include 
 #else  // POSIX regex - not so good...
 extern "C" { // bug with some libc5 distributions
 #include 
@@ -115,7 +116,7 @@
 #endif
 private:
 #if HAVE_PCREPOSIX
-pcre *_regex;
+pcre2_code *_regex;
 #else
 regex_t _regex;
 #endif
--- kjs-5.107.0.orig/src/kjs/regexp.cpp
+++ kjs-5.107.0/src/kjs/regexp.cpp
@@ -273,8 +273,8 @@
 #if HAVE_PCREPOSIX
 // Determine whether libpcre has unicode support if need be..
 if (utf8Support == Unknown) {
-int supported;
-pcre_config(PCRE_CONFIG_UTF8, (void *));
+uint32_t supported;
+pcre2_config(PCRE2_CONFIG_UNICODE, );
 utf8Support = supported ? Supported : Unsupported;
 }
 #endif
@@ -282,50 +282,49 @@
 UString intern = sanitizePattern(p);
 
 #if HAVE_PCREPOSIX
-int options = 0;
+uint32_t options = 0;
 
 // we are close but not 100% the same as Perl
-#ifdef PCRE_JAVASCRIPT_COMPAT // introduced in PCRE 7.7
-options |= PCRE_JAVASCRIPT_COMPAT;
-#endif
+options |= (PCRE2_ALT_BSUX | PCRE2_MATCH_UNSET_BACKREF);
 
 // Note: the Global flag is already handled by RegExpProtoFunc::execute.
 // FIXME: That last comment is dubious. Not all RegExps get run through 
RegExpProtoFunc::execute.
 if (flags & IgnoreCase) {
-options |= PCRE_CASELESS;
+options |= PCRE2_CASELESS;
 }
 if (flags & Multiline) {
-options |= PCRE_MULTILINE;
+options |= PCRE2_MULTILINE;
 }
 
 if (utf8Support == Supported) {
-options |= (PCRE_UTF8 | PCRE_NO_UTF8_CHECK);
+options |= (PCRE2_UTF | PCRE2_NO_UTF_CHECK);
 }
 
-const char *errorMessage;
-int errorOffset;
+PCRE2_UCHAR errorMessage[120];
+PCRE2_SIZE errorOffset;
+int errCode;

Bug#999975: rdup: depends on obsolete pcre3 library

2023-12-22 Thread Yavor Doganov
Control: tags -1 + patch

Please find attached a patch -- build-tested after adding -Wno-error
to CFLAGS due to #941101.
Description: Port to PCRE2.
Bug-Debian: https://bugs.debian.org/75
Author: Yavor Doganov 
Forwarded: no
Last-Update: 2023-12-22
---

--- rdup-1.1.15.orig/configure.ac
+++ rdup-1.1.15/configure.ac
@@ -62,26 +62,28 @@
 if test "$with_libpcre_includes" != "no"; then
CFLAGS="${CFLAGS} -I${with_libpcre_includes}"
 else
-   CFLAGS="${CFLAGS} `pcre-config --cflags`"
+   CFLAGS="${CFLAGS} `pcre2-config --cflags`"
 fi
 
 if test "$with_libpcre_libraries" != "no"; then
LIBS="${LIBS} -L${with_libpcre_libraries}"
 else
-   LIBS="${LIBS} `pcre-config --libs`"
+   LIBS="${LIBS} `pcre2-config --libs8`"
 fi
 
 # PCRE configuration (required)
 # Verify that we have the headers
 PCRE_H=""
-AC_CHECK_HEADERS(pcre.h,, PCRE_H="no")
+AC_CHECK_HEADERS([pcre2.h], [], [PCRE_H="no"], [[
+#define PCRE2_CODE_UNIT_WIDTH 8
+]])
 if test "$PCRE_H" = "no"; then
AC_MSG_ERROR([** No pcre library found.])
 fi
 
 # Verify that we have the library
 PCRE_L=""
-AC_CHECK_LIB(pcre, pcre_compile, ,PCRE_L="no")
+AC_CHECK_LIB([pcre2-8], [pcre2_compile_8], [], [PCRE_L="no"])
 if test "$PCRE_L" = "no"; then
AC_MSG_ERROR([** No pcre library found.])
 fi
--- rdup-1.1.15.orig/gfunc.c
+++ rdup-1.1.15/gfunc.c
@@ -7,7 +7,8 @@
 
 #include "rdup.h"
 #include "protocol.h"
-#include 
+#define PCRE2_CODE_UNIT_WIDTH 8
+#include 
 #ifdef HAVE_LIBNETTLE
 #include 
 #else
@@ -622,20 +623,26 @@
 gboolean gfunc_regexp(GSList * l, char *n, size_t len)
 {
GSList *k;
-   pcre *P;
-   int ovector[REG_VECTOR];
+   pcre2_code *P;
+   pcre2_match_data *md;
 
+   md = pcre2_match_data_create(REG_VECTOR, NULL);
for (k = g_slist_nth(l, 0); k; k = k->next) {
-   if (sig != 0)
+   if (sig != 0) {
+   pcre2_match_data_free(md);
signal_abort(sig);
+   }
 
-   P = (pcre *) k->data;
+   P = (pcre2_code *) k->data;
/* pcre_exec errors are all < 0, so >= 0 is some kind
 * of success
 */
-   if (pcre_exec(P, NULL, n, len, 0, 0, ovector, REG_VECTOR) >= 0)
+   if (pcre2_match(P, (PCRE2_SPTR)n, len, 0, 0, md, NULL) >= 0) {
+   pcre2_match_data_free(md);
return TRUE;
+   }
}
+   pcre2_match_data_free(md);
return FALSE;
 }
 
--- rdup-1.1.15.orig/regexp.c
+++ rdup-1.1.15/regexp.c
@@ -6,7 +6,8 @@
  */
 
 #include "rdup.h"
-#include 
+#define PCRE2_CODE_UNIT_WIDTH 8
+#include 
 
 GSList *pregex_list = NULL;
 
@@ -18,15 +19,16 @@
 {
FILE *fp;
char *buf;
-   const char *errbuf;
-   int erroff;
+   PCRE2_UCHAR errbuf[120];
+   PCRE2_SIZE erroff;
+   int err;
char delim;
gpointer d;
size_t l;
size_t s;
size_t re_length;
ssize_t j;
-   pcre *P;
+   pcre2_code *P;
 
if ((fp = fopen(file, "r")) == NULL) {
msg(_("Could not open '%s\': %s"), file, strerror(errno));
@@ -45,18 +47,20 @@
/* buf[j - 1] holds the delimeter */
buf[j - 1] = '\0';
 
-   if ((P = pcre_compile(buf, 0, , , NULL)) == NULL) 
{
+   if ((P = pcre2_compile((PCRE2_SPTR)buf, strlen(buf), 0, , 
, NULL)) == NULL) {
/* error */
fclose(fp);
+   pcre2_get_error_message(err, errbuf, sizeof(errbuf));
msg(_
-   ("Corrupt regular expression line: %zd, column %d: 
%s"),
+   ("Corrupt regular expression line: %zd, column %zu: 
%s"),
l, erroff, errbuf);
g_free(buf);
return FALSE;
} else {
-   pcre_fullinfo(P, NULL, PCRE_INFO_SIZE, _length);
+   pcre2_pattern_info(P, PCRE2_INFO_SIZE, _length);
d = g_malloc(re_length);
d = memcpy(d, P, re_length);
+   pcre2_code_free(P);
pregex_list = g_slist_append(pregex_list, d);
}
l++;


Bug#1000014: mydumper: depends on obsolete pcre3 library

2023-12-22 Thread Yavor Doganov
Control: tags -1 + patch

Please find attached a patch; build-tested only.
Description: Port to PCRE2.
Bug-Debian: https://bugs.debian.org/114
Author: Yavor Doganov 
Forwarded: no
Last-Update: 2023-12-22
---

--- mydumper-0.10.1.orig/cmake/modules/FindPCRE.cmake
+++ mydumper-0.10.1/cmake/modules/FindPCRE.cmake
@@ -11,10 +11,10 @@
 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
 
 
-if (PCRE_INCLUDE_DIR AND PCRE_PCREPOSIX_LIBRARY AND PCRE_PCRE_LIBRARY)
+if (PCRE_INCLUDE_DIR AND PCRE_PCRE_LIBRARY)
   # Already in cache, be silent
   set(PCRE_FIND_QUIETLY TRUE)
-endif (PCRE_INCLUDE_DIR AND PCRE_PCREPOSIX_LIBRARY AND PCRE_PCRE_LIBRARY)
+endif (PCRE_INCLUDE_DIR AND PCRE_PCRE_LIBRARY)
 
 
 if (NOT WIN32)
@@ -22,24 +22,22 @@
   # in the FIND_PATH() and FIND_LIBRARY() calls
   find_package(PkgConfig)
 
-  pkg_check_modules(PC_PCRE REQUIRED libpcre)
+  pkg_check_modules(PC_PCRE REQUIRED libpcre2-8)
 
   set(PCRE_DEFINITIONS ${PC_PCRE_CFLAGS_OTHER})
 
 endif (NOT WIN32)
 
-find_path(PCRE_INCLUDE_DIR pcre.h 
+find_path(PCRE_INCLUDE_DIR pcre2.h
   HINTS ${PC_PCRE_INCLUDEDIR} ${PC_PCRE_INCLUDE_DIRS} 
-  PATH_SUFFIXES pcre)
+  )
 
-find_library(PCRE_PCRE_LIBRARY NAMES pcre HINTS ${PC_PCRE_LIBDIR} 
${PC_PCRE_LIBRARY_DIRS})
-
-find_library(PCRE_PCREPOSIX_LIBRARY NAMES pcreposix HINTS ${PC_PCRE_LIBDIR} 
${PC_PCRE_LIBRARY_DIRS})
+find_library(PCRE_PCRE_LIBRARY NAMES pcre2-8 HINTS ${PC_PCRE_LIBDIR} 
${PC_PCRE_LIBRARY_DIRS})
 
 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(PCRE DEFAULT_MSG PCRE_INCLUDE_DIR 
PCRE_PCRE_LIBRARY PCRE_PCREPOSIX_LIBRARY )
+find_package_handle_standard_args(PCRE DEFAULT_MSG PCRE_INCLUDE_DIR 
PCRE_PCRE_LIBRARY )
 
-set(PCRE_LIBRARIES ${PCRE_PCRE_LIBRARY} ${PCRE_PCREPOSIX_LIBRARY})
+set(PCRE_LIBRARIES ${PCRE_PCRE_LIBRARY})
 
-mark_as_advanced(PCRE_INCLUDE_DIR PCRE_LIBRARIES PCRE_PCREPOSIX_LIBRARY 
PCRE_PCRE_LIBRARY)
+mark_as_advanced(PCRE_INCLUDE_DIR PCRE_LIBRARIES PCRE_PCRE_LIBRARY)
 
--- mydumper-0.10.1.orig/mydumper.c
+++ mydumper-0.10.1/mydumper.c
@@ -36,7 +36,8 @@
 #include 
 #include 
 #include 
-#include 
+#define PCRE2_CODE_UNIT_WIDTH 8
+#include 
 #include 
 #include 
 #include "config.h"
@@ -387,26 +388,31 @@
 
 gboolean check_regex(char *database, char *table) {
   /* This is not going to be used in threads */
-  static pcre *re = NULL;
+  static pcre2_code *re = NULL;
+  pcre2_match_data *md;
   int rc;
-  int ovector[9] = {0};
-  const char *error;
-  int erroroffset;
+  PCRE2_UCHAR error[120];
+  int err;
+  PCRE2_SIZE erroroffset;
 
   char *p;
 
   /* Let's compile the RE before we do anything */
   if (!re) {
-re = pcre_compile(regexstring, PCRE_CASELESS | PCRE_MULTILINE, ,
-  , NULL);
+re = pcre2_compile((PCRE2_SPTR)regexstring, strlen(regexstring),
+   PCRE2_CASELESS | PCRE2_MULTILINE,
+   , , NULL);
 if (!re) {
+  pcre2_get_error_message(err, error, sizeof(error));
   g_critical("Regular expression fail: %s", error);
   exit(EXIT_FAILURE);
 }
   }
 
   p = g_strdup_printf("%s.%s", database, table);
-  rc = pcre_exec(re, NULL, p, strlen(p), 0, 0, ovector, 9);
+  md = pcre2_match_data_create(9, NULL);
+  rc = pcre2_match(re, (PCRE2_SPTR)p, strlen(p), 0, 0, md, NULL);
+  pcre2_match_data_free(md);
   g_free(p);
 
   return (rc > 0) ? TRUE : FALSE;
--- mydumper-0.10.1.orig/server_detect.c
+++ mydumper-0.10.1/server_detect.c
@@ -15,73 +15,96 @@
 Authors:Andrew Hutchings, SkySQL (andrew at skysql dot com)
 */
 
-#include 
+#define PCRE2_CODE_UNIT_WIDTH 8
+#include 
 #include 
 #include 
 #include "server_detect.h"
 
 int detect_server(MYSQL *conn) {
-  pcre *re = NULL;
-  const char *error;
-  int erroroffset;
-  int ovector[9] = {0};
+  pcre2_code *re = NULL;
+  pcre2_match_data *md;
+  PCRE2_UCHAR error[120];
+  PCRE2_SIZE erroroffset;
+  int err;
   int rc;
   const char *db_version = mysql_get_server_info(conn);
 
   // debug the version
   g_message("Server version reported as: %s", db_version);
 
-  re = pcre_compile(DETECT_TIDB_REGEX, 0, , , NULL);
+  re = pcre2_compile((PCRE2_SPTR)DETECT_TIDB_REGEX, PCRE2_ZERO_TERMINATED,
+ 0, , , NULL);
   if (!re) {
+pcre2_get_error_message(err, error, sizeof(error));
 g_critical("Regular expression fail: %s", error);
 exit(EXIT_FAILURE);
   }
 
-  rc = pcre_exec(re, NULL, db_version, strlen(db_version), 0, 0, ovector, 9);
-  pcre_free(re);
+  md = pcre2_match_data_create(9, NULL);
+  rc = pcre2_match(re, (PCRE2_SPTR)db_version, strlen(db_version),
+   0, 0, md, NULL);
+  pcre2_code_free(re);
 
   if (rc > 0) {
+pcre2_match_data_free(md);
 return SERVER_TYPE_TIDB;
   }
 
-  re = pcre_compile(DETECT_MYSQL_REGEX, 0, , , NULL);
+  re = pcre2_compile((PCRE2_SPTR)DETECT_MYSQL_REGEX, PCRE2_ZERO_TERMINATED,
+ 0, , , NULL);
 

Bug#999919: zoneminder: depends on obsolete pcre3 library

2023-12-22 Thread Yavor Doganov
Control: tags -1 + patch

Please find attached a patch; build-tested only.
Description: Port to PCRE2.
Bug-Debian: https://bugs.debian.org/19
Bug: https://github.com/ZoneMinder/zoneminder/issues/3384
Author: Yavor Doganov 
Forwarded: no
Last-Update: 2023-12-22
---

--- zoneminder-1.36.33+dfsg1.orig/CMakeLists.txt
+++ zoneminder-1.36.33+dfsg1/CMakeLists.txt
@@ -396,17 +396,17 @@
 endif()
 
 # pcre (using find_library and find_path)
-find_library(PCRE_LIBRARIES pcre)
+find_library(PCRE_LIBRARIES pcre2-8)
 if(PCRE_LIBRARIES)
   set(HAVE_LIBPCRE 1)
   list(APPEND ZM_BIN_LIBS "${PCRE_LIBRARIES}")
-  find_path(PCRE_INCLUDE_DIR pcre.h)
+  find_path(PCRE_INCLUDE_DIR pcre2.h)
   if(PCRE_INCLUDE_DIR)
 include_directories("${PCRE_INCLUDE_DIR}")
 set(CMAKE_REQUIRED_INCLUDES "${PCRE_INCLUDE_DIR}")
   endif()
   mark_as_advanced(FORCE PCRE_LIBRARIES PCRE_INCLUDE_DIR)
-  check_include_file("pcre.h" HAVE_PCRE_H)
+  check_include_file("pcre2.h" HAVE_PCRE2_H -DPCRE2_CODE_UNIT_WIDTH=8)
   set(optlibsfound "${optlibsfound} PCRE")
 else()
   set(optlibsnotfound "${optlibsnotfound} PCRE")
--- zoneminder-1.36.33+dfsg1.orig/src/zm_regexp.cpp
+++ zoneminder-1.36.33+dfsg1/src/zm_regexp.cpp
@@ -24,25 +24,20 @@
 
 #if HAVE_LIBPCRE
 
-RegExpr::RegExpr( const char *pattern, int flags, int p_max_matches ) : 
max_matches( p_max_matches ), match_buffers( nullptr ), match_lengths( nullptr 
), match_valid( nullptr )
+RegExpr::RegExpr( const char *pattern, uint32_t flags, int p_max_matches ) : 
max_matches( p_max_matches ), match_buffers( nullptr ), match_lengths( nullptr 
), match_valid( nullptr )
 {
-  const char *errstr;
-  int erroffset = 0;
-  if ( !(regex = pcre_compile( pattern, flags, , , 0 )) )
+  char errstr[120];
+  int err;
+  PCRE2_SIZE erroffset;
+  if ( !(regex = pcre2_compile( (PCRE2_SPTR)pattern, strlen( pattern ), flags, 
, , NULL )) )
   {
-Panic( "pcre_compile(%s): %s at %d", pattern, errstr, erroffset );
-  }
-
-  regextra = pcre_study( regex, 0,  );
-  if ( errstr )
-  {
-Panic( "pcre_study(%s): %s", pattern, errstr );
+pcre2_get_error_message( err, (PCRE2_UCHAR *)errstr, sizeof(errstr) );
+Panic( "pcre2_compile(%s): %s at %zu", pattern, errstr, erroffset );
   }
 
   if ( (ok = (bool)regex) )
   {
-match_vectors = new int[3*max_matches];
-memset( match_vectors, 0, sizeof(*match_vectors)*3*max_matches );
+match_data = pcre2_match_data_create( 3*max_matches, NULL );
 match_buffers = new char *[max_matches];
 memset( match_buffers, 0, sizeof(*match_buffers)*max_matches );
 match_lengths = new int[max_matches];
@@ -68,18 +63,20 @@
   delete[] match_valid;
   delete[] match_lengths;
   delete[] match_buffers;
-  delete[] match_vectors;
+  pcre2_match_data_free( match_data );
+  pcre2_code_free( regex );
 }
 
-int RegExpr::Match( const char *subject_string, int subject_length, int flags )
+int RegExpr::Match( const char *subject_string, PCRE2_SIZE subject_length, 
uint32_t flags )
 {
   match_string = subject_string;
 
-  n_matches = pcre_exec( regex, regextra, subject_string, subject_length, 0, 
flags, match_vectors, 2*max_matches );
+  n_matches = pcre2_match( regex, (PCRE2_SPTR)subject_string, subject_length, 
0, flags, match_data, NULL );
+  match_vectors = pcre2_get_ovector_pointer( match_data );
 
   if ( n_matches <= 0 )
   {
-if ( n_matches < PCRE_ERROR_NOMATCH )
+if ( n_matches != PCRE2_ERROR_NOMATCH )
 {
   Error( "Error %d executing regular expression", n_matches );
 }
@@ -101,7 +98,7 @@
   }
   if ( !match_valid[match_index] )
   {
-int match_len = 
match_vectors[(2*match_index)+1]-match_vectors[2*match_index];
+int match_len = 
(int)(match_vectors[(2*match_index)+1]-match_vectors[2*match_index]);
 if ( match_lengths[match_index] < (match_len+1) )
 {
   delete[] match_buffers[match_index];
@@ -121,7 +118,7 @@
   {
 return( 0 );
   }
-  return( match_vectors[(2*match_index)+1]-match_vectors[2*match_index] );
+  return( (int)(match_vectors[(2*match_index)+1]-match_vectors[2*match_index]) 
);
 }
 
 #endif // HAVE_LIBPCRE
--- zoneminder-1.36.33+dfsg1.orig/src/zm_regexp.h
+++ zoneminder-1.36.33+dfsg1/src/zm_regexp.h
@@ -24,21 +24,20 @@
 
 #if HAVE_LIBPCRE
 
-#if HAVE_PCRE_H
-#include 
-#elif HAVE_PCRE_PCRE_H
-#include 
+#if HAVE_PCRE2_H
+#define PCRE2_CODE_UNIT_WIDTH 8
+#include 
 #else
-#error Unable to locate pcre.h, please do 'locate pcre.h' and report location 
to zoneminder.com
+#error Unable to locate pcre2.h, please do 'locate pcre2.h' and report 
location to zoneminder.com
 #endif
 
 class RegExpr
 {
 protected:
-  pcre *regex;
-  pcre_extra *regextra;
+  pcre2_code *regex;
+  pcre2_match_data *match_data;
   int max_matches;
-  int *match_vectors;
+  PCRE2_SIZE *match_vectors;
   mutable char **match_buffers;
   int *match_lengths;
   bool *match_valid;
@@ -51,11 +50,11 @@
   bool ok;
 
 public:
-

Bug#1000010: ohcount: depends on obsolete pcre3 library

2023-12-21 Thread Yavor Doganov
Control: tags -1 + patch

Please find a patch attached.
Description: Port to PCRE2.
Bug-Debian: https://bugs.debian.org/110
Author: Yavor Doganov 
Forwarded: no
Last-Update: 2023-12-21
---

--- ohcount-4.0.0.orig/build
+++ ohcount-4.0.0/build
@@ -31,7 +31,7 @@
   # You shouldn't have to change the following.
   CFLAGS="-fno-common -g"
   WARN="-Wall -Wno-parentheses"
-  SHARED="-dynamiclib -L$LIB_DIR -lpcre"
+  SHARED="-dynamiclib -L$LIB_DIR -lpcre2-8"
   SHARED_NAME=libohcount.dylib
   RB_SHARED="-dynamic -bundle -lruby"
   RB_SHARED_NAME=ohcount.bundle
@@ -97,7 +97,7 @@
   build_parser_o
   echo "Building Ohcount"
   mkdir -p bin/
-  sh -c "$cc src/ohcount.c $files -o bin/ohcount -lpcre -lmagic" || exit 1
+  sh -c "$cc src/ohcount.c $files -o bin/ohcount -lpcre2-8 -lmagic" || exit 1
 }
 
 build_test_suite()
@@ -105,7 +105,7 @@
   build_hash_headers
   build_parser_o
   echo "Building test suite"
-  sh -c "$cc test/unit/all_tests.c $files -o test/unit/run_tests -lpcre 
-lmagic" \
+  sh -c "$cc test/unit/all_tests.c $files -o test/unit/run_tests -lpcre2-8 
-lmagic" \
 || exit 1
 }
 
@@ -127,10 +127,10 @@
mkdir -p ruby/$arch
 echo $cc $RB_SHARED ruby/ohcount_wrap.c $files -o 
ruby/$arch/$RB_SHARED_NAME \
 -I$RUBY_HEADER_DIR -I$RUBY_CONFIG_DIR  
-I/usr/include/$rbconfig_arch/ruby-$RUBY_VERSION  \
--lpcre -lmagic
+-lpcre2-8 -lmagic
   sh -c "$cc $RB_SHARED ruby/ohcount_wrap.c $files -o 
ruby/$arch/$RB_SHARED_NAME \
 -I$RUBY_HEADER_DIR -I$RUBY_CONFIG_DIR  
-I/usr/include/$rbconfig_arch/ruby-$RUBY_VERSION  \
--lpcre -lmagic" || exit 1
+-lpcre2-8 -lmagic" || exit 1
   sh -c "cd test/unit/ruby && ruby ruby_test.rb" || exit 1
 }
 
--- ohcount-4.0.0.orig/src/structs.h
+++ ohcount-4.0.0/src/structs.h
@@ -4,7 +4,8 @@
 #ifndef OHCOUNT_STRUCTS_H
 #define OHCOUNT_STRUCTS_H
 
-#include 
+#define PCRE2_CODE_UNIT_WIDTH 8
+#include 
 
 /**
  * @struct License
@@ -24,7 +25,7 @@
   const char *re;
 
   /** PCRE flags for re. (Typically PCRE_CASELESS or PCRE_MULTILINE). */
-  int re_flags;
+  uint32_t re_flags;
 
   /**
* A PCRE regular expression for text that matches re, but should not match
@@ -33,13 +34,13 @@
   const char *exclude_re;
 
   /** PCRE flags for exclude_re. */
-  int exclude_re_flags;
+  uint32_t exclude_re_flags;
 
   /** The PCRE object for re. (This field is set automatically.) */
-  pcre *regexp;
+  pcre2_code *regexp;
 
   /** The PCRE object for exclude_re. (This field is set automatically.) */
-  pcre *exclude_regexp;
+  pcre2_code *exclude_regexp;
 
 } License;
 
--- ohcount-4.0.0.orig/src/detector.c
+++ ohcount-4.0.0/src/detector.c
@@ -889,7 +889,8 @@
   return NULL; // only blanks
 }
 
-#include 
+#define PCRE2_CODE_UNIT_WIDTH 8
+#include 
 
 // strnlen is not available on OS X, so we roll our own
 size_t mystrnlen(const char *begin, size_t maxlen) {
@@ -906,24 +907,35 @@
  return NULL;
 
/* prepare regular expressions */
-   const char *error;
-   int erroffset;
+   int error;
+   PCRE2_SIZE erroffset;
 
/* try harder with optional spaces */
-   pcre *keyword;
-   keyword = 
pcre_compile("^\\s*(ensure|content|notify|require|source)\\s+=>",
-   PCRE_MULTILINE, , , NULL);
-
-   if (pcre_exec(keyword, NULL, p, mystrnlen(p, 1), 0, 0, NULL, 0) > 
-1)
+   pcre2_code *keyword;
+   pcre2_match_data *md;
+   keyword = pcre2_compile((PCRE2_SPTR)
+   
"^\\s*(ensure|content|notify|require|source)\\s+=>",
+   PCRE2_ZERO_TERMINATED, PCRE2_MULTILINE,
+   , , NULL);
+   md = pcre2_match_data_create(30, NULL);
+   if (pcre2_match(keyword, (PCRE2_SPTR)p, mystrnlen(p, 1),
+   0, 0, md, NULL) > -1) {
+   pcre2_match_data_free(md);
return LANG_PUPPET;
+   }
 
/* check for standard puppet constructs */
-   pcre *construct;
-   construct = 
pcre_compile("^\\s*(define\\s+[\\w:-]+\\s*\\(|class\\s+[\\w:-]+(\\s+inherits\\s+[\\w:-]+)?\\s*[\\({]|node\\s+\\'?[\\w:\\.-]+\\'?\\s*{|import\\s+\"|include\\s+[\"']?[\\w:-][\"']?)",
-   PCRE_MULTILINE, , , NULL);
-
-   if (pcre_exec(construct, NULL, p, mystrnlen(p, 1), 0, 0, NULL, 0) > 
-1)
+   pcre2_code *construct;
+   construct = 
pcre2_compile((PCRE2_SPTR)"^\\s*(define\\s+[\\w:-]+\\s*\\(|class\\s+[\\w:-]+(\\s+inherits\\s+[\\w:-]+)?\\s*[\\({]|node\\s+\\'?[\\w:\\.-]+\\'?\\s*{|import\\s+\"|include\\s+[\"']?[\\w:-][\"']?)",
+ PCRE2_ZERO_TERMINATED, PCRE2_MULTILINE,
+ , , NULL);
+
+   if (pcre2_match(construct, (PCRE2_SPTR)p, mystrnlen(p, 1),
+  

Bug#999937: tup: depends on obsolete pcre3 library

2023-12-21 Thread Yavor Doganov
On Tue, Aug 29, 2023 at 03:18:26PM +0200, Bastian Germann wrote:
> On Tue, 31 Jan 2023 21:36:46 +0800 Bo YU  wrote:
> > The upstream has tried to switch pcre2[0], but the backporting is
> > not easy, so maybe waiting a new release is good iead.
> 
> I have started a backport in git but there is at least one linker
> flag missing.

That's right; the attached patch makes the build succeed for me but I
have not tested further (sorry for the patch noise; it's because I had
to "quilt refresh").
>From 2b6f55b4d9f476646072d2be197b4fc1defcf7ac Mon Sep 17 00:00:00 2001
From: Yavor Doganov 
Date: Thu, 21 Dec 2023 19:20:23 +0200
Subject: [PATCH] pcre2.patch: Add missing linker flag; refresh

---
 debian/patches/pcre2.patch | 81 +-
 1 file changed, 37 insertions(+), 44 deletions(-)

diff --git a/debian/patches/pcre2.patch b/debian/patches/pcre2.patch
index 9d012bb..031b6a7 100644
--- a/debian/patches/pcre2.patch
+++ b/debian/patches/pcre2.patch
@@ -6,11 +6,9 @@ Subject: Update pcre 8.44 -> pcre2 10.42
 libpcre is no longer maintained, and was replaced by libpcre2. This
 requires some minor API changes.
 ---
-diff --git a/Tupfile b/Tupfile
-index 107c81cca..cc6ed1ce5 100644
 a/Tupfile
-+++ b/Tupfile
-@@ -30,7 +30,7 @@ srcs += src/sqlite3/*.o
+--- tup.orig/Tupfile
 tup/Tupfile
+@@ -30,7 +30,7 @@
  endif
  
  ifeq ($(use_system_pcre),y)
@@ -19,11 +17,9 @@ index 107c81cca..cc6ed1ce5 100644
  else
  srcs += src/pcre/*.o
  endif
-diff --git a/Tuprules.tup b/Tuprules.tup
-index 3cdab0ffc..a7fd6cb66 100644
 a/Tuprules.tup
-+++ b/Tuprules.tup
-@@ -99,7 +99,7 @@ else
+--- tup.orig/Tuprules.tup
 tup/Tuprules.tup
+@@ -89,7 +89,7 @@
  use_system_pcre = $(TUP_USE_SYSTEM_PCRE)
  endif
  ifeq ($(use_system_pcre),y)
@@ -32,11 +28,18 @@ index 3cdab0ffc..a7fd6cb66 100644
  else
  CFLAGS += -I$(TUP_CWD)/src/pcre
  CFLAGS += -DPCRE_STATIC
-diff --git a/build.sh b/build.sh
-index 7fecb8914..6ac7041e6 100755
 a/build.sh
-+++ b/build.sh
-@@ -80,6 +80,7 @@ mkdir luabuiltin
+--- tup.orig/build.sh
 tup/build.sh
+@@ -27,7 +27,7 @@
+ 	echo "Error: invalid TUP_SERVER \"$server\"" 1>&2
+ 	exit 1
+ fi
+-LDFLAGS="$LDFLAGS -lm"
++LDFLAGS="$LDFLAGS -lm -lpcre2-8"
+ : ${CC:=gcc}
+ case "$os" in
+ 	Linux)
+@@ -80,6 +80,7 @@
  ./lua ../src/luabuiltin/xxd.lua builtin.lua luabuiltin/luabuiltin.h
  
  CFLAGS="$CFLAGS -DTUP_SERVER=\"$server\""
@@ -44,11 +47,9 @@ index 7fecb8914..6ac7041e6 100755
  CFLAGS="$CFLAGS -DHAVE_CONFIG_H"
  
  for i in ../src/tup/*.c ../src/tup/tup/main.c ../src/tup/monitor/null.c ../src/tup/flock/fcntl.c ../src/inih/ini.c ../src/pcre/*.c $plat_files; do
-diff --git a/src/tup/entry.c b/src/tup/entry.c
-index 90e1b80c0..96842bc4b 100644
 a/src/tup/entry.c
-+++ b/src/tup/entry.c
-@@ -151,7 +151,7 @@ static int rm_entry(tupid_t tupid, int safe)
+--- tup.orig/src/tup/entry.c
 tup/src/tup/entry.c
+@@ -151,7 +151,7 @@
  		string_tree_rm(>parent->entries, >name);
  	}
  	if(tent->re) {
@@ -57,7 +58,7 @@ index 90e1b80c0..96842bc4b 100644
  	}
  	free_tent_tree(>stickies);
  	free_tent_tree(>group_stickies);
-@@ -504,11 +504,13 @@ static struct tup_entry *new_entry(tupid_t tupid, tupid_t dt,
+@@ -473,11 +473,13 @@
  	RB_INIT(>entries);
  
  	if(tent->dt == exclusion_dt()) {
@@ -75,7 +76,7 @@ index 90e1b80c0..96842bc4b 100644
  			return NULL;
  		}
  	} else {
-@@ -795,14 +797,16 @@ int exclusion_match(FILE *f, struct tent_entries *exclusion_root, const char *s,
+@@ -767,14 +769,16 @@
  	*match = 0;
  	RB_FOREACH(tt, tent_entries, exclusion_root) {
  		int rc;
@@ -95,10 +96,8 @@ index 90e1b80c0..96842bc4b 100644
  			fprintf(f, "tup error: Regex failed to execute: %s\n", tt->tent->name.s);
  			return -1;
  		}
-diff --git a/src/tup/entry.h b/src/tup/entry.h
-index 332849842..1b37e077e 100644
 a/src/tup/entry.h
-+++ b/src/tup/entry.h
+--- tup.orig/src/tup/entry.h
 tup/src/tup/entry.h
 @@ -26,9 +26,9 @@
  #include "string_tree.h"
  #include "db_types.h"
@@ -110,7 +109,7 @@ index 332849842..1b37e077e 100644
  
  struct variant;
  struct estring;
-@@ -51,7 +51,7 @@ struct tup_entry {
+@@ -51,7 +51,7 @@
  	_Atomic int refcount;
  
  	/* For exclusions */
@@ -119,11 +118,9 @@ index 332849842..1b37e077e 100644
  
  	/* For command strings */
  	char *flags;
-diff --git a/src/tup/parser.c b/src/tup/parser.c
-index ce057737f..71ee32c79 100644
 a/src/tup/parser.c
-+++ b/src/tup/parser.c
-@@ -2288,6 +2288,7 @@ struct path_list *new_pl(struct tupfile *tf, const char *s, int len, struct bin_
+--- tup.orig/src/tup/parser.c
 tup/src/tup/parser.c
+@@ -2235,6 +2235,7 @@
  	pl->pel = NULL;
  	pl->bin = NULL;
  	pl->re = NULL;
@@ -131,7 +128,8 @@ index ce057737f..71ee32c79 100644
  	memcpy(pl->mem, s, len);
  	pl->mem[len] = 0;
  	pl->orderid = orderid;
-@@ -2316,13 +2317,

Bug#999921: xymon: depends on obsolete pcre3 library

2023-12-21 Thread Yavor Doganov
Control: tags -1 + patch

Please find a patch which I've been testing for a while with no ill
effects AFAICT.  However, I'm not familiar at all with this package so
it's possible that I've missed something.  I also couldn't test all
available functionality.

Unfortunately the patch does not apply cleanly to the latest upstream
release (4.4-alpha) but I am ready and willing to rebase it, whenever
you decide to package it.  Just let me know.
>From d626686d8e004bbb9e1f5f0074ff825f27d1c2e5 Mon Sep 17 00:00:00 2001
From: Yavor Doganov 
Date: Thu, 21 Dec 2023 18:44:44 +0200
Subject: [PATCH] Port to PCRE2 (#21).

---
 debian/changelog  |5 +
 debian/control|2 +-
 debian/patches/93_pcre2.patch | 2167 +
 debian/patches/series |1 +
 debian/rules  |2 +-
 5 files changed, 2175 insertions(+), 2 deletions(-)
 create mode 100644 debian/patches/93_pcre2.patch

diff --git a/debian/changelog b/debian/changelog
index b406ada..1c01d47 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -37,6 +37,11 @@ xymon (4.3.30-2) UNRELEASED; urgency=medium
   * xymon: update xymonserver.cfg: ntpdate obsoleted the "-p" option.
 (Closes: #1057044)
 
+  [ Yavor Doganov ]
+  * debian/patches/93_pcre2.patch: New; port to PCRE2 (Closes: #21).
+  * debian/control (Build-Depends): Replace libpcre3-dev with libpcre2-dev.
+  * debian/rules (override_dh_auto_configure): Use pcre2-config.
+
  -- Axel Beckert   Mon, 10 Aug 2020 04:39:28 +0200
 
 xymon (4.3.30-1) unstable; urgency=medium
diff --git a/debian/control b/debian/control
index 6766762..aaa40b3 100644
--- a/debian/control
+++ b/debian/control
@@ -8,7 +8,7 @@ Build-Depends: debhelper-compat (= 13),
imagemagick,
libc-ares-dev,
libldap2-dev,
-   libpcre3-dev,
+   libpcre2-dev,
librrd-dev,
libssl-dev,
libtirpc-dev,
diff --git a/debian/patches/93_pcre2.patch b/debian/patches/93_pcre2.patch
new file mode 100644
index 000..7c163fd
--- /dev/null
+++ b/debian/patches/93_pcre2.patch
@@ -0,0 +1,2167 @@
+Description: Port to PCRE2.
+Bug-Debian: https://bugs.debian.org/999921
+Author: Yavor Doganov 
+Forwarded: no
+Last-Update: 2023-12-21
+---
+
+--- xymon.orig/lib/acknowledgementslog.c
 xymon/lib/acknowledgementslog.c
+@@ -26,7 +26,8 @@
+ #include 
+ #include 
+ 
+-#include 
++#define PCRE2_CODE_UNIT_WIDTH 8
++#include 
+ 
+ #include "libxymon.h"
+ 
+@@ -103,16 +104,17 @@
+   char title[200];
+ 
+   /* For the PCRE matching */
+-  const char *errmsg = NULL;
+-  int errofs = 0;
+-  pcre *pageregexp = NULL;
+-  pcre *expageregexp = NULL;
+-  pcre *hostregexp = NULL;
+-  pcre *exhostregexp = NULL;
+-  pcre *testregexp = NULL;
+-  pcre *extestregexp = NULL;
+-  pcre *rcptregexp = NULL;
+-  pcre *exrcptregexp = NULL;
++  int err;
++  PCRE2_SIZE errofs;
++  pcre2_code *pageregexp = NULL;
++  pcre2_code *expageregexp = NULL;
++  pcre2_code *hostregexp = NULL;
++  pcre2_code *exhostregexp = NULL;
++  pcre2_code *testregexp = NULL;
++  pcre2_code *extestregexp = NULL;
++  pcre2_code *rcptregexp = NULL;
++  pcre2_code *exrcptregexp = NULL;
++  pcre2_match_data *ovector;
+ 
+   if (maxminutes && (fromtime || totime)) {
+   fprintf(output, "Only one time interval type is 
allowed!");
+@@ -147,14 +149,14 @@
+ 
+   if (!maxcount) maxcount = 100;
+ 
+-  if (pageregex && *pageregex) pageregexp = pcre_compile(pageregex, 
PCRE_CASELESS, , , NULL);
+-  if (expageregex && *expageregex) expageregexp = 
pcre_compile(expageregex, PCRE_CASELESS, , , NULL);
+-  if (hostregex && *hostregex) hostregexp = pcre_compile(hostregex, 
PCRE_CASELESS, , , NULL);
+-  if (exhostregex && *exhostregex) exhostregexp = 
pcre_compile(exhostregex, PCRE_CASELESS, , , NULL);
+-  if (testregex && *testregex) testregexp = pcre_compile(testregex, 
PCRE_CASELESS, , , NULL);
+-  if (extestregex && *extestregex) extestregexp = 
pcre_compile(extestregex, PCRE_CASELESS, , , NULL);
+-  if (rcptregex && *rcptregex) rcptregexp = pcre_compile(rcptregex, 
PCRE_CASELESS, , , NULL);
+-  if (exrcptregex && *exrcptregex) exrcptregexp = 
pcre_compile(exrcptregex, PCRE_CASELESS, , , NULL);
++  if (pageregex && *pageregex) pageregexp = pcre2_compile(pageregex, 
strlen(pageregex), PCRE2_CASELESS, , , NULL);
++  if (expageregex && *expageregex) expageregexp = 
pcre2_compile(expageregex, strlen(expageregex), PCRE2_CASELESS, , , 
NULL);
++  if (hostregex && *hostregex) hostregexp = pcre2_compile(hostregex, 
strlen(hostregex), PCRE2_CASELESS, , , NULL);
++  if (exhostregex && *exhostregex) exhostregexp = 
pcre2_compile(exhostregex, strl

Bug#999922: xneur: depends on obsolete pcre3 library

2023-12-20 Thread Yavor Doganov
Control: tags -1 + patch

Please find attached a patch.
Description: Port to PCRE2.
Bug-Debian: https://bugs.debian.org/22
Author: Yavor Doganov ya...@gnu.org>
Forwarded: no
Last-Update: 2023-12-20
---

--- xneur.orig/configure.ac
+++ xneur/configure.ac
@@ -143,7 +143,7 @@
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-keyloggerCompile without keylogger 
function])
 if test "x$with_keylogger" != "xno"; then
--- xneur.orig/lib/misc/regexp.c
+++ xneur/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, , , 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, , , 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, _string) < 0)
+   PCRE2_UCHAR *pcre_string;
+   if(pcre2_substring_get_bynumber(ovector, 0, _string, _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;
 }


Bug#999931: virtuoso-opensource: depends on obsolete pcre3 library

2023-12-20 Thread Yavor Doganov
Control: tags -1 + patch

Please find attached a patch; build-tested only (although the
package's own testsuite has some checks which test this
functionality).
Description: Port to PCRE2.
Bug-Debian: https://bugs.debian.org/31
Author: Yavor Doganov 
Forwarded: no
Last-Update: 2023-12-20
---

--- virtuoso-opensource.orig/libsrc/Wi/Makefile.am
+++ virtuoso-opensource/libsrc/Wi/Makefile.am
@@ -559,7 +559,7 @@
$(libwi_base_la_sources)
 
 libwi_la_CFLAGS  = $(libwi_base_la_cflags)
-libwi_la_LDLAGS  = -static -lminizip -lpcre
+libwi_la_LDLAGS  = -static -lminizip -lpcre2-8
 
 #KUBL_UNIV_FILES_ODBC
 libwi_odbc_la_SOURCES += \
--- virtuoso-opensource.orig/libsrc/Wi/bif_regexp.c
+++ virtuoso-opensource/libsrc/Wi/bif_regexp.c
@@ -30,7 +30,8 @@
 
 // Debian maintainer: replaced by external PCRE
 // #include "util/pcrelib/pcre.h"
-#include "pcre.h"
+#define PCRE2_CODE_UNIT_WIDTH 8
+#include 
 
 /*
typedef struct rx_query_s {
@@ -66,15 +67,16 @@
 typedef struct compiled_regexp_s
 {
   int refctr;
-  pcre *code;
-  pcre_extra *code_x;
+  pcre2_code *code;
 }
 compiled_regexp_t;
 
 id_hash_t *compiled_regexps;
 
-int32 c_pcre_match_limit_recursion = 500;
-int32 c_pcre_match_limit = 10;
+static pcre2_match_context *match_ctxt = NULL;
+
+uint32 c_pcre_match_limit_recursion = 500;
+uint32 c_pcre_match_limit = 10;
 int32 pcre_max_cache_sz = 2;
 int32 pcre_rnd_seed;
 
@@ -97,6 +99,23 @@
 }
 
 void
+create_match_context (void)
+{
+  if (NULL != match_ctxt)
+return;
+
+  match_ctxt = pcre2_match_context_create (NULL);
+  if (c_pcre_match_limit > 0)
+{
+  pcre2_set_match_limit (match_ctxt, c_pcre_match_limit);
+}
+  if (c_pcre_match_limit_recursion > 0)
+{
+  pcre2_set_depth_limit (match_ctxt, c_pcre_match_limit_recursion);
+}
+}
+
+void
 release_compiled_regexp (id_hash_t *c_r, compiled_regexp_t *data)
 {
   int delete_data;
@@ -112,9 +131,7 @@
   if (!delete_data)
 return;
   if (NULL != data->code)
-pcre_free (data->code);
-  if (NULL != data->code_x)
-pcre_free (data->code_x);
+pcre2_code_free (data->code);
   dk_free (data, sizeof (compiled_regexp_t));
 }
 
@@ -137,10 +154,11 @@
 }
 
 static compiled_regexp_t *
-get_compiled_regexp (id_hash_t *c_r, const char *pattern, int options, caddr_t 
*err_ret)
+get_compiled_regexp (id_hash_t *c_r, const char *pattern, uint32_t options, 
caddr_t *err_ret)
 {
-  const char *error = NULL;
-  int erroff;
+  int err;
+  PCRE2_UCHAR error[120];
+  PCRE2_SIZE erroff;
   regexp_key_t key;
   compiled_regexp_t **val = NULL;
   compiled_regexp_t tmp, *new_val;
@@ -156,46 +174,18 @@
 }
   HT_LEAVE (c_r);
   dbg_printf (("regex compiling (%s) with options %x ...\n", pattern, 
options));
-  tmp.code = pcre_compile (pattern, options, , , 0);
+  tmp.code = pcre2_compile ((PCRE2_SPTR) pattern, strlen (pattern),
+options, , , NULL);
   if (NULL == tmp.code)
 {
-  if (error)
-err_ret[0] = srv_make_new_error ("2201B",
-"SR098", "regexp error at \'%s\' column %d (%s)", pattern, erroff, 
error);
-  else
-err_ret[0] = srv_make_new_error ("2201B",
-"SR098", "regexp error at \'%s\' column %d", pattern, erroff);
+  pcre2_get_error_message(err, error, sizeof (error));
+  err_ret[0] = srv_make_new_error ("2201B",
+  "SR098", "regexp error at \'%s\' column %zu (%s)", pattern, erroff, 
error);
   return NULL;
 }
-  tmp.code_x = pcre_study (tmp.code, options, );
-#ifdef DEBUG
-  if (!tmp.code_x)
-dbg_printf (("***warning RX100: regexp warning: extra regular expression 
compiling failed\n"));
-#endif
-  if (!tmp.code_x)
- {
-   tmp.code_x = pcre_malloc (sizeof (pcre_extra));
-   if (tmp.code_x)
- memset (tmp.code_x, 0, sizeof (pcre_extra));
- }
-#ifdef PCRE_EXTRA_MATCH_LIMIT
-  if (c_pcre_match_limit > 0)
-{
-  tmp.code_x->flags |= PCRE_EXTRA_MATCH_LIMIT;
-  tmp.code_x->match_limit = c_pcre_match_limit;
-}
-#endif
-#ifdef PCRE_EXTRA_MATCH_LIMIT_RECURSION
-  if (c_pcre_match_limit_recursion > 0)
-{
-  tmp.code_x->flags |= PCRE_EXTRA_MATCH_LIMIT_RECURSION;
-  tmp.code_x->match_limit_recursion = c_pcre_match_limit_recursion;
-}
-#endif
   key.orig_strg = box_dv_short_string (pattern);
   new_val = (compiled_regexp_t *)dk_alloc (sizeof (compiled_regexp_t));
   new_val->code = tmp.code;
-  new_val->code_x = tmp.code_x;
   new_val->refctr = 1;
   HT_ENTER (c_r);
   pcre_cache_check (c_r);
@@ -302,18 +292,18 @@
 }
 
 
-static int
+static uint32_t
 regexp_optchars_to_bits (const char *strg)
 {
-  int res = 0;
+  uint32_t res = 0;
   const char *tail;
   for (tail = strg; '\0' != tail[0]; tail++)
 {
   switch (tail[0])
 {
-case 'i': case 'I': res |= PCRE_CASELESS; break;
-cas

Bug#999954: [Pkg-sugar-devel] Bug#999954: squeak-vm: depends on obsolete pcre3 library

2023-12-19 Thread Yavor Doganov
Jonas Smedegaard wrote:
> Quoting Yavor Doganov (2023-12-19 11:21:34)
> > Please find attached a patch;
> 
> Is it a patch that you composed yourself, or did you work based off of
> some upstream changeset.

The former.  I checked the new upstream release (downloaded with
uscan) and also checked upstream SVN trunk -- the problem was not
fixed there so I started off the current code in unstable.

This patch doesn't apply cleanly to the latest upstream release (it
has a bit different layout and there were changes to RePlugin) but I
guess it would be more or less trivial for me to adapt it.



Bug#999954: squeak-vm: depends on obsolete pcre3 library

2023-12-19 Thread Yavor Doganov
Control: tags -1 + patch

Please find attached a patch; unfortunately I could not find a way to
test it.
Description: Port to PCRE2.
Bug-Debian: https://bugs.debian.org/54
Author: Yavor Doganov 
Forwarded: no
Last-Update: 2023-12-19
---

--- squeak-vm.orig/platforms/unix/CMakeLists.txt
+++ squeak-vm/platforms/unix/CMakeLists.txt
@@ -125,7 +125,7 @@
   USE_LIBRARY ("-framework ${fwk}")
 ENDMACRO (USE_FRAMEWORK)
 
-USE_LIBRARY_SHARED ("-lpcre")
+USE_LIBRARY_SHARED ("-lpcre2-8")
 USE_LIBRARY_SHARED ("-ljpeg")
 
 MACRO (CONFIG_DEFINE var)
--- squeak-vm.orig/platforms/Cross/plugins/RePlugin/rePlugin.h
+++ squeak-vm/platforms/Cross/plugins/RePlugin/rePlugin.h
@@ -15,11 +15,9 @@
 
 The instance variables must appear in the preceding order.  MatchSpaceObj must 
be allocated by the calling routine and contain at least 6*(numGroups+1) bytes.
 */
-#include "pcre.h"
-#include "internal.h"
+#define PCRE2_CODE_UNIT_WIDTH 8
+#include 
 
 /* Adjust malloc and free routines as used by PCRE */
-static void rePluginFree(void * aPointer);
-static void * rePluginMalloc(size_t anInteger);
-void *(*pcre_malloc)(size_t) = rePluginMalloc;
-void  (*pcre_free)(void *) = rePluginFree;
+static void rePluginFree(void * aPointer, void * aData);
+static void * rePluginMalloc(size_t anInteger, void * aData);
--- squeak-vm.orig/platforms/unix/src/vm/intplugins/RePlugin/RePlugin.c
+++ squeak-vm/platforms/unix/src/vm/intplugins/RePlugin/RePlugin.c
@@ -35,7 +35,6 @@
 /*** Constants ***/
 
 /*** Function Prototypes ***/
-static sqInt allocateByteArrayAndSetRcvrExtraPtrFrom(sqInt anExtraPtr);
 static sqInt allocateByteArrayAndSetRcvrPCREPtrFromPCRE(sqInt aPCREPtr);
 static sqInt allocateStringAndSetRcvrErrorStrFromCStr(const char *aCStrBuffer);
 #pragma export on
@@ -52,17 +51,19 @@
 EXPORT(sqInt) primPCREExecfromto(void);
 EXPORT(sqInt) primPCRENumSubPatterns(void);
 #pragma export off
-static void rePluginFree(void *  aPointer);
+static void rePluginFree(void *  aPointer, void * aData);
 #pragma export on
-EXPORT(void *) rePluginMalloc(size_t  anInteger);
+EXPORT(void *) rePluginMalloc(size_t  anInteger, void * aData);
 EXPORT(sqInt) setInterpreter(struct VirtualMachine*anInterpreter);
 #pragma export off
 /*** Variables ***/
 static sqInt compileFlags;
-static sqInt errorOffset;
+static PCRE2_SIZE errorOffset;
 static sqInt errorStr;
-static const char *  errorStrBuffer;
-static sqInt extraPtr;
+static int errorCode;
+static pcre2_general_context * genContext = NULL;
+static pcre2_compile_context * compContext = NULL;
+static pcre2_match_context * matchContext = NULL;
 
 #ifdef SQUEAK_BUILTIN_PLUGIN
 extern
@@ -86,28 +87,6 @@
 static sqInt rcvr;
 
 
-static sqInt allocateByteArrayAndSetRcvrExtraPtrFrom(sqInt anExtraPtr) {
-   sqInt extraObject;
-   void *extraByteArrayPtr;
-
-   if (anExtraPtr) {
-
-   /* Allocate a Smalltalk ByteArray -- lastAlloc contains the 
length */
-
-   extraObject = 
interpreterProxy->instantiateClassindexableSize(interpreterProxy->classByteArray(),
 sizeof(real_pcre_extra));
-   /* begin loadRcvrFromStackAt: */
-   rcvr = interpreterProxy->stackObjectValue(0);
-   extraByteArrayPtr = interpreterProxy->arrayValueOf(extraObject);
-   memcpy(extraByteArrayPtr, (void *) anExtraPtr, 
sizeof(real_pcre_extra));
-   } else {
-   extraObject = interpreterProxy->nilObject();
-   }
-   /* begin rcvrExtraPtrFrom: */
-   interpreterProxy->storePointerofObjectwithValue(3, rcvr, extraObject);
-   ;
-   return extraObject;
-}
-
 static sqInt allocateByteArrayAndSetRcvrPCREPtrFromPCRE(sqInt aPCREPtr) {
sqInt patObject;
void *patByteArrayPtr;
@@ -184,13 +163,18 @@
 
 /* , where rcvr is an object with instance variables:
 
-   'patternStr compileFlags pcrePtr extraPtr errorStr errorOffset 
matchFlags'  
+   'patternStr compileFlags pcrePtr errorStr errorOffset matchFlags'
 
 Compile the regular expression in patternStr, and if the compilation is 
successful, attempt to optimize the compiled expression.  Store the results in 
 and , or fill errorStr with a meaningful errorString and 
errorOffset with an indicator where the error was found, applying compileFlags 
throughout.  Answer nil with a clean compile (regardless of whether an 
optimization is possible, and answer with the string otherwise. */
 
 EXPORT(sqInt) primPCRECompile(void) {
sqInt anInteger;
 
+   if (!genContext)
+   genContext = pcre2_general_context_create(rePluginMalloc,
+ rePluginFree, NULL);
+   if (!compContext)
+   compContext = pcre2_compile_context_create(genContext);
/* begin loadRcvrFromStackAt: */
rcvr = interpreterProxy->stackObjectValue(0);
patternStrPtr = ((char *) (interpreterProxy->fetchA

Bug#999960: sipxtapi: depends on obsolete pcre3 library

2023-12-18 Thread Yavor Doganov
Control: tags -1 + patch

Attached is a patch which I tested with the demo program at the end of
sipXportLib/src/utl/UtlRegex.cpp.
Description: Port to PCRE2.
Bug-Debian: https://bugs.debian.org/60
Author: Yavor Doganov 
Forwarded: no
Last-Update: 2023-12-18
---

--- sipxtapi-3.3.0~test18+dfsg.1.orig/configure.ac
+++ sipxtapi-3.3.0~test18+dfsg.1/configure.ac
@@ -59,7 +59,7 @@
 CHECK_OPUS
 
 # PCRE is mandatory
-PKG_CHECK_MODULES([DEPS_PCRE], [libpcre >= 4.5])
+PKG_CHECK_MODULES([DEPS_PCRE], [libpcre2-8])
 
 # OpenSSL is mandatory, find it or configure fails:
 CHECK_SSL
--- sipxtapi-3.3.0~test18+dfsg.1.orig/sipXportLib/include/utl/UtlRegex.h
+++ sipxtapi-3.3.0~test18+dfsg.1/sipXportLib/include/utl/UtlRegex.h
@@ -12,7 +12,8 @@
 #define _REGEX_H
 
 #include 
-#include 
+#define PCRE2_CODE_UNIT_WIDTH 8
+#include 
 #include "utl/UtlString.h"
 
 /**
@@ -61,8 +62,8 @@

/// Compile a regular expression to create the matching object.
   RegEx( const char * regex, //< the regular expression
- int   options = 0, //< any sum of PCRE options bits
- unsigned long int maxDepth = MAX_RECURSION // see MAX_RECURSION
+ uint32_t  options = 0, //< any sum of PCRE options bits
+ uint32_t maxDepth = MAX_RECURSION // see MAX_RECURSION
  );
   /**<
* If compiling the regular expression fails, an error message string is
@@ -71,7 +72,7 @@
*/
 
   /// Default maximum for the recursion depth in searches.
-  static const unsigned long int MAX_RECURSION;
+  static const uint32_t MAX_RECURSION;
   /**<
* The PCRE internal match() function implements some searches by recursion.
* This value is the default maximumm allowed depth for that recursion.  It 
can
@@ -115,7 +116,7 @@
   ~RegEx();
 
   /// Count the number of possible substrings returned by this expression
-  int SubStrings(void) const;
+  uint32_t SubStrings(void) const;
   /**<
*   SubStrings() @returns the number of substrings defined by
*   the regular expression.
@@ -142,8 +143,8 @@
 
   /// Search a string for matches to this regular expression
   bool Search( const char * subject,  ///< the string to be searched for a 
match
-   int len = -1,  ///< the length of the subject string
-   int options = 0///< sum of any PCRE options flags
+   PCRE2_SIZE len = -1,   ///< the length of the subject string
+   uint32_t options = 0   ///< sum of any PCRE options flags
);
   /**<
*Apply the regular expression to the subject string.
@@ -156,9 +157,9 @@
 
   /// Search a string starting at some offset for matches to this regular 
expression
   bool SearchAt(const char* subject,  ///< the string to be searched for a 
match
-int offset,   ///< offset to begin search in subject 
string
-int len = -1, ///< the length of the subject string
-int options = 0   ///< sum of any PCRE options flags
+PCRE2_SIZE offset,///< offset to begin search in subject 
string
+PCRE2_SIZE len = 0,   ///< the length of the subject string
+uint32_t options = 0  ///< sum of any PCRE options flags
 );
   /**<
*Apply the regular expression to the subject string, starting at the 
given offset.
@@ -175,7 +176,7 @@
 
 
   /// Repeat the last search operation, starting immediately after the 
previous match
-  bool SearchAgain( int options = 0///< sum of any PCRE options flags
+  bool SearchAgain( uint32_t options = 0   ///< sum of any PCRE options flags
);
   /**<
*SearchAgain() applies the regular expression to the same
@@ -432,17 +433,17 @@
 
   void ClearMatchList(void);
 
-  pcre * re;
+  pcre2_code * re;
+  pcre2_general_context * gen_ctxt;
+  pcre2_match_context * match_ctxt;
   size_t re_size;
-  pcre_extra * pe;
-  bool allocated_study;
-  size_t  study_size;
-  int substrcount; // maximum substrings in pattern
+  uint32_t substrcount;// maximum substrings in pattern
   const char * subjectStr; // original subject
-  int subjectLen;  // original length
-  int lastStart;   // offset of start for most recent Search or 
SearchAgain
-  int lastMatches; // pcre_exec return for most recent Search or 
SearchAgain
-  int * ovector;   // results from (and workspace for) pcre_exec
+  PCRE2_SIZE subjectLen;   // original length
+  PCRE2_SIZE lastStart;// offset of start for most recent Search or 
SearchAgain
+  int lastMatches; // pcre2_match return for most recent Search or 
SearchAgain
+  PCRE2_SIZE * ovector;// results from (and workspace for) pcre2_match
+  pcre2_match_data * md;   // PCRE match data block
   const char * * matchlist;// string cache for Match
 };
 
--- sipxtapi-3.3.0~test18+dfsg.1.orig/sipXportLib/src/

Bug#984331: sipxtapi: ftbfs with GCC-11

2023-12-18 Thread Yavor Doganov
Control: tags -1 + patch

Please find attached a patch.
Description: Fix FTBFS with GCC 11+.
Bug-Debian: https://bugs.debian.org/984331
Author: Yavor Doganov 
Forwarded: no
Last-Update: 2023-12-18
---

--- sipxtapi-3.3.0~test18+dfsg.1.orig/sipXtackLib/src/net/SipMessage.cpp
+++ sipxtapi-3.3.0~test18+dfsg.1/sipXtackLib/src/net/SipMessage.cpp
@@ -3806,13 +3806,13 @@
 routeString.append(SIP_MULTIFIELD_SEPARATOR);
 }
 // Make sure the route is in name-addr format
-if(strstr(routeUri,"<") <= 0)
+if(!strstr(routeUri,"<"))
 {
 routeString.append("<");
 }
 
 routeString.append(routeUri);
-if(strstr(routeUri, ">") <= 0)
+if(!strstr(routeUri, ">"))
 {
 routeString.append(">");
 }


Bug#1058941: sipxtapi: FTBFS: PlgSpeex.c:21:10: fatal error: speex/speex.h: No such file or directory

2023-12-18 Thread Yavor Doganov
Source: sipxtapi
Version:  3.3.0~test18+dfsg.1-0.1
Severity: serious
Tags: sid ftbfs patch

This package fails to build from source because it has to build-depend
on libspeex-dev (libspeexdsp-dev only suggests it).  The exact error is:

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../../../.. 
-I../../../../../sipXmediaLib/include -I../../../../../sipXportLib/include 
-I../../../../../../sipXmediaLib/contrib/libspeex/include 
-I../../../../../sipXmediaLib/contrib/libspeex/include -Wdate-time 
-D_FORTIFY_SOURCE=2 -DHAVE_SSL 
-DDEFAULT_CODECS_PATH=\"/usr/lib/x86_64-linux-gnu/sipxtapi/codecs\" -g -O2 
"-ffile-prefix-map=/<>=." -fstack-protector-strong 
-fstack-clash-protection -Wformat -Werror=format-security -fcf-protection 
-DHAVE_SPEEX -D__pingtel_on_posix__ -D_linux_ -D_REENTRANT 
-D_FILE_OFFSET_BITS=64 -fmessage-length=0 -Wall -Wformat -Wwrite-strings 
-Wpointer-arith -Wnested-externs -Wmissing-declarations -Wmissing-prototypes -c 
speex_nb.c  -fPIC -DPIC -o .libs/codec_speex_la-speex_nb.o
In file included from plgspeex.h:16,
 from speex_nb.c:16:
speex_nb.c:57:33: warning: no previous prototype for ‘speex_get_info_v1_1’ 
[-Wmissing-prototypes]
   57 | CODEC_API int PLG_GET_INFO_V1_1(speex)(const struct MppCodecInfoV1_1 
**codecInfo)
  | ^
../../../../../sipXmediaLib/include/mp/codecs/PlgDefsV1.h:183:40: note: in 
definition of macro ‘PLG_GET_INFO_V1_1’
  183 | #define PLG_GET_INFO_V1_1(x)   x##_get_info_v1_1
  |^
speex_nb.c:66:31: warning: no previous prototype for ‘speex_init_v1_2’ 
[-Wmissing-prototypes]
   66 | CODEC_API void *PLG_INIT_V1_2(speex)(const char* fmtp, int isDecoder,
  |   ^
../../../../../sipXmediaLib/include/mp/codecs/PlgDefsV1.h:184:40: note: in 
definition of macro ‘PLG_INIT_V1_2’
  184 | #define PLG_INIT_V1_2(x)   x##_init_v1_2
  |^
speex_nb.c:73:27: warning: no previous prototype for ‘speex_free_v1’ 
[-Wmissing-prototypes]
   73 | CODEC_API int PLG_FREE_V1(speex)(void* handle, int isDecoder)
  |   ^
../../../../../sipXmediaLib/include/mp/codecs/PlgDefsV1.h:188:40: note: in 
definition of macro ‘PLG_FREE_V1’
  188 | #define PLG_FREE_V1(x) x##_free_v1
  |^
speex_nb.c:78:43: warning: no previous prototype for 
‘speex_get_packet_samples_v1_2’ [-Wmissing-prototypes]
   78 | CODEC_API int PLG_GET_PACKET_SAMPLES_V1_2(speex)(void  *handle,
  |   ^
../../../../../sipXmediaLib/include/mp/codecs/PlgDefsV1.h:185:40: note: in 
definition of macro ‘PLG_GET_PACKET_SAMPLES_V1_2’
  185 | #define PLG_GET_PACKET_SAMPLES_V1_2(x) x##_get_packet_samples_v1_2
  |^
speex_nb.c:88:30: warning: no previous prototype for ‘speex_decode_v1’ 
[-Wmissing-prototypes]
   88 | CODEC_API  int PLG_DECODE_V1(speex)(void* handle, const void* 
pCodedData,
  |  ^
../../../../../sipXmediaLib/include/mp/codecs/PlgDefsV1.h:186:40: note: in 
definition of macro ‘PLG_DECODE_V1’
  186 | #define PLG_DECODE_V1(x)   x##_decode_v1
  |^
speex_nb.c:97:29: warning: no previous prototype for ‘speex_encode_v1’ 
[-Wmissing-prototypes]
   97 | CODEC_API int PLG_ENCODE_V1(speex)(void* handle, const void* 
pAudioBuffer,
  | ^
../../../../../sipXmediaLib/include/mp/codecs/PlgDefsV1.h:187:40: note: in 
definition of macro ‘PLG_ENCODE_V1’
  187 | #define PLG_ENCODE_V1(x)   x##_encode_v1
  |^
PlgSpeex.c:21:10: fatal error: speex/speex.h: No such file or directory
   21 | #include 
  |  ^~~
compilation terminated.
make[7]: *** [Makefile:576: codec_speex_la-PlgSpeex.lo] Error 1

Trivial patch attached.
--- debian/control.orig
+++ debian/control
@@ -2,7 +2,7 @@
 Section: libs
 Priority: optional
 Maintainer: Debian VoIP Team 
-Build-Depends: debhelper-compat (= 12), libssl-dev, libcppunit-dev, automake, 
libpcre3-dev, dpkg-dev (>= 1.16.1~), libxerces-c-dev, pkg-config, libgsm1-dev, 
libspandsp-dev, libspeexdsp-dev, doxygen, libopus-dev
+Build-Depends: debhelper-compat (= 12), libssl-dev, libcppunit-dev, automake, 
libpcre3-dev, dpkg-dev (>= 1.16.1~), libxerces-c-dev, pkg-config, libgsm1-dev, 
libspandsp-dev, libspeexdsp-dev, libspeex-dev, doxygen, libopus-dev
 Homepage: http://www.sipxtapi.org
 Standards-Version: 4.5.0
 Vcs-Git: https://salsa.debian.org/pkg-voip-team/sipxtapi.git


Bug#999964: shush: depends on obsolete pcre3 library

2023-12-17 Thread Yavor Doganov
Control: tags -1 + patch

Please find attached a patch.
Description: Port to PCRE2.
Bug-Debian: https://bugs.debian.org/64
Author: Yavor Doganov 
Forwarded: no
Last-Update: 2023-12-17
---

--- shush-1.2.3.orig/configure.ac
+++ shush-1.2.3/configure.ac
@@ -60,9 +60,19 @@
 # Checks for libraries.
 AC_SEARCH_LIBS([basename], [gen])
 if test "x$with_pcre" != "xno"; then
-   AC_SEARCH_LIBS([pcre_compile], [pcre], ,
-   AC_MSG_WARN([Perl Compatible Regular Expressions library is missing.])
-   with_pcre="no")
+   save_libs="$LIBS"
+   LIBS="$LIBS -lpcre2-8"
+   AC_MSG_CHECKING([for pcre library])
+   AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[#define PCRE2_CODE_UNIT_WIDTH 8
+#include 
+]],
+  [[pcre2_match_data_create(4, NULL);]])],
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])
+  AC_MSG_WARN([Perl Compatible Regular Expressions library is missing.])
+  with_pcre="no"
+  LIBS="$save_libs"])
 fi
 AC_SEARCH_LIBS([MD5Data], [md])
 AC_SEARCH_LIBS([md5_calc], [md5])
@@ -70,7 +80,11 @@
 # Checks for header files.
 AC_CHECK_HEADERS([md5.h paths.h pthread.h])
 if test "x$with_pcre" != "xno"; then
-   AC_CHECK_HEADERS([pcre.h])
+   AC_CHECK_HEADERS([pcre2.h],
+ [AC_DEFINE([HAVE_PCRE_H], [1],
+[Define to 1 if you have the  header file.])],
+ [], [[#define PCRE2_CODE_UNIT_WIDTH 8
+ ]])
 fi
 
 # Checks for typedefs, structures, and compiler characteristics.
--- shush-1.2.3.orig/src/analyzer.c
+++ shush-1.2.3/src/analyzer.c
@@ -16,7 +16,8 @@
 #include 
 #include 
 #if defined(HAVE_PCRE_H)
-# include 
+# define PCRE2_CODE_UNIT_WIDTH 8
+# include 
 #endif
 
 #include "analyzer.h"
@@ -40,7 +41,7 @@
 {
regex_t re;
 #if defined(HAVE_PCRE_H)
-   pcre *pcre;
+   pcre2_code *pcre;
 #endif
 } val;
 };
@@ -98,15 +99,19 @@
 static int
 compile_pcre(void *pcreptr, char *str)
 {
-pcre **re;
-const char *errmsg;
-int erroffset;
+pcre2_code **re;
+int err;
+PCRE2_SIZE erroffset;
 
 re = pcreptr;
-*re = pcre_compile(str, 0, , , NULL);
+*re = pcre2_compile((PCRE2_SPTR)str, strlen(str), 0,
+, , NULL);
 if (*re == NULL)
   {
-   error("Bad PCRE (offset %d): %s", erroffset, errmsg);
+   PCRE2_UCHAR errmsg[120];
+
+   pcre2_get_error_message(err, errmsg, sizeof(errmsg));
+   error("Bad PCRE (offset %zu): %s", erroffset, errmsg);
return -1;
   }
 return 0;
@@ -501,15 +506,17 @@
 #if defined(HAVE_PCRE_H)
  else if (type == PCRE)
{
- int ovector[3072];
+ PCRE2_SIZE *ovector;
+ pcre2_match_data *md;
 
- r = pcre_exec(list[condno].val.pcre, NULL, ln,
+ md = pcre2_match_data_create(3072, NULL);
+ r = pcre2_match(list[condno].val.pcre, (PCRE2_SPTR)ln,
(lndup != NULL) ? strlen(lndup) : nl - ln,
-   0, 0, ovector, 3072);
- if (r < 0 && r != PCRE_ERROR_NOMATCH)
+   0, 0, md, NULL);
+ if (r < 0 && r != PCRE2_ERROR_NOMATCH)
{
  /* Something bad happened */
- error("Fatal error during output analysis: pcre_exec() failed 
with code %d", r);
+ error("Fatal error during output analysis: pcre2_match() 
failed with code %d", r);
  error("Regular expression used was: %s",
list[condno].expression);
  error("Trying to match the following line of data: %s", ln);
@@ -517,6 +524,7 @@
  free(lndup);
  else
  *nl = '\n';
+  pcre2_match_data_free(md);
  return -1;
}
  else
@@ -527,14 +535,15 @@
 
  /* Matched */
  debug(DDATA,
-   "Matched: #%d %d[%c] (PCRE_ERROR_NOMATCH=%d)",
-   condno+1, r, list[condno].code, PCRE_ERROR_NOMATCH);
+   "Matched: #%d %d[%c] (PCRE2_ERROR_NOMATCH=%d)",
+   condno+1, r, list[condno].code, 
PCRE2_ERROR_NOMATCH);
  byteset_set(list[condno].code, 1);
  /* Check for substrings */
  i = 1;
+ ovector = pcre2_get_ovector_pointer(md);
  while (i < r)
{
- if (ovector[i*2] < 0 || ovector[i*2+1] < 0)
+ if ((int)ovector[i*2] < 0 || (int)ovector[i*2+1] < 0)
  continue;
  set_mark(marks, , ,
   ln - str + ovector[i*2], TOGGLE);
@@ 

Bug#999965: shadowsocks-libev: depends on obsolete pcre3 library

2023-12-17 Thread Yavor Doganov
Control: tags -1 + patch

Please find attached a patch, build-tested only.
>From a214f32480e417c9bf3358652f96d29d51325560 Mon Sep 17 00:00:00 2001
From: Yavor Doganov 
Date: Sun, 17 Dec 2023 14:23:39 +0200
Subject: [PATCH] Port to PCRE2 (#65)

---
 debian/changelog   |   7 ++
 debian/control |   2 +-
 debian/patches/pcre2.patch | 157 +
 debian/patches/series  |   1 +
 4 files changed, 166 insertions(+), 1 deletion(-)
 create mode 100644 debian/patches/pcre2.patch

diff --git a/debian/changelog b/debian/changelog
index c43a915..20c1f63 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+shadowsocks-libev (3.3.5+ds-11) UNRELEASED; urgency=medium
+
+  * debian/patches/pcre2.patch: New; port to PCRE2 (Closes: #65).
+  * debian/control (Build-Depends): Replace libpcre3-dev with libpcre2-dev.
+
+ -- Yavor Doganov   Sun, 17 Dec 2023 14:22:39 +0200
+
 shadowsocks-libev (3.3.5+ds-10) unstable; urgency=medium
 
   * Revert the move of systemd service files from /lib/ to /usr/lib/.
diff --git a/debian/control b/debian/control
index c2becba..d944661 100644
--- a/debian/control
+++ b/debian/control
@@ -16,7 +16,7 @@ Build-Depends:
  libev-dev,
  libjsonparser-dev,
  libmbedtls-dev,
- libpcre3-dev,
+ libpcre2-dev,
  libsodium-dev,
  pkg-config,
  xmlto,
diff --git a/debian/patches/pcre2.patch b/debian/patches/pcre2.patch
new file mode 100644
index 000..2691534
--- /dev/null
+++ b/debian/patches/pcre2.patch
@@ -0,0 +1,157 @@
+Description: Port to PCRE2.
+Bug-Debian: https://bugs.debian.org/65
+Author: Yavor Doganov 
+Forwarded: no
+Last-Update: 2023-12-17
+---
+
+--- shadowsocks-libev.orig/src/rule.c
 shadowsocks-libev/src/rule.c
+@@ -78,14 +78,18 @@
+ init_rule(rule_t *rule)
+ {
+ if (rule->pattern_re == NULL) {
+-const char *reerr;
+-int reerroffset;
++int reerr;
++PCRE2_SIZE reerroffset;
+ 
+ rule->pattern_re =
+-pcre_compile(rule->pattern, 0, , , NULL);
++pcre2_compile((PCRE2_SPTR)rule->pattern, strlen(rule->pattern),
++  0, , , NULL);
+ if (rule->pattern_re == NULL) {
+-LOGE("Regex compilation of \"%s\" failed: %s, offset %d",
+- rule->pattern, reerr, reerroffset);
++PCRE2_UCHAR buf[120];
++
++pcre2_get_error_message(reerr, buf, sizeof(buf));
++LOGE("Regex compilation of \"%s\" failed: %s, offset %zu",
++ rule->pattern, buf, reerroffset);
+ return 0;
+ }
+ }
+@@ -97,6 +101,7 @@
+ lookup_rule(const struct cork_dllist *rules, const char *name, size_t 
name_len)
+ {
+ struct cork_dllist_item *curr, *next;
++pcre2_match_data *md = NULL;
+ 
+ if (name == NULL) {
+ name = "";
+@@ -105,10 +110,15 @@
+ 
+ cork_dllist_foreach_void(rules, curr, next) {
+ rule_t *rule = cork_container_of(curr, rule_t, entries);
+-if (pcre_exec(rule->pattern_re, NULL,
+-  name, name_len, 0, 0, NULL, 0) >= 0)
++pcre2_match_data_free(md);
++md = pcre2_match_data_create_from_pattern(rule->pattern_re, NULL);
++if (pcre2_match(rule->pattern_re, (PCRE2_SPTR)name,
++name_len, 0, 0, md, NULL) >= 0) {
++pcre2_match_data_free(md);
+ return rule;
++}
+ }
++pcre2_match_data_free(md);
+ 
+ return NULL;
+ }
+@@ -128,6 +138,6 @@
+ 
+ ss_free(rule->pattern);
+ if (rule->pattern_re != NULL)
+-pcre_free(rule->pattern_re);
++pcre2_code_free(rule->pattern_re);
+ ss_free(rule);
+ }
+--- shadowsocks-libev.orig/src/rule.h
 shadowsocks-libev/src/rule.h
+@@ -33,17 +33,16 @@
+ 
+ #include 
+ 
+-#ifdef HAVE_PCRE_H
+-#include 
+-#elif HAVE_PCRE_PCRE_H
+-#include 
++#ifdef HAVE_PCRE2_H
++#define PCRE2_CODE_UNIT_WIDTH 8
++#include 
+ #endif
+ 
+ typedef struct rule {
+ char *pattern;
+ 
+ /* Runtime fields */
+-pcre *pattern_re;
++pcre2_code *pattern_re;
+ 
+ struct cork_dllist_item entries;
+ } rule_t;
+--- shadowsocks-libev.orig/m4/pcre.m4
 shadowsocks-libev/m4/pcre.m4
+@@ -82,12 +82,12 @@
+   fi
+ ],
+ [
+-  AC_CHECK_PROG(PCRE_CONFIG, pcre-config, pcre-config)
++  AC_CHECK_PROG(PCRE_CONFIG, pcre2-config, pcre2-config)
+   if test "x$PCRE_CONFIG" != "x"; then
+ enable_pcre=yes
+ pcre_base_dir="`$PCRE_CONFIG --prefix`"
+ pcre_include="`$PCRE_CONFIG --cflags | sed -es/-I//`"
+-pcre_ldflags="`$PCRE_CONFIG --libs | sed -es/-lpcre// -es/-L//`"
++pcre_ldflags="`$PCRE_CONFIG --libs8 | sed -es/-lpcre// -es/-L//`"
+   fi
+ ])
+ 
+@@ -95,7 +95,7 @@
+   AC_MSG_CHECKING([for pcre location])
+   AC_CACHE_VAL(ats_cv_pcre_dir,[
+   for dir in /usr/local /usr ; do
+-if test -d $dir &&

Bug#999968: sagan: depends on obsolete pcre3 library

2023-12-17 Thread Yavor Doganov
Control: tags -1 + patch

Please find attached a patch, build-tested only.
Description: Port to PCRE2.
Bug-Debian: https://bugs.debian.org/68
Author: Yavor Doganov 
Forwarded: no
Last-Update: 2023-12-17
---

--- sagan-1.2.0.orig/configure.ac
+++ sagan-1.2.0/configure.ac
@@ -392,14 +392,25 @@
 CPPFLAGS="${CPPFLAGS} -I${with_libpcre_includes}"
 fi
 
-AC_CHECK_HEADER(pcre.h,,[AC_ERROR(pcre.h not found ...)])
+AC_CHECK_HEADER([pcre2.h], [], [AC_MSG_ERROR([pcre2.h not found ...])],
+[[#define PCRE2_CODE_UNIT_WIDTH 8
+]])
 
 if test "$with_libpcre_libraries" != "no"; then
 LDFLAGS="${LDFLAGS} -L${with_libpcre_libraries}"
 fi
 
 PCRE=""
-AC_CHECK_LIB(pcre, pcre_get_substring,, PCRE="no")
+LIBS="$LIBS -lpcre2-8"
+AC_MSG_CHECKING([for pcre library])
+AC_LINK_IFELSE(
+  [AC_LANG_PROGRAM([[#define PCRE2_CODE_UNIT_WIDTH 8
+#include 
+]],
+[[pcre2_match_data *md = pcre2_match_data_create(4, NULL);]])],
+  [AC_MSG_RESULT([yes])],
+  [AC_MSG_RESULT([no])
+   PCRE="no"])
 if test "$PCRE" = "no"; then
 echo
 echo "   ERROR!  pcre library not found, go get it"
@@ -408,98 +419,44 @@
 exit 1
 fi
 
-# libpcre 8.35 (especially on debian) has a known issue that results in 
segfaults
-if test "$with_libpcre_libraries" = "no"; then
-PKG_CHECK_MODULES(LIBPCREVERSION, [libpcre = 
8.35],[libpcre_buggy_found="yes"],[libprce_buggy_found="no"])
-if test "$libpcre_buggy_found" = "yes"; then
-echo
-echo "   Warning! vulnerable libpcre version 8.35 found"
-echo "   This version has a known issue that could result in segfaults"
-echo "   please upgrade to a newer version of pcre which you can get 
from"
-echo "   www.pcre.org. For more information, see issue #1693"
-echo
-echo "   Continuing for now with JIT disabled..."
-echo
-fi
-fi
-
-# To prevent duping the lib link we reset LIBS after this check. Setting 
action-if-found to NULL doesn't seem to work
-# see: http://blog.flameeyes.eu/2008/04/29/i-consider-ac_check_lib-harmful
-PCRE=""
-TMPLIBS="${LIBS}"
-AC_CHECK_LIB(pcre, pcre_dfa_exec,, PCRE="no")
-if test "$PCRE" = "no"; then
-echo
-echo "   ERROR!  pcre library was found but version was < 6.0"
-echo "   please upgrade to a newer version of pcre which you can get from"
-echo "   www.pcre.org."
-echo
-exit 1
-fi
-LIBS="${TMPLIBS}"
-
-AC_TRY_COMPILE([ #include  ],
-[ int eo = 0; eo |= PCRE_EXTRA_MATCH_LIMIT_RECURSION; ],
-[ pcre_match_limit_recursion_available=yes ], [:]
-)
-
-if test "$pcre_match_limit_recursion_available" != "yes"; then
-echo
-echo "   Warning! pcre extra opt PCRE_EXTRA_MATCH_LIMIT_RECURSION not 
found"
-echo "   This could lead to potential DoS please upgrade to pcre >= 6.5"
-echo "   from www.pcre.org."
-echo "   Continuing for now"
-echo
-AC_DEFINE([NO_PCRE_MATCH_RLIMIT],[1],[Pcre 
PCRE_EXTRA_MATCH_LIMIT_RECURSION not available])
-fi
-
-TMPCFLAGS="${CFLAGS}"
-CFLAGS="-O0 -g -Werror -Wall"
-AC_TRY_COMPILE([ #include  ],
-[ pcre_extra *extra = NULL; pcre_free_study(extra); ],
-[ AC_DEFINE([HAVE_PCRE_FREE_STUDY], [1], [Pcre pcre_free_study 
supported])], [:]
-)
-CFLAGS="${TMPCFLAGS}"
-
-
 #enable support for PCRE-jit available since pcre-8.20
 AC_MSG_CHECKING(for PCRE JIT support)
-AC_TRY_COMPILE([ #include  ],
-[
-int jit = 0;
-pcre_config(PCRE_CONFIG_JIT, );
-],
+AC_RUN_IFELSE(
+  [AC_LANG_PROGRAM([[#define PCRE2_CODE_UNIT_WIDTH 8
+#include 
+]],
+[[uint32_t jit = 0;
+  pcre2_config(PCRE2_CONFIG_JIT, );
+  if (jit)
+exit(EXIT_SUCCESS);
+  exit(EXIT_FAILURE);]])],
 [ pcre_jit_available=yes ], [ pcre_jit_available=no ]
 )
 
-# bug 1693, libpcre 8.35 is broken and debian jessie is still using that
-if test "$libpcre_buggy_found" = "yes"; then
-pcre_jit_available="no, libpcre 8.35 blacklisted"
-fi
-
 
 if test "x$pcre_jit_available" = "xyes"; then
AC_MSG_RESULT(yes)
AC_DEFINE([PCRE_HAVE_JIT], [1], [Pcre with JIT compiler support enabled])
 
AC_MSG_CHECKING(for PCRE JIT support usability)
-   AC_TRY_COMPILE([ #include  ],
-   [
-   const char* regexstr = "(a|b|c|d)";
-   pcre *re;
-   const char *error;
-   pcre_extra *extra;
-   int err_offset;
-   re = pcre_compile(regexstr,0, , _offset,NULL);
-   extra = pcre_study(re, PCRE_STUDY_JIT_COMPILE, );
-   if (extra == NULL)
-   exit(EXIT_FAILURE);
-   int jit = 0;
-   int ret = pcre_fullinfo(re, extra, PCRE_INFO_JIT, );
-   if (ret != 0 || jit !=

Bug#999984: prads: depends on obsolete pcre3 library

2023-12-16 Thread Yavor Doganov
Control: tags -1 + patch

Please find a patch attached.
I could not observe problems while testing it.
>From 014406e858e3e2af471bfb2b392ea693674120e3 Mon Sep 17 00:00:00 2001
From: Yavor Doganov 
Date: Sun, 17 Dec 2023 00:53:23 +0200
Subject: [PATCH] Port to PCRE2 (#84)

---
 debian/changelog  |   8 +
 debian/control|   5 +-
 debian/patches/debian-changes | 359 ++
 src/Makefile  |   2 +-
 src/prads.c   |   5 +-
 src/prads.h   |   6 +-
 src/servicefp/servicefp.c |  31 ++-
 src/servicefp/servicefp.h |   4 +-
 src/servicefp/tcpc.c  |  18 +-
 src/servicefp/tcps.c  |  18 +-
 src/servicefp/udps.c  |  18 +-
 11 files changed, 430 insertions(+), 44 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 445f0e0..9735891 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+prads (0.3.3-8) UNRELEASED; urgency=medium
+
+  * Port to PCRE2 (Closes: #84).
+  * debian/control (Depends): Drop libpcre3.
+(Build-Depends): Replace libpcre3-dev with libpcre2-dev.
+
+ -- Yavor Doganov   Sun, 17 Dec 2023 00:51:17 +0200
+
 prads (0.3.3-7) unstable; urgency=medium
 
   * Remove 1 obsolete maintscript entry.
diff --git a/debian/control b/debian/control
index 5895778..a2fb71f 100644
--- a/debian/control
+++ b/debian/control
@@ -5,7 +5,7 @@ Maintainer: Stig Sandbeck Mathisen 
 Build-Depends:
  debhelper-compat (= 13),
  libpcap-dev,
- libpcre3-dev,
+ libpcre2-dev,
  python3-docutils,
 Standards-Version: 4.6.0
 Homepage: https://gamelinux.github.com/prads/
@@ -15,8 +15,7 @@ Vcs-Browser: https://salsa.debian.org/debian/prads
 Package: prads
 Architecture: any
 Pre-Depends: ${misc:Pre-Depends}
-Depends: ${shlibs:Depends}, ${misc:Depends}, libpcap0.8, libpcre3,
- adduser
+Depends: ${shlibs:Depends}, ${misc:Depends}, libpcap0.8, adduser
 Description: Passive Real-time Asset Detection System
  PRADS is a Passive Real-time Asset Detection System.
  .
diff --git a/debian/patches/debian-changes b/debian/patches/debian-changes
index 89c1c18..848acc3 100644
--- a/debian/patches/debian-changes
+++ b/debian/patches/debian-changes
@@ -58,6 +58,15 @@ A single combined diff, containing all the changes, follows.
  
  # for finding static libraries
  LIBDIR=/usr/lib/x86_64-linux-gnu
+@@ -28,7 +28,7 @@ ifeq (${STATIC},)
+ ifeq (${TCMALLOC},y)
+ LDFLAGS+=-ltcmalloc
+ endif
+-LDFLAGS+=-lpcap -lpcre -lresolv
++LDFLAGS+=-lpcap -lpcre2-8 -lresolv
+ CFLAGS+=-DCONFDIR='"${CONFDIR}/"'
+ else
+ ifeq (${TCMALLOC},y)
 --- prads-0.3.3.orig/src/output-plugins/log.h
 +++ prads-0.3.3/src/output-plugins/log.h
 @@ -19,8 +19,8 @@ typedef struct _output_plugin {
@@ -82,3 +91,353 @@ A single combined diff, containing all the changes, follows.
  
  /* --
   * FUNCTION : init_identification
+@@ -135,8 +135,8 @@ int parse_raw_signature(bstring line, in
+ signature *sig, *head;
+ sig = head = NULL;
+ bstring pcre_string = NULL;
+-const char *err = NULL; /* PCRE */
+-int erroffset;  /* PCRE */
++int err;/* PCRE */
++PCRE2_SIZE erroffset;   /* PCRE */
+ int ret = 0;
+ int i;
+ 
+@@ -207,18 +207,17 @@ int parse_raw_signature(bstring line, in
+  */
+ if (pcre_string != NULL) {
+ if ((sig->regex =
+- pcre_compile((char *)bdata(pcre_string), 0, ,
+-  , NULL)) == NULL) {
++ pcre2_compile((PCRE2_SPTR)bdata(pcre_string),
++   PCRE2_ZERO_TERMINATED, 0, ,
++   , NULL)) == NULL) {
++PCRE2_UCHAR buf[120];
++
++pcre2_get_error_message(err, buf, sizeof(buf));
+ printf("Unable to compile signature:  %s at line %d (%s)",
+-   err, lineno, bdata(line));
++   buf, lineno, bdata(line));
+ ret = -1;
+ }
+ }
+-if (ret != -1) {
+-sig->study = pcre_study(sig->regex, 0, );
+-if (err != NULL)
+-printf("Unable to study signature:  %s", err);
+-}
+ 
+ /*
+  * Add signature to 'signature_list' data structure. 
+@@ -266,8 +265,7 @@ void free_signature_list (signature *hea
+ bdestroy(head->title.app);
+ bdestroy(head->title.ver);
+ bdestroy(head->title.misc);
+-if (head->regex != NULL) free(head->regex);
+-if (head->study != NULL) free(head->study);
++pcre2_code_free(head->regex);
+ tmp = head->next;
+ free(head);
+ head = NULL;
+@@ -297,11 +295,11 @@ void del_signature_lists()
+  * INPUT: 0 - Signature Pointer
+  *  : 1 - payload
+  *

Bug#1058817: picom: depends on obsolete pcre3 library

2023-12-16 Thread Yavor Doganov
Source: picom
Version: 10.2-1
Severity: serious
Tags: sid trixie fixed-upstream
User: matthew-pcre...@debian.org
Usertags: obsolete-pcre3

Dear maintainer,

During the mass bug filing for the pcre3->pcre2 transition [*], this
package was left out somehow.  I am filing this (edited copy)
post-factum.  Fortunately this bug has been fixed upstream.

[*] https://release.debian.org/transitions/html/pcre3-to-pcre2.html

Your package still depends on the old, obsolete PCRE3 libraries
(i.e. libpcre3-dev). This has been end of life for a while now, and
upstream do not intend to fix any further bugs in it. Accordingly, we
would like to remove the pcre3 libraries from Debian.

The newer PCRE2 library was first released in 2015, and has been in
Debian since stretch. Upstream's documentation for PCRE2 is available
here: https://pcre.org/current/doc/html/

Many large projects that use PCRE have made the switch now (e.g. git,
php); it does involve some work, but we are now at the stage where
PCRE3 should not be used, particularly if it might ever be exposed to
untrusted input.

This mass bug filing was discussed on debian-devel@ in
https://lists.debian.org/debian-devel/2021/11/msg00176.html



Bug#1000001: pgpcre: depends on obsolete pcre3 library

2023-12-16 Thread Yavor Doganov
Control: tags -1 + patch

Please find attached a patch.

I have not tested the package except the build-time tests.  Initially,
I tried to follow upstream's desire for custom memory management, so I
created a pcre2_general_context in _PG_init (changing the
pgpcre_malloc/pgpcre_free prototypes as is required).  Unfortunately,
the test program crashes when pfree is invoked in
src:pcre2:src/pcre2_match.c:6846.  It looks like palloc/pfree are not
suitable as PCRE2 custom memory management functions as they use memory
context like in PCRE2 itself.  Or I am misunderstanding something.
>From f46d9ca762751a3c856369d781cf69554c31e001 Mon Sep 17 00:00:00 2001
From: Yavor Doganov 
Date: Sat, 16 Dec 2023 22:29:20 +0200
Subject: [PATCH] Port to PCRE2 (#101).

---
 debian/changelog   |   6 +
 debian/control |   2 +-
 debian/control.in  |   2 +-
 debian/patches/pcre2.patch | 268 +
 debian/patches/series  |   1 +
 5 files changed, 277 insertions(+), 2 deletions(-)
 create mode 100644 debian/patches/pcre2.patch
 create mode 100644 debian/patches/series

diff --git a/debian/changelog b/debian/changelog
index 1d0f545..cba8632 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+pgpcre (0.20190509-7) UNRELEASED; urgency=medium
+
+  * Port to PCRE2 (Closes: #101).
+
+ -- Yavor Doganov   Sat, 16 Dec 2023 22:27:38 +0200
+
 pgpcre (0.20190509-6) unstable; urgency=medium
 
   * Upload for PostgreSQL 16.
diff --git a/debian/control b/debian/control
index 1073417..bb8c141 100644
--- a/debian/control
+++ b/debian/control
@@ -6,7 +6,7 @@ Uploaders:
  Christoph Berg ,
 Build-Depends:
  debhelper-compat (= 13),
- libpcre3-dev,
+ libpcre2-dev,
  pkg-config,
  postgresql-all (>= 217~),
 Standards-Version: 4.6.2
diff --git a/debian/control.in b/debian/control.in
index 5fe2318..0f01b24 100644
--- a/debian/control.in
+++ b/debian/control.in
@@ -6,7 +6,7 @@ Uploaders:
  Christoph Berg ,
 Build-Depends:
  debhelper-compat (= 13),
- libpcre3-dev,
+ libpcre2-dev,
  pkg-config,
  postgresql-all (>= 217~),
 Standards-Version: 4.6.2
diff --git a/debian/patches/pcre2.patch b/debian/patches/pcre2.patch
new file mode 100644
index 000..f138fb1
--- /dev/null
+++ b/debian/patches/pcre2.patch
@@ -0,0 +1,268 @@
+Description: Port to PCRE2.
+Bug-Debian: https://bugs.debian.org/101
+Author: Yavor Doganov 
+Forwarded: no
+Last-Update: 2023-12-16
+---
+
+--- pgpcre-0.20190509.orig/Makefile
 pgpcre-0.20190509/Makefile
+@@ -6,12 +6,12 @@
+ OBJS = pgpcre.o
+ DATA = pgpcre--0.sql pgpcre--1.sql pgpcre--0--1.sql
+ 
+-ifeq (no,$(shell $(PKG_CONFIG) libpcre || echo no))
++ifeq (no,$(shell $(PKG_CONFIG) libpcre2-8 || echo no))
+ $(warning libpcre not registed with pkg-config, build might fail)
+ endif
+ 
+-PG_CPPFLAGS += $(shell $(PKG_CONFIG) --cflags-only-I libpcre)
+-SHLIB_LINK += $(shell $(PKG_CONFIG) --libs libpcre)
++PG_CPPFLAGS += $(shell $(PKG_CONFIG) --cflags-only-I libpcre2-8)
++SHLIB_LINK += $(shell $(PKG_CONFIG) --libs libpcre2-8)
+ 
+ REGRESS = init test unicode
+ REGRESS_OPTS = --inputdir=test
+--- pgpcre-0.20190509.orig/pgpcre.c
 pgpcre-0.20190509/pgpcre.c
+@@ -5,7 +5,8 @@
+ #include 
+ #include 
+ 
+-#include 
++#define PCRE2_CODE_UNIT_WIDTH 8
++#include 
+ 
+ PG_MODULE_MAGIC;
+ 
+@@ -57,19 +58,19 @@
+ pcre_in(PG_FUNCTION_ARGS)
+ {
+   char   *input_string = PG_GETARG_CSTRING(0);
+-  pcre   *pc;
+-  const char *err;
+-  int erroffset;
+-  size_t  in_strlen;
+-  int rc, total_len, pcsize;
++  pcre2_code *pc;
++  int err;
++  PCRE2_SIZE  erroffset;
++  size_t  in_strlen, pcsize;
++  int rc, total_len;
+   pgpcre *result;
+ 
+   in_strlen = strlen(input_string);
+ 
+   if (GetDatabaseEncoding() == PG_UTF8)
+-  pc = pcre_compile(input_string, PCRE_UTF8 | PCRE_UCP, , 
, NULL);
++  pc = pcre2_compile((PCRE2_SPTR) input_string, in_strlen, 
PCRE2_UTF | PCRE2_UCP, , , NULL);
+   else if (GetDatabaseEncoding() == PG_SQL_ASCII)
+-  pc = pcre_compile(input_string, 0, , , NULL);
++  pc = pcre2_compile((PCRE2_SPTR) input_string, in_strlen, 0, 
, , NULL);
+   else
+   {
+   char *utf8string;
+@@ -78,22 +79,27 @@
+   
in_strlen,
+   
GetDatabaseEncoding(),
+   
PG_UTF8);
+-  pc = pcre_compile(utf8string, PCRE_UTF8 | PCRE_UCP, , 
, NULL);
++  pc = pcre2_compile((PCRE2_SPTR) utf8string, strlen(utf8string), 
PCRE2_UTF | PCRE2_UCP, , , NULL);
+   if (utf8string != inp

Bug#1000009: opencollada: depends on obsolete pcre3 library

2023-12-16 Thread Yavor Doganov
Control: tags -1 + patch

Please find attached a patch.
Tested with an example COLLADA file.
>From f1772e60500e6cbdf3231792a6f7216eb1ac53e0 Mon Sep 17 00:00:00 2001
From: Yavor Doganov 
Date: Sat, 16 Dec 2023 15:34:11 +0200
Subject: [PATCH] Port to PCRE2 (#109)

---
 debian/changelog   |   7 +
 debian/control |   2 +-
 debian/patches/pcre2.patch | 785 +
 debian/patches/series  |   1 +
 4 files changed, 794 insertions(+), 1 deletion(-)
 create mode 100644 debian/patches/pcre2.patch

diff --git a/debian/changelog b/debian/changelog
index c87ac4f..f0634a2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+opencollada (0.1.0~20180719.619d942+dfsg0-3) UNRELEASED; urgency=medium
+
+  * debian/patches/pcre2.patch: New; port to PCRE2 (Closes: #109).
+  * debian/control (Build-Depends): Replace libpcre3-dev with libpcre2-dev.
+
+ -- Yavor Doganov   Sat, 16 Dec 2023 15:32:13 +0200
+
 opencollada (0.1.0~20180719.619d942+dfsg0-2) unstable; urgency=medium
 
   * Upload to unstable
diff --git a/debian/control b/debian/control
index da6c13e..4c64ef8 100644
--- a/debian/control
+++ b/debian/control
@@ -6,7 +6,7 @@ Uploaders: Matteo F. Vescovi 
 Build-Depends:
  cmake,
  debhelper-compat (= 11),
- libpcre3-dev,
+ libpcre2-dev,
  libxml2-dev
 Standards-Version: 4.2.1
 Homepage: http://www.opencollada.org/
diff --git a/debian/patches/pcre2.patch b/debian/patches/pcre2.patch
new file mode 100644
index 000..6849bc6
--- /dev/null
+++ b/debian/patches/pcre2.patch
@@ -0,0 +1,785 @@
+Description: Port to PCRE2.
+Bug-Debian: https://bugs.debian.org/109
+Author: Yavor Doganov 
+Forwarded: no
+Last-Update: 2023-12-16
+---
+
+--- opencollada.orig/CMakeLists.txt
 opencollada/CMakeLists.txt
+@@ -257,16 +257,8 @@
+ find_package(PCRE)

+ if (PCRE_FOUND)

+   message(STATUS "SUCCESSFUL: PCRE found")

+-else ()  # if pcre not found building its local copy from ./Externals

+-  if (WIN32 OR APPLE)

+-  message("WARNING: Native PCRE not found, taking PCRE from 
./Externals")

+-  add_definitions(-DPCRE_STATIC)

+-  add_subdirectory(${EXTERNAL_LIBRARIES}/pcre)

+-  set(PCRE_INCLUDE_DIR ${libpcre_include_dirs})

+-  set(PCRE_LIBRARIES pcre)

+-  else ()

+-  message("ERROR: PCRE not found, please install pcre library")

+-  endif ()

++else ()

++  message("ERROR: PCRE not found, please install pcre library")

+ endif ()

+ 

+ # building required libs

+--- opencollada.orig/COLLADABaseUtils/include/COLLADABUPcreCompiledPattern.h
 opencollada/COLLADABaseUtils/include/COLLADABUPcreCompiledPattern.h
+@@ -12,6 +12,8 @@
+ #define __COLLADABU_PCRECOMPILEDPATTERN_H__

+ 

+ #include "COLLADABUPrerequisites.h"

++#define PCRE2_CODE_UNIT_WIDTH 8
++#include 
+ 

+ struct real_pcre;
+ typedef struct real_pcre pcre;
+@@ -29,7 +31,7 @@
+   {

+   private:

+   /** The compiled pattern.*/

+-  pcre *mCompiledPattern;

++  pcre2_code *mCompiledPattern;

+ 

+   /** True, if we need to free the pattern in the destructor, 
false otherwise.*/

+   bool mFreePattern;

+@@ -44,7 +46,7 @@
+   virtual ~PcreCompiledPattern();

+ 

+   /** Returns the compiled pattern. */

+-  pcre* getCompiledPattern() const;

++  pcre2_code* getCompiledPattern() const;

+ 

+   private:

+ 

+@@ -55,7 +57,7 @@
+   const PcreCompiledPattern& operator= ( const 
PcreCompiledPattern& pre );

+ 

+   /** Compiles the pattern.*/

+-  pcre* compilePattern( const char* pattern );

++  pcre2_code* compilePattern( const char* pattern );

+ 

+   };

+ 

+--- opencollada.orig/COLLADABaseUtils/src/COLLADABUPcreCompiledPattern.cpp
 opencollada/COLLADABaseUtils/src/COLLADABUPcreCompiledPattern.cpp
+@@ -11,7 +11,6 @@
+ #include "COLLADABUStableHeaders.h"
+ #include "COLLADABUPcreCompiledPattern.h"
+ 
+-#include "pcre.h"
+ 
+ namespace COLLADABU
+ {
+@@ -30,17 +29,18 @@
+   {
+   if ( mFreePattern )
+   {
+-  pcre_free(mCompiledPattern);
++  pcre2_code_free(mCompiledPattern);
+   }
+   }
+ 
+   //--
+-  pcre* PcreCompiledPattern::compilePattern( const char* pattern )
++  pcre2_code* PcreCompiledPattern::compilePattern( const char* pattern )
+   {
+-  const char *error;
+-  int erroffset;
+-  pcre* compiledPattern = pcre_compile(
+-  pattern,
  /* the pattern */
++  int error;
++  size_t erroffset;
++  pcre2_code* compiledPattern = pcre2_compile(
++

Bug#1050187: mvdsv: depends on obsolete pcre3 library

2023-12-14 Thread Yavor Doganov
Control: tags -1 + patch

Please find attached a patch (build-tested only).
>From e7127e5a2fa57f84dc12cc6d63671c872c48d28b Mon Sep 17 00:00:00 2001
From: Yavor Doganov 
Date: Thu, 14 Dec 2023 18:31:41 +0200
Subject: [PATCH] Port to PCRE2 (#1050187)

---
 debian/changelog   |   7 +
 debian/control |   2 +-
 debian/patches/pcre2.patch | 316 +
 debian/patches/series  |   1 +
 4 files changed, 325 insertions(+), 1 deletion(-)
 create mode 100644 debian/patches/pcre2.patch

diff --git a/debian/changelog b/debian/changelog
index 0f44607..9874ff2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+mvdsv (0.35-7) UNRELEASED; urgency=medium
+
+  * debian/patches/pcre2.patch: New; port to PCRE2 (Closes: #1050187).
+  * debian/control (Build-Depends): Replace libpcre3-dev with libpcre2-dev.
+
+ -- Yavor Doganov   Thu, 14 Dec 2023 18:30:40 +0200
+
 mvdsv (0.35-6) unstable; urgency=high
 
   * Fix build failure on big endian systems
diff --git a/debian/control b/debian/control
index d53102d..f69173d 100644
--- a/debian/control
+++ b/debian/control
@@ -5,7 +5,7 @@ Priority: optional
 Build-Depends: debhelper-compat (= 13),
cmake,
libcurl4-openssl-dev,
-   libpcre3-dev,
+   libpcre2-dev,
 Rules-Requires-Root: no
 Standards-Version: 4.6.2
 Vcs-Browser: https://salsa.debian.org/games-team/mvdsv
diff --git a/debian/patches/pcre2.patch b/debian/patches/pcre2.patch
new file mode 100644
index 000..efad8d1
--- /dev/null
+++ b/debian/patches/pcre2.patch
@@ -0,0 +1,316 @@
+Description: Port to PCRE2.
+Bug-Debian: https://bugs.debian.org/1050187
+Author: Yavor Doganov 
+Forwarded: no
+Last-Update: 2023-12-14
+---
+
+--- mvdsv.orig/CMakeLists.txt
 mvdsv/CMakeLists.txt
+@@ -90,18 +90,14 @@
+ 
##
+  
+ # Check for PCRE. if found, include it; if not found, use bundled PCRE.
+-find_library(PCRE_LIBRARIES pcre)
++find_library(PCRE_LIBRARIES pcre2-8)
+ if(PCRE_LIBRARIES)
+   set(PCRE_FOUND 1)
+-  find_path(PCRE_INCLUDE_DIR pcre.h)
++  find_path(PCRE_INCLUDE_DIR pcre2.h)
+ endif(PCRE_LIBRARIES)
+ 
+ if(NOT PCRE_FOUND)
+-  message(STATUS "PCRE library not found. Using bundled PCRE instead.")
+-  list(APPEND SRC_COMMON
+-  "${DIR_SRC}/pcre/get.c"
+-  "${DIR_SRC}/pcre/pcre.c"
+-  )
++  message(FATAL_ERROR "PCRE library not found.")
+ else()
+   message(STATUS "Found PCRE: ${PCRE_LIBRARIES}")
+ endif()
+--- mvdsv.orig/src/sv_demo_misc.c
 mvdsv/src/sv_demo_misc.c
+@@ -22,7 +22,8 @@
+ #ifndef CLIENTONLY
+ #include "qwsvdef.h"
+ #ifndef SERVERONLY
+-#include "pcre.h"
++#define PCRE2_CODE_UNIT_WIDTH 8
++#include 
+ #endif
+ 
+ #define MAX_DEMOINFO_SIZE (1024 * 200)
+@@ -342,8 +343,10 @@
+   int files[MAX_DIRFILES + 1];
+ 
+   int r;
+-  pcre*preg;
+-  const char  *errbuf;
++  size_t erroffset;
++  pcre2_code *preg;
++  pcre2_match_data *md;
++  PCRE2_UCHAR errbuf[120];
+ 
+   memset(files, 0, sizeof(files));
+ 
+@@ -361,26 +364,29 @@
+   {
+   if (use_regex)
+   {
+-  if (!(preg = 
pcre_compile(Q_normalizetext(Cmd_Argv(j)), PCRE_CASELESS, , , NULL)))
++  if (!(preg = 
pcre2_compile((PCRE2_SPTR)Q_normalizetext(Cmd_Argv(j)), PCRE2_ZERO_TERMINATED, 
PCRE2_CASELESS, , , NULL)))
+   {
+-  Con_Printf("Sys_listdir: 
pcre_compile(%s) error: %s at offset %d\n",
+- Cmd_Argv(j), errbuf, r);
+-  pcre_free(preg);
++  pcre2_get_error_message(r, errbuf, 
sizeof(errbuf));
++  Con_Printf("Sys_listdir: 
pcre2_compile(%s) error: %s at offset %lu\n",
++ Cmd_Argv(j), errbuf, 
erroffset);
+   break;
+   }
+-  switch (r = pcre_exec(preg, NULL, list->name,
+-strlen(list->name), 0, 0, 
NULL, 0))
++  md = pcre2_match_data_create_from_pattern(preg, 
NULL);
++  switch (r = pcre2_match(preg, 
(PCRE2_SPTR)list->name,
++  strlen(list->name), 0, 
0, md, NULL))
+   {
+   case 0:
+-  pcre_free(preg);
++  pcre2_match_data_free(md);
++  pcre

Bug#1000015: mp4h: depends on obsolete pcre3 library

2023-12-10 Thread Yavor Doganov
Control: tags -1 + patch

Please find attached a patch.
>From 4ead19b22c1564097192c50e2ec42c07351ef8de Mon Sep 17 00:00:00 2001
From: Yavor Doganov 
Date: Sun, 10 Dec 2023 17:12:31 +0200
Subject: [PATCH] Port to PCRE2 (#115)

---
 debian/changelog   |   7 +
 debian/control |   2 +-
 debian/patches/pcre2.patch | 449 +
 debian/patches/series  |   1 +
 4 files changed, 458 insertions(+), 1 deletion(-)
 create mode 100644 debian/patches/pcre2.patch

diff --git a/debian/changelog b/debian/changelog
index b8143c6..018 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+mp4h (1.3.1-18) UNRELEASED; urgency=medium
+
+  * debian/patches/pcre2.patch: New; port to PCRE2 (Closes: #115).
+  * debian/control (Build-Depends): Replace libpcre3-dev with libpcre2-dev.
+
+ -- Yavor Doganov   Sun, 10 Dec 2023 17:11:18 +0200
+
 mp4h (1.3.1-17) unstable; urgency=medium
 
   [ Axel Beckert ]
diff --git a/debian/control b/debian/control
index 4ee9a51..4630c13 100644
--- a/debian/control
+++ b/debian/control
@@ -9,7 +9,7 @@ Build-Depends: autoconf (>= 2.57~),
fakeroot,
gettext,
libltdl-dev,
-   libpcre3-dev,
+   libpcre2-dev,
libtool,
tidy
 Build-Conflicts: autoconf2.13,
diff --git a/debian/patches/pcre2.patch b/debian/patches/pcre2.patch
new file mode 100644
index 000..15a5857
--- /dev/null
+++ b/debian/patches/pcre2.patch
@@ -0,0 +1,449 @@
+Description: Port to PCRE2.
+Bug-Debian: https://bugs.debian.org/115
+Author: Yavor Doganov 
+Forwarded: no
+Last-Update: 2023-12-10
+---
+
+--- mp4h.orig/src/Makefile.am
 mp4h/src/Makefile.am
+@@ -17,7 +17,7 @@
+ if LOADABLE_MODULES
+ mp4h_LDFLAGS = -export-dynamic
+ endif
+-mp4h_LDADD   = -lm $(top_builddir)/lib/libmp4h.a -lpcre @LIBINTL@ 
$(MODULE_LDADD)
++mp4h_LDADD   = -lm $(top_builddir)/lib/libmp4h.a -lpcre2-8 @LIBINTL@ 
$(MODULE_LDADD)
+ 
+ include_HEADERS = mp4h.h
+ noinst_HEADERS  = builtin.h
+--- mp4h.orig/src/builtin.c
 mp4h/src/builtin.c
+@@ -373,7 +373,7 @@
+ static char * utf8char_skip __P ((char *, int));
+ static int utf8char_strlen __P ((char *));
+ static int encoding_strlen __P ((char *));
+-static void substitute __P ((struct obstack *, const char *, const char *, 
int *));
++static void substitute __P ((struct obstack *, const char *, const char *, 
size_t *));
+ static void string_regexp __P ((struct obstack *, int, token_data **, int, 
const char *));
+ static void subst_in_string __P ((struct obstack *, int, token_data **, int));
+ static void generic_variable_lookup __P ((MP4H_BUILTIN_PROTO, boolean));
+@@ -382,6 +382,8 @@
+ static int array_member __P ((const char *, symbol *, boolean));
+ static int sort_function __P ((const void *, const void *));
+ static void logical_to_physical_paths __P ((char **));
++static void * pcre_malloc (size_t, void *);
++static void pcre_free (void *, void *);
+ 
+ /*  This symbol controls breakings of flow statements.  */
+ static symbol varbreak;
+@@ -398,7 +400,12 @@
+ struct lconv *my_locale;
+ 
+ /*  Table of characters used by PCRE with non-C locales  */
+-static const unsigned char *re_tableptr = NULL;
++static const uint8_t *re_tableptr = NULL;
++
++/*  PCRE contexts needed for custom memory management and adding
++non-builtin character tables.  */
++static pcre2_general_context *gen_ctxt;
++static pcre2_compile_context *comp_ctxt;
+ 
+ /*  Timer  */
+ static struct tms elapsed_time;
+@@ -662,12 +669,22 @@
+ | Initialise all builtin and predefined macros.  |
+ `---*/
+ 
++static void *
++pcre_malloc (size_t size, void *ptr)
++{
++  return xmalloc (size);
++}
++
++static void
++pcre_free (void *ptr, void *tag)
++{
++  xfree (ptr);
++}
++
+ void
+ builtin_init (void)
+ {
+   install_builtin_table (builtin_tab);
+-  pcre_malloc = xmalloc;
+-  pcre_free   = xfree;
+ }
+ 
+ /*---.
+@@ -688,18 +705,22 @@
+   varstack_check ();
+ }
+ 
+-static pcre *
++static pcre2_code *
+ xre_compile (const char *pattern, int cflags)
+ {
+-  pcre *patcomp;
+-  const char *errbuf;
+-  int erroffset;
++  pcre2_code *patcomp;
++  PCRE2_UCHAR errbuf[120];
++  int errcode;
++  size_t erroffset;
+ 
+   if (document_encoding == ENCODING_UTF8)
+-  cflags |= PCRE_UTF8;
+-  patcomp = pcre_compile (pattern, cflags, , , re_tableptr);
++  cflags |= PCRE2_UTF;
++  pcre2_set_character_tables (comp_ctxt, re_tableptr);
++  patcomp = pcre2_compile ((PCRE2_SPTR) pattern, PCRE2_ZERO_TERMINATED,
++   cflags, , , comp_ctxt);
+   if (patcomp == 0)
+ {
++  pcre2_get_error_message (errcode, errbuf, sizeof (errbuf));
+   MP4HERROR ((warning_status, 0,
+ _("Warning:%s:%d: Bad regular expression `%s' at position %d: %s"),
+  CURRENT_FILE_LINE, pattern, erroffset, errbuf));
+@@ -822,11 +843,10 @@
+

Bug#1000047: libsynthesis: depends on obsolete pcre3 library

2023-12-09 Thread Yavor Doganov
Control: tags -1 + patch

The patch available at the forwarded URL that Adrian Bunk added some
time ago looks decent to me -- I have build-tested it and include it
here in a form that can be directly dropped in debian/patches.
Description: Port to PCRE2.
Bug-Debian: https://bugs.debian.org/147
Author: Milan Crha
Forwarded: no
Last-Update: 2023-12-09
---

--- libsynthesis-3.4.0.47.5+syncevolution-1.5.3.orig/configure.in
+++ libsynthesis-3.4.0.47.5+syncevolution-1.5.3/configure.in
@@ -70,9 +70,9 @@
   [enable_regex=$enableval],
   [enable_regex="yes"])
 if test "$enable_regex" == "yes"; then
-PKG_CHECK_MODULES(PCRE, libpcre,
+PKG_CHECK_MODULES(PCRE, libpcre2-8,
   [HAVE_PCRE=1],
-  [AC_ERROR([libpcre not found, required for 
--enable-regex])])
+  [AC_ERROR([libpcre2 not found, required for 
--enable-regex])])
 HAVE_PCRE=1
 else
 HAVE_PCRE=0
--- 
libsynthesis-3.4.0.47.5+syncevolution-1.5.3.orig/src/sysync/scriptcontext.cpp
+++ libsynthesis-3.4.0.47.5+syncevolution-1.5.3/src/sysync/scriptcontext.cpp
@@ -24,7 +24,8 @@
 #include "vtimezone.h" // for SETTIMEZONE
 #include "mimediritemtype.h" // for AlldayCount/MakeAllday
 #ifdef REGEX_SUPPORT
-  #include "pcre.h" // for RegEx functions
+  #define PCRE2_CODE_UNIT_WIDTH 8
+  #include "pcre2.h" // for RegEx functions
 #endif
 
 #include 
@@ -1323,7 +1324,7 @@
   // Returns:  > 0 => success; value is the number of elements filled 
in
   //   = 0 => success, but offsets is not big enough
   //-1 => failed to match
-  //-2 => PCRE_ERROR_NULL => did not compile, error 
reported to aDbgLogger
+  //-2 => PCRE2_ERROR_NULL => did not compile, error 
reported to aDbgLogger
   //  < -2 => some kind of unexpected problem
   static int run_pcre(cAppCharP aRegEx, cAppCharP aSubject, stringSize 
aSubjLen, stringSize aSubjStart, int *aOutVec, int aOVSize, TDebugLogger 
*aDbgLogger)
   {
@@ -1351,11 +1352,11 @@
 cAppCharP o = p++;
 while (*o) {
   switch (*o) {
-case 'i' : options |= PCRE_CASELESS; break;
-case 'm' : options |= PCRE_MULTILINE; break;
-case 's' : options |= PCRE_DOTALL; break;
-case 'x' : options |= PCRE_EXTENDED; break;
-case 'U' : options |= PCRE_UNGREEDY; break;
+case 'i' : options |= PCRE2_CASELESS; break;
+case 'm' : options |= PCRE2_MULTILINE; break;
+case 's' : options |= PCRE2_DOTALL; break;
+case 'x' : options |= PCRE2_EXTENDED; break;
+case 'U' : options |= PCRE2_UNGREEDY; break;
   }
   o++;
 }
@@ -1369,23 +1370,43 @@
   } // while chars in regex
 } // if regex with delimiter
 // - compile regex
-pcre *regex;
-cAppCharP errMsg=NULL;
-int errOffs=0;
-regex = pcre_compile(aRegEx, options | PCRE_UTF8, , , NULL);
+pcre2_code *regex;
+int errNum=0;
+size_t errOffs=0;
+regex = pcre2_compile((PCRE2_SPTR) aRegEx, options | PCRE2_UTF | 
PCRE2_ZERO_TERMINATED, 0, , , NULL);
 if (regex==NULL) {
+  PCRE2_UCHAR buffer[256] = { 0 };
+  pcre2_get_error_message(errNum, buffer, sizeof(buffer));
   // error, display it in log if script logging is on
   PLOGDEBUGPRINTFX(aDbgLogger,DBG_SCRIPTS+DBG_ERROR,(
 "RegEx error at pattern pos %d: %s ",
-errOffs,
-errMsg ? errMsg : ""
+(int) errOffs,
+*buffer ? (const char *) buffer : ""
   ));
-  return PCRE_ERROR_NULL; // -2, regexp did not compile
+  return PCRE2_ERROR_NULL; // -2, regexp did not compile
 }
 else {
+  pcre2_match_data *match_data;
   // regExp is ok and can be executed against subject
-  int r = pcre_exec(regex, NULL, aSubject, aSubjLen, aSubjStart, 0, 
aOutVec, aOVSize);
-  pcre_free(regex);
+  match_data = pcre2_match_data_create_from_pattern(regex, NULL);
+  int r = pcre2_match(regex, (PCRE2_SPTR) aSubject, aSubjLen, 0, 0, 
match_data, NULL);
+  if (r > 0 && aOutVec != NULL) {
+PCRE2_SIZE *ovector;
+   ovector = pcre2_get_ovector_pointer(match_data);
+   if (ovector[0] > ovector[1]) {
+  aOutVec[0] = ovector[1];
+ r = 1;
+} else {
+   int ii;
+   for (ii = 0; ii < r && ii < aOVSize; ii++) {
+  aOutVec[ii] = (int) ovector[ii];
+   }
+   if (r > ii)
+  r = ii;
+}
+  }
+  pcre2_match_data_free(match_data);
+  pcre2_code_free(regex);
   return r;
 }
   } // run_pcre


Bug#1050183: httest: depends on obsolete pcre3 library

2023-12-09 Thread Yavor Doganov
Control: tags -1 + patch

Please find attached a patch.
Description: Port to PCRE2.
Debian-Bug: https://bugs.debian.org/1050183
Author: Yavor Doganov 
Forwarded: no
Last-Update: 2023-12-09
---

--- httest-2.4.23.orig/configure.ac
+++ httest-2.4.23/configure.ac
@@ -54,9 +54,9 @@
 fi],
[APR_ICONV_INCLUDES="";
 APR_ICONV_LIBS=""])
-AC_ARG_WITH(pcre,AS_HELP_STRING(--with-pcre=PATH,path to pcre-config script),
-   [if test ! -x $withval/pcre-config; then 
AC_MSG_ERROR($withval/pcre-config do not exist or is not executable); else 
PCRE_CONFIG="$withval/pcre-config"; fi],
-   [PCRE_CONFIG="pcre-config"])
+AC_ARG_WITH(pcre,AS_HELP_STRING(--with-pcre=PATH,path to pcre2-config script),
+   [if test ! -x $withval/pcre2-config; then 
AC_MSG_ERROR($withval/pcre2-config do not exist or is not executable); else 
PCRE_CONFIG="$withval/pcre2-config"; fi],
+   [PCRE_CONFIG="pcre2-config"])
 AC_ARG_WITH(lua,AS_HELP_STRING(--with-lua=PATH,path to lua source dir),
[if test ! -d $withval; then AC_MSG_ERROR($withval is not a directory); 
else LUA_LIB_PATH="-L${withval}"; LUA_INCLUDES="-I${withval}"; LUA_LIB="-llua"; 
fi],
 [LUA_LIB_PATH=""; if test -d /usr/include/lua5.1; then 
LUA_INCLUDES="-I/usr/include/lua5.1"; else LUA_INCLUDES=""; fi; 
LUA_LIB="-llua5.1"])
@@ -93,7 +93,7 @@
 INCLUDES="`$APR_CONFIG --includes` `$APU_CONFIG --includes` $OPENSSL_INCLUDES 
$APR_ICONV_CONFIG"
 CFLAGS="`$APR_CONFIG --cflags` `$PCRE_CONFIG --cflags` $CFLAGS $INCLUDES"
 CPPFLAGS="`$APR_CONFIG --cppflags` $CPPFLAGS"
-LIBS="$OPENSSL_LIB_PATH -lssl -lcrypto `$APR_CONFIG --link-ld`  `$APU_CONFIG 
--link-ld` `$APR_CONFIG --libs` `$APU_CONFIG --libs` `$PCRE_CONFIG --libs` -lz 
-lm"
+LIBS="$OPENSSL_LIB_PATH -lssl -lcrypto `$APR_CONFIG --link-ld`  `$APU_CONFIG 
--link-ld` `$APR_CONFIG --libs` `$APU_CONFIG --libs` `$PCRE_CONFIG --libs8` -lz 
-lm"
 
 if test "$enable_ssl_legacy_reneg" = "yes"; then
   CFLAGS="$CFLAGS -DSSL_ALLOW_UNSAFE_LEGACY_RENEGOTIATION"
--- httest-2.4.23.orig/src/regex.c
+++ httest-2.4.23/src/regex.c
@@ -29,7 +29,8 @@
 #include 
 #endif
 
-#include 
+#define PCRE2_CODE_UNIT_WIDTH 8
+#include 
 
 #include 
 #include 
@@ -71,26 +72,27 @@
  *
  * @param p IN pool
  * @param pattern IN pattern to compile
- * @param error IN error string
+ * @param error IN error code
  * @param erroff IN offset into pattern wherer compilation fails
  *
  * @return regular express on success else NULL
  */
 htt_regex_t *htt_regexcomp(apr_pool_t * p, const char *pattern,
-  const char **error, int *erroff) {
+  int *error, size_t *erroff) {
   htt_regex_t *preg = apr_palloc(p, sizeof *preg);
 
   preg->match = 0;
   preg->pattern = apr_pstrdup(p, pattern);
 
-  preg->re_pcre = pcre_compile(pattern, 0, error, erroff, NULL);
+  preg->re_pcre = pcre2_compile((PCRE2_SPTR) pattern, PCRE2_ZERO_TERMINATED,
+0, error, erroff, NULL);
   preg->re_erroffset = *erroff;
 
   if (preg->re_pcre == NULL) {
 return NULL;
   }
 
-  pcre_fullinfo((const pcre *)preg->re_pcre, NULL, PCRE_INFO_CAPTURECOUNT, 
&(preg->re_nsub));
+  pcre2_pattern_info(preg->re_pcre, PCRE2_INFO_CAPTURECOUNT, &(preg->re_nsub));
 
   apr_pool_cleanup_register(p, (void *) preg, htt_regex_cleanup,
 apr_pool_cleanup_null);
@@ -114,24 +116,24 @@
 apr_size_t nmatch, regmatch_t pmatch[], int eflags) {
   int rc;
   int options = 0;
-  int *ovector = NULL;
-  int small_ovector[POSIX_MALLOC_THRESHOLD * 3];
-  int allocated_ovector = 0;
+  pcre2_match_data *md;
+  size_t *ovector = NULL;
+  uint32_t md_size;
 
   ((htt_regex_t *) preg)->re_erroffset = (apr_size_t) (-1); /* Only has 
meaning after compile */
 
   if (nmatch > 0) {
 if (nmatch <= POSIX_MALLOC_THRESHOLD) {
-  ovector = &(small_ovector[0]);
+  md_size = POSIX_MALLOC_THRESHOLD * 3;
 }
 else {
-  ovector = (int *) malloc(sizeof(int) * nmatch * 3);
-  allocated_ovector = 1;
+  md_size = nmatch * 3;
 }
   }
 
-  rc = pcre_exec((const pcre *) preg->re_pcre, NULL, data,
- len, 0, options, ovector, nmatch * 3);
+  md = pcre2_match_data_create(md_size, NULL);
+  rc = pcre2_match(preg->re_pcre, (PCRE2_SPTR) data,
+   len, 0, options, md, NULL);
 
   if (rc == 0) {
 rc = nmatch;/* All captured slots were filled in */
@@ -139,22 +141,19 @@
 
   if (rc >= 0) {
 apr_size_t i;
+ovector = pcre2_get_ovector_pointer(md);
 for (i = 0; i < (apr_size_t) rc; i++) {
   pmatch[i].rm_so = ovector[i * 2];
   pmatch[i].rm_eo = ovector[i * 2 + 1];
 }
-if (allocated_ovector) {
-  free(ovector);
-}
+pcre2_match

Bug#1000065: grok: depends on obsolete pcre3 library

2023-12-09 Thread Yavor Doganov
Control: tags -1 + patch

Please find a patch attached.  Tested with the examples only.  Also
tested discogrok with

$ discogrok --verbose --patterns /usr/share/grok/patterns/base

It hangs at this line:

[855838]   [capture] [grok_capture_add:28] Adding pattern 'YEAR' as capture 0 
(pcrenum 1)

But so does unpatched discogrok from sid.

Note that this patch breaks the libgrok ABI since the library exposes
the PCRE API.  As libgrok does not have any reverse dependencies in
Debian (even grok itself doesn't link with it), the second patch
simply removes it.  Alternatively, if you wish to retain it, you'd
have to bump the SONAME (using a Debian-specific one, perhaps) and the
package has to pass through NEW.  IMHO that's too much trouble for an
unused library, but of course it's up to you as maintainer.
>From 8f984ea80430f973d13a67f87b884d4dd3f7383e Mon Sep 17 00:00:00 2001
From: Yavor Doganov 
Date: Sat, 9 Dec 2023 09:02:57 +0200
Subject: [PATCH 1/2] Port to PCRE2 (#165)

---
 Makefile  |   2 +-
 debian/control|   2 +-
 debian/patches/debian-changes | 556 +-
 grok.c|  55 ++--
 grok.h|  25 +-
 grok_discover.c   |   2 +-
 grokre.c  | 100 +++---
 predicates.c  |  38 ++-
 predicates.h  |   1 -
 9 files changed, 686 insertions(+), 95 deletions(-)

diff --git a/Makefile b/Makefile
index 564a8c3..fcbf843 100644
--- a/Makefile
+++ b/Makefile
@@ -42,7 +42,7 @@ VERSION=$(shell sh $(BASE)/version.sh)
 #LDFLAGS+=-g
 
 CFLAGS+=-pipe -fPIC -I. -O2
-LDFLAGS+=-lpcre -levent -rdynamic -ltokyocabinet
+LDFLAGS+=-lpcre2-8 -levent -rdynamic -ltokyocabinet
 
 LIBSUFFIX=$(shell sh $(BASE)/platform.sh libsuffix)
 VERLIBSUFFIX=$(shell sh $(BASE)/platform.sh libsuffix $(MAJOR))
diff --git a/debian/control b/debian/control
index b9f6cad..dd9afb1 100644
--- a/debian/control
+++ b/debian/control
@@ -10,7 +10,7 @@ Build-Depends:
  gperf,
  help2man,
  libevent-dev,
- libpcre3-dev,
+ libpcre2-dev,
  libtirpc-dev,
  libtokyocabinet-dev,
 Standards-Version: 3.9.3
diff --git a/debian/patches/debian-changes b/debian/patches/debian-changes
index 8718175..f1563fc 100644
--- a/debian/patches/debian-changes
+++ b/debian/patches/debian-changes
@@ -17,6 +17,15 @@ A single combined diff, containing all the changes, follows.
 
 --- grok-1.20110708.1.orig/Makefile
 +++ grok-1.20110708.1/Makefile
+@@ -42,7 +42,7 @@ VERSION=$(shell sh $(BASE)/version.sh)
+ #LDFLAGS+=-g
+ 
+ CFLAGS+=-pipe -fPIC -I. -O2
+-LDFLAGS+=-lpcre -levent -rdynamic -ltokyocabinet
++LDFLAGS+=-lpcre2-8 -levent -rdynamic -ltokyocabinet
+ 
+ LIBSUFFIX=$(shell sh $(BASE)/platform.sh libsuffix)
+ VERLIBSUFFIX=$(shell sh $(BASE)/platform.sh libsuffix $(MAJOR))
 @@ -162,14 +162,14 @@ cleanver:
  # Binary creation
  grok: LDFLAGS+=-levent
@@ -93,7 +102,12 @@ A single combined diff, containing all the changes, follows.
  
 --- grok-1.20110708.1.orig/grokre.c
 +++ grok-1.20110708.1/grokre.c
-@@ -12,8 +12,8 @@
+@@ -1,4 +1,3 @@
+-#include 
+ #include 
+ #include  
+ #include 
+@@ -12,8 +11,8 @@
  
  /* global, static variables */
  
@@ -104,15 +118,268 @@ A single combined diff, containing all the changes, 
follows.
  
  /* internal functions */
  static char *grok_pattern_expand(grok_t *grok); //, int offset, int length);
-@@ -183,7 +183,7 @@ static char *grok_pattern_expand(grok_t
+@@ -24,15 +23,15 @@ static void grok_capture_add_predicate(g
+ 
+ void grok_free_clone(const grok_t *grok) {
+   if (grok->re != NULL) {
+-pcre_free(grok->re);
++pcre2_code_free(grok->re);
+   }
+ 
+   if (grok->full_pattern != NULL) {
+ free(grok->full_pattern);
+   }
+ 
+-  if (grok->pcre_capture_vector != NULL) {
+-free(grok->pcre_capture_vector);
++  if (grok->md != NULL) {
++pcre2_match_data_free(grok->md);
+   }
+ 
+   if (grok->captures_by_name != NULL) {
+@@ -76,24 +75,28 @@ int grok_compilen(grok_t *grok, const ch
+   grok->full_pattern = grok_pattern_expand(grok);
+ 
+   if (grok->full_pattern == NULL) {
++const char *errstr;
++
+ grok_log(grok, LOG_COMPILE, "A failure occurred while compiling '%.*s'",
+  length, pattern);
+-grok->errstr = "failure occurred while expanding pattern "\
+-   "(too pattern recursion?)";
++errstr = "failure occurred while expanding pattern "
++ "(too pattern recursion?)";
++strcpy((char *)grok->errstr, errstr);
+ return GROK_ERROR_COMPILE_FAILED;
+   }
+ 
+-  grok->re = pcre_compile(grok->full_pattern, 0, 
+-  >pcre_errptr, >pcre_erroffset, NULL);
++  grok->re = pcre2_compile((PCRE2_SPTR)grok->full_pattern,
++   PCRE2_ZERO_TERMINATED, 0,
++   >pcre_errno, >pcre_erroffset, NULL);
+ 
+   if (grok->re == NULL) {
+-gr

Bug#1000044: ccze: depends on obsolete pcre3 library

2023-12-06 Thread Yavor Doganov
On Mon, 04 Dec 2023 15:46:29 +0200,
Yavor Doganov wrote:
> I guess I need to revisit my patch and find some way to fix this.

Here it is -- no memory leaks and I could not obtain crash or abort
with the logs I've tested.  Note that while my original patch
introduced some leaks, it also fixes some in the original code.

Tested the following plugins: dpkg, exim, httpd, procmail, sulog and
syslog (yours and mine).  Also compared the output between version -7
and git master + this new patch.

Please test extensively and let me know if something is wrong.

You may wish to apply (or not) two additional patches: 1 memory leak
that I discovered with aptitude/Xorg logs and 1 uninitialized value
(reported by valgrind as error).
>From 475cbc072cb08bd6a57befa6c3856f8458355b1b Mon Sep 17 00:00:00 2001
From: Yavor Doganov 
Date: Wed, 6 Dec 2023 15:07:25 +0200
Subject: [PATCH] pcre2.patch: Fix some memory leaks

---
 debian/patches/pcre2.patch | 181 +
 1 file changed, 125 insertions(+), 56 deletions(-)

diff --git a/debian/patches/pcre2.patch b/debian/patches/pcre2.patch
index 6b60dc8..4014fc3 100644
--- a/debian/patches/pcre2.patch
+++ b/debian/patches/pcre2.patch
@@ -2,7 +2,7 @@ Description: Port to PCRE2.
 Bug-Debian: https://bugs.debian.org/144
 Author: Yavor Doganov 
 Forwarded: no
-Last-Update: 2023-12-03
+Last-Update: 2023-12-06
 ---
 
 --- ccze.orig/configure.ac
@@ -39,7 +39,7 @@ Last-Update: 2023-12-03
  
  static char *words_bad[] = {
"warn", "restart", "exit", "stop", "end", "shutting", "down", "close",
-@@ -71,33 +71,31 @@
+@@ -71,34 +71,35 @@
  void
  ccze_wordcolor_process_one (char *word, int slookup)
  {
@@ -48,8 +48,9 @@ Last-Update: 2023-12-03
 +  size_t wlen, l;
ccze_color_t col;
 -  int match, printed = 0;
+-  char *pre = NULL, *post = NULL, *tmp, *lword;
 +  int printed = 0;
-   char *pre = NULL, *post = NULL, *tmp, *lword;
++  char *pre = NULL, *post = NULL, *tmp = NULL, *lword;
 +  pcre2_match_data *offsets;
  
col = CCZE_COLOR_DEFAULT;
@@ -63,10 +64,11 @@ Last-Update: 2023-12-03
  {
 -  pcre_get_substring (word, offsets, match, 1, (const char **));
 -  pcre_get_substring (word, offsets, match, 2, (const char **));
--  free (word);
 +  pcre2_substring_get_bynumber (offsets, 1, (unsigned char **), );
 +  pcre2_substring_get_bynumber (offsets, 2, (unsigned char **), );
-   word = tmp;
+   free (word);
+-  word = tmp;
++  word = strdup (tmp);
  }
else
  pre = NULL;
@@ -78,13 +80,16 @@ Last-Update: 2023-12-03
  {
 -  pcre_get_substring (word, offsets, match, 1, (const char **));
 -  pcre_get_substring (word, offsets, match, 2, (const char **));
--  free (word);
++  pcre2_substring_free (tmp);
 +  pcre2_substring_get_bynumber (offsets, 1, (unsigned char **), );
 +  pcre2_substring_get_bynumber (offsets, 2, (unsigned char **), );
-   word = tmp;
+   free (word);
+-  word = tmp;
++  word = strdup (tmp);
  }
else
-@@ -107,45 +105,45 @@
+ post = NULL;
+@@ -107,45 +108,45 @@
lword = _stolower (word);

/** Host **/
@@ -144,20 +149,20 @@ Last-Update: 2023-12-03
  {
char *host, *ip;
size_t hostlen, iplen;
-@@ -206,9 +204,9 @@
- }
+@@ -207,8 +208,10 @@

free (lword);
--  free (word);
+   free (word);
 -  free (post);
 -  free (pre);
++  pcre2_substring_free (tmp);
 +  pcre2_substring_free (post);
 +  pcre2_substring_free (pre);
 +  pcre2_match_data_free (offsets);
  }
  
  void
-@@ -260,64 +258,67 @@
+@@ -260,64 +263,67 @@
  void
  ccze_wordcolor_setup (void)
  {
@@ -305,7 +310,8 @@ Last-Update: 2023-12-03
 +ccze_apm_process (pcre2_match_data *offsets)
  {
char *battery, *charge, *rate, *stuff1, *elapsed, *remain;
-   char *stuff2;
+-  char *stuff2;
++  char *stuff2, *ret;
 +  size_t l;

 -  pcre_get_substring (str, offsets, match, 1, (const char **));
@@ -325,7 +331,7 @@ Last-Update: 2023-12-03
  
ccze_addstr (CCZE_COLOR_DEFAULT, "Battery:");
ccze_space ();
-@@ -62,12 +63,12 @@
+@@ -62,48 +63,54 @@
ccze_addstr (CCZE_COLOR_DATE, remain);
ccze_space ();
  
@@ -335,16 +341,19 @@ Last-Update: 2023-12-03
 -  free (stuff1);
 -  free (elapsed);
 -  free (remain);
++  ret = strdup (stuff2);
 +  pcre2_substring_free (battery);
 +  pcre2_substring_free (charge);
 +  pcre2_substring_free (rate);
 +  pcre2_substring_free (stuff1);
 +  pcre2_substring_free (elapsed);
 +  pcre2_substring_free (remain);
++  pcre2_substring_free (stuff2);

-   return stuff2;
+-  return stuff2;
++  return ret;
  }
-@@ -75,35 +76,39 @@
+ 
  static void
  ccze_apm_setup (void)
  {
@@ -408,7 +417,8 @@ Last-Update: 2023-12-03
 -ccze_distcc_process (const char *str, int *offsets, int match)
 +ccze_distcc_process (pcre2_match_data *offsets)
  {
-   char *pid, *func, *rest;
+-  char *pid, *func, *rest;
++  char *pid,

Bug#1000041: ganglia: depends on obsolete pcre3 library

2023-12-05 Thread Yavor Doganov
Control: tags -1 + patch

Please find attached a patch.  As I know absolutely nothing about this
package, I was unable to test it properly.  I added the following
snippet to /etc/ganglia/gmond.conf (taken from gmond.conf manpage):

collection_group {
  collect_every = 60
  time_threshold = 300
  metric {
name_match = "multicpu_([a-z]+)([0-9]+)"
value_threshold = 1.0
title = "CPU-\\2 \\1"
  }
}

The output of "gmond -m" doesn't change (maybe that's expected) but at
least it doesn't crash.  According to INSTALL (as well as my humble
reading of the code), pcre is used only for parsing name_match in the
configuration file.  But it seems I cannot trigger a match or do
something else improperly.

Please test and let me know if corrections are needed.
>From 7d05aca52f9cf1b579b80f719bed47cfd6ba7b7b Mon Sep 17 00:00:00 2001
From: Yavor Doganov 
Date: Tue, 5 Dec 2023 19:26:34 +0200
Subject: [PATCH] Port to PCRE2 (#141).

---
 debian/changelog   |   5 ++
 debian/control |   2 +-
 debian/patches/pcre2.patch | 130 +
 debian/patches/series  |   1 +
 4 files changed, 137 insertions(+), 1 deletion(-)
 create mode 100644 debian/patches/pcre2.patch

diff --git a/debian/changelog b/debian/changelog
index 081dbec..7c78336 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,13 @@
 ganglia (3.7.2-7) UNRELEASED; urgency=medium
 
+  [ Marcos Fouces ]
   * Remove Stuart from uploaders as he changed to the Emeritus status.
 (Closes: #1011995).
 
+  [ Yavor Doganov ]
+  * debian/patches/pcre2.patch: New; port to PCRE2 (Closes: #141).
+  * debian/control (Build-Depends): Replace libpcre3-dev with libpcre2-dev.
+
  -- Marcos Fouces   Sun, 29 May 2022 23:53:57 +0200
 
 ganglia (3.7.2-6) unstable; urgency=medium
diff --git a/debian/control b/debian/control
index 406ff30..40ade70 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: net
 Priority: optional
 Maintainer: Marcos Fouces 
 Homepage: http://ganglia.info/
-Build-Depends: debhelper-compat (=13), librrd-dev, libapr1-dev, libexpat1-dev, libconfuse-dev, po-debconf, libxml2-dev, libdbi0-dev, libpcre3-dev, gperf, rsync, libkvm-dev [kfreebsd-any], pkg-config, libz-dev, libtirpc-dev
+Build-Depends: debhelper-compat (=13), librrd-dev, libapr1-dev, libexpat1-dev, libconfuse-dev, po-debconf, libxml2-dev, libdbi0-dev, libpcre2-dev, gperf, rsync, libkvm-dev [kfreebsd-any], pkg-config, libz-dev, libtirpc-dev
 Standards-Version: 4.6.0
 Vcs-Git: https://salsa.debian.org/debian/ganglia.git
 Vcs-Browser: https://salsa.debian.org/debian/ganglia
diff --git a/debian/patches/pcre2.patch b/debian/patches/pcre2.patch
new file mode 100644
index 000..54ecaa0
--- /dev/null
+++ b/debian/patches/pcre2.patch
@@ -0,0 +1,130 @@
+Description: Port to PCRE2.
+Bug-Debian: https://bugs.debian.org/141
+Author: Yavor Doganov 
+Forwarded: no
+Last-Update: 2023-12-05
+---
+
+--- ganglia.orig/configure.ac
 ganglia/configure.ac
+@@ -520,14 +520,20 @@
+   echo "Added -L$libpcrepath/${LIB_SUFFIX} to LDFLAGS"
+ fi
+ if test x"$libpcre" == xyes ; then
+-  AC_CHECK_HEADERS([pcre/pcre.h pcre.h])
+-  AC_CHECK_LIB(pcre, pcre_compile)
+-  if test x"$ac_cv_lib_pcre_pcre_compile" = xyes; then
+-echo "Found a suitable pcre library"
+-  else
+-echo "libpcre not found, specify --with-libpcre=no to build without PCRE support"
+-exit 1;
+-  fi
++  AC_CHECK_HEADERS([pcre2.h], [], [], [[#define PCRE2_CODE_UNIT_WIDTH 8]])
++  LIBS="$LIBS -lpcre2-8"
++  AC_MSG_CHECKING([for pcre2_match_data_create in -lpcre2-8])
++  AC_LINK_IFELSE(
++[AC_LANG_PROGRAM([[#define PCRE2_CODE_UNIT_WIDTH 8
++   #include 
++ ]],
++ [[pcre2_match_data *md;
++   md = pcre2_match_data_create (16, NULL);]])],
++[AC_DEFINE([HAVE_LIBPCRE], [1], [Define if the PCRE2 library is available])
++ AC_MSG_RESULT([yes])
++ AC_MSG_RESULT([Found a suitable pcre library])],
++[AC_MSG_RESULT([no])
++ AC_MSG_FAILURE([libpcre not found, specify --with-libpcre=no to build without PCRE support], [1])])
+ else
+   echo "building without PCRE support"
+ fi
+--- ganglia.orig/gmond/gmond.c
 ganglia/gmond/gmond.c
+@@ -38,11 +38,8 @@
+ #include 
+ 
+ #ifdef HAVE_LIBPCRE
+-#if defined (HAVE_PCRE_PCRE_H)
+-#include 
+-#else
+-#include 
+-#endif
++#define PCRE2_CODE_UNIT_WIDTH 8
++#include 
+ #endif
+ 
+ #include "cmdline.h"   /* generated by cmdline.sh which runs gengetopt */
+@@ -2650,10 +2647,11 @@
+ 
+   if(name_match != NULL)
+ {
+-  pcre *pcre_re;
+-  const char *pcre_err_ptr;
+-  int pcre_err_offset;
+-  int pcre_ovector[PCRE_OVECCOUNT];
++  pcre2_code *pcre_re;
++  pcre2_match_data *pcre_md;
++  int pcre_e

Bug#1000044: ccze: depends on obsolete pcre3 library

2023-12-04 Thread Yavor Doganov
Axel Beckert wrote:
> A local test on my /var/log/syslog immediately ran into a segfault,
> though, so I guess, that's one of the plugins you couldn't test.

I tested it but I guess results depend on the contents of the log;
apparently my log didn't trigger this code.

> Culprit is this line, actually the first line in my current
> /var/log/syslog:
> 
>   Dec  3 06:38:28 c6 syslog-ng[26651]: Configuration reload request
>   received, reloading configuration;

Many thanks for the reproducer.  Attached is patch that fixes it for
me.  I suspect there are other issues like these; in fact my pathethic
patch introduces a few memory leaks (I should have told you that in
advance).  The problem is that ccze code manipulates strings obtained
with pcre_get_substring, and assumes it can always use "free" to free
them.  That assumption is fine in the case with the old pcre, because
the definition of pcre_free_substring is just a wrapper around free
(src:pcre3: pcre_get.c:655):

void
pcre_free_substring(const char *pointer)
{
(PUBL(free))((void *)pointer);
}

So ccze code always uses "free".  However, in pcre2, the equivalent
function is different (src:pcre2: src/pcre2_substring.c:240):

void
pcre2_substring_free(PCRE2_UCHAR *string)
{
if (string != NULL)
  {
  pcre2_memctl *memctl = (pcre2_memctl *)((char *)string - 
sizeof(pcre2_memctl));
  memctl->free(memctl, memctl->memory_data);
  }
}

Attempting to use "free" to free a string obtained with
pcre2_subtring_get_by* results in SIGABRT with invalid pointer, while
using pcre2_substring_free on a string obtained with strdup or some
other standard (glibc) string manipulation functions results in
SIGSEGV.  Attached are two equivalent minimalistic programs that
demonstrate this: foo.c uses pcre2 and if you exchange the free
functions at the end for date and dup, you will observe exactly what I
wrote above.  The other program, bar.c, uses the old pcre and it
doesn't make any difference if you swap them or use only "free" as
ccze does.

I guess I need to revisit my patch and find some way to fix this.
It's up to you whether to upload the memleaky patch now or wait for me
to find a solution.  Sorry about this.
diff --git a/debian/patches/pcre2.patch b/debian/patches/pcre2.patch
index 6b60dc8..2723ff8 100644
--- a/debian/patches/pcre2.patch
+++ b/debian/patches/pcre2.patch
@@ -2455,26 +2455,32 @@ Last-Update: 2023-12-03
  }

if (process)
-@@ -87,12 +87,13 @@
+@@ -60,7 +60,7 @@
+ 
+ pid = strndup ([1], (size_t)(t2 - t - 1));
+ tmp = strndup (process, (size_t)(t - process));
+-free (process);
++pcre2_substring_free (process);
+ process = tmp;
+   }
+ }
+@@ -87,11 +87,11 @@
else
  toret = strdup (send);
  
 -  free (date);
 -  free (host);
 -  free (send);
--  free (process);
--  free (msg);
 +  pcre2_substring_free (date);
 +  pcre2_substring_free (host);
 +  pcre2_substring_free (send);
-+  pcre2_substring_free (process);
 +  pcre2_substring_free (msg);
+   free (process);
+-  free (msg);
free (pid);
-+  free (tmp);
  
return toret;
- }
-@@ -100,33 +101,34 @@
+@@ -100,33 +100,34 @@
  static void
  ccze_syslog_setup (void)
  {
#define PCRE2_CODE_UNIT_WIDTH 8
#include 
#include 
#include 

int
main (void)
{
  pcre2_code *pcre;
  pcre2_match_data *md;
  int error;
  size_t errptr, l;
  char *date = NULL, *dup;
  const char *str = "Dec  3 06:38:28 c6 syslog-ng[26651]: Configuration "
"reload request received, reloading configuration;";

  pcre = pcre2_compile ("^(\\S*\\s{1,2}\\d{1,2}\\s\\d\\d:\\d\\d:\\d\\d)"
"\\s(\\S+)\\s+((\\S+:?)\\s(.*))$",
PCRE2_ZERO_TERMINATED, 0, , , NULL);

  md = pcre2_match_data_create (99, NULL);

  pcre2_match (pcre, str, PCRE2_ZERO_TERMINATED, 0, 0, md, NULL);
  pcre2_substring_get_bynumber (md, 1, (unsigned char **), );

  if (date)
{
  printf ("%s\n", date);
  dup = strdup (date);
}

  pcre2_substring_free (date);
  free (dup);

  return 0;
}
#include 
#include 
#include 

int
main (void)
{
  pcre *pcre;
  int md[99];
  const char *error;
  int errptr, match;
  char *date = NULL, *dup;
  const char *str = "Dec  3 06:38:28 c6 syslog-ng[26651]: Configuration "
"reload request received, reloading configuration;";

  pcre = pcre_compile ("^(\\S*\\s{1,2}\\d{1,2}\\s\\d\\d:\\d\\d:\\d\\d)"
   "\\s(\\S+)\\s+((\\S+:?)\\s(.*))$",
   0, , , NULL);

  match = pcre_exec (pcre, NULL, str, strlen (str), 0, 0, md, 99);
  pcre_get_substring (str, md, match, 1, (const char **));

  if (date)
{
  printf ("%s\n", date);
  dup = strdup (date);
}

  pcre_free_substring (date);
  free (dup);

  return 0;
}


Bug#1000044: ccze: depends on obsolete pcre3 library

2023-12-03 Thread Yavor Doganov
Control: tags -1 + patch

Please find a patch attached (I was not able to test all plugins).
>From 1b55bb243cb69c8f1ce006f237187eca7fb47793 Mon Sep 17 00:00:00 2001
From: Yavor Doganov 
Date: Sun, 3 Dec 2023 20:13:33 +0200
Subject: [PATCH] Port to PCRE2 (#144)

---
 debian/changelog   |7 +
 debian/control |2 +-
 debian/patches/pcre2.patch | 2807 
 debian/patches/series  |1 +
 4 files changed, 2816 insertions(+), 1 deletion(-)
 create mode 100644 debian/patches/pcre2.patch

diff --git a/debian/changelog b/debian/changelog
index 9e9de97..95eb7a5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+ccze (0.2.1-8) UNRELEASED; urgency=medium
+
+  * debian/patches/pcre2.patch: New; port to PCRE2 (Closes: #144).
+  * debian/control (Build-Depends): Replace libpcre3-dev with libpcre2-dev.
+
+ -- Yavor Doganov   Sun, 03 Dec 2023 20:00:06 +0200
+
 ccze (0.2.1-7) unstable; urgency=medium
 
   * Update debian/watch AGAIN with regards to Github changes.
diff --git a/debian/control b/debian/control
index 895d45e..2b67dd6 100644
--- a/debian/control
+++ b/debian/control
@@ -5,7 +5,7 @@ Maintainer: Axel Beckert 
 Standards-Version: 4.6.0
 Build-Depends: debhelper-compat (= 13),
libncurses5-dev,
-   libpcre3-dev
+   libpcre2-dev
 Vcs-Git: https://salsa.debian.org/debian/ccze.git
 Vcs-Browser: https://salsa.debian.org/debian/ccze
 Homepage: https://github.com/madhouse/ccze
diff --git a/debian/patches/pcre2.patch b/debian/patches/pcre2.patch
new file mode 100644
index 000..6b60dc8
--- /dev/null
+++ b/debian/patches/pcre2.patch
@@ -0,0 +1,2807 @@
+Description: Port to PCRE2.
+Bug-Debian: https://bugs.debian.org/144
+Author: Yavor Doganov 
+Forwarded: no
+Last-Update: 2023-12-03
+---
+
+--- ccze.orig/configure.ac
 ccze/configure.ac
+@@ -102,14 +102,14 @@
+ AC_CHECK_FUNC(getopt_long, [], [AC_CHECK_LIB(gnugetopt, getopt_long)])
+ 
+ if test -z "${PCRE_CONFIG}"; then
+-	AC_PATH_PROG(PCRE_CONFIG, pcre-config, no)
++	AC_PATH_PROG(PCRE_CONFIG, pcre2-config, no)
+ fi
+ AC_MSG_CHECKING(for PCRE)
+ if test "${PCRE_CONFIG}" = "no"; then
+ 	AC_ERROR(PCRE not found)
+ fi
+ PCRE_CFLAGS=$($PCRE_CONFIG --cflags)
+-PCRE_LIBS=$($PCRE_CONFIG --libs)
++PCRE_LIBS=$($PCRE_CONFIG --libs8)
+ AC_SUBST(PCRE_CFLAGS)
+ AC_SUBST(PCRE_LIBS)
+ AC_MSG_RESULT(found)
+--- ccze.orig/src/ccze-wordcolor.c
 ccze/src/ccze-wordcolor.c
+@@ -29,9 +29,9 @@
+ #include "ccze-private.h"
+ #include "ccze-compat.h"
+ 
+-static pcre *reg_pre, *reg_post, *reg_host, *reg_mac, *reg_email;
+-static pcre *reg_uri, *reg_size, *reg_ver, *reg_time, *reg_addr;
+-static pcre *reg_num, *reg_sig, *reg_email2, *reg_hostip, *reg_msgid;
++static pcre2_code *reg_pre, *reg_post, *reg_host, *reg_mac, *reg_email;
++static pcre2_code *reg_uri, *reg_size, *reg_ver, *reg_time, *reg_addr;
++static pcre2_code *reg_num, *reg_sig, *reg_email2, *reg_hostip, *reg_msgid;
+ 
+ static char *words_bad[] = {
+   "warn", "restart", "exit", "stop", "end", "shutting", "down", "close",
+@@ -71,33 +71,31 @@
+ void
+ ccze_wordcolor_process_one (char *word, int slookup)
+ {
+-  size_t wlen;
+-  int offsets[99];
++  size_t wlen, l;
+   ccze_color_t col;
+-  int match, printed = 0;
++  int printed = 0;
+   char *pre = NULL, *post = NULL, *tmp, *lword;
++  pcre2_match_data *offsets;
+ 
+   col = CCZE_COLOR_DEFAULT;
+ 
++  offsets = pcre2_match_data_create (99, NULL);
++
+   /** prefix **/
+-  if ((match = pcre_exec (reg_pre, NULL, word, strlen (word), 0, 0,
+-			  offsets, 99)) >= 0)
++  if (pcre2_match (reg_pre, word, strlen (word), 0, 0, offsets, NULL) >= 0)
+ {
+-  pcre_get_substring (word, offsets, match, 1, (const char **));
+-  pcre_get_substring (word, offsets, match, 2, (const char **));
+-  free (word);
++  pcre2_substring_get_bynumber (offsets, 1, (unsigned char **), );
++  pcre2_substring_get_bynumber (offsets, 2, (unsigned char **), );
+   word = tmp;
+ }
+   else
+ pre = NULL;
+ 
+   /** postfix **/
+-  if ((match = pcre_exec (reg_post, NULL, word, strlen (word), 0, 0,
+-			  offsets, 99)) >= 0)
++  if (pcre2_match (reg_post, word, strlen (word), 0, 0, offsets, NULL) >= 0)
+ {
+-  pcre_get_substring (word, offsets, match, 1, (const char **));
+-  pcre_get_substring (word, offsets, match, 2, (const char **));
+-  free (word);
++  pcre2_substring_get_bynumber (offsets, 1, (unsigned char **), );
++  pcre2_substring_get_bynumber (offsets, 2, (unsigned char **), );
+   word = tmp;
+ }
+   else
+@@ -107,45 +105,45 @@
+   lword = _stolower (word);
+   
+   /** Host **/
+-  if (pcre_exec (reg_host, NULL, lword, wlen, 0, 0, offsets, 99) >= 0)
++  if (pcre2_match (reg_host, lword, wlen, 0, 0, offsets, NULL) >= 0)
+ col = CCZE_COLOR_HOST;

Bug#1055981: wmforecast: Does not retrieve data; shows error

2023-11-15 Thread Yavor Doganov
Package: wmforecast
Version: 1.9.0-1
Severity: grave
X-Debbugs-Cc: Yavor Doganov 

Since some time (about 2 weeks, but I'm not entirely sure) wmforecast
displays an image with a question mark along with the text "ERROR".  The
following message(s) appear on the console:

$ LC_ALL=C wmforecast
GWeather-Message: 11:51:41.964: Failed to get weather.gov point data: [status: 
404] Not Found
GWeather-Message: 11:52:41.353: Failed to get weather.gov point data: [status: 
404] Not Found
GWeather-Message: 11:53:41.349: Failed to get weather.gov point data: [status: 
404] Not Found

(process:179771): GWeather-WARNING **: 11:54:40.649: Failed to get METAR data: 
HTTP/2 Error: NO_ERROR

My ~/GNUstep/Defaults/wmforecast:
,
| {
|   longitude = "27,91108";
|   interval = 60;
|   text = "#20b2aa";
|   icondir = "/usr/share/wmforecast";
|   units = c;
|   background = "#00";
|   latitude = "43,211375";
| }
`

-- System Information:
Debian Release: trixie/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'testing-debug'), (500, 
'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, x32

Kernel: Linux 6.5.0-4-amd64 (SMP w/2 CPU threads; PREEMPT)
Locale: LANG=bg_BG.UTF-8, LC_CTYPE=bg_BG.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages wmforecast depends on:
ii  ca-certificates  20230311
ii  libc62.37-12
ii  libgeoclue-2-0   2.7.1-1
ii  libglib2.0-0 2.78.1-4
ii  libgweather-4-0  4.4.0-1
ii  libwings30.96.0-2+b1
ii  libwraster6  0.96.0-2+b1
ii  libwutil50.96.0-2+b1
ii  libx11-6 2:1.8.7-1

wmforecast recommends no packages.

wmforecast suggests no packages.

-- no debconf information



Bug#1028579: src:sope: FTBFS with gnustep-base/1.29.0

2023-06-17 Thread Yavor Doganov
On Fri, Jan 13, 2023 at 09:39:04AM +0200, Yavor Doganov wrote:
> On Fri, Jan 13, 2023 at 09:28:11AM +0200, Yavor Doganov wrote:
> > Tags: patch
> 
> Here it is.

It looks like I made a mistake; please find attached the correct one.
>From e3d7ed13d3b764c834dc25776a8f845756f820f0 Mon Sep 17 00:00:00 2001
From: Yavor Doganov 
Date: Fri, 13 Jan 2023 09:18:57 +0200
Subject: [PATCH] Fix FTBFS with gnustep-base/1.29.0.

---
 debian/control |  2 +-
 debian/patches/base-1.29.patch | 25 +
 debian/patches/series  |  1 +
 3 files changed, 27 insertions(+), 1 deletion(-)
 create mode 100644 debian/patches/base-1.29.patch

diff --git a/debian/control b/debian/control
index f361674..172a89f 100644
--- a/debian/control
+++ b/debian/control
@@ -7,7 +7,7 @@ Uploaders: Jeroen Dekkers ,
 Build-Depends: debhelper-compat (= 13),
  gnustep-make,
  gobjc,
- libgnustep-base-dev,
+ libgnustep-base-dev (>= 1.29),
  libxml2-dev,
  libldap2-dev,
  libpq-dev,
diff --git a/debian/patches/base-1.29.patch b/debian/patches/base-1.29.patch
new file mode 100644
index 000..b111a31
--- /dev/null
+++ b/debian/patches/base-1.29.patch
@@ -0,0 +1,25 @@
+Description: Fix FTBFS with gnustep-base/1.29.0
+Bug-Debian: https://bugs.debian.org/1028579
+Author: Yavor Doganov 
+Forwarded: no
+Last-Update: 2023-01-13
+---
+
+--- sope-5.8.0.orig/sope-mime/NGMime/NGMimeType.m
 sope-5.8.0/sope-mime/NGMime/NGMimeType.m
+@@ -125,13 +125,13 @@
+ encoding = NSKoreanEUCStringEncoding;
+   }
+   else if ([charset isEqualToString:@"big5"]) {
+-encoding = NSBIG5StringEncoding;
++encoding = NSBig5StringEncoding;
+   }
+   else if ([charset isEqualToString:@"iso-2022-jp"]) {
+ encoding = NSISO2022JPStringEncoding;
+   }
+   else if ([charset isEqualToString:@"gb2312"]) {
+-encoding = NSGB2312StringEncoding;
++encoding = NSHZ_GB_2312StringEncoding;
+   }
+   else if ([charset isEqualToString:@"koi8-r"]) {
+ encoding = NSKOI8RStringEncoding;
diff --git a/debian/patches/series b/debian/patches/series
index 68fbd93..381749b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 0001-do-not-build-json.patch
 0002-Do-not-build-xmlrpc-and-stxsaxdriver.patch
 0003-Unset-MAKEFLAGS-and-MFLAGS-in-configure.patch
+base-1.29.patch
-- 
2.39.0



Bug#1031442: gnustep-base: FTBFS: dh_auto_test: error: make -j8 check "TESTSUITEFLAGS=-j8 --verbose" VERBOSE=1 messages=yes returned exit code 2

2023-02-17 Thread Yavor Doganov
Lucas Nussbaum wrote:
> Source: gnustep-base
> Version: 1.28.1+really1.28.0-5
> Severity: serious
> Justification: FTBFS

> During a rebuild of all packages in sid, your package failed to build
> on amd64.

Thanks for the report; I believe this is due to tzdata #1031395.  I
cannot reproduce with tzdata/2022g-6 where the removal of
/etc/timezone has been reverted.

I'm unsure whether to reassign this bug or just close it when
tzdata/2022g-6 migrates to testing.



Bug#1028189: gnustep-base/1.28.1-2 should not migrate to testing

2023-01-08 Thread Yavor Doganov
Source: gnustep-base
Version: 1.28.1-1
Severity: serious
Justification: API/ABI break

Filing this bug to block migration to testing.  This upload will be
reverted as it introduced silent API/ABI break.



Bug#1017818: elpa-jabber: Fails to compile with Emacs 28: Error: Wrong number of arguments: make-obsolete, 2

2022-08-21 Thread Yavor Doganov
Package: elpa-jabber
Version: 0.8.92+git98dc8e-7
Severity: serious

The upgrade from Emacs 27 to 28 aborts because byte-compilation of
elpa-jabber fails with the following error(s):

| In toplevel form:
| jabber-vcard.el:67:1: Error: Wrong number of arguments: make-obsolete, 2

The full log is:

Install elpa-jabber for emacs
install/jabber-0.8.92: Handling install of emacsen flavor emacs
install/jabber-0.8.92: byte-compiling for emacs

In toplevel form:
fsm.el:108:1: Warning: Package cl is deprecated
fsm.el:131:1: Warning: ‘defmacro*’ is an obsolete alias (as of 27.1); use
‘cl-defmacro’ instead.

In define-state-machine:
fsm.el:166:18: Warning: ‘destructuring-bind’ is an obsolete alias (as of
27.1); use ‘cl-destructuring-bind’ instead.
fsm.el:183:1: Warning: ‘defmacro*’ is an obsolete alias (as of 27.1); use
‘cl-defmacro’ instead.
fsm.el:214:1: Warning: ‘defmacro*’ is an obsolete alias (as of 27.1); use
‘cl-defmacro’ instead.
fsm.el:233:1: Warning: ‘defmacro*’ is an obsolete alias (as of 27.1); use
‘cl-defmacro’ instead.

In define-fsm:
fsm.el:255:29: Warning: ‘loop’ is an obsolete alias (as of 27.1); use
‘cl-loop’ instead.

In fsm-goodbye-cruel-world:
fsm.el:283:8: Warning: ‘remprop’ is an obsolete function (as of 27.1); use
‘cl-remprop’ instead.
fsm.el:283:21: Warning: ‘remprop’ is an obsolete function (as of 27.1); use
‘cl-remprop’ instead.

In fsm-update:
fsm.el:333:12: Warning: ‘destructuring-bind’ is an obsolete alias (as of
27.1); use ‘cl-destructuring-bind’ instead.

In fsm-send-sync:
fsm.el:374:30: Warning: ‘destructuring-bind’ is an obsolete alias (as of
27.1); use ‘cl-destructuring-bind’ instead.

In hexrgb-read-color:
hexrgb.el:349:14: Warning: ‘interactive-p’ is an obsolete function (as of
23.2); use ‘called-interactively-p’ instead.

In hexrgb-complement:
hexrgb.el:373:10: Warning: ‘interactive-p’ is an obsolete function (as of
23.2); use ‘called-interactively-p’ instead.

In hexrgb-hsv-to-rgb:
hexrgb.el:497:25: Warning: ‘case’ is an obsolete alias (as of 27.1); use
‘cl-case’ instead.

In end of data:
hexrgb.el:332:35: Warning: the function ‘eyedrop-background-at-mouse’ is not
known to be defined.
hexrgb.el:328:35: Warning: the function ‘eyedrop-foreground-at-mouse’ is not
known to be defined.
hexrgb.el:326:66: Warning: the function ‘eyedrop-background-at-point’ is not
known to be defined.
../../elpa-src/jabber-0.8.92/jabber-util.el: Warning: ‘return’ is an obsolete 
alias (as of 27.1); use ‘cl-return’ instead.
../../elpa-src/jabber-0.8.92/jabber-util.el: Warning: ‘loop’ is an obsolete 
alias (as of 27.1); use ‘cl-loop’ instead.
../../elpa-src/jabber-0.8.92/jabber-util.el: Warning: ‘loop’ is an obsolete 
alias (as of 27.1); use ‘cl-loop’ instead.
../../elpa-src/jabber-0.8.92/jabber-util.el: Warning: ‘return’ is an obsolete 
alias (as of 27.1); use ‘cl-return’ instead.
../../elpa-src/jabber-0.8.92/jabber-util.el: Warning: ‘case’ is an obsolete 
alias (as of 27.1); use ‘cl-case’ instead.
../../elpa-src/jabber-0.8.92/jabber-util.el: Warning: ‘return’ is an obsolete 
alias (as of 27.1); use ‘cl-return’ instead.
../../elpa-src/jabber-0.8.92/jabber-util.el: Warning: ‘destructuring-bind’ is 
an obsolete alias (as of 27.1); use ‘cl-destructuring-bind’ instead.
../../elpa-src/jabber-0.8.92/jabber-util.el: Warning: ‘do’ is an obsolete alias 
(as of 27.1); use ‘cl-do’ instead.
../../elpa-src/jabber-0.8.92/jabber-xml.el: Warning: ‘loop’ is an obsolete 
alias (as of 27.1); use ‘cl-loop’ instead.
../../elpa-src/jabber-0.8.92/jabber-xml.el: Warning: ‘return’ is an obsolete 
alias (as of 27.1); use ‘cl-return’ instead.

In toplevel form:
jabber-activity.el:42:1: Warning: Package tls is deprecated
jabber-activity.el:42:1: Warning: Package starttls is deprecated
../../elpa-src/jabber-0.8.92/srv.el: Warning: ‘incf’ is an obsolete alias (as 
of 27.1); use ‘cl-incf’ instead.
../../elpa-src/jabber-0.8.92/srv.el: Warning: ‘return’ is an obsolete alias (as 
of 27.1); use ‘cl-return’ instead.
../../elpa-src/jabber-0.8.92/jabber-conn.el: Warning: ‘labels’ is an obsolete 
macro (as of 24.3); use ‘cl-labels’ instead.
../../elpa-src/jabber-0.8.92/jabber-conn.el: Warning: ‘labels’ is an obsolete 
macro (as of 24.3); use ‘cl-labels’ instead.
../../elpa-src/jabber-0.8.92/jabber-conn.el: Warning: ‘case’ is an obsolete 
alias (as of 27.1); use ‘cl-case’ instead.
../../elpa-src/jabber-0.8.92/fsm.el: Warning: ‘destructuring-bind’ is an 
obsolete alias (as of 27.1); use ‘cl-destructuring-bind’ instead.
../../elpa-src/jabber-0.8.92/fsm.el: Warning: ‘loop’ is an obsolete alias (as 
of 27.1); use ‘cl-loop’ instead.
../../elpa-src/jabber-0.8.92/fsm.el: Warning: ‘destructuring-bind’ is an 
obsolete alias (as of 27.1); use ‘cl-destructuring-bind’ instead.
../../elpa-src/jabber-0.8.92/fsm.el: Warning: ‘destructuring-bind’ is an 
obsolete alias (as of 27.1); use ‘cl-destructuring-bind’ instead.
../../elpa-src/jabber-0.8.92/jabber-core.el: Warning: ‘destructuring-bind’ is 

Bug#995007: gnustep-base ftbfs with updated autoconf/automake

2021-10-03 Thread Yavor Doganov
On Sat, 02 Oct 2021 16:01:45 +0300,
Peter Green wrote:
> I see a fix for this issue has been uploaded to mentors, do you want
> me to sponsor it?

I'd be very grateful, thanks in advance!
My usual sponsor is not answering...



Bug#963081: src:camera.app: Please switch to using pkg-config for libgphoto2

2020-07-20 Thread Yavor Doganov
Sudip Mukherjee wrote:
> On Fri, Jun 19, 2020 at 09:41:22PM +0300, Yavor Doganov wrote:
> > wf...@niif.hu wrote:
> > > Yavor Doganov  writes:
> > > > Thanks; I'll fix this shortly -- the upload will depend on my sponsor
> > > > though.  Meanwhile, feel free to upload libgphoto2 whenever you like
> > > > and raise the severity of this bug to serious.
> > > 
> > > Did so, thanks.  I'm willing to sponsor your upload fixing this issue if
> > > needed.
> > 
> > It has a bunch of other changes so I'm not sure you'll be comfortable
> > reviewing them.  And I've already contacted my sponsor...  Anyway, the
> > updated package is available at mentors.d.n and also on Salsa.
> 
> Fixing the FTBFS is fairly simple and the attached patch is sufficient.
> Might be worth doing the NMU as it has been removed from testing.

I've already pushed Ferenc's fix plus some other changes so please
don't NMU it.  Pinging my sponsor again (sorry to disturb you, Peter).



Bug#963478: gworkspace.app: Crashes on startup

2020-06-22 Thread Yavor Doganov
Package: gworkspace.app
Version: 0.9.4-2+b1
Severity: grave
User: pkg-gnustep-maintain...@lists.alioth.debian.org
Usertags: gnustep-gui0.28-transition gnustep-transition

(gdb) r
Starting program: /usr/bin/GWorkspace 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
2020-06-22 10:08:32.852 GWorkspace[771743:771743] styleoffsets ... guessing 
offsets
2020-06-22 10:08:32.855 GWorkspace[771743:771743] styleoffsets ... guessing 
offsets
[Detaching after vfork from child process 771748]
[Detaching after vfork from child process 771750]
2020-06-22 10:08:36.914 fswatcher[771750:771750] register client 2
2020-06-22 10:08:37.373 GWorkspace[771743:771743] Selected non-scalable font.
2020-06-22 10:08:38.471 GWorkspace[771743:771743] Setting unknown encoding 1

Program received signal SIGSEGV, Segmentation fault.
0x77126981 in objc_msg_lookup (
receiver=0x77344f90 <+[NSArray arrayWithObjects:]>, 
op=0x776a19f0 <_OBJC_SELECTOR_TABLE+208>)
at /build/gcc-10-JUVXRb/gcc-10-10.1.0/src/libobjc/sendmsg.c:442
442 /build/gcc-10-JUVXRb/gcc-10-10.1.0/src/libobjc/sendmsg.c: Няма такъв 
файл или директория.
(gdb) bt
#0  0x77126981 in objc_msg_lookup
(receiver=0x77344f90 <+[NSArray arrayWithObjects:]>, op=0x776a19f0 
<_OBJC_SELECTOR_TABLE+208>)
at /build/gcc-10-JUVXRb/gcc-10-10.1.0/src/libobjc/sendmsg.c:442
#1  0x772e639e in -[GSInlineArray initWithObjects:count:]
(self=0x5a734200, _cmd=, objects=0x7fffdda0, 
count=35) at GSArray.m:420
#2  0x773450d9 in +[NSArray arrayWithObjects:]
(self=, _cmd=, firstObject=0x77e38a10 
<_OBJC_INSTANCE_155>) at NSArray.m:266
#3  0x77aaf3f6 in iterate_reps_for_types
(imageReps=, method=method@entry=0x77d617c0 
<_OBJC_SELECTOR_TABLE+4512>) at NSImage.m:2197
#4  0x77aaf6fa in +[NSImage imagePasteboardTypes]
(self=, _cmd=) at NSImage.m:2165
#5  0x77efc067 in -[IconView setInspector:]
(self=0x5a741470, _cmd=, insp=)
at IconView.m:35
#6  0x77ef2984 in -[Attributes initForInspector:]
(self=0x5a53c620, _cmd=, insp=0x5a71f320)
at Attributes.m:91
#7  0x77eefa88 in -[Inspector init]
(self=0x5a71f320, _cmd=) at Inspector.m:90
#8  0x555ec6c9 in -[GWorkspace applicationWillFinishLaunching:]
(self=0x5578a770, _cmd=, aNotification=)
at GWorkspace.m:496
#9  0x7740a604 in -[NSNotificationCenter _postAndRelease:]
(self=0x558c6d10, _cmd=, notification=0x55ad1de0)
at NSNotificationCenter.m:1198
#10 0x77a18285 in -[NSApplication finishLaunching]
(self=0x55abe5f0, _cmd=) at NSApplication.m:1016
#11 0x77a1c7b1 in -[NSApplication run]
(self=0x55abe5f0, _cmd=) at NSApplication.m:1561
#12 0x555e0775 in main
(argc=, argv=, env=)
at main.m:38

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'testing-debug'), (500, 
'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, x32

Kernel: Linux 5.6.0-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=bg_BG.UTF-8, LC_CTYPE=bg_BG.UTF-8 (charmap=UTF-8), 
LANGUAGE=bg_BG.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages gworkspace.app depends on:
ii  gnustep-back0.28  0.28.0-2
ii  gnustep-base-runtime  1.27.0-3
ii  gnustep-gui-runtime   0.28.0-2
ii  gworkspace-common 0.9.4-2
ii  libc6 2.30-8
ii  libgcc-s1 10.1.0-4
ii  libgnustep-base1.27   1.27.0-3
ii  libgnustep-gui0.280.28.0-2
ii  libobjc4  10.1.0-4
ii  libpopplerkit00.0.20051227svn-8+b3
ii  libsqlite3-0  3.32.3-1

Versions of packages gworkspace.app recommends:
ii  cynthiune.app  1.0.0-2+b3
ii  price.app  1.3.0-4+b1
ii  systempreferences.app  1.2.0-2+b6
ii  textedit.app   5.0-2+b2
ii  viewpdf.app1:0.2dfsg1-7+b1
ii  zipper.app 1.5-3+b1

Versions of packages gworkspace.app suggests:
ii  gworkspace-apps-wrappers  0.9.4-2

-- no debconf information



Bug#963081: src:camera.app: Please switch to using pkg-config for libgphoto2

2020-06-19 Thread Yavor Doganov
wf...@niif.hu wrote:
> Yavor Doganov  writes:
> 
> > Thanks; I'll fix this shortly -- the upload will depend on my sponsor
> > though.  Meanwhile, feel free to upload libgphoto2 whenever you like
> > and raise the severity of this bug to serious.
> 
> Did so, thanks.  I'm willing to sponsor your upload fixing this issue if
> needed.

It has a bunch of other changes so I'm not sure you'll be comfortable
reviewing them.  And I've already contacted my sponsor...  Anyway, the
updated package is available at mentors.d.n and also on Salsa.

P.S. I noticed that libgphoto2/2.5.25-1 FTBFS almost everywhere, you
might want to take a look.



Bug#936681: gwyddion: Python2 removal in sid/bullseye

2019-11-20 Thread Yavor Doganov
On Wed, Nov 20, 2019 at 11:49:44AM +0100, Andreas Tille wrote:
> I guess you have read the past conversation that upstream is not
> willing to port code to GTK 3.

Yes, that's why I don't think it's a good idea for me to attempt
porting it -- the result won't be merged in.

> On Wed, Nov 20, 2019 at 12:20:38PM +0200, Yavor Doganov wrote:
> > IMO the only chance to keep gwyddion in bullseye is to build it with
> > the option --disable-pygwy.
> 
> I fully agree here.

OK, I'll start working on this then and I'll ping you when I'm done (I
have commit access to debian-med but I'm not a DD).  I'll probably
remove or at least disable Shayan's patch as it is not sufficient and
this code won't be installed anyway.



Bug#936681: gwyddion: Python2 removal in sid/bullseye

2019-11-20 Thread Yavor Doganov
On Sun, Sep 29, 2019 at 08:27:59PM +0100, Shayan Doust wrote:
> Just a notice to those who read this: it seems like with the python2 ->
> python3 migration, python-gtk2-dev becomes redundant and should be avoided.

It's more complex than that.  PyGTK is strictly tied to Python 2 and
GTK 2.  To move to Python 3, one must use the dynamic bindings (PyGI,
based on gobject-introspection) but OTOH introspection _officially_
only works with GTK 3.

I have ported a GTK 2 package from PyGTK to PyGI, see planner [1].
However, as the patch description says, it's basically a hack that
works by chance.  I only tested with a simple example script; it's
quite possible that some of the exposed APIs may fail miserably.  And
there's a big fat warning when you start it:

| $ planner 
| /usr/lib/python3/dist-packages/gi/overrides/Gtk.py:55: RuntimeWarning:
| You have imported the Gtk 2.0 module.  Because Gtk 2.0 was not
| designed for use with introspection some of the interfaces and API
| will fail.  As such this is not supported by the pygobject development
| team and we encourage you to port your app to Gtk 3 or greater. PyGTK
| is the recomended python module to use with Gtk 2.0

If you are comfortable with Python (I'm not) you could try and do the
same with gwyddion.  However, it is certain that such patch will be
rejected upstream because it will break user scripts.

The only viable, long-term solution is to port the whole thing to GTK
3.  I'd be willing to do that but it appears that upstream will reject
the patch anyway, so it's a lost cause.  We could still use this patch
in Debian but it will be a nightmare to update it when merging new
upstream releases and it may spoil the relationship with upstream, as
the gwyddion APIs that Debian will provide will be incompatible with
the rest of the world.

IMO the only chance to keep gwyddion in bullseye is to build it with
the option --disable-pygwy.  This will automatically solve #936681,
#942902 and #911167 (gtksourceview2 is used only for syntax
highlighting in the python console).  At least for the time being it
will give us a releasable but less capable version of the package
which is still better than no package at all.

When GTK 4 is out, most probably the Debian GNOME team will start an
effort to remove GTK 2 as I don't think they'd be happy to maintain 3
library versions.  Then gwyddion would be at risk of being removed as
well, in case upstream are still unwilling to move away from GTK 2.

[1] https://sources.debian.org/src/planner/0.14.6-8/debian/patches/python3.patch



Bug#939119: gnustep-base-runtime: Upgrading to Debian 10 causes gdomap network service to become enabled

2019-09-14 Thread Yavor Doganov
Control: severity -1 important

On Sun, 01 Sep 2019 14:24:05 +0300,
Alan Jenkins wrote:
> Package: gnustep-base-runtime
> Version: 1.26.0-4
> Severity: grave
> Tags: security
> Justification: user security hole

Many thanks for the report but like Michael Biebl I disagree with the
severity.  This is an unfortunate regression that I'd like to fix in
buster but I don't think it has anything to do with security.  If the
gdomap daemon is vulnerable that is a separate issue which may or may
not be RC.

Starting the daemon has been the default in Debian for many years;
people rightfully complained about it since 99.5% of the users won't
need it.

> "update-rc.d" does not do anything in this case.  The man page says
> 
> > If any files named /etc/rcrunlevel.d/[SK]??name already exist then
> > update-rc.d does nothing.  The program was written this way so that
> > it will never change an existing configuration, which may have been
> > customized by the system administrator.  The program will only  
> > install links if none are present, i.e., if it appears that the 
> > service has never been installed before.
> 
> It is unfortunate that "Policy 9.3.3.1" does not have an explicit
> warning about this potential security problem.

Indeed, thanks for the analysis.  I thought I have followed Policy to
the letter but apparently missed this, and my tests on a sid system
back then were somehow successful which has misleaded me, apparently.
 
Michael Biebl wrote:
> On 01.09.19 13:52, Michael Biebl wrote:
> > I guess gnustep-base-runtime explicitly needs to remove the existing
> > /etc/rc?.d/???gdomap symlinks on upgrades in preinst (possibly guarded
> > by a check which reads the old /etc/default/gdomap and tests if
> > ENABLED=NO) so they can be properly re-created (and disabled) by
> > "update-rc.d defaults-disabled"
> 
> But since /etc/default/gdomap could have been upgraded in the mean time,
> not finding ENABLED=NO in /etc/default/gdomap probably also means that
> you want to remove the /etc/rc?.d/???gdomap symlinks.
> 
> That on the other hand could blow away the changes for a system where
> gdomap was explicity enable via "update-rc.d enable gdomap", so you need
> to handle that case as well (i.e. don't remove the symlinks if there is
> no ENABLED= key but a /etc/rc2.d/S??gdomap symlink)

IOW, something like this snippet:

if [ ! -h /etc/rc2.d/S*gdomap ]; then
find /etc/rc?.d -name \*gdomap -delete
fi

Seems a bit brutal to me but it looks like there is no other way.



Bug#924010: wmbiff: Built without TLS support

2019-03-08 Thread Yavor Doganov
On Fri, Mar 08, 2019 at 07:21:22PM +0100, Andreas Metzler wrote:
> On 2019-03-08 Yavor Doganov  wrote:
> > | checking for gzopen in -lz... no
> > | GNUTLS support requires libz.a and libgdbm.a
> 
> Actually ./configure seems to wrong, GNUTLS suppport does not require
> libz.a and libgdbm.a (anymore).

Thanks; here is a better patch.
>From da55170615c095d2076a839d335f1071ceb8f906 Mon Sep 17 00:00:00 2001
From: Yavor Doganov 
Date: Sat, 9 Mar 2019 08:30:55 +0200
Subject: [PATCH] debian/patches: (gnutls-detection.patch) Detect GNUTLS
 unconditionally.

---
 debian/patches/gnutls-detection.patch | 40 +++
 debian/patches/series |  1 +
 2 files changed, 41 insertions(+)
 create mode 100644 debian/patches/gnutls-detection.patch
 create mode 100644 debian/patches/series

diff --git a/debian/patches/gnutls-detection.patch b/debian/patches/gnutls-detection.patch
new file mode 100644
index 000..acb58bb
--- /dev/null
+++ b/debian/patches/gnutls-detection.patch
@@ -0,0 +1,40 @@
+Description: Detect GNUTLS unconditionally.
+Author: Yavor Doganov 
+Debian-Bug: https://bugs.debian.org/924010
+Forwarded: no
+Last-Update: 2019-03-09
+---
+
+--- wmbiff.orig/configure.ac
 wmbiff/configure.ac
+@@ -58,11 +58,7 @@
+ AC_CHECK_LIB(resolv, herror)
+ 
+ dnl Pre-gnutls.
+-gnutls="ok"
+ gcrypt="ok"
+-AC_CHECK_LIB(z, gzopen, [], [gnutls="nope"]) dnl GNUTLS seems to need libz; fail here if it's missing.
+-dnl perhaps not required anymore:
+-dnl AC_CHECK_LIB(gdbm, dbminit, [], [gnutls="nope"]) dnl GNUTLS seems to need libgdbm; fail here if it's missing.
+ 
+ dnl Parameter is minimum version
+ dnl TODO: fix so that GCRYPT is tested only if GNUTLS fails; the dependence
+@@ -76,17 +72,13 @@
+ 
+ 
+ GNUTLS_MAN_STATUS="This copy of WMBiff was not compiled with GNUTLS."
+-if test "$gnutls" = "ok"; then
+- PKG_CHECK_MODULES([LIBGNUTLS], [gnutls > 2.2.0], [LIBS="$LIBS $LIBGNUTLS_LIBS"
++PKG_CHECK_MODULES([LIBGNUTLS], [gnutls > 2.2.0], [LIBS="$LIBS $LIBGNUTLS_LIBS"
+   CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
+  CPPFLAGS="$CPPFLAGS $LIBGNUTLS_CFLAGS"
+  GNUTLS_COMMON_O="gnutls-common.o"
+  GNUTLS_MAN_STATUS="This copy of WMBiff was compiled with GNUTLS."
+  AC_CHECK_HEADERS(gnutls/gnutls.h) ],
+  [ echo GNUTLS can be found at ftp://gnutls.hellug.gr/pub/gnutls ])
+-else
+- AC_MSG_RESULT(GNUTLS support requires libz.a and libgdbm.a, so will be disabled)
+-fi
+ 
+ GCRYPT_MAN_STATUS="This copy of WMBiff was not compiled with gcrypt."
+ if test "$gcrypt" = "ok"; then
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 000..99fe75a
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+gnutls-detection.patch
-- 
2.20.1



Bug#924010: wmbiff: Built without TLS support

2019-03-08 Thread Yavor Doganov
Package: wmbiff
Version: 0.4.33-1
Severity: serious
Tags: patch

IMHO any sane mail checker should support TLS:

$ wmbiff
This copy of wmbiff was not compiled with gnutls;
imaps is unavailable.  Exiting to protect your
passwords and privacy.

Looking at the build log:

| checking for gzopen in -lz... no
| GNUTLS support requires libz.a and libgdbm.a

The attached trivial patch fixes it.

-- System Information:
Debian Release: buster/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'testing-debug'), (500, 
'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, x32

Kernel: Linux 4.19.0-3-amd64 (SMP w/2 CPU cores)
Locale: LANG=bg_BG.UTF-8, LC_CTYPE=bg_BG.UTF-8 (charmap=UTF-8), 
LANGUAGE=bg_BG.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages wmbiff depends on:
ii  libc62.28-8
ii  libgcrypt20  1.8.4-5
ii  libx11-6 2:1.6.7-1
ii  libxext6 2:1.3.3-1+b2
ii  libxpm4  1:3.5.12-1

wmbiff recommends no packages.

Versions of packages wmbiff suggests:
ii  ruby 1:2.5.1
ii  ssh-askpass-gnome [ssh-askpass]  1:7.9p1-9

-- no debconf information
>From 6c6acf935e8fa7679537c0b34dcf535853a7a5c1 Mon Sep 17 00:00:00 2001
From: Yavor Doganov 
Date: Fri, 8 Mar 2019 11:59:31 +0200
Subject: [PATCH] debian/control: Add zlib1g-dev to Build-Depends.

---
 debian/control | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/debian/control b/debian/control
index 690b8c8..bba64de 100644
--- a/debian/control
+++ b/debian/control
@@ -9,7 +9,8 @@ Build-Depends: debhelper (>= 11),
libx11-dev,
libxext-dev,
libxpm-dev,
-   pkg-config
+   pkg-config,
+   zlib1g-dev
 Standards-Version: 4.3.0
 Rules-Requires-Root: no
 Homepage: https://www.dockapps.net/wmbiff
-- 
2.20.1



Bug#920609: lynkeos.app: Does not start; assertion failure

2019-01-29 Thread Yavor Doganov
Control: tags -1 + pending

On Sun, 27 Jan 2019 14:11:06 +0200,
Yavor Doganov wrote:
> Package: lynkeos.app
> Version: 2.10+dfsg1-3+b2
> Severity: grave
> 
> $ Lynkeos
> Lynkeos: malloc.c:2385: sysmalloc: Assertion `(old_top == initial_top (av) && 
> old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse 
> (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed.

I fixed this but there's a new upstream release which ideally I'd like
to get in buster.  If I'm unable to complete the porting work in time
for the soft freeze I'll upload 2.10+dfsg1-4 fixing this bug.



Bug#920629: Bug#920629: volumecontrol.app: Cannot quit, blocks under some circumstances

2019-01-27 Thread Yavor Doganov
Gürkan Myczko wrote:
> Hi Yavor many thanks would you mind doing a pr for that on github?

I don't have a GitHub account and don't plan to make one at least
until it is possible to do it off the web, with one of the cli tools
that are available.

I can send you the modified .gorm file in private if you want, or a
patch produced with "git format-patch" that you can apply directly
with "git am".



Bug#920629: volumecontrol.app: Cannot quit, blocks under some circumstances

2019-01-27 Thread Yavor Doganov
Package: volumecontrol.app
Version: 0.7-1+b1
Severity: grave

The Quit menu item is greyed out and does not work.  Selecting missing
controls (Bass/Treble for my card) makes the "Control missing" dialog
appear but you can't get rid of it.  The app then becomes completely
unusable.

There are multiple identical entries in the log:

2019-01-27 18:57:31.160 VolumeControl[17687:17687] Target NSMenu: VolumeControl 
(Normal) does not respont to action terminate:

Apart from the spelling error this message is correct.  Note that as of
GUI 0.27.0 NSApplication -targetForAction:to:from: returns nil if the
target is not nil but it doesn't respond to the selector.

I opened Volumecontrol.gorm and noticed that the connection is
terminate: (NSMenu) while it should be NSFirst.  Changing the connection
makes the app behave as expected.  I guess it would be easier to make a
new upstream release than to deal with binary patches...

-- System Information:
Debian Release: buster/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'testing-debug'), (500, 
'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.19.0-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=bg_BG.UTF-8, LC_CTYPE=bg_BG.UTF-8 (charmap=UTF-8), 
LANGUAGE=bg_BG.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages volumecontrol.app depends on:
ii  gnustep-back0.27   0.27.0-2
ii  gnustep-base-runtime   1.26.0-3
ii  gnustep-common [gnustep-fslayout-fhs]  2.7.0-4
ii  gnustep-gui-runtime0.27.0-3
ii  libasound2 1.1.7-2
ii  libc6  2.28-5
ii  libgnustep-base1.261.26.0-3
ii  libgnustep-gui0.27 0.27.0-3
ii  libobjc4   8.2.0-15

volumecontrol.app recommends no packages.

volumecontrol.app suggests no packages.

-- no debconf information



Bug#920609: lynkeos.app: Does not start; assertion failure

2019-01-27 Thread Yavor Doganov
Package: lynkeos.app
Version: 2.10+dfsg1-3+b2
Severity: grave

$ Lynkeos
2019-01-27 14:04:19.881 Lynkeos[10492:10492] styleoffsets ... guessing offsets
2019-01-27 14:04:19.882 Lynkeos[10492:10492] styleoffsets ... guessing offsets
2019-01-27 14:04:20.852 Lynkeos[10492:10492] Selected non-scalable font.
2019-01-27 14:04:20.999 Lynkeos[10492:10492] File NSData.m: 253. In 
readContentsOfFile Open ((null)) attempt failed - bad path
2019-01-27 14:04:21.000 Lynkeos[10492:10492] Could not convert cursor bitmap 
data
Lynkeos: malloc.c:2385: sysmalloc: Assertion `(old_top == initial_top (av) && 
old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse 
(old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed.
Прекъснат

(gdb) bt
#0  0x7544d85b in __GI_raise (sig=sig@entry=6) at 
../sysdeps/unix/sysv/linux/raise.c:50
#1  0x75438535 in __GI_abort () at abort.c:79
#2  0x75495c98 in __malloc_assert 
(assertion=assertion@entry=0x7559c230 "(old_top == initial_top (av) && 
old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse 
(old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)", 
file=file@entry=0x755983b0 "malloc.c", line=line@entry=2385, 
function=function@entry=0x7559c940 <__PRETTY_FUNCTION__.12981> "sysmalloc") 
at malloc.c:298
#3  0x7549809f in sysmalloc (nb=nb@entry=64, av=av@entry=0x755d1c40 
) at malloc.c:2382
#4  0x754994e9 in _int_malloc (av=av@entry=0x755d1c40 , 
bytes=bytes@entry=48) at malloc.c:4133
#5  0x7549a603 in __GI___libc_malloc (bytes=48) at malloc.c:3049
#6  0x756033b9 in objc_malloc (size=size@entry=48) at 
/build/gcc-8-oQsZX8/gcc-8-8.2.0/src/libobjc/memory.c:95
#7  0x7560492f in sarray_lazy_copy (oarr=0x5582a100) at 
/build/gcc-8-oQsZX8/gcc-8-8.2.0/src/libobjc/sarray.c:489
#8  0x75605c59 in __objc_prepare_dtable_for_class 
(cls=cls@entry=0x556a5220 <_OBJC_MetaClass_MyImageAnalyzerPrefs>) at 
/build/gcc-8-oQsZX8/gcc-8-8.2.0/src/libobjc/sendmsg.c:1095
#9  0x75605a88 in __objc_install_dtable_for_class (cls=0x556a5220 
<_OBJC_MetaClass_MyImageAnalyzerPrefs>) at 
/build/gcc-8-oQsZX8/gcc-8-8.2.0/src/libobjc/sendmsg.c:1012
#10 0x75605a88 in __objc_install_dtable_for_class (cls=0x556a5220 
<_OBJC_MetaClass_MyImageAnalyzerPrefs>) at 
/build/gcc-8-oQsZX8/gcc-8-8.2.0/src/libobjc/sendmsg.c:981
#11 0x75606dd4 in get_implementation (sel=, 
class=, receiver=) at 
/build/gcc-8-oQsZX8/gcc-8-8.2.0/src/libobjc/sendmsg.c:260
#12 0x75606dd4 in objc_msg_lookup 
(receiver=receiver@entry=0x556a4fa0 <_OBJC_Class_MyImageAnalyzerPrefs>, 
op=op@entry=0x556deb90 <_OBJC_SELECTOR_TABLE+1968>) at 
/build/gcc-8-oQsZX8/gcc-8-8.2.0/src/libobjc/sendmsg.c:450
#13 0x5563391f in -[MyPluginsController(Private) 
processPreferencesClass:] (self=0x581d2a80, _cmd=, 
theClass=0x556a4fa0 <_OBJC_Class_MyImageAnalyzerPrefs>) at 
./GNUstep/../Sources/MyPluginsController.m:330
#14 0x55633ab8 in -[MyPluginsController(Private) retrieveClasses] 
(self=0x581d2a80, _cmd=) at 
./GNUstep/../Sources/MyPluginsController.m:389
#15 0x55632fba in -[MyPluginsController init] (self=0x581d2a80, 
_cmd=) at ./GNUstep/../Sources/MyPluginsController.m:542
#16 0x55632c54 in +[MyPluginsController defaultPluginController] 
(self=0x556df440 <_OBJC_Class_MyPluginsController>, _cmd=0x556f0100 
<_OBJC_SELECTOR_TABLE+1664>) at ./GNUstep/../Sources/MyPluginsController.m:521
#17 0x5563c942 in -[MyUserPrefsController 
toolbarSelectableItemIdentifiers:] (self=, _cmd=, 
toolbar=) at ./GNUstep/../Sources/MyUserPrefsController.m:99
#18 0x75fb1533 in -[NSToolbar _build] (self=0x581c6c50, 
_cmd=) at NSToolbar.m:1041
#19 0x5563cfad in -[MyUserPrefsController init] (self=0x581cba40, 
_cmd=) at ./GNUstep/../Sources/MyUserPrefsController.m:75
#20 0x76021a7d in -[NSCustomObject nibInstantiate] 
(self=0x57a26a60, _cmd=) at GSNibLoading.m:1009
#21 0x76052bb1 in -[GSXibLoader awake:inContainer:withContext:] 
(self=, _cmd=, rootObjects=, 
objects=0x56f963f0, context=) at GSXibLoader.m:957
#22 0x76052578 in -[GSXibLoader 
loadModelData:externalNameTable:withZone:] (self=0x56046660, 
_cmd=, data=, context=0x5594e180, 
zone=) at GSXibLoader.m:1007
#23 0x75e84b87 in +[NSBundle(NSBundleAdditions) 
loadNibFile:externalNameTable:withZone:] (self=, _cmd=, fileName=0x558a9e30, context=0x5594e180, zone=0x75bfd360 
) at NSBundleAdditions.m:52
#24 0x75e399e7 in NSApplicationMain (argc=, 
argv=) at Functions.m:83
#25 0x7543a09b in __libc_start_main (main=0x555e9ad0 , 
argc=1, argv=0x7fffe948, init=, fini=, 
rtld_fini=, stack_end=0x7fffe938) at ../csu/libc-start.c:308
#26 0x555e9e6a in _start ()

-- System Information:
Debian Release: buster/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 

Bug#920605: fortunate.app: Does not start: Bad application class '(null)' specified

2019-01-27 Thread Yavor Doganov
Package: fortunate.app
Version: 3.1-2
Severity: grave

$ Fortunate
2019-01-27 12:44:44.637 Fortunate[7927:7927] Bad application class '(null)' 
specified

And the reason is:

$ ls -la /usr/lib/GNUstep/Applications/Fortunate.app/Resources/
общо 8
drwxr-xr-x 2 root root 4096 яну 17 11:47 .
drwxr-xr-x 3 root root 4096 яну 17 11:47 ..

-- System Information:
Debian Release: buster/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'testing-debug'), (500, 
'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.19.0-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=bg_BG.UTF-8, LC_CTYPE=bg_BG.UTF-8 (charmap=UTF-8), 
LANGUAGE=bg_BG.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages fortunate.app depends on:
ii  fortune-mod   1:1.99.1-7+b1
ii  gnustep-back0.27  0.27.0-2
ii  gnustep-base-runtime  1.26.0-3
ii  gnustep-gui-runtime   0.27.0-3
ii  libc6 2.28-5
ii  libgcc1   1:8.2.0-15
ii  libgnustep-base1.26   1.26.0-3
ii  libgnustep-gui0.270.27.0-3
ii  libobjc4  8.2.0-15

fortunate.app recommends no packages.

fortunate.app suggests no packages.

-- no debconf information



Bug#885742: linsmith: GTK+ 3 / GooCanvas port may be available upstream

2019-01-12 Thread Yavor Doganov
On Wed, 09 Jan 2019 07:24:00 +0200,
Jeremy Bicha wrote:
> We'd like to remove those libraries soon, but I am willing to wait a
> bit longer for someone to port linsmith to gtk3.

JFTR, I don't intend to work on this package.  I don't have time at
the moment, but more importantly I don't have the motivation, knowing
in advance that this is already fixed upstream.

(I spent good few days working on rasmol, glaring at those molecules
and fighting with ancient code, and the reward was that my work ended
up in the trashcan only because the maintainer didn't bother to write
one or two lines informing people that the issue is fixed upstream.  I
knew my patch was suboptimal but it still leaves a bitter taste in my
mouth -- I could have spent these days working on something else.)



Bug#907624: Help for SIGSEGV in test suite needed when built with gcc 8.2 what works nicely with gcc 6.3

2019-01-11 Thread Yavor Doganov
On Wed, 09 Jan 2019 22:42:43 +0200,
Andreas Tille wrote:
> The values of the structure are set in line 350[3] and are OK there.

What looks suspicious to me is that an unsigned long long value is
assigned to struct members of type size_t.  In the previous upstream
release that worked, the return value of ffparse_ulong was used which
was unsigned long.

I doubt this is the culprit but may be something worth looking at.

> I admit I fail to see why the code works under stretch with gcc 6.3
> but fails with gcc 8.2.

If the code works with an old compiler but fails with a modern one, in
99.99% of the cases it's a bug in the code.  These bugs are revealed
due to new and more aggressive optimization techniques/algorithms that
assume undefined behavior.  IOW, the code was/is buggy by definition
but you got away with it somehow.  The remaining 0.01% is due to
compiler bugs but I bet that's not the case here.



Bug#915714: gnustep-base: Please use pkg-config to detect icu

2019-01-02 Thread Yavor Doganov
Hugh McMaster wrote:
> Control: severity -1 serious
> Control: tags -1 + patch

> As the removal of icu-config from Debian is imminent, I have prepared a
> patch for gnustep-base so its build system uses pkg-config to detect icu.

Thanks for the patch but AFAICT this is a cosmetic issue that
definitely does not warrant RC severity.  Since 1.25.1-2 gnustep-base
is configured with --disable-icu-config so icu-config is not used to
detect ICU.  This was necessary because icu-config has been removed in
icu/59.1-1 but was reintroduced later.

The package builds fine without icu-config so I'm inclined to close
this bug or at least downgrade the severity.



Bug#911166: gtksourceview2: Do not release with Buster

2018-10-21 Thread Yavor Doganov
Jeremy Bicha wrote:
> On Sun, Oct 21, 2018 at 5:07 PM Yavor Doganov  wrote:
> > This is slightly confusing to me; there is src:gtksourceview3 but I
> > cannot find src:gtksourceview4.
> 
> Here are some links:
> https://tracker.debian.org/pkg/gtksourceview4

I feel stupid right now; I typed "gtksourceview" in the "Jump to
package..." box at tracker.d.o and it didn't show gtksourceview4; I
should have tried the obvious shell commands before jumping to the
wrong conclusions.

> We don't intend to remove gtksourceview 3 from Debian Buster but it
> would be nice if it could be removed in time for the release after
> that (Bullseye).

So I deduce that porting from 2 straight to 4 is preferable.  Thanks.



Bug#911166: gtksourceview2: Do not release with Buster

2018-10-21 Thread Yavor Doganov
On Tue, Oct 16, 2018 at 12:49:36PM -0400, Jeremy Bicha wrote:
> Please port your package to gtk3 and gtksourceview4.

This is slightly confusing to me; there is src:gtksourceview3 but I
cannot find src:gtksourceview4.  It's not in the NEW queue either.  Is
it going to be a new source package?  If yes, when it is going to be
uploaded to Debian?  (I assume it is API/ABI incompatible with
gtksourceview3.)

Is porting from gtksourceview2 to gtksourceview3 desirable now or it
is preferred to wait for gtksourceview4?



Bug#856086: Bug#885037: Patch for monster-masher

2018-10-21 Thread Yavor Doganov
Markus Koschany wrote:
> I only noticed that the Close button in the "Info" submenu doesn't
> work as intended.

There is no "Info" submenu; I guess you mean the Close button in the
About dialog?  None of the patches touches this code and I can
reproduce with 1.8.1-7+b1 so it's not a regression.

> Please consider to submit a debdiff for future patches because it is
> easier to apply.

Apologies; I thought it is self-explanatory because I mentioned that
no-esound.patch replaces add-esound-as-dependency.patch and the other
patches are naturally appended to the series in the order they're
attached:

glib-single-include.patch
no-esound.patch
crash_after_intro.patch
desktop_lintian.patch
add_hungarian_translation.patch
no-libgnome.patch
gsettings-port.patch

I'll be more careful in the future but it's difficult to please all
maintainters as people have different workflows (some dislike debdiffs
with upstream patches because they're somewhat difficult to read, some
hate spamming bugs belonging to the same package with semi-identical
debdiffs, some will reject incremental debdiffs as they think they're
unnecessary burden, you name it).



Bug#885037: Port to Gio::Settings

2018-10-21 Thread Yavor Doganov
tags 885037 + patch
thanks

Attached are patches which remove the libgnome and gconfmm
dependencies.  (I know nothing about C++ so please bear with me.  The
code appears to work but is likely to have some issues like memory
management bugs.)

Apart from removing libgnome2-dev and libgconfmm-2.6-dev from B-D,
please consider adding gconf2 to Recommends; see #907826.
Description: Eliminate libgnome dependency.
Bug-Debian: https://bugs.debian.org/885037
Author: Yavor Doganov 
Forwarded: no
Last-Update: 2018-10-21
---

--- monster-masher-1.8.1.orig/configure.ac
+++ monster-masher-1.8.1/configure.ac
@@ -14,8 +14,7 @@
 AC_PROG_CXX
 
 dnl checks for libraries
-PKG_CHECK_MODULES(DEPS, libgnome-2.0 >= 2.0.0 \
-gconfmm-2.6 >= 2.6.0 \
+PKG_CHECK_MODULES(DEPS, gconfmm-2.6 >= 2.6.0 \
 gtkmm-2.4 >= 2.6.0 \
 libgnomecanvasmm-2.6 >= 2.6.0 \
libglademm-2.4 >= 2.4.0 \
--- monster-masher-1.8.1.orig/src/main.cpp
+++ monster-masher-1.8.1/src/main.cpp
@@ -29,9 +29,6 @@
 #include 
 #include 
 
-#include 
-#include 
-
 #include 
 
 #include "main-window.hpp"
@@ -40,11 +37,10 @@
 
 int main(int argc, char *argv[])
 {
-  Gtk::Main main(argc, argv);
+  Glib::OptionContext ctxt;
+  Gtk::Main main(argc, argv, ctxt);
   Gnome::Conf::init();
   Gnome::Canvas::init();
-  
-  gnome_program_init(PACKAGE, VERSION, LIBGNOME_MODULE, argc, argv, NULL);
 
   try {
 // i18n
Description: Port to Gio::Settings.
Debian-Bug: https://bugs.debian.org/885037
Author: Yavor Doganov 
Forwarded: no
Last-Update: 2018-10-21
---

--- monster-masher-1.8.1.orig/Makefile.am
+++ monster-masher-1.8.1/Makefile.am
@@ -6,11 +6,12 @@
 desktop_DATA   = $(desktop_in_files:.desktop.in=.desktop)
 @INTLTOOL_DESKTOP_RULE@
 
-# GConf schema
-schema_in_files = monster-masher.schemas.in
-schemadir = $(sysconfdir)/gconf/schemas
-schema_DATA = $(schema_in_files:.schemas.in=.schemas)
-@INTLTOOL_SCHEMAS_RULE@
+data_convertdir = $(datadir)/GConf/gsettings
+dist_data_convert_DATA = monster-masher.convert
+
+# GSettings schema
+gsettings_SCHEMAS = dk.iola.olau.monster-masher.gschema.xml
+@GSETTINGS_RULES@
 
 # icon
 icondir = $(datadir)/pixmaps
@@ -18,14 +19,7 @@
 
 pixmapdir = $(datadir)/$(PACKAGE)/pixmaps/
 
-EXTRA_DIST = $(desktop_in_files) $(schema_in_files) \
+EXTRA_DIST = $(desktop_in_files) $(gsettings_SCHEMAS) \
  $(desktop_DATA) $(icon_DATA) \
  intltool-merge.in intltool-extract.in intltool-update.in \
  MAINTAINERS
-
-install-data-local:
-   if test -z "$(DESTDIR)" ; then \
-   for p in $(schema_DATA) ; do \
-   GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) 
--makefile-install-rule $(top_builddir)/$$p; \
-   done \
-fi
--- monster-masher-1.8.1.orig/configure.ac
+++ monster-masher-1.8.1/configure.ac
@@ -14,8 +14,7 @@
 AC_PROG_CXX
 
 dnl checks for libraries
-PKG_CHECK_MODULES(DEPS, gconfmm-2.6 >= 2.6.0 \
-gtkmm-2.4 >= 2.6.0 \
+PKG_CHECK_MODULES(DEPS, gtkmm-2.4 >= 2.6.0 \
 libgnomecanvasmm-2.6 >= 2.6.0 \
libglademm-2.4 >= 2.4.0 \
libcanberra)
@@ -23,15 +22,7 @@
 AC_SUBST(DEPS_LIBS)
 

-dnl GConf
-AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
-
-if test x"$GCONFTOOL" = xno; then
-AC_MSG_ERROR([gconftool-2 executable not found in your path - should be 
installed with GConf])
-fi
-
-AM_GCONF_SOURCE_2
-
+GLIB_GSETTINGS
 
 dnl i18n
 ALL_LINGUAS="ar az bg ca cs cy da de dz el en_CA en_GB es eu fi fr ga gu hr hu 
it ka lt lv nb ne nl oc pa pl pt pt_BR rw sl sq sr sr@Latn sv ta tr uk vi zh_CN 
zh_HK zh_TW"
--- /dev/null
+++ monster-masher-1.8.1/monster-masher.convert
@@ -0,0 +1,24 @@
+[dk.iola.olau.monster-masher]
+fullscreen = /apps/monster-masher/fullscreen
+
+[dk.iola.olau.monster-masher.player1]
+left-key = /apps/monster-masher/player1/left_key
+left-up-key = /apps/monster-masher/player1/left_up_key
+up-key = /apps/monster-masher/player1/up_key
+right-up-key = /apps/monster-masher/player1/right_up_key
+right-key = /apps/monster-masher/player1/right_key
+right-down-key = /apps/monster-masher/player1/right_down_key
+down-key = /apps/monster-masher/player1/down_key
+left-down-key = /apps/monster-masher/player1/left_down_key
+pull-key = /apps/monster-masher/player1/pull_key
+
+[dk.iola.olau.monster-masher.player2]
+left-key = /apps/monster-masher/player2/left_key
+left-up-key = /apps/monster-masher/player2/left_up_key
+up-key = /apps/monster-masher/player2/up_key
+right-up-key = /apps/monster-masher/player2/right_up_key
+right-key = /apps/monster-masher/player2/right_key
+right-down-key = /apps/monster-masher/player2/right_down_key
+down-key = /apps/monster-masher/player2/down_key
+left-down-key = /apps/monster-masher/player2/left_down_key
+pull-key = /apps/monster-masher/player2/pull_key
--- /dev/null
+++ mo

Bug#856086: Patch

2018-10-21 Thread Yavor Doganov
tags 856086 + patch
tags 848052 + patch
thanks

Attached is a patch which works for me; it replaces
add-esound-as-dependency.patch.  You only have to replace libesd0-dev
with libcanberra-dev in Build-Depends and also remove -lesd from
DEB_LDFLAGS_MAINT_APPEND.
Description: Remove esound dependency; make sounds playable.
Bug-Debian: https://bugs.debian.org/848052
Bug-Debian: https://bugs.debian.org/856086
Author: Yavor Doganov 
Forwarded: no
Last-Update: 2018-10-20
---

--- monster-masher-1.8.1.orig/configure.ac
+++ monster-masher-1.8.1/configure.ac
@@ -18,7 +18,8 @@
 gconfmm-2.6 >= 2.6.0 \
 gtkmm-2.4 >= 2.6.0 \
 libgnomecanvasmm-2.6 >= 2.6.0 \
-   libglademm-2.4 >= 2.4.0)
+   libglademm-2.4 >= 2.4.0 \
+   libcanberra)
 AC_SUBST(DEPS_CFLAGS)
 AC_SUBST(DEPS_LIBS)
 
--- monster-masher-1.8.1.orig/src/sound.cpp
+++ monster-masher-1.8.1/src/sound.cpp
@@ -18,8 +18,7 @@
  * USA.
  */
 
-#include 
-#include 
+#include 
 
 #include "sound.hpp"
 
@@ -40,16 +39,11 @@
 
 void Sound::play(const std::string )
 {
-  int id;
-  
-  cache_map::iterator i = cache.find(name);
-  if (i != cache.end())
-id = i->second;
-  else {
-id = gnome_sound_sample_load(name.c_str(),
-   (MONSTER_MASHER_SOUND_DIR + name).c_str());
-cache.insert(make_pair(name, id));
-  }
+  static ca_context *ctxt = NULL;
 
-  esd_sample_play(gnome_sound_connection_get(), id);
+  if (!ctxt)
+ca_context_create();
+
+  ca_context_play(ctxt, 0, CA_PROP_MEDIA_FILENAME,
+  (MONSTER_MASHER_SOUND_DIR + name).c_str(), NULL);
 }
--- monster-masher-1.8.1.orig/src/sound.hpp
+++ monster-masher-1.8.1/src/sound.hpp
@@ -38,9 +38,6 @@
   
 private:
   Sound();
-  
-  typedef std::map cache_map;
-  cache_map cache;
 };
 
 #endif


Bug#868411: gniall: Port to GTK+ 3

2018-10-15 Thread Yavor Doganov
Jeremy Bicha wrote:
> Yavor, I'm planning to orphan gniall now. Are you interested in being
> its maintainer in Debian? It's ok if you don't want to.

No, but if it gets orphaned, I can prepare a QA upload fixing other
packaging issues and take care of it in the future (I'm already
subscribed to the PTS), treating it like my own package.  This is more
or less the same thing as adopting it.

It would be great if you can create a repository (possibly using gbp's
--debsnap option), import it at Salsa and grant me commit access.
That way, I can make gradual commits which will be easier to review by
a potential sponsor (rather than a giant debdiff).



Bug#868411: gniall: Port to GTK+ 3

2018-10-15 Thread Yavor Doganov
Jeremy Bicha wrote:
> On Mon, Oct 15, 2018 at 9:13 AM Yavor Doganov  wrote:
> > Please do what you think is best.
> 
> No. I'm delegating this decision to you. There is no upstream. There
> is no Debian maintainer. You're the closest we have to either one of
> those for this package.

If your question is whether I would deal with future bug
reports/regressions/etc if the package stays in Debian, then yes, I
would, to the best of my ability.

BTW, if the Debian maintainer is MIA, why this package is not
orphaned?

> By creating these patches, you are making a statement that you believe
> these apps are worth saving.

How does that follow?  It would never occur to me that I'm making a
statement.  There's an RC bug, my intention is to fix it.  I check if
there's an RM bug or intention to file an RM bug, I check if the bug
is not already fixed upstream and if these are false, I start working
on it.  Evaluating whether it's worth to save the package or kick it
out is sometimes more complex than fixing the bug, furthermore I don't
think I'm qualified to make such evaluations.

> Otherwise, I or someone else would eventually file removal bugs for
> all these packages.

Right, ideally shortly after filing the RC bugs (or raising the
severity) so that people don't lose time to fix RC bugs that are going
to be "fixed" by RMing the package.



Bug#868411: gniall: Port to GTK+ 3

2018-10-15 Thread Yavor Doganov
Jeremy Bicha wrote:
> On Sun, Oct 14, 2018 at 5:00 PM Yavor Doganov  wrote:
> > I am not in a position to decide the faith of a package that I do not
> > maintain.
> 
> With its very low popcon and the fact that it has no maintainer in
> Debian (or anywhere), I think your opinion is the most important here.
> 
> If you want it to stay in Debian, I can sponsor your upload.
> Otherwise, I can file the removal bug now.

Please do what you think is best.  I am just an occasional contributor
providing a patch; I cannot decide whether this package should be
removed.

> I think this is the oldest app I've seen in Debian (based on its
> last upstream release and maintainer upload and lack of NMUs).

The lack of NMUs is a clear indication that it doesn't require
frequent changes and therefore is not a maintenance burden.



Bug#868411: gniall: Port to GTK+ 3

2018-10-14 Thread Yavor Doganov
Jeremy Bicha wrote:
> I think it would be better for Debian for gnial to be removed from
> Debian.  [...] Please let me know what you think we should do here.

I am not in a position to decide the faith of a package that I do not
maintain.  It looks like a tiny little program that doesn't appear to
require too much effort wrt maintenance.  Its usefulness is debatable
but I can say the same about tons of other Debian packages that are
actively maintained upstream but I don't use; that's very subjective.

> I apologize for the time you spent working on this package.

No problem, my patch shouldn't stop you from removing the package if
that is deemed as the better course of action.  (Although if you or
other members of the GNOME team intend to remove rdeps rather than
porting to current APIs, I would appreciate if you communicate your
intention early enough to avoid unnecessary porting work.)



Bug#885115: Patch to eliminate scrollkeeper build-dependency

2018-10-09 Thread Yavor Doganov
tags 885115 + patch
thanks

The dependency can be safely dropped as well; it is unnecessary.
Description: Eliminate scrollkeeper build-dependency.
Bug-Debian: https://bugs.debian.org/885115
Author: Yavor Doganov 
Forwarded: no
Last-Update: 2018-10-09
---


--- grdesktop-0.23+d040330.orig/help/C/Makefile.am
+++ grdesktop-0.23+d040330/help/C/Makefile.am
@@ -22,8 +22,8 @@
 figs = $(top_srcdir)/pixmaps/grdesktop-mainwin.png
 docname = grdesktop
 lang = C
-extraomf = grdesktop-C.omf
-omffile = grdesktop-C.omf
+extraomf =
+omffile =
 entities = legal.xml
 
 include $(top_srcdir)/help/xmldocs.make
@@ -38,10 +38,6 @@
touch omf_timestamp
 
 install-data-hook-omf:
-   $(mkinstalldirs) $(DESTDIR)$(omf_dest_dir)
-   for file in $(extraomf); do \
-   $(INSTALL_DATA) $$file.out $(DESTDIR)$(omf_dest_dir)/$$file; \
-   done
-scrollkeeper-update -p $(scrollkeeper_localstate_dir) -o 
$(DESTDIR)$(omf_dest_dir)
 
 dist-hook: app-dist-hook
--- grdesktop-0.23+d040330.orig/help/C/Makefile.in
+++ grdesktop-0.23+d040330/help/C/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.7.9 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
 # @configure_input@
 
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-# Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -75,17 +75,67 @@
 #  http://scrollkeeper.sourceforge.net/
 #  Version: 0.1.2 (last updated: March 20, 2002)
 #
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
 VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+false; \
+  elif test -n '$(MAKE_HOST)'; then \
+true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+true; \
+  else \
+false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+  ?) ;; \
+  *) echo "am__make_running_with_option: internal error: invalid" \
+  "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+sane_makeflags=$$MFLAGS; \
+  else \
+case $$MAKEFLAGS in \
+  *\\[\ \  ]*) \
+bs=\\; \
+sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+  | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
+esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+test $$skip_next = yes && { skip_next=no; continue; }; \
+case $$flg in \
+  *=*|--*) continue;; \
+-*I) strip_trailopt 'I'; skip_next=yes;; \
+  -*I?*) strip_trailopt 'I';; \
+-*O) strip_trailopt 'O'; skip_next=yes;; \
+  -*O?*) strip_trailopt 'O';; \
+-*l) strip_trailopt 'l'; skip_next=yes;; \
+  -*l?*) strip_trailopt 'l';; \
+  -[dEDm]) skip_next=yes;; \
+  -[JT]) skip_next=yes;; \
+esac; \
+case $$flg in \
+  *$$target_option*) has_opt=yes; break;; \
+esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ../..
-
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
@@ -97,10 +147,42 @@
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
+subdir = help/C
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+   $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+n|no|NO) false;; \
+*) (install-info --version) >/dev/null 2>&1;; \
+  e

Bug#868425: Port to GIO

2018-10-08 Thread Yavor Doganov
tags 868425 + patch
tags 886079 + patch
thanks

Attached is a patch fixing this bug.  The current package doesn't
handle EOF properly and also doesn't close the stream.

Incidentally, the patch fixes #886079 as well.  This package doesn't
use GConf but ends up linking with it due to gnome-vfs-2.0.pc.
Description: Port to GIO.
Bug-Debian: https://bugs.debian.org/868425
Author: Yavor Doganov 
Forwarded: no
Last-Update: 2018-10-08
---


--- gmotionlive-1.0.orig/Makefile
+++ gmotionlive-1.0/Makefile
@@ -5,7 +5,7 @@
 all:   gmotionlive
 
 gmotionlive: gmotionlive.c
-   $(CC) gmotionlive.c -o gmotionlive $(CFLAGS) `pkg-config gtk+-2.0 
--cflags --libs` `pkg-config gnome-vfs-2.0 --cflags --libs`
+   $(CC) gmotionlive.c -o gmotionlive $(CFLAGS) `pkg-config gtk+-2.0 
--cflags --libs`
 
 clean:
rm -f *.o gmotionlive
--- gmotionlive-1.0.orig/gmotionlive.c
+++ gmotionlive-1.0/gmotionlive.c
@@ -9,7 +9,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -207,32 +206,56 @@
return size * nmemb;
 }
 
-void read_callback (GnomeVFSAsyncHandle *handle, GnomeVFSResult result, 
gpointer buffer, GnomeVFSFileSize bytes_requested, GnomeVFSFileSize bytes_read, 
gpointer callback_data)
+void read_callback (GObject *handle, GAsyncResult *result, gpointer 
callback_data)
 {
-   if (result != GNOME_VFS_OK) {
-   failure("gmotionlive can not read from the stream");
+   GFile *file = G_FILE(callback_data);
+   GError *error = NULL;
+   gssize bytes_read;
+
+   bytes_read = g_input_stream_read_finish(G_INPUT_STREAM(handle),
+   result, );
+   if (error) {
+   g_object_unref(handle);
+   g_object_unref(file);
+   g_error_free(error);
+   failure("gmotionlive can not read from the stream");
+   return;
+   }
+
+   if (bytes_read) {
+   netcam_write(buf, 1, bytes_read, NULL);
+   g_input_stream_read_async(G_INPUT_STREAM(handle), buf, 4095,
+ G_PRIORITY_LOW, NULL, read_callback,
+ file);
} else {
-   if (bytes_read)
-   netcam_write(buffer, 1, bytes_read, NULL);
-   gnome_vfs_async_read(handle, buffer, 4095, read_callback, 
"read_callback");
+   g_object_unref(handle);
+   g_object_unref(file);
}
 }
 
-void open_callback (GnomeVFSAsyncHandle *handle, GnomeVFSResult result, 
gpointer callback_data)
+void open_callback (GObject *handle, GAsyncResult *result, gpointer 
callback_data)
 {
-   if (result != GNOME_VFS_OK) {
-   failure("gmotionlive was unable to open the specified stream");
-   } else {
-   gnome_vfs_async_read(handle, buf, 4095, read_callback, 
"read_callback");
+   GFileInputStream *stream;
+   GError *error = NULL;
+
+   stream = g_file_read_finish(G_FILE(handle), result, );
+   if (error) {
+   g_object_unref(handle);
+   g_error_free(error);
+   failure("gmotionlive was unable to open the specified stream");
+   return;
}
+
+   g_input_stream_read_async(G_INPUT_STREAM(stream), buf, 4095,
+ G_PRIORITY_LOW, NULL, read_callback, handle);
 }
 
 int transfer(char *transfer_url)
 {
-   GnomeVFSAsyncHandle *handle;
+   GFile *handle;
 
-   gnome_vfs_async_open(, transfer_url, GNOME_VFS_OPEN_READ,
-   GNOME_VFS_PRIORITY_MIN, open_callback, "open_callback");
+   handle = g_file_new_for_uri(transfer_url);
+   g_file_read_async(handle, G_PRIORITY_LOW, NULL, open_callback, NULL);
 
return 0;
 }
@@ -282,8 +305,6 @@
return 1;
}
 
-   gnome_vfs_init();
-
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
 
gtkimage = gtk_image_new();


Bug#868382: gbatnav: Port to GTK+ 3

2018-09-26 Thread Yavor Doganov
tags 868382 + patch
thanks

Attached is a patch which fixes this bug.  You only have to replace
libgnome2-dev and libgnomeui-dev in Build-Depends with
libgoocanvas-2.0-dev.
Description: Port to GTK+ 3.
 Migrate from libpopt to GOption.
 Migrate frome GnomeCanvas to GooCanvas.
 Migrate from old-style ~/.gnome2 configuration files to GSettings.
Bug-Debian: https://bugs.debian.org/868382
Author: Yavor Doganov 
Forwarded: no
Last-Update: 2018-09-26
---

--- gbatnav-1.0.4cvs20051004.orig/configure.in
+++ gbatnav-1.0.4cvs20051004/configure.in
@@ -12,13 +12,14 @@
 AC_HEADER_STDC
 AC_ARG_PROGRAM
 
-PKG_CHECK_MODULES(GNOME,[libgnomeui-2.0])
+PKG_CHECK_MODULES(GNOME,[goocanvas-2.0])
 AC_SUBST(GNOME_CFLAGS)
 AC_SUBST(GNOME_LIBS)
 
 ALL_LINGUAS="es de pl ja ru fr sv"
 AM_GNU_GETTEXT
 
+GLIB_GSETTINGS
 
 dnl DATADIRNAME is generated by AM_GNU_GETTEXT; 
 dnl note this has to match the path installed by po/Makefile
--- gbatnav-1.0.4cvs20051004.orig/gbnserver/g_interface.h
+++ gbatnav-1.0.4cvs20051004/gbnserver/g_interface.h
@@ -4,7 +4,6 @@
 #define __BN_G_INTERFACE_H__
 
 #include 
-#include 
 #include "protocol.h"
 
 void init_screen();
--- gbatnav-1.0.4cvs20051004.orig/gbnserver/gbnserver.c
+++ gbatnav-1.0.4cvs20051004/gbnserver/gbnserver.c
@@ -30,7 +30,9 @@
 
 /* Includes de la interface */
 #include 
-#include 
+#include 
+#include 
+#include 
 
 #include "protocol.h"  /* definicion del protocolo */
 #include "server.h"
@@ -58,21 +60,54 @@
 extern struct { char *nombre; } st_nombres[];
 
 /* This describes all the arguments we understand.  */
-static struct poptOption options[] =
+static GOptionEntry options[] =
 {
-   { "port", 'p', POPT_ARG_INT, , 0,  N_("PORT"), N_("Port 
number. Default is 1995")},
+   { "port", 'p', G_OPTION_FLAG_NONE, G_OPTION_ARG_INT, , 
N_("Port number. Default is 1995"), N_("PORT")},
 #ifdef WITH_GGZ
-   { "ggz", 0, POPT_ARG_NONE, _ggz, 0,  NULL, N_("Enables GGZ 
mode")},
+   { "ggz", 0, G_OPTION_FLAG_NONE, G_OPTION_ARG_NONE, _ggz, 
N_("Enables GGZ mode"), NULL},
 #endif /* WITH_GGZ */
-   { NULL, '\0',  0, NULL  }
+   { NULL }
 };
 
-void init_args( void )
+
+/* Migrate old settings from ~/.gnome2/gbnserver.  */
+static void migrate_old_settings( GSettings *settings )
 {
-   usuario.port = 
gnome_config_get_int_with_default("/gbnserver/data/port=1995",NULL);
+   GKeyFile *kf;
+   gchar *file;
+
+   kf = g_key_file_new();
+   file = g_build_filename(g_get_home_dir(), ".gnome2",
+   "gbnserver", NULL);
+   if(g_key_file_load_from_file(kf, file, G_KEY_FILE_NONE, NULL)) {
+   gchar **groups;
+   gsize len;
+
+   /* File exists but if the user never changed the
+  settings it will contain only the Placement section
+  (automatically created internal Bonobo stuff).  */
+   groups = g_key_file_get_groups(kf, );
+   if(len > 1) {
+   gint i;
+
+   i = g_key_file_get_integer(kf, "data", "port", NULL);
+   g_settings_set_uint(settings, "port", i);
+   fprintf(stdout,
+   _("Sucessfully migrated old settings.\n"));
+} else
+   fprintf(stdout,
+   _("Found empty old config file; deleted.\n"));
+
+   g_strfreev(groups);
+   g_unlink(file);
+   }
+   g_free(file);
+   g_key_file_free(kf);
+}
 
-   gnome_config_set_int("/gbnserver/data/port",usuario.port);
-   gnome_config_sync();
+void init_args( GSettings *settings )
+{
+   usuario.port = g_settings_get_uint(settings, "port");
 }
 /***
funciones relacionadas con las tablas 
@@ -116,7 +151,7 @@
 void borrar_jugador( int num_jug )
 {
if( ! usuario.with_ggz )
-   gdk_input_remove( usuario.tag[num_jug] );
+   g_source_remove( usuario.tag[num_jug] );
 #ifdef WITH_GGZ
else
batnavggz_del_fd(usuario.nro_fd[num_jug]);
@@ -325,31 +360,36 @@
return BATNAV_STATUS_SUCCESS;
 }
 
-void ex_loop( gpointer data, gint que_sock, GdkInputCondition GDK_INPUT_READ)
+gboolean ex_loop( GIOChannel *src, GIOCondition cond, gpointer data )
 {
-   int i,j,k,client_len;
+   guint i;
+   int j,que_sock,client_len;
 char str[150];
 struct sockaddr client;
+GIOChannel *channel;
 
client_len = sizeof(client);
-   k = que_sock;
+   que_sock = g_io_channel_unix_get_fd(src);

if( que_sock==usuario.sock ) { /* AF_INET */

Bug#868424: gnome-breakout: Port to GooCanvas / GTK+ 3

2018-09-11 Thread Yavor Doganov
tags 868424 + patch
thanks

Attached is a patch which fixes this this bug.
--- gnome-breakout-0.5.3.orig/debian/control
+++ gnome-breakout-0.5.3/debian/control
@@ -4,7 +4,7 @@ Priority: optional
 Maintainer: Debian Games Team 
 Uploaders: Barry deFreese , 
Vincent Legout 
-Build-Depends: debhelper (>= 9), libgnomeui-dev, libglib2.0-dev, 
autotools-dev, dh-autoreconf
+Build-Depends: debhelper (>= 9), libgoocanvas-2.0-dev, 
libgnome-games-support-1-dev, autotools-dev, dh-autoreconf
 Standards-Version: 3.9.4
 Vcs-Svn: svn://svn.debian.org/svn/pkg-games/packages/trunk/gnome-breakout/
 Vcs-Browser: 
http://svn.debian.org/wsvn/pkg-games/packages/trunk/gnome-breakout/
--- gnome-breakout-0.5.3.orig/debian/copyright
+++ gnome-breakout-0.5.3/debian/copyright
@@ -14,3 +14,9 @@ You are free to distribute this software
 the GNU General Public License.
 On Debian systems, the complete text if the GNU General Public
 License can be found in /usr/share/common-licenses/GPL
+
+As the program links dynamically with libgnome-games-support, the
+package is distributed under the terms of the GNU General Public
+License, version 3 or later.
+On Debian systems, the complete text if the GNU General Public
+License, version 3 can be found in /usr/share/common-licenses/GPL-3.
--- gnome-breakout-0.5.3.orig/debian/patches/09_goocanvas_port.patch
+++ gnome-breakout-0.5.3/debian/patches/09_goocanvas_port.patch
@@ -0,0 +1,2017 @@
+Description: Port to GooCanvas / GTK+ 3.
+ Migrate from old-style ~/.gnome2 configuration file to GSettings.
+ Use libgnome-games-support as replacement of libgnome's gnome-scores.
+Bug-Debian: https://bugs.debian.org/868424
+Author: Yavor Doganov 
+Forwarded: no
+Last-Update: 2018-09-11
+---
+
+--- gnome-breakout-0.5.3.orig/configure.in
 gnome-breakout-0.5.3/configure.in
+@@ -4,7 +4,7 @@
+ AC_CONFIG_SRCDIR(src/gnome-breakout.c)
+ AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
+ 
+-PKG_CHECK_MODULES(GNOMEUI, libgnomeui-2.0)
++PKG_CHECK_MODULES(GNOMEUI, goocanvas-2.0 libgnome-games-support-1)
+ AC_SUBST(GNOMEUI_CFLAGS)
+ AC_SUBST(GNOMEUI_LIBS)
+ 
+@@ -17,6 +17,10 @@
+ AC_ISC_POSIX
+ AC_HEADER_STDC
+ 
++GLIB_GSETTINGS
++# Avoid installation of schema in /usr/share/games.
++AC_SUBST(gsettingsschemadir, [${prefix}/share/glib-2.0/schemas])
++
+ GETTEXT_PACKAGE=gnome-breakout
+ ALL_LINGUAS="ru tr de sv"
+ AM_GLIB_GNU_GETTEXT
+--- gnome-breakout-0.5.3.orig/src/breakout.h
 gnome-breakout-0.5.3/src/breakout.h
+@@ -7,9 +7,7 @@
+  * "COPYING" for more details.
+  */
+ 
+-#include 
+-#include 
+-#include 
++#include 
+ 
+ /*
+  * Dimensions.
+@@ -56,7 +54,7 @@
+   gint frame_no;
+   gint num_frames;
+   GdkPixbuf **pixmaps;
+-  GnomeCanvasItem *canvas_item;
++  GooCanvasItem *canvas_item;
+   AnimType type;
+ } Animation;
+ 
+@@ -139,6 +137,9 @@
+ #define ADD_SCORE(game, _score) game->score += _score * 
game->flags->score_modifier
+ 
+ typedef struct {
++  GSettings *settings;
++  gboolean migrated;
++
+   /* User set values */
+   Difficulty difficulty;
+   Difficulty next_game_difficulty;
+@@ -155,7 +156,7 @@
+   gboolean pause_on_pointer;
+   gboolean pause_on_pref;
+   gint bounce_entropy;
+-  GList *level_files;
++  gchar **level_files;
+ 
+   /* Computed values */
+   gdouble score_modifier;
+--- gnome-breakout-0.5.3.orig/src/gui.h
 gnome-breakout-0.5.3/src/gui.h
+@@ -7,6 +7,8 @@
+  * "COPYING" for more details.
+  */
+ 
++#include 
++
+ void gui_init(Game *game, int argc, char **argv);
+ void add_to_canvas(Entity *entity);
+ void remove_from_canvas(Entity *entity);
+@@ -23,10 +25,12 @@
+ /* This holds pointers to objects in the currently running GNOME app. It 
should
+  * only be used in gui.c and gui-callbacks.c */
+ typedef struct {
+-  GnomeApp *app;
+-  GnomeCanvas *canvas;
+-  GnomeCanvasItem *title_image;
+-  GnomeCanvasItem *background;
++  GtkWindow *app;
++  GamesScoresCategory *category;
++  GamesScoresContext *scores;
++  GooCanvas *canvas;
++  GooCanvasItem *title_image;
++  GooCanvasItem *background;
+   GtkWidget *vbox;
+   GtkWidget *label_hbox1;
+   GtkWidget *label_hbox2;
+--- gnome-breakout-0.5.3.orig/src/flags.c
 gnome-breakout-0.5.3/src/flags.c
+@@ -8,6 +8,8 @@
+  * "COPYING" for more details.
+  */
+ 
++#include 
++#include 
+ #include "breakout.h"
+ #include "flags.h"
+ #include "util.h"
+@@ -23,10 +25,10 @@
+ #define DEFAULT_PAUSE_ON_POINTER "true"
+ #define DEFAULT_PAUSE_ON_PREF "true"
+ #define DEFAULT_HIDE_POINTER "true"
+-#define DEFAULT_LEFT_KEY GDK_Left
+-#define DEFAULT_RIGHT_KEY GDK_Right
+-#define DEFAULT_FIRE1_KEY GDK_z
+-#define DEFAULT_FIRE2_KEY GDK_x
++#define DEFAULT_LEFT_KEY GDK_KEY_Left
++#define DEFAULT_RIGHT_KEY GDK_KEY_Right
++#define DEFAULT_FIRE1_KEY GDK_KEY_z
++#define DEFAULT_FIRE2_KEY GDK_KEY_x

Bug#822590: Patch to remove python-gtksourceview2 dependency

2018-09-06 Thread Yavor Doganov
tags 822590 + patch
thanks

Attached is a simplistic patch that fixes this bug.
--- liblunar-2.0.1.orig/configure.ac
+++ liblunar-2.0.1/configure.ac
@@ -153,12 +153,10 @@
 if test "x$have_python" != "xno"; then
PYGOBJECT_REQUIRED=2.15.4
PYGTK_REQUIRED=2.12.0
-   PYGTKSOURCEVIEW_REQUIRED=2.2.0
 
PKG_CHECK_MODULES([PYGTK], [
pygobject-2.0 >= $PYGOBJECT_REQUIRED
-   pygtk-2.0 >= $PYGTK_REQUIRED
-   pygtksourceview-2.0 >= $PYGTKSOURCEVIEW_REQUIRED],
+   pygtk-2.0 >= $PYGTK_REQUIRED],
[],
[
have_python=no


Bug#790584: Bug fixed upstream

2018-09-06 Thread Yavor Doganov
tags 790584 + fixed-upstream
thanks

This bug is fixed in the latest upstream release.



Bug#790196: rasmol: Port to GTK+ 3 / VTE 2.91

2018-09-06 Thread Yavor Doganov
tags 790196 + patch
thanks

Attached is a patch which should fix this bug.

I used molecule files from src:avogadro to test.  (I think) I tried
all actions and couldn't spot any problems.  One known regression is
that the accelerators don't work when the menubar is hidden.  (I've
made only F9 to work so that the menubar can be brought back.)  There
might be other regressions as I'm not familiar with GTK+ API and I'm
not a proper programmer either.  One minor improvement is that the
tooltips work.

The second patch is only remotely related, it fixes the build system
so that LDFLAGS get inherited from the environment.  This is necessary
because traditionally GNOME/GTK+ libraries expose their dependencies
which results in overlinking causing unnecessary dependencies.

The third patch should fix the FTBFS on GNU/Hurd (untested).

I just subsribed to this package and will do my best to fix any issues
that arise as a result of my porting attempt.
>From 0545dcee54c57128d82872e2a016f8c43978530a Mon Sep 17 00:00:00 2001
From: Yavor Doganov 
Date: Thu, 6 Sep 2018 13:53:09 +0300
Subject: [PATCH 1/3] Port to GTK+ 3 / VTE 2.91

---
 debian/control|3 +-
 debian/patches/14_gtk3-port.patch | 1979 +
 debian/patches/series |1 +
 3 files changed, 1981 insertions(+), 2 deletions(-)
 create mode 100644 debian/patches/14_gtk3-port.patch

diff --git a/debian/control b/debian/control
index 4bdd239..b7a9bd4 100644
--- a/debian/control
+++ b/debian/control
@@ -10,8 +10,7 @@ Build-Depends: debhelper (>= 11~),
libxext-dev,
libxi-dev,
x11proto-core-dev,
-   libvte-dev,
-   libgtk2.0-dev,
+   libvte-2.91-dev,
libcbf-dev,
libcvector2-dev,
libcqrlib2-dev,
diff --git a/debian/patches/14_gtk3-port.patch 
b/debian/patches/14_gtk3-port.patch
new file mode 100644
index 000..afd8bbe
--- /dev/null
+++ b/debian/patches/14_gtk3-port.patch
@@ -0,0 +1,1979 @@
+Description: Port to GTK+ 3 and VTE 2.91.
+ The real changes required are minimalistic; this patch is largish
+ because I wanted to avoid the deprecated API which will be removed in
+ GTK+ 4 (GtkUIManager, GtkAction and friends) and would require yet
+ another porting effort.  I deliberately chose to use the basic API
+ (rather than GtkBuilder, GtkApplication and GAction) because the GTK+
+ folks have a tendency to deprecate these high level APIs fairly
+ quickly.  Another reason for this choice is that I wanted to avoid
+ XML stuff; I find it extremely unpleasant to deal with.
+ .
+ However, this approach made the patch convoluted as I realized way
+ too late that there is a fully-fledged popup menu with nearly all
+ actions exposed.  These have to be kept in sync programmatically,
+ which is done in a clumsy/inefficient way.
+Debian-Bug: https://bugs.debian.org/790196
+Author: Yavor Doganov 
+Forwarded: no
+Last-Update: 2018-09-06
+---
+
+--- rasmol.orig/src/Imakefile
 rasmol/src/Imakefile
+@@ -131,9 +131,8 @@
+ #endif
+ 
+ #ifdef GTKWIN
+-#GTKLIBS = $(shell pkg-config --libs vte gtk+-2.0)
+-GTKLIBS = -lvte -lgtk-x11-2.0 -lgdk-x11-2.0 -lgdk_pixbuf-2.0 -lgobject-2.0 
-lglib-2.0 -lcairo -lX11
+-GTKCFLAGS = $(shell pkg-config --cflags vte gtk+-2.0)
++GTKLIBS = $(shell pkg-config --libs vte-2.91)
++GTKCFLAGS = $(shell pkg-config --cflags vte-2.91)
+ GUISRC = gtkwin.c eggfileformatchooser.c 
+ GUIOBJ = gtkwin.o eggfileformatchooser.o
+ GUIDEF = -DGTKWIN
+@@ -437,13 +436,9 @@
+ 
+ gtkwin.c: gtkui.h
+ 
+-gtkui.h: sizechooser.glade printing-resolution.glade actionmenu.gtk
++gtkui.h: sizechooser.glade printing-resolution.glade
+echo "/* Automatically generated GTK ui definitions, do not edit! */" 
> gtkui.h
+echo >> gtkui.h
+-   echo "const gchar *actionmenu_str = \"\\" >> gtkui.h
+-   cat actionmenu.gtk | sed "s/$$/\\\/" | sed 's/"/\\\"/g' >> gtkui.h
+-   echo "\";" >> gtkui.h
+-   echo >> gtkui.h
+echo "const gchar *sizechooser_str = \"\\" >> gtkui.h
+gtk-builder-convert -w sizechooser.glade - | sed "s/$$/\\\/" | sed 
's/"/\\\"/g' >> gtkui.h
+echo "\";" >> gtkui.h
+@@ -452,4 +447,3 @@
+gtk-builder-convert -w printing-resolution.glade - | sed "s/$$/\\\/" | 
sed 's/"/\\\"/g' >> gtkui.h
+echo "\";" >> gtkui.h
+echo >> gtkui.h
+-   gdk-pixbuf-csource --name=rasmol_icon --struct rasmol_48x48.xpm  >> 
gtkui.h
+--- rasmol.orig/src/eggfileformatchooser.h
 rasmol/src/eggfileformatchooser.h
+@@ -19,7 +19,7 @@
+ #ifndef __EGG_FILE_FORMAT_CHOOSER_H__
+ #define __EGG_FILE_FORMAT_CHOOSER_H__
+ 
+-#include 
++#include 
+ 
+ G_BEGIN_DECLS
+ 
+--- rasmol.orig/src/gtkwin.c
 rasmol/src/gtkw

Bug#885823: evolution-rss: raising severity of gconf dependency bug

2018-09-02 Thread Yavor Doganov
retitle 885823 evolution-rss: Unnecessary Build-Depends on libgconf2-dev
thanks

On Mon, Mar 12, 2018 at 03:40:35PM -0400, Jeremy Bicha wrote:
> Please try to port your package away from gconf.

AFAICS it's already ported and the code uses conditionals based on
EVOLUTION_VERSION, which evaluate to true.  The only thing that has to
be done is to remove libgconf2-dev from B-D.



Bug#907691: petri-foo: License incompatibility: links with OpenSSL

2018-08-31 Thread Yavor Doganov
Package: petri-foo
Version: 0.1.87-4
Severity: serious

This package is licensed under GPLv2 only but links with the OpenSSL
library which makes it impossible for distribution as the licenses are
incompatible.  See

https://www.gnu.org/licenses/license-list.html#OpenSSL
https://people.gnome.org/~markmc/openssl-and-the-gpl.html

You either have to ask the copyright holders to release it under GPL +
OpenSSL exception or modify it to link with another cryptographic
library such as GnuTLS.

-- System Information:
Debian Release: buster/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'testing-debug'), (500, 
'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.17.0-3-amd64 (SMP w/2 CPU cores)
Locale: LANG=bg_BG.UTF-8, LC_CTYPE=bg_BG.UTF-8 (charmap=UTF-8), 
LANGUAGE=bg_BG.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages petri-foo depends on:
ii  libart-2.0-2  2.3.21-3
ii  libasound21.1.6-1
ii  libatk1.0-0   2.28.1-1
ii  libc6 2.27-5
ii  libcairo2 1.15.12-1
ii  libfontconfig12.13.0-5
ii  libfreetype6  2.8.1-2
ii  libgdk-pixbuf2.0-02.36.12-2
ii  libglib2.0-0  2.56.1-2
ii  libgnomecanvas2-0 2.30.3-3
ii  libgtk2.0-0   2.24.32-3
ii  libjack-jackd2-0 [libjack-0.125]  1.9.12~dfsg-2
ii  liblo70.29-1
ii  libpango-1.0-01.42.4-2
ii  libpangocairo-1.0-0   1.42.4-2
ii  libpangoft2-1.0-0 1.42.4-2
ii  libpangoxft-1.0-0 1.42.4-2
ii  libsamplerate00.1.9-2
ii  libsndfile1   1.0.28-4
ii  libssl1.1 1.1.1~~pre9-1
ii  libxml2   2.9.4+dfsg1-7+b1

petri-foo recommends no packages.

petri-foo suggests no packages.

-- no debconf information



Bug#885740: gnomekiss: Port to GTK+ 3

2018-08-21 Thread Yavor Doganov
Yavor Doganov wrote:
> Please find attached a patch that ports the program to GTK+ 3.

I wasn't careful enough; my patch introduces memory leaks.  Please
find attached an updated version (compressed); please use it instead.
Thanks.


gtk3-port.patch.xz
Description: Binary data


Bug#885742: linsmith: GTK+ 3 / GooCanvas port may be available upstream

2018-08-20 Thread Yavor Doganov
I started working on this bug but fortunately discovered fairly
quickly that upstream is on the way of moving to GTK+ 3:

https://sourceforge.net/p/linsmith/discussion/389360/thread/90b515fb/#01e5/f302

You might want to check the status, it would be a pity if this package
has to be removed for buster.  Even if the port is not completely
finished, please encourage him to publish the work either as a VCS
branch or as a patch so that we can help get it done.



Bug#885740: gnomekiss: Port to GTK+ 3

2018-08-20 Thread Yavor Doganov
tags 885740 + patch
thanks

Please find attached a patch that ports the program to GTK+ 3.  I
tested it with a couple of paper dolls from the website that is given
at the homepage [0] and observed no problems.

[0] http://www.otakuworld.com/kiss/

I also took the opportunity to migrate the old settings in ~/.gnome2
to GSettings and sucessfully tested all migration scenarios.

There are a few (minor?) issues, though:

  * The accelerators of the Colors menu don't work and I don't know
why.  This is the case with the current package as well so at
least it is not a regression.

  * The toolbar looks terrible and is probably close to useless.  I
couldn't find suitable replacements for the colored books which
are no longer available as stock icons, so there are 10 completely
identical icons now.

  * In the Preferences dialog, the GtkEntry for the midi player is
aligned on the right and way too far from the label.  I tried
different approaches, including the official API recommendation to
use gtk_grid_attach_next_to, but it doesn't work.  I hope someone
familiar with the GTK+ API will find out what the problem is.
Description: Port to GTK+ 3 and GSettings.
Bug-Debian: https://bugs.debian.org/885740
Author: Yavor Doganov 
Forwarded: no
Last-Update: 2018-08-20
---

--- gnomekiss-2.0.orig/configure.in
+++ gnomekiss-2.0/configure.in
@@ -10,7 +10,7 @@
 AM_PROG_CC_STDC
 AC_HEADER_STDC
 
-pkg_modules="libgnomeui-2.0"
+pkg_modules="gtk+-3.0 libcanberra"
 PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
 AC_SUBST(PACKAGE_CFLAGS)
 AC_SUBST(PACKAGE_LIBS)
@@ -22,6 +22,7 @@
 dnl Add the languages which your application supports here.
 ALL_LINGUAS="en_GB es es_ES"
 AM_GLIB_GNU_GETTEXT
+GLIB_GSETTINGS
 
 AC_OUTPUT([
 Makefile
--- gnomekiss-2.0.orig/src/main.c
+++ gnomekiss-2.0/src/main.c
@@ -20,64 +20,114 @@
 #  include 
 #endif
 
-#include 
+#include 
+#include 
+#include 
 
 #include "interface.h"
 #include "support.h"
 #include "kiss.h"
 
 /* Implementation */
-GtkWidget *app, *area, *appbar, *pref_dialog, *error_clist;
-GtkWidget *about, *error_list, *set_open, *config_open, *add_open;
+GtkWidget *app, *area, *appbar, *pbar, *error_clist;
+GtkWidget *about, *error_list;
 GtkWidget *buttons[SETS], *items[SETS];
 
 static GtkTargetEntry targets[1]= { { "text/uri-list", 0, 1} };
 
-static void set_toggle(char *toggle, gboolean value) {
-  GtkWidget *widget;
-
-  widget = lookup_widget(pref_dialog, toggle);
-  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), value);
-}
-
 static void preferences(void) {
-  GtkWidget *widget;
+  GKeyFile *kf;
+  gchar *file;
 
-  gnome_config_push_prefix("/GnomeKiss/");
-  prefs.midi= gnome_config_get_bool("Sound/midi=true");
-  set_toggle("pref_midi", prefs.midi);
-
-  prefs.midi_player= gnome_config_get_string("Sound/midi_player=playmidi");
-  widget = lookup_widget(pref_dialog, "pref_midi_player");
-  gtk_entry_set_text(GTK_ENTRY(widget), prefs.midi_player);
-
-  prefs.esound= gnome_config_get_bool("Sound/esound=true");
-  set_toggle("pref_esound", prefs.esound);
-
-  prefs.error_list= gnome_config_get_bool("Diagnostics/error_list=true");
-  set_toggle("pref_error_list", prefs.error_list);
-  prefs.warnings= gnome_config_get_bool("Diagnostics/warnings=true");
-  set_toggle("pref_warnings", prefs.warnings);
-  prefs.trace= gnome_config_get_bool("Diagnostics/trace=false");
-  set_toggle("pref_trace", prefs.trace);
-
-  prefs.ignore_colon= gnome_config_get_bool("Features/ignore_colon=false");
-  set_toggle("pref_ignore_colon", prefs.ignore_colon);
-  prefs.fkiss_case= gnome_config_get_bool("Features/fkiss_case=false");
-  set_toggle("pref_fkiss_case", prefs.fkiss_case);
-  prefs.default_palette= 
gnome_config_get_bool("Features/default_palette=false");
-  set_toggle("pref_default_palette", prefs.default_palette);
-  
-  prefs.speed_factor= gnome_config_get_int("Features/speed_factor=1");
-  widget = lookup_widget(pref_dialog, "pref_speed_factor");
-  
gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget),(gfloat)prefs.speed_factor);
-
-  prefs.min_timer= gnome_config_get_int("Features/min_timer=1");
-  widget = lookup_widget(pref_dialog, "pref_min_timer");
-  gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget),(gfloat)prefs.min_timer);
+  settings = g_settings_new("org.tlrmx.devel.GnomeKiss");
 
-  prefs.catch_drop= gnome_config_get_bool("Features/catch_drop=false");
-  set_toggle("pref_catch_drop", prefs.catch_drop);
+  /* Migrate old settings; code can be dropped for bullseye.  */
+  kf = g_key_file_new();
+  file = g_build_filename(g_get_home_dir(), ".gnome2", "GnomeKiss", NULL);
+
+  if (g_key_file_load_

Bug#906522: price.app: Does not start: Bad application class '(null)' specified

2018-08-17 Thread Yavor Doganov
Package: price.app
Version: 1.3.0-2
Severity: grave

$ PRICE
2018-08-18 02:38:40.000 PRICE[5441:5441] Bad application class '(null)' 
specified
2018-08-18 02:38:40.440 PRICE[5441:5441] styleoffsets ... guessing offsets
2018-08-18 02:38:40.441 PRICE[5441:5441] styleoffsets ... guessing offsets
Fontconfig error: failed reading config file
...

And it's stuck; no app icon, menu, window, etc.  This happens because
/usr/lib/GNUstep/Applications/PRICE.app/Resources is an empty directory.
I guess the intention was to be a symlink pointing to
/usr/share/GNUstep/PRICE.app but the the transition was not handled
properly.

-- System Information:
Debian Release: buster/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'testing-debug'), (500, 
'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.17.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=bg_BG.UTF-8, LC_CTYPE=bg_BG.UTF-8 (charmap=UTF-8), 
LANGUAGE=bg_BG.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages price.app depends on:
ii  gnustep-back0.26  0.26.2-4
ii  gnustep-base-runtime  1.25.1-4
ii  gnustep-gui-runtime   0.26.2-3+b2
ii  libc6 2.27-5
ii  libgnustep-base1.25   1.25.1-4

ii  libgnustep-gui0.260.26.2-3+b2
ii  libobjc4  8.2.0-4

price.app recommends no packages.

price.app suggests no packages.

-- no debconf information



Bug#903829: myspell-bg: Package not installable; upgrades from 4.1-4 impossible

2018-07-15 Thread Yavor Doganov
Package: myspell-bg
Version: 4.1-5
Severity: serious

This change (commit 311c4d9)

   * make myspell-bg a transitional package depending on hunspell-bg
 (Closes: #898709)

does not work as intended, because hunspell-bg conflicts with
myspell-bg.  It also prevents migration to testing:

$ grep-excuses bgoffice
bgoffice (4.1-4 to 4.1-6)
Maintainer: Damyan Ivanov
31 days old (needed 5 days)
Rejected due to piuparts regression -
https://piuparts.debian.org/sid/source/b/bgoffice.html

I'm not sure what is the best course of action (perhaps reassign to
hunspell-bg with request to remove the Conflicts relationship or replace
it with versioned Breaks, downgrading severity).



Bug#896939: wmweather+: Segfaults on startup

2018-04-26 Thread Yavor Doganov
Package: wmweather+
Version: 2.15-1.1+b2
Severity: grave

Happens with or without user configuration file.  Here's the backtrace:

Program received signal SIGSEGV, Segmentation fault.
__strcasecmp_l_ssse3 () at ../sysdeps/x86_64/multiarch/../strcmp.S:173
173 ../sysdeps/x86_64/multiarch/../strcmp.S: Няма такъв файл или директория.
(gdb) bt
#0  __strcasecmp_l_ssse3 () at ../sysdeps/x86_64/multiarch/../strcmp.S:173
#1  0x77bce228 in CreateColors (display=display@entry=0x557a9830, 
attributes=attributes@entry=0x7fffe040, colors=0x557bca90, 
ncolors=ncolors@entry=5, image_pixels=image_pixels@entry=0x557bbec0, 
mask_pixels=mask_pixels@entry=0x557bbe90, mask_pixel_index=0x7fffbd74, 
alloc_pixels=0x557bbe60, nalloc_pixels=0x7fffbd78, 
used_pixels=0x557bbe30, nused_pixels=0x7fffbd7c) at 
../../src/create.c:652
#2  0x77bd0011 in xpmParseDataAndCreate 
(display=display@entry=0x557a9830, data=data@entry=0x7fffbeb0, 
image_return=image_return@entry=0x7fffdf38, 
shapeimage_return=shapeimage_return@entry=0x7fffdf40, 
image=image@entry=0x7fffbe50, info=info@entry=0x7fffbe70, 
attributes=0x7fffe040) at ../../src/create.c:2118
#3  0x77bcb07f in XpmCreateImageFromData 
(display=display@entry=0x557a9830, data=0x55775b60 , 
image_return=image_return@entry=0x7fffdf38, 
shapeimage_return=0x7fffdf40, attributes=0x7fffe040) at 
../../src/CrIFrDat.c:65
#4  0x77bcb40a in XpmCreatePixmapFromData (display=0x557a9830, 
d=159, data=data@entry=0x55775b60 , 
pixmap_return=pixmap_return@entry=0x7fffe030, 
shapemask_return=shapemask_return@entry=0x7fffe038, 
attributes=attributes@entry=0x7fffe040) at ../../src/CrPFrDat.c:59
#5  0x55569cb1 in GetXPM (wmgen=wmgen@entry=0x7fffe030, 
pixmap_bytes=pixmap_bytes@entry=0x55775b60 ) at 
wmgeneral-x11.c:117
#6  0x5556086b in init_font (i=i@entry=1) at font.c:61
#7  0x5556092d in DrawChar (x=x@entry=7, y=y@entry=17, c=, font=font@entry=1) at font.c:143
#8  0x55560ada in DrawString (x=x@entry=7, y=y@entry=17, str=, font=font@entry=1) at font.c:72
#9  0xc624 in DrawDisplay (force=) at dock.c:443
#10 0x90a3 in main (argc=1, argv=0x7fffe458) at wmweather+.c:735

-- System Information:
Debian Release: buster/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'testing-debug'), (500, 
'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.15.0-3-amd64 (SMP w/2 CPU cores)
Locale: LANG=bg_BG.UTF-8, LC_CTYPE=bg_BG.UTF-8 (charmap=UTF-8), 
LANGUAGE=bg_BG.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages wmweather+ depends on:
ii  libc62.27-3
ii  libcurl3-gnutls  7.58.0-2
ii  libpcre3 2:8.39-9
ii  libwraster6  0.95.8-2
ii  libx11-6 2:1.6.5-1
ii  libxext6 2:1.3.3-1+b2
ii  libxpm4  1:3.5.12-1

wmweather+ recommends no packages.

Versions of packages wmweather+ suggests:
ii  metacity [x-window-manager]  1:3.28.0-1
ii  mutter [x-window-manager]3.28.1-2
ii  wmaker [x-window-manager]0.95.8-2
pn  xless

-- no debconf information



Bug#893442: lynkeos.app: FTBFS on ppc64el: AltiVec argument passed to unprototyped function

2018-03-22 Thread Yavor Doganov
Frédéric Bonnard wrote:
> I'm not an altivec expert but I was interested to look into this and
> maybe help.

Many thanks for taking the time and effort, this is exactly the
response I was hoping for.

> When I compile :
> __vector unsigned char Va = vec_pack(vec_pack(vec_ctu(Vperma, 0), 
> vec_splat_u32(0)), vec_splat_u16(0));
> __vector unsigned char Vb = vec_pack(vec_pack(vec_ctu(Vpermb, 0), 
> vec_splat_u32(0)), vec_splat_u16(0));
> 
> and print those, I have : 
> Va :  3  3  8  8 0 0 0 0 0 0 0 0 0 0 0 0
> Vb : 10 10 10 10 0 0 0 0 0 0 0 0 0 0 0 0

This looks bogus; either a bug in my code or the unfortunate result of
the type conversion.  Knowing me, I would definitely bet it's the
former :)

Out of curiosity, how do you print vectors?  Is there a specific
function or you write your own?

> So with this :
> vector unsigned char Va = { 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 6, 7, 4, 5, 6, 7 };
> vector unsigned char Vb = { 8, 9, 10, 11, 8, 9, 10, 11, 12, 13, 14, 15, 12, 
> 13, 14, 15};
> we get the following indexes :
> Va : 0 1 2 3 0 1 2 3 4 5 6 7 4 5 6 7
> Vb : 8 9 a b 8 9 a b c d e f c d e f
> 
> which extracts good looking floats.

Thanks, I will use your version of the patch.

> I also extracted part of the computation code to test the computation
> done with some random floats and check if the results make some sense which
> seems to be the case (in terms of addition, multiplication, load/store).
> I also did this on powerpc, ppc64 and ppc64el to see if I had some
> endianness issue, but I got the same results on the 3 archs.

Thanks for doing this, I was going to ask if it's possible to check
for endianness bugs as well but thought it would be too pushy.  As
ppc64el is a relevantly new architecture it's quite common to see code
assuming big endian (powerpc/pcc64).

If my grasp of GCC's configuration is correct, this particular snippet
is conditionally compiled only on ppc64el because -mvsx is the default
which implies -maltivec.  This is not the case for the other PowerPC
ports which (should) support machines without AltiVec, so it would be
a bug in the package if it assumed AltiVec everywhere.

Anyway, it's good to know that it works as expected on the other
PowerPC ports.

> The best would be to test all this in real by running lynkeos.app's
> deconvulation, or at least compile part of the original code on Mac
> OS X and check if the indexes used here gives the same results
> compared to the original ones.

I don't have access to Mac OS X and wouldn't want to use it even if I
had.  It is natural to ask the upstream author to perform this test
but his email bounces.  And I never received a response from the
person who ported the 1.x series to GNUstep.

If you have some spare time and direct access to a GNU/Linux PowerPC
machine, perhaps you can compare the results (visually) with another
common architecture by processing the same image?  Or on powerpc/ppc64
with and without AltiVec.



Bug#893442: lynkeos.app: FTBFS on ppc64el: AltiVec argument passed to unprototyped function

2018-03-18 Thread Yavor Doganov
Source: lynkeos.app
Version: 2.10+dfsg1-2
Severity: serious
Tags: patch
User: debian-powe...@lists.debian.org
Usertags: ppc64el

I would appreciate if someone knowledgeable from -powerpc confirms
that the attached patch is correct.  The build failure is:

gcc /<>/lynkeos.app-2.10+dfsg1/GNUstep/../Sources/MyDeconvolution.m 
-c \
  -MMD -MP -Wdate-time -D_FORTIFY_SOURCE=2 -I. -I.. 
-I/<>/lynkeos.app-2.10+dfsg1/GNUstep.. 
-I/<>/lynkeos.app-2.10+dfsg1/GNUstep/../Sources 
-I/<>/lynkeos.app-2.10+dfsg1/GNUstep/../ThreadConnectionSources 
-I/<>/lynkeos.app-2.10+dfsg1/GNUstep/../ThirdPartySources/SMDoubleSlider
 -DNO_FRAMEWORK_CHECK=1 -DGNUSTEP -DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 
-DGNU_RUNTIME=1 -DGNUSTEP_BASE_LIBRARY=1 -fno-strict-aliasing -fexceptions 
-fobjc-exceptions -D_NATIVE_OBJC_EXCEPTIONS -pthread -fPIC -Wall -DGSWARN 
-DGSDIAGNOSE -Wno-import -g -O2 -g -O2 
-fdebug-prefix-map=/<>/lynkeos.app-2.10+dfsg1=. 
-fstack-protector-strong -Wformat -Werror=format-security -fgnu-runtime 
-Wno-unknown-pragmas -Wno-cpp -fconstant-string-class=NSConstantString -I. 
-I/usr/local/include/GNUstep -I/usr/include/GNUstep \
   -o obj/Lynkeos.obj/MyDeconvolution.m.o
/<>/lynkeos.app-2.10+dfsg1/GNUstep/../Sources/MyDeconvolution.m: In 
function 'vector_Process_One_line':
/<>/lynkeos.app-2.10+dfsg1/GNUstep/../Sources/MyDeconvolution.m:72:44:
 warning: excess elements in vector initializer
0x04050607, 0x04050607 };
^~
/<>/lynkeos.app-2.10+dfsg1/GNUstep/../Sources/MyDeconvolution.m:72:44:
 note: (near initialization for 'Vperma')
/<>/lynkeos.app-2.10+dfsg1/GNUstep/../Sources/MyDeconvolution.m:72:56:
 warning: excess elements in vector initializer
0x04050607, 0x04050607 };
^~
/<>/lynkeos.app-2.10+dfsg1/GNUstep/../Sources/MyDeconvolution.m:72:56:
 note: (near initialization for 'Vperma')
/<>/lynkeos.app-2.10+dfsg1/GNUstep/../Sources/MyDeconvolution.m:74:44:
 warning: excess elements in vector initializer
0x0C0D0E0F, 0x0C0D0E0F };
^~
/<>/lynkeos.app-2.10+dfsg1/GNUstep/../Sources/MyDeconvolution.m:74:44:
 note: (near initialization for 'Vpermb')
/<>/lynkeos.app-2.10+dfsg1/GNUstep/../Sources/MyDeconvolution.m:74:56:
 warning: excess elements in vector initializer
0x0C0D0E0F, 0x0C0D0E0F };
^~
/<>/lynkeos.app-2.10+dfsg1/GNUstep/../Sources/MyDeconvolution.m:74:56:
 note: (near initialization for 'Vpermb')
/<>/lynkeos.app-2.10+dfsg1/GNUstep/../Sources/MyDeconvolution.m:88:13:
 warning: implicit declaration of function 'vec_madd' 
[-Wimplicit-function-declaration]
   Vdx = vec_madd( vec_ld(0,expXptr), Vdy, Vzero );
 ^~~~
/<>/lynkeos.app-2.10+dfsg1/GNUstep/../Sources/MyDeconvolution.m:88:23:
 warning: implicit declaration of function 'vec_ld'; did you mean 'vector'? 
[-Wimplicit-function-declaration]
   Vdx = vec_madd( vec_ld(0,expXptr), Vdy, Vzero );
   ^~
   vector
/<>/lynkeos.app-2.10+dfsg1/GNUstep/../Sources/MyDeconvolution.m:88:7: 
error: AltiVec argument passed to unprototyped function
   Vdx = vec_madd( vec_ld(0,expXptr), Vdy, Vzero );
   ^~~
/<>/lynkeos.app-2.10+dfsg1/GNUstep/../Sources/MyDeconvolution.m:89:41:
 warning: implicit declaration of function 'vec_cmplt' 
[-Wimplicit-function-declaration]
   const __vector __bool int Vmask = vec_cmplt(Vdx,Vthr);
 ^
/<>/lynkeos.app-2.10+dfsg1/GNUstep/../Sources/MyDeconvolution.m:89:7: 
error: AltiVec argument passed to unprototyped function
   const __vector __bool int Vmask = vec_cmplt(Vdx,Vthr);
   ^
/<>/lynkeos.app-2.10+dfsg1/GNUstep/../Sources/MyDeconvolution.m:90:27:
 warning: implicit declaration of function 'vec_and'; did you mean 'vscanf'? 
[-Wimplicit-function-declaration]
   __vector REAL Vge = vec_and(Vdx,Vmask);
   ^~~
   vscanf
/<>/lynkeos.app-2.10+dfsg1/GNUstep/../Sources/MyDeconvolution.m:90:7: 
error: AltiVec argument passed to unprototyped function
   __vector REAL Vge = vec_and(Vdx,Vmask);
   ^~~~
/<>/lynkeos.app-2.10+dfsg1/GNUstep/../Sources/MyDeconvolution.m:91:27:
 warning: implicit declaration of function 'vec_andc'; did you mean 'vscanf'? 
[-Wimplicit-function-declaration]
   __vector REAL Vlt = vec_andc(Vthr,Vmask);
   ^~~~
   vscanf
/<>/lynkeos.app-2.10+dfsg1/GNUstep/../Sources/MyDeconvolution.m:91:7: 
error: AltiVec argument passed to unprototyped function
   __vector REAL Vlt = vec_andc(Vthr,Vmask);
   ^~~~

Bug#893097: lynkeos.app: FTBFS on many architectures - PAGE_SIZE undeclared

2018-03-16 Thread Yavor Doganov
tags 893097 + pending
thanks

James Cowgill wrote:
> lynkeos.app FTBFS on many architectures (all except for x86, s390x and
> alpha) with the error:

Right; I've already fixed this in the Git repository, exactly in the
way you suggest.



Bug#890070: textedit.app: Does not start after upgrade; missing resources

2018-02-10 Thread Yavor Doganov
Package: textedit.app
Version: 5.0-1
Severity: grave

Hi Gürkan,

TextEdit does not start after upgrading from 4.0+20061029-3.5:

$ TextEdit
2018-02-10 21:27:48.951 TextEdit[16231:16231] Bad application class '(null)' 
specified
2018-02-10 21:27:49.027 TextEdit[16231:16231] Xlib does not support locale 
setting bg_BG.utf8
2018-02-10 21:27:49.031 TextEdit[16231:16231] Unable to initialize XIM, using 
standard keyboard events

The problem is the same as the one I reported for affiche.app (#889550):

$ ls /usr/lib/GNUstep/Applications/TextEdit.app/Resources/
$

As agreed on IRC I'll fix this; filing as a reminder and to prevent
migration to testing.

-- System Information:
Debian Release: buster/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'testing-debug'), (500, 
'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.14.0-3-amd64 (SMP w/2 CPU cores)
Locale: LANG=bg_BG.utf8, LC_CTYPE=bg_BG.utf8 (charmap=UTF-8), 
LANGUAGE=bg_BG.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages textedit.app depends on:
ii  gnustep-back0.26   0.26.2-2
ii  gnustep-base-runtime   1.25.1-1
ii  gnustep-common [gnustep-fslayout-fhs]  2.7.0-3
ii  gnustep-gui-runtime0.26.2-2
ii  libc6  2.26-6
ii  libgnustep-base1.251.25.1-1
ii  libgnustep-gui0.26 0.26.2-2
ii  libobjc4   8-20180207-2

Versions of packages textedit.app recommends:
ii  aspell  0.60.7~20110707-4

textedit.app suggests no packages.

-- no debconf information



Bug#889536: libaddressview0: Missing dependencies

2018-02-04 Thread Yavor Doganov
Package: libaddressview0
Version: 0.4.8-2+b2
Severity: serious
Justification: Policy 10.2

$ ldd -r /usr/lib/libAddressView.so.0
linux-gate.so.1 (0xb773a000)
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb76d5000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb751d000)
/lib/ld-linux.so.2 (0xb773c000)
undefined symbol: ADEmailProperty   (/usr/lib/libAddressView.so.0)
undefined symbol: NSViewFrameDidChangeNotification  
(/usr/lib/libAddressView.so.0)
undefined symbol: NSCalibratedRGBColorSpace (/usr/lib/libAddressView.so.0)
undefined symbol: NSFontAttributeName   (/usr/lib/libAddressView.so.0)
undefined symbol: NSTIFFPboardType  (/usr/lib/libAddressView.so.0)
undefined symbol: ADOrganizationProperty(/usr/lib/libAddressView.so.0)
undefined symbol: ADAddressCountryCodeKey   (/usr/lib/libAddressView.so.0)
undefined symbol: NSStringPboardType(/usr/lib/libAddressView.so.0)
undefined symbol: ADImageProperty   (/usr/lib/libAddressView.so.0)
undefined symbol: ADAddressProperty (/usr/lib/libAddressView.so.0)
undefined symbol: ADNoteProperty(/usr/lib/libAddressView.so.0)
undefined symbol: ADJobTitleProperty(/usr/lib/libAddressView.so.0)
undefined symbol: NSGenericException(/usr/lib/libAddressView.so.0)
undefined symbol: ADHomePageProperty(/usr/lib/libAddressView.so.0)
undefined symbol: NSDragPboard  (/usr/lib/libAddressView.so.0)
undefined symbol: ADBirthdayProperty(/usr/lib/libAddressView.so.0)
undefined symbol: ADAddressCountryKey   (/usr/lib/libAddressView.so.0)
undefined symbol: ADLastNameProperty(/usr/lib/libAddressView.so.0)
undefined symbol: NSFilenamesPboardType (/usr/lib/libAddressView.so.0)
undefined symbol: ADGroupNameProperty   (/usr/lib/libAddressView.so.0)
undefined symbol: ADFirstNameProperty   (/usr/lib/libAddressView.so.0)
undefined symbol: ADAIMInstantProperty  (/usr/lib/libAddressView.so.0)
undefined symbol: NSShortDateFormatString   (/usr/lib/libAddressView.so.0)
undefined symbol: ADPhoneProperty   (/usr/lib/libAddressView.so.0)
undefined symbol: ADDatabaseChangedExternallyNotification   
(/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_NSObject(/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_NSConstantString
(/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_Protocol(/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_NSMutableArray  
(/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_ADConverterManager  
(/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_NSView  (/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_NSProcessInfo   
(/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_NSMutableDictionary 
(/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_NSPasteboard
(/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_ADMutableMultiValue 
(/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_ADPerson(/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_NSOpenPanel (/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_NSBezierPath
(/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_NSMutableAttributedString   
(/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_NSAttributedString  
(/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_NSColor (/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_NSTextView  (/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_NSTextField (/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_NSArray (/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_NSNotificationCenter
(/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_NSFont  (/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_NSImage (/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_NSAssertionHandler  
(/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_NSDictionary
(/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_NSString(/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_NSBundle(/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_NSImageView (/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_NSDistantObject 
(/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_NSTextFieldCell 
(/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_NSImageCell (/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_NSBitmapImageRep
(/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_NSMutableString 
(/usr/lib/libAddressView.so.0)
undefined symbol: __objc_class_name_ADMultiValue
(/usr/lib/libAddressView.so.0)
undefined symbol: 

Bug#889534: libaddresses0: Missing dependencies

2018-02-04 Thread Yavor Doganov
Package: libaddresses0
Version: 0.4.8-2+b2
Severity: serious
Justification: Policy 10.2

$ ldd -r /usr/lib/libAddresses.so.0
linux-gate.so.1 (0xb77cc000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb7765000)
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb7748000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb759)
/lib/ld-linux.so.2 (0xb77ce000)
undefined symbol: NSGenericException(/usr/lib/libAddresses.so.0)
undefined symbol: __objc_class_name_NSObject(/usr/lib/libAddresses.so.0)
undefined symbol: __objc_class_name_NSConstantString
(/usr/lib/libAddresses.so.0)
undefined symbol: __objc_class_name_NSDictionary
(/usr/lib/libAddresses.so.0)
undefined symbol: __objc_class_name_NSArray (/usr/lib/libAddresses.so.0)
undefined symbol: __objc_class_name_NSMutableArray  
(/usr/lib/libAddresses.so.0)
undefined symbol: __objc_class_name_NSString(/usr/lib/libAddresses.so.0)
undefined symbol: __objc_class_name_NSData  (/usr/lib/libAddresses.so.0)
undefined symbol: __objc_class_name_NSMutableDictionary 
(/usr/lib/libAddresses.so.0)
undefined symbol: __objc_class_name_NSException (/usr/lib/libAddresses.so.0)
undefined symbol: __objc_class_name_NSAssertionHandler  
(/usr/lib/libAddresses.so.0)
undefined symbol: __objc_class_name_NSConnection
(/usr/lib/libAddresses.so.0)
undefined symbol: __objc_class_name_NSUserDefaults  
(/usr/lib/libAddresses.so.0)
undefined symbol: __objc_class_name_NSBundle(/usr/lib/libAddresses.so.0)
undefined symbol: __objc_class_name_NSNumber(/usr/lib/libAddresses.so.0)
undefined symbol: __objc_class_name_NSCharacterSet  
(/usr/lib/libAddresses.so.0)
undefined symbol: __objc_class_name_NSDistributedNotificationCenter 
(/usr/lib/libAddresses.so.0)
undefined symbol: __objc_class_name_NSProcessInfo   
(/usr/lib/libAddresses.so.0)
undefined symbol: __objc_class_name_NSNotificationCenter
(/usr/lib/libAddresses.so.0)
undefined symbol: __objc_class_name_NSFileManager   
(/usr/lib/libAddresses.so.0)
undefined symbol: __objc_class_name_Protocol(/usr/lib/libAddresses.so.0)
undefined symbol: __objc_class_name_NSMutableData   
(/usr/lib/libAddresses.so.0)
undefined symbol: __objc_class_name_NSValue (/usr/lib/libAddresses.so.0)
undefined symbol: __objc_class_name_NSDate  (/usr/lib/libAddresses.so.0)
undefined symbol: __objc_class_name_NSCalendarDate  
(/usr/lib/libAddresses.so.0)
undefined symbol: __objc_class_name_GSMimeDocument  
(/usr/lib/libAddresses.so.0)
undefined symbol: __objc_class_name_NSMutableString 
(/usr/lib/libAddresses.so.0)
undefined symbol: __gnu_objc_personality_v0 (/usr/lib/libAddresses.so.0)
undefined symbol: NSSearchPathForDirectoriesInDomains   
(/usr/lib/libAddresses.so.0)
undefined symbol: _NSRangeExceptionRaise(/usr/lib/libAddresses.so.0)
undefined symbol: objc_get_class(/usr/lib/libAddresses.so.0)
undefined symbol: objc_msg_lookup_super (/usr/lib/libAddresses.so.0)
undefined symbol: NSLog (/usr/lib/libAddresses.so.0)
undefined symbol: NSCopyObject  (/usr/lib/libAddresses.so.0)
undefined symbol: NSStringFromSelector  (/usr/lib/libAddresses.so.0)
undefined symbol: NSTemporaryDirectory  (/usr/lib/libAddresses.so.0)
undefined symbol: objc_msg_lookup   (/usr/lib/libAddresses.so.0)
undefined symbol: __objc_exec_class (/usr/lib/libAddresses.so.0)

-- System Information:
Debian Release: 9.3
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-debug'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 4.9.0-5-686-pae (SMP w/1 CPU core)
Locale: LANG=bg_BG.UTF-8, LC_CTYPE=bg_BG.UTF-8 (charmap=UTF-8), 
LANGUAGE=bg_BG.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages libaddresses0 depends on:
ii  libc62.24-11+deb9u1
ii  libgcc1  1:6.3.0-18

libaddresses0 recommends no packages.

libaddresses0 suggests no packages.

-- no debconf information



Bug#886305: gnumail.app: links against openssl

2018-01-04 Thread Yavor Doganov
Package: gnumail.app
Version: 1.2.2-1.1
Severity: serious
Justification: license incompatibility

This is a reincarnation of #756852, a regression introduced in
gnumail/1.2.2-1.1.  The dependency would have been stripped by the
linker with --as-needed if DEB_LDFLAGS_MAINT_APPEND was not commented
out with this change:

https://anonscm.debian.org/cgit/pkg-gnustep/gnumail.git/commit/?id=35f767a28021af7592ecbae66628516da8958e0a

-- System Information:
Debian Release: 9.3
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-debug'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 4.9.0-4-686-pae (SMP w/1 CPU core)
Locale: LANG=bg_BG.UTF-8, LC_CTYPE=bg_BG.UTF-8 (charmap=UTF-8), 
LANGUAGE=bg_BG.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages gnumail.app depends on:
ii  addressmanager.app   0.4.8-2+b2
ii  gnumail.app-common   1.2.2-1.1
ii  gnustep-back0.25 0.25.0-2
ii  gnustep-gui-runtime  0.25.0-4+b1
ii  libaddresses00.4.8-2+b2
ii  libaddressview0  0.4.8-2+b2
ii  libc62.24-11+deb9u1
ii  libgcc1  1:6.3.0-18
ii  libgnustep-base1.24  1.24.9-3.1
ii  libgnustep-gui0.25   0.25.0-4+b1
ii  libobjc4 6.3.0-18
ii  libpantomime1.2  1.2.2+dfsg1-1
ii  libssl1.11.1.0f-3+deb9u1

gnumail.app recommends no packages.

Versions of packages gnumail.app suggests:
ii  gnupg 2.1.18-8~deb9u1
ii  steptalk  0.10.0-6+b3

-- no debconf information



Bug#884098: agenda.app: Cannot create new task or appointment

2017-12-11 Thread Yavor Doganov
Package: agenda.app
Version: 0.42.2-1+b7
Severity: grave
Justification: renders package unusable
Control: fixed -1 0.44-1

Creating a new task or appointment is impossible; an exception occurs:

2017-12-11 13:40:53.671 SimpleAgenda[2016:2016] Problem posting notification: 
 NAME:NSInvalidArgumentException 
REASON:TaskEditor(instance) does not recognize document INFO:(null)
2017-12-11 13:41:10.333 SimpleAgenda[2016:2016] Problem posting notification: 
 NAME:NSInvalidArgumentException 
REASON:AppointmentEditor(instance) does not recognize document INFO:(null)

Much to my regret I've let this bug sneak into a Debian stable
release.  Shame on me.

-- System Information:
Debian Release: 9.3
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-debug'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 4.9.0-4-686-pae (SMP w/1 CPU core)
Locale: LANG=bg_BG.UTF-8, LC_CTYPE=bg_BG.UTF-8 (charmap=UTF-8), 
LANGUAGE=bg_BG.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages agenda.app depends on:
ii  gnustep-back0.25   0.25.0-2
ii  gnustep-common [gnustep-fslayout-fhs]  2.6.8-2.1
ii  gnustep-gui-runtime0.25.0-4+b1
ii  libaddresses0  0.4.8-2+b2
ii  libc6  2.24-11+deb9u1
ii  libgcc11:6.3.0-18
ii  libgnustep-base1.241.24.9-3.1
ii  libgnustep-gui0.25 0.25.0-4+b1
ii  libical2   2.0.0-0.5+b1
ii  libobjc4   6.3.0-18
ii  libuuid1   2.29.2-1

agenda.app recommends no packages.

agenda.app suggests no packages.

-- no debconf information



Bug#863788: oolite: Please drop dependency against mozjs 1.8.5

2017-10-29 Thread Yavor Doganov
ibmozjs.diff
+++ b/debian/patches/debian_version_of_libmozjs.diff
@@ -218,7 +218,7 @@ Forwarded: Michael Werle <mi...@michaelwerle.com>
  ifeq ($(OO_JAVASCRIPT_TRACE),yes)
  ADDITIONAL_OBJCFLAGS += -DMOZ_TRACE_JSCALLS=1
  endif
-+PKG_CONFIG_LIBRARIES += glu gl x11 sdl mozjs185 nspr openal vorbisfile minizip
++PKG_CONFIG_LIBRARIES += glu gl x11 sdl mozjs-52 nspr openal vorbisfile minizip
 +PKG_CONFIG_CFLAGS := `pkg-config --cflags $(PKG_CONFIG_LIBRARIES)`
 +PKG_CONFIG_LDLIBS := `pkg-config --libs   $(PKG_CONFIG_LIBRARIES)`
 +ADDITIONAL_OBJC_LIBS += $(PKG_CONFIG_LDLIBS)
diff --git a/debian/patches/gobjc++.patch b/debian/patches/gobjc++.patch
new file mode 100644
index 000..08a6420
--- /dev/null
+++ b/debian/patches/gobjc++.patch
@@ -0,0 +1,425 @@
+Description: Compile all files which include C++ headers as Objective-C++
+Author: Yavor Doganov <ya...@gnu.org>
+Bug-Debian: https://bugs.debian.org/863788
+Forwarded: no
+Last-Update: 2017-10-29
+---
+
+--- oolite.orig/GNUmakefile
 oolite/GNUmakefile
+@@ -1,6 +1,7 @@
+ include $(GNUSTEP_MAKEFILES)/common.make
+ include config.make
+ 
++vpath %.mm src/SDL:src/Core:src/Core/Entities:src/Core/Materials:src/Core/Scripting:src/Core/OXPVerifier:src/Core/Debug
+ vpath %.m src/SDL:src/Core:src/Core/Entities:src/Core/Materials:src/Core/Scripting:src/Core/OXPVerifier:src/Core/Debug
+ vpath %.h src/SDL:src/Core:src/Core/Entities:src/Core/Materials:src/Core/Scripting:src/Core/OXPVerifier:src/Core/Debug
+ vpath %.c src/SDL:src/Core:src/BSDCompat:src/Core/Debug
+@@ -158,6 +159,11 @@
+ ADDITIONAL_OBJCFLAGS += -DSNAPSHOT_BUILD -DOOLITE_SNAPSHOT_VERSION=\"$(VERSION_STRING)\"
+ endif
+ 
++# GNUstep Make treats Objective-C++ files differently, using a
++# separate variable.  The -std=gnu99 option is not recognized by the
++# compiler so filter it out as it triggers a warning.
++ADDITIONAL_OBJCCFLAGS := $(filter-out -std=gnu99,$(ADDITIONAL_OBJCFLAGS))
++
+ OBJC_PROGRAM_NAME = oolite
+ 
+ oolite_C_FILES = \
+@@ -176,94 +182,105 @@
+ OOTCPStreamDecoderAbstractionLayer.m
+ 
+ OOLITE_ENTITY_FILES = \
+-DockEntity.m \
+-DustEntity.m \
+-Entity.m \
+-OOEntityWithDrawable.m \
+-OOParticleSystem.m \
+-PlanetEntity.m \
+-PlayerEntity.m \
+-PlayerEntityContracts.m \
+-PlayerEntityControls.m \
+-PlayerEntityLegacyScriptEngine.m \
+-PlayerEntityLoadSave.m \
+-PlayerEntityScriptMethods.m \
+-PlayerEntitySound.m \
+-PlayerEntityStickMapper.m \
+-PlayerEntityStickProfile.m \
+-ProxyPlayerEntity.m \
+-OOBreakPatternEntity.m \
+-ShipEntity.m \
+-ShipEntityAI.m \
+-ShipEntityScriptMethods.m \
+-SkyEntity.m \
+-StationEntity.m \
+-OOSunEntity.m \
+-WormholeEntity.m \
+-OOLightParticleEntity.m \
+-OOFlasherEntity.m \
+-OOExhaustPlumeEntity.m \
+-OOSparkEntity.m \
+-OOECMBlastEntity.m \
+-OOPlanetEntity.m \
+-OOPlasmaShotEntity.m \
+-OOPlasmaBurstEntity.m \
+-OOFlashEffectEntity.m \
+-OOExplosionCloudEntity.m \
+-ShipEntityLoadRestore.m \
+-OOLaserShotEntity.m \
+-OOQuiriumCascadeEntity.m \
+-OORingEffectEntity.m \
+-OOVisualEffectEntity.m \
+-OOWaypointEntity.m 
++PlanetEntity.m
++
++# ENTITY ObjC++ files.
++oolite_OBJCC_FILES = \
++DustEntity.mm \
++DockEntity.mm \
++PlayerEntity.mm \
++Entity.mm \
++OOEntityWithDrawable.mm \
++OOParticleSystem.mm \
++PlayerEntityContracts.mm \
++PlayerEntityControls.mm \
++PlayerEntityLegacyScriptEngine.mm \
++PlayerEntityLoadSave.mm \
++PlayerEntityScriptMethods.mm \
++PlayerEntitySound.mm \
++PlayerEntityStickMapper.mm \
++PlayerEntityStickProfile.mm \
++ProxyPlayerEntity.mm \
++OOBreakPatternEntity.mm \
++ShipEntity.mm \
++ShipEntityAI.mm \
++ShipEntityScriptMethods.mm \
++SkyEntity.mm \
++StationEntity.mm \
++OOSunEntity.mm \
++WormholeEntity.mm \
++OOLightParticleEntity.mm \
++OOFlasherEntity.mm \
++OOExhaustPlumeEntity.mm \
++OOSparkEntity.mm \
++OOECMBlastEntity.mm \
++OOPlanetEntity.mm \
++OOPlasmaShotEntity.mm \
++OOPlasmaBurstEntity.mm \
++OOFlashEffectEntity.mm \
++OOExplosionCloudEntity.mm \
++ShipEntityLoadRestore.mm \
++OOLaserShotEntity.mm \
++OOQuiriumCascadeEntity.mm \
++OORingEffectEntity.mm \
++OOVisualEffectEntity.mm \
++OOWaypointEntity.mm
+ 
+ OOLITE_GRAPHICS_DRAWABLE_FILES = \
+-OODrawable.m \
+-OOPlanetDrawable.m \
+-OOMesh.m
++OODrawable.m
++
++# DRAWABLE ObjC++ files.
++oolite_OBJCC_FILES += \
++OOPlanetDrawable.mm \
++OOMesh.mm
+ 
+ OOLITE_GRAPHICS_MATERIAL_FILES = \
+-OOMaterialSpecifier.m \
+-OOBasicMaterial.m \
+ 	OODefaultShaderSynthesizer.m \
+ OOMaterial.m \
+ OONullTexture.m \
+-OOPlanetTextureGenerator.m \
+-OOStandaloneAtmosphereGenerator.m \
+

Bug#835894: terminal.app: crashes on startup: Did not find correct version of backend

2016-08-29 Thread Yavor Doganov
reassign 835894 libgnustep-gui0.25 0.25.0-2
affects 835894 terminal.app
thanks

Eric Heintzmann wrote:
> Well, it seems that teminal.app doesn't depends on gnustep-back package.
> 
> Instead it depends on libgnustep-gui0.25 which doesn't depends on
> gnustep-back.

That's because of the .symbols file; the .shlibs is not used at all
which makes gnustep-gui's dh_makeshlibs override kind of useless.

Unfortunately it looks like all apps that were rebuilt during the
GNUstep transition are affected.

Yet another good reason to avoid .symbols files for Objective-C
libraries.



Bug#768127: Fails to build the index when invalid UTF-8 is met

2014-12-18 Thread Yavor Doganov
reopen 768127
notfixed 768127 0.6.21+nmu6
thanks

Thanks for your work, but unfortunately I experience exactly the same
problem with the new version.

$ isutf8 /var/lib/doc-base/documents/*
$ echo $?
0


-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#768127: Fails to build the index when invalid UTF-8 is met

2014-12-18 Thread Yavor Doganov
gregor herrmann wrote:
 On Thu, 18 Dec 2014 12:01:02 +0200, Yavor Doganov wrote:
  Thanks for your work, but unfortunately I experience exactly the
  same problem with the new version.
 
 I guess it would be helpful if you could try to
 - add a puts @path in /usr/lib/ruby/vendor_ruby/dhelp.rb:184
   (see Santiago's message #24);
 - copy the output of `locale' and `/etc/cron.weekly/dhelp';

$ locale
LANG=bg_BG.UTF-8
LANGUAGE=bg:en_GB
LC_CTYPE=bg_BG.UTF-8
LC_NUMERIC=bg_BG.UTF-8
LC_TIME=bg_BG.UTF-8
LC_COLLATE=bg_BG.UTF-8
LC_MONETARY=bg_BG.UTF-8
LC_MESSAGES=bg_BG.UTF-8
LC_PAPER=bg_BG.UTF-8
LC_NAME=bg_BG.UTF-8
LC_ADDRESS=bg_BG.UTF-8
LC_TELEPHONE=bg_BG.UTF-8
LC_MEASUREMENT=bg_BG.UTF-8
LC_IDENTIFICATION=bg_BG.UTF-8
LC_ALL=

[ Sorry for the long output. ]

/var/lib/doc-base/documents/dc
/var/lib/doc-base/documents/abi-compliance-checker
/var/lib/doc-base/documents/aptitude-doc-en
/var/lib/doc-base/documents/autoconf
/var/lib/doc-base/documents/automake-1.14
/var/lib/doc-base/documents/bash
/var/lib/doc-base/documents/bashref
/var/lib/doc-base/documents/bc
/var/lib/doc-base/documents/bzip2
/var/lib/doc-base/documents/bzr
/var/lib/doc-base/documents/bzr-builddeb
/var/lib/doc-base/documents/comerr-manual
/var/lib/doc-base/documents/copyright-format-1.0
/var/lib/doc-base/documents/cpp-4.9
/var/lib/doc-base/documents/cppinternals-4.9
/var/lib/doc-base/documents/cvs-doc
/var/lib/doc-base/documents/cvs-doc-client
/var/lib/doc-base/documents/cvs-doc-faq
/var/lib/doc-base/documents/cvs-doc-intro
/var/lib/doc-base/documents/cvs-doc-paper
/var/lib/doc-base/documents/cvs-doc-rcsfiles
/var/lib/doc-base/documents/dbuskit-api-docs
/var/lib/doc-base/documents/dbuskit-manual
/var/lib/doc-base/documents/debconf-spec
/var/lib/doc-base/documents/debian-constitution-text
/var/lib/doc-base/documents/debian-faq
/var/lib/doc-base/documents/debian-mailing-lists
/var/lib/doc-base/documents/debian-manifesto
/var/lib/doc-base/documents/debian-menu-policy
/var/lib/doc-base/documents/debian-perl-policy
/var/lib/doc-base/documents/debian-policy
/var/lib/doc-base/documents/debian-reporting-bugs
/var/lib/doc-base/documents/debian-social-contract
/var/lib/doc-base/documents/debian-tex-policy
/var/lib/doc-base/documents/developers-reference
/var/lib/doc-base/documents/doc-base
/var/lib/doc-base/documents/docbook-xsl-doc
/var/lib/doc-base/documents/everyday-git
/var/lib/doc-base/documents/exim4-filter-txt
/var/lib/doc-base/documents/exim4-readme-debian
/var/lib/doc-base/documents/exim4-spec-txt
/var/lib/doc-base/documents/expat
/var/lib/doc-base/documents/feynmf-manual
/var/lib/doc-base/documents/fhs
/var/lib/doc-base/documents/findutils
/var/lib/doc-base/documents/fontconfig-devel
/var/lib/doc-base/documents/fontconfig-user
/var/lib/doc-base/documents/gawk-doc-gawk
/var/lib/doc-base/documents/gawk-doc-gawkinet
/var/lib/doc-base/documents/gcc-4.9
/var/lib/doc-base/documents/gccint-4.9
/var/lib/doc-base/documents/gccintro
/var/lib/doc-base/documents/gdl2api
/var/lib/doc-base/documents/gdl2intro
/var/lib/doc-base/documents/git-api
/var/lib/doc-base/documents/git-bisect-lk2009
/var/lib/doc-base/documents/git-buildpackage
/var/lib/doc-base/documents/git-howtos
/var/lib/doc-base/documents/git-index-format
/var/lib/doc-base/documents/git-pack-format
/var/lib/doc-base/documents/git-protocol
/var/lib/doc-base/documents/git-reference-manual
/var/lib/doc-base/documents/git-shallow-clone-design
/var/lib/doc-base/documents/git-tools
/var/lib/doc-base/documents/git-trivial-merge-rules
/var/lib/doc-base/documents/git-user-manual
/var/lib/doc-base/documents/glibc-manual
/var/lib/doc-base/documents/gnu-coding-standards
/var/lib/doc-base/documents/gnu-maintainers-information
/var/lib/doc-base/documents/gnustep-base-additions
/var/lib/doc-base/documents/gnustep-base-programming-manual
/var/lib/doc-base/documents/gnustep-base-reference
/var/lib/doc-base/documents/gnustep-base-tools
/var/lib/doc-base/documents/gnustep-coding-standards
/var/lib/doc-base/documents/gnustep-gui-additions
/var/lib/doc-base/documents/gnustep-gui-programming-manual
/var/lib/doc-base/documents/gnustep-gui-reference
/var/lib/doc-base/documents/gnustep-make-manual
/var/lib/doc-base/documents/gnustep-netclasses-docs
/var/lib/doc-base/documents/gnustep-performance
/var/lib/doc-base/documents/gnustep-sqlclient
/var/lib/doc-base/documents/gorm.app
/var/lib/doc-base/documents/initramfs-maintainer
/var/lib/doc-base/documents/install-docs-man
/var/lib/doc-base/documents/jade
/var/lib/doc-base/documents/kbd-font-formats
/var/lib/doc-base/documents/libao
/var/lib/doc-base/documents/libexif-api
/var/lib/doc-base/documents/libffi
/var/lib/doc-base/documents/libfreetype6-dev
/var/lib/doc-base/documents/libidn11
/var/lib/doc-base/documents/libio-stringy-perl
/var/lib/doc-base/documents/libpng12
/var/lib/doc-base/documents/libsdl1.2-dev
/var/lib/doc-base/documents/libsndfile
/var/lib/doc-base/documents/libtasn1
/var/lib/doc-base/documents/libvorbis
/var/lib/doc-base/documents/libxml-parser-perl
/var/lib/doc

Bug#768127: Fails to build the index when invalid UTF-8 is met

2014-12-18 Thread Yavor Doganov
gregor herrmann wrote:
  /var/lib/doc-base/documents/xterm-ctlseqs
  /var/lib/doc-base/documents/xterm-faq
  ArgumentError: invalid byte sequence in UTF-8 
  (/usr/lib/ruby/vendor_ruby/debian.rb:914:in `block in initialize'
 
 So according to the previous findings, my guess is that
 /var/lib/doc-base/documents/xterm-faq can't be interpreted as UTF-8.

I don't think this has anything to do with xterm-faq, it's just that
this is the last file in alphabetical order.  If I move the file away
I get the same failure -- it chokes on xterm-ctlseqs then.

 Could you please try `file -i /var/lib/doc-base/documents/xterm-faq'
 as well and open the file in a pager/editor to see if it's the same
 on your machine?

Yes, it's the same:

$ file -i /var/lib/doc-base/documents/xterm-faq 
/var/lib/doc-base/documents/xterm-faq: text/plain; charset=us-ascii
$ md5sum /usr/share/doc-base/xterm-faq 
4f81e4dd965c918abc250beeb54131fb  /usr/share/doc-base/xterm-faq

Too bad I don't know Ruby and I'm completely clueless.

It seems that there are two different problems -- Santiago's failure
that he posted on the bug log is at dhelp.rb:185 while mine is at
debian.rb:914 (which is why I suggested it might be a ruby-debian
issue).  If you and Daniel have reproduced and fixed Santiago's bug it
is not surprising that the NMU does not address the bug I am
observing.  (At least that is how I explain the mystery for the time
being, with my limited knowledge.)


-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#768127: Fails to build the index when invalid UTF-8 is met

2014-12-18 Thread Yavor Doganov
Daniel Getz wrote:
 Can you run with the attached patch to debian.rb, and see if it will
 show which entry of which file triggers the error?

Thanks; here's the output:

Error parsing file /var/lib/dpkg/available
Contents of info:
Package: ayuda
Priority: extra
Section: misc
Installed-Size: 204
Maintainer: Javier Vi�uales Guti�rrez v...@matrio.com
Architecture: all
Version: 0.1-4
Suggests: manpages-es, doc-linux-es, doc-debian-es
Filename: pool/main/a/ayuda/ayuda_0.1-4_all.deb
Size: 31710
MD5sum: 79c8ded94cce4b054ad883cb139500d7
Description: Help for spanish-speakers
 This package contains a help program called 'ayuda' useful
 for users that speak spanish, and are new to the world of
 Debian GNU/Linux.
 .
 The help provided covers many topics from administration to daily use.

(Ruby backtrace follows.)

The maintainer name is not valid UTF-8:

$ isutf8 /var/lib/dpkg/available
/var/lib/dpkg/available: line 17427, char 1, byte offset 22: invalid UTF-8 code


--
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



  1   2   3   4   5   >