summaryrefslogtreecommitdiff
path: root/debian/patches/cherry-pick-10bdbd8b-51877-do-not-build-pcre-module-if-pcre2-config-is-not-fo...
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2023-07-05 02:27:43 +0200
committerAxel Beckert <abe@deuxchevaux.org>2023-07-05 18:55:51 +0200
commit138340f908926ef5bfbc3e82b1ca1cc9a97de22c (patch)
treebdf12e2df4bdd3202e99dfefb9d10b2e6a35d8d8 /debian/patches/cherry-pick-10bdbd8b-51877-do-not-build-pcre-module-if-pcre2-config-is-not-found.patch
parentd2a99aa86a81f1ad931ab2d3bf8a5ba28c2ed0d4 (diff)
downloadzsh-138340f908926ef5bfbc3e82b1ca1cc9a97de22c.tar.gz
zsh-138340f908926ef5bfbc3e82b1ca1cc9a97de22c.zip
Cherry pick multiple upstream commits to migrate pcre module to pcre2.
Update Build-Depends and Build-Using from libpcre3-dev to libpcre2-dev accordingly. Closes: #999918 Gbp-Dch: Full
Diffstat (limited to 'debian/patches/cherry-pick-10bdbd8b-51877-do-not-build-pcre-module-if-pcre2-config-is-not-found.patch')
-rw-r--r--debian/patches/cherry-pick-10bdbd8b-51877-do-not-build-pcre-module-if-pcre2-config-is-not-found.patch93
1 files changed, 93 insertions, 0 deletions
diff --git a/debian/patches/cherry-pick-10bdbd8b-51877-do-not-build-pcre-module-if-pcre2-config-is-not-found.patch b/debian/patches/cherry-pick-10bdbd8b-51877-do-not-build-pcre-module-if-pcre2-config-is-not-found.patch
new file mode 100644
index 000000000..c9f14f234
--- /dev/null
+++ b/debian/patches/cherry-pick-10bdbd8b-51877-do-not-build-pcre-module-if-pcre2-config-is-not-found.patch
@@ -0,0 +1,93 @@
+commit 10bdbd8b5b0b43445aff23dcd412f25cf6aa328a
+Author: Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
+Date: Tue Jun 20 18:14:27 2023 +0900
+
+ 51877: do not build pcre module if pcre2-config is not found
+
+--- a/Src/Modules/pcre.mdd
++++ b/Src/Modules/pcre.mdd
+@@ -1,5 +1,5 @@
+ name=zsh/pcre
+-link=`if test x$enable_pcre = xyes && (pcre-config --version >/dev/null 2>/dev/null); then echo dynamic; else echo no; fi`
++link=`if test x$enable_pcre = xyes; then echo dynamic; else echo no; fi`
+ load=no
+
+ autofeatures="b:pcre_compile b:pcre_study b:pcre_match"
+--- a/configure.ac
++++ b/configure.ac
+@@ -440,6 +440,17 @@
+ AC_ARG_ENABLE(pcre,
+ AS_HELP_STRING([--enable-pcre],[enable the search for the pcre2 library (may create run-time library dependencies)]))
+
++AC_ARG_VAR(PCRE_CONFIG, [pathname of pcre2-config if it is not in PATH])
++if test "x$enable_pcre" = xyes; then
++ AC_CHECK_PROG([PCRE_CONFIG], pcre2-config, pcre2-config)
++ if test "x$PCRE_CONFIG" = x; then
++ enable_pcre=no
++ AC_MSG_WARN([pcre2-config not found: pcre module is disabled.])
++ AC_MSG_NOTICE(
++ [Set PCRE_CONFIG to pathname of pcre2-config if it is not in PATH.])
++ fi
++fi
++
+ dnl Do you want to look for capability support?
+ AC_ARG_ENABLE(cap,
+ AS_HELP_STRING([--enable-cap],[enable the search for POSIX capabilities (may require additional headers to be added by hand)]))
+@@ -660,15 +671,12 @@
+ AC_HEADER_STAT
+ AC_HEADER_SYS_WAIT
+
+-oldcflags="$CFLAGS"
+-if test x$enable_pcre = xyes; then
+-AC_CHECK_PROG([PCRECONF], pcre2-config, pcre2-config)
+ dnl pcre2-config --cflags may produce a -I output which needs to go into
+ dnl CPPFLAGS else configure's preprocessor tests don't pick it up,
+ dnl producing a warning.
+-if test "x$ac_cv_prog_PCRECONF" = xpcre2-config; then
+- CPPFLAGS="$CPPFLAGS `pcre2-config --cflags`"
+-fi
++if test "x$enable_pcre" = xyes; then
++ CPPFLAGS="`$PCRE_CONFIG --cflags` $CPPFLAGS"
++ AC_CHECK_HEADERS([pcre2.h],,,[#define PCRE2_CODE_UNIT_WIDTH 8])
+ fi
+
+ AC_CHECK_HEADERS(sys/time.h sys/times.h sys/select.h termcap.h termio.h \
+@@ -680,7 +688,6 @@
+ netinet/in_systm.h langinfo.h wchar.h stddef.h \
+ sys/stropts.h iconv.h ncurses.h ncursesw/ncurses.h \
+ ncurses/ncurses.h)
+-AC_CHECK_HEADERS([pcre2.h],,,[#define PCRE2_CODE_UNIT_WIDTH 8])
+ if test x$dynamic = xyes; then
+ AC_CHECK_HEADERS(dlfcn.h)
+ AC_CHECK_HEADERS(dl.h)
+@@ -957,10 +964,6 @@
+ [Define as const if the declaration of iconv() needs const.])
+ fi
+
+-if test x$enable_pcre = xyes; then
+- LIBS="`$ac_cv_prog_PCRECONF --libs8` $LIBS"
+-fi
+-
+ dnl ---------------------
+ dnl CHECK TERMCAP LIBRARY
+ dnl ---------------------
+@@ -1321,7 +1324,6 @@
+ pathconf sysconf \
+ tgetent tigetflag tigetnum tigetstr setupterm initscr resize_term \
+ getcchar setcchar waddwstr wget_wch win_wch use_default_colors \
+- pcre2_compile_8 \
+ nl_langinfo \
+ erand48 open_memstream \
+ posix_openpt \
+@@ -1376,6 +1378,11 @@
+ AC_DEFINE(REALPATH_ACCEPTS_NULL)
+ fi
+
++if test x$enable_pcre = xyes; then
++ LIBS="`$PCRE_CONFIG --libs8` $LIBS"
++ AC_CHECK_FUNCS(pcre2_compile_8)
++fi
++
+ if test x$enable_cap = xyes; then
+ AC_CHECK_FUNCS(cap_get_proc)
+ fi