Bug#920290: libpcre2-dev: libpcre2-posix is not usable

2019-02-03 Thread Matthew Vernon

Hi,

Further to my previous email (did you get that?), I note that upstream 
will have these definitions in their next release - see 
https://bugs.exim.org/show_bug.cgi?id=1830#c30


Regards,

Matthew



Bug#920290: libpcre2-dev: libpcre2-posix is not usable

2019-01-28 Thread Matthew Vernon
Hi,

One further thing, I note that the next upstream version of pcre2 will do

PCRE2POSIX_EXP_DECL int pcre2_regcomp(regex_t *, const char *, int);
PCRE2POSIX_EXP_DECL int regcomp(regex_t *, const char *, int);

and in the .c file:

PCRE2POSIX_EXP_DEFN int PCRE2_CALL_CONVENTION

regcomp(regex_t *preg, const char *pattern, int cflags)
{
return pcre2_regcomp(preg, pattern, cflags);
}

See
https://bugs.exim.org/show_bug.cgi?id=1830#c20

Regards,

Matthew



Bug#920290: libpcre2-dev: libpcre2-posix is not usable

2019-01-27 Thread Matthew Vernon

Hi,

On 24/01/2019 15:48, Julian Andres Klode wrote:

How is it inherited? 
In pcre2, the names are overriden in debian/rules, and any application wishing to

make use of it has to add the same definitions:


Huh, yes. Bother.

I think the attached patch does the right thing now?

[past-me clearly screwed this up once, so I'd appreciate another pair of 
eyes on it this time :-/ ]


Regards,

Matthew
diff --git a/debian/README.Debian b/debian/README.Debian
index 8c23e75..6b4a336 100644
--- a/debian/README.Debian
+++ b/debian/README.Debian
@@ -6,7 +6,7 @@ expression) library. New projects should use this library in
 preference the older PCRE library (which is, for historical reasons,
 called pcre3 in Debian).
 
-The names of functions in libpcre2-posix are prefixed with PCRE2_, so
+The names of functions in libpcre2-posix are prefixed with PCRE2, so
 they don't clash with the names in libc.
 
- -- Matthew Vernon , Sun, 22 Nov 2015 16:07:27 +
+ -- Matthew Vernon , Sun, 27 Jan 2019 13:55:17 +
diff --git a/debian/changelog b/debian/changelog
index 634d436..5894999 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+pcre2 (10.32-5) unstable; urgency=medium
+
+  * Properly provide prefixed function names in libpcre2-posix (thanks to
+Julian Andres Klode for the report) (Closes: #920290)
+
+ -- Matthew Vernon   Sun, 27 Jan 2019 13:56:43 +
+
 pcre2 (10.32-4) unstable; urgency=medium
 
   * Take patch from Jeremy Bicha to build with
diff --git a/debian/rules b/debian/rules
index a68760a..ddb47e5 100755
--- a/debian/rules
+++ b/debian/rules
@@ -8,7 +8,6 @@ DPKG_EXPORT_BUILDFLAGS = 1
 include /usr/share/dpkg/default.mk
 # prefix names of functions in libpcreposix with PCRE2 to avoid clash with
 # ones in libc.
-export DEB_CFLAGS_MAINT_APPEND = -Dregcomp=PCRE2regcomp -Dregexec=PCRE2regexec -Dregerror=PCRE2regerror -Dregfree=PCRE2regfree
 
 
 deb_maint_conf_args = --enable-pcre2-16 --enable-pcre2-32 --disable-pcre2grep-callout
diff --git a/src/pcre2posix.h b/src/pcre2posix.h
index 4ae1d3c..3aa28c5 100644
--- a/src/pcre2posix.h
+++ b/src/pcre2posix.h
@@ -138,14 +138,19 @@ file. */
 
 /* The functions */
 
-PCRE2POSIX_EXP_DECL int regcomp(regex_t *, const char *, int);
-PCRE2POSIX_EXP_DECL int regexec(const regex_t *, const char *, size_t,
+PCRE2POSIX_EXP_DECL int PCRE2regcomp(regex_t *, const char *, int);
+PCRE2POSIX_EXP_DECL int PCRE2regexec(const regex_t *, const char *, size_t,
  regmatch_t *, int);
-PCRE2POSIX_EXP_DECL size_t regerror(int, const regex_t *, char *, size_t);
-PCRE2POSIX_EXP_DECL void regfree(regex_t *);
+PCRE2POSIX_EXP_DECL size_t PCRE2regerror(int, const regex_t *, char *, size_t);
+PCRE2POSIX_EXP_DECL void PCRE2regfree(regex_t *);
 
 #ifdef __cplusplus
 }   /* extern "C" */
 #endif
 
+#define regcomp PCRE2regcomp
+#define regexec PCRE2regexec
+#define regerror PCRE2regerror
+#define regfree PCRE2regfree
+
 /* End of pcre2posix.h */


Bug#920290: libpcre2-dev: libpcre2-posix is not usable

2019-01-24 Thread Julian Andres Klode
On Thu, Jan 24, 2019 at 03:14:43PM +, Matthew Vernon wrote:
> Hi,
> 
> Thanks for the bug report. The change you complain of was inherited from
> Marc Haber's packaging of pcre3, as referred to in a related upstream issue:
> https://bugs.exim.org/show_bug.cgi?id=1830
> 
> Is your objection that Marc's change is incorrect, that it's misapplied in
> pcre2, or something else?

How is it inherited? It's completely different. In pcre3, the .h is patched
to rename the functions and then provide compatibility macros using the standard
names:

https://sources.debian.org/src/pcre3/2:8.39-11/debian/patches/pcreposix.patch/

In pcre2, the names are overriden in debian/rules, and any application wishing 
to
make use of it has to add the same definitions:

export DEB_CFLAGS_MAINT_APPEND = -Dregcomp=PCRE2regcomp -Dregexec=PCRE2regexec 
-Dregerror=PCRE2regerror -Dregfree=PCRE2regfree

Which also, quite frankly, are ugly symbol names - they should have been
pcre2posix_regcomp and so on to follow pcre3. But well, can't fix that
without an ABI break (or compat symbols with those names).

Adopting the patch from pcre3 (using PCRE2 instead of pcreposix_ as the prefix)
instead of the ad-hoc patch in debian/rules solves this bug and makes it 
possible
for other packages to use libpcre2-posix without having to append custom cflags.

-- 
debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer  i speak de, en



Bug#920290: libpcre2-dev: libpcre2-posix is not usable

2019-01-24 Thread Matthew Vernon

Hi,

Thanks for the bug report. The change you complain of was inherited from 
Marc Haber's packaging of pcre3, as referred to in a related upstream issue:

https://bugs.exim.org/show_bug.cgi?id=1830

Is your objection that Marc's change is incorrect, that it's misapplied 
in pcre2, or something else?


I should say, though, that I'm going to be a bit reluctant to change 
this just before a freeze, in case doing so breaks things that are 
relying on the current behaviour...


Regards,

Matthew



Bug#920290: libpcre2-dev: libpcre2-posix is not usable

2019-01-23 Thread Julian Andres Klode
Package: libpcre2-dev
Version: 10.32-3
Severity: important

The header exports the standard libc names, but debian/rules
overrides them at build time to use PCRE2Posix and friends.

This does not help applications wanting to link against
pcreposix - including the header and calling the functions
regcomp() and friends just makes it use the libc ones.

You have to do the #define dance in the header for things
to work.

-- System Information:
Debian Release: buster/sid
  APT prefers disco
  APT policy: (500, 'disco'), (500, 'cosmic-security')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

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

Versions of packages libpcre2-dev depends on:
ii  libc6-dev2.28-0ubuntu1
ii  libpcre2-16-010.32-3
ii  libpcre2-32-010.32-3
ii  libpcre2-8-0 10.32-3
ii  libpcre2-posix0  10.32-3

libpcre2-dev recommends no packages.

libpcre2-dev suggests no packages.

-- no debconf information

-- 
debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer  i speak de, en