From d8691f9225b45acae070ea74f01c44413d1dd2f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com>
Date: Tue, 3 Oct 2017 15:58:11 +0200
Subject: [PATCH] contrib: disable building prce executables
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* add patch to prevent the build of pcre executables and tests
* update pcre from 8.40 to 8.41

Change-Id: I0cd008e59c905ab44a02c11808a8cf9233063817
Reviewed-by: Sébastien Blin <sebastien.blin@savoirfairelinux.com>
---
 .../0001-build-don-t-build-executables.patch  | 65 +++++++++++++++++++
 contrib/src/pcre/SHA512SUMS                   |  2 +-
 contrib/src/pcre/rules.mak                    |  4 +-
 3 files changed, 69 insertions(+), 2 deletions(-)
 create mode 100644 contrib/src/pcre/0001-build-don-t-build-executables.patch

diff --git a/contrib/src/pcre/0001-build-don-t-build-executables.patch b/contrib/src/pcre/0001-build-don-t-build-executables.patch
new file mode 100644
index 0000000000..caac10f8fd
--- /dev/null
+++ b/contrib/src/pcre/0001-build-don-t-build-executables.patch
@@ -0,0 +1,65 @@
+From a33857636bb0721469bc08173dd196138457fa6c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com>
+Date: Tue, 3 Oct 2017 15:52:48 +0200
+Subject: [PATCH] build: don't build executables
+
+Disables building pcregrep and pcretest.
+---
+ Makefile.am | 41 -----------------------------------------
+ 1 file changed, 41 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 22b6947..58cc22b 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -487,47 +487,6 @@ endif # WITH_PCRE_CPP
+ # Each unit test is a binary plus a script that runs that binary in various
+ # ways. We install these test binaries in case folks find it helpful.
+ 
+-TESTS += RunTest
+-dist_noinst_SCRIPTS += RunTest
+-EXTRA_DIST += RunTest.bat
+-bin_PROGRAMS += pcretest
+-pcretest_SOURCES = pcretest.c
+-pcretest_CFLAGS = $(AM_CFLAGS)
+-pcretest_LDADD = $(LIBREADLINE)
+-if WITH_PCRE8
+-pcretest_SOURCES += pcre_printint.c
+-pcretest_LDADD += libpcre.la libpcreposix.la
+-endif # WITH_PCRE8
+-if WITH_PCRE16
+-pcretest_SOURCES += pcre16_printint.c
+-pcretest_LDADD += libpcre16.la
+-endif # WITH_PCRE16
+-if WITH_PCRE32
+-pcretest_SOURCES += pcre32_printint.c
+-pcretest_LDADD += libpcre32.la
+-endif # WITH_PCRE32
+-if WITH_VALGRIND
+-pcretest_CFLAGS += $(VALGRIND_CFLAGS)
+-endif # WITH_VALGRIND
+-if WITH_GCOV
+-pcretest_CFLAGS += $(GCOV_CFLAGS)
+-pcretest_LDADD += $(GCOV_LIBS)
+-endif # WITH_GCOV
+-
+-if WITH_PCRE8
+-TESTS += RunGrepTest
+-dist_noinst_SCRIPTS += RunGrepTest
+-bin_PROGRAMS += pcregrep
+-pcregrep_SOURCES = pcregrep.c
+-pcregrep_CFLAGS = $(AM_CFLAGS)
+-pcregrep_LDADD = $(LIBZ) $(LIBBZ2)
+-pcregrep_LDADD += libpcre.la libpcreposix.la
+-if WITH_GCOV
+-pcregrep_CFLAGS += $(GCOV_CFLAGS)
+-pcregrep_LDADD += $(GCOV_LIBS)
+-endif # WITH_GCOV
+-endif # WITH_PCRE8
+-
+ EXTRA_DIST += \
+   testdata/grepbinary \
+   testdata/grepfilelist \
+-- 
+2.13.1
+
diff --git a/contrib/src/pcre/SHA512SUMS b/contrib/src/pcre/SHA512SUMS
index 15d0b0bb4c..f65e19cb60 100644
--- a/contrib/src/pcre/SHA512SUMS
+++ b/contrib/src/pcre/SHA512SUMS
@@ -1 +1 @@
-b4c27eafbdf33bd7a1384655b1936f4be3bc6745c072347eb26e988896c52664bd85ac42444da1be78b6e20f45b6c7e5921f5f20f5b0741b5bd3d9844e5bd4e2  pcre-8.40.tar.bz2
\ No newline at end of file
+cc9cdbeb98c010fe4f093a019bebfb91965dae4c6a48f8e49c38ec8df7d9da7f0d32c12fc58f22c51f1c2f010e72b65bcbf8bbf180060e93edf464fa9a7c3551  pcre-8.41.tar.bz2
diff --git a/contrib/src/pcre/rules.mak b/contrib/src/pcre/rules.mak
index 21fc066111..a0214507cc 100644
--- a/contrib/src/pcre/rules.mak
+++ b/contrib/src/pcre/rules.mak
@@ -1,6 +1,6 @@
 # Perl Compatible Regular Expression
 
-PCRE_VERSION := 8.40
+PCRE_VERSION := 8.41
 PCRE_URL := ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-$(PCRE_VERSION).tar.bz2
 
 PKGS += pcre
@@ -19,9 +19,11 @@ $(TARBALLS)/pcre-$(PCRE_VERSION).tar.bz2:
 
 pcre: pcre-$(PCRE_VERSION).tar.bz2 .sum-pcre
 	$(UNPACK)
+	$(APPLY) $(SRC)/pcre/0001-build-don-t-build-executables.patch
 	$(MOVE)
 
 .pcre: pcre
+	$(RECONF)
 	cd $< && $(HOSTVARS) ./configure --disable-cpp $(HOSTCONF)
 	cd $< && $(MAKE) install
 	touch $@
-- 
GitLab