summaryrefslogtreecommitdiff
path: root/dev-libs/libpcre
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-libs/libpcre
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-libs/libpcre')
-rw-r--r--dev-libs/libpcre/Manifest11
-rw-r--r--dev-libs/libpcre/files/libpcre-8.40-jit-else.patch68
-rw-r--r--dev-libs/libpcre/files/libpcre-8.40-pcregrep-multiline-1.patch69
-rw-r--r--dev-libs/libpcre/files/libpcre-8.40-pcregrep-multiline-2.patch25
-rw-r--r--dev-libs/libpcre/files/libpcre-8.41-sljit_mips-label-statement-fix.patch15
-rw-r--r--dev-libs/libpcre/libpcre-8.40-r1.ebuild96
-rw-r--r--dev-libs/libpcre/libpcre-8.41.ebuild103
-rw-r--r--dev-libs/libpcre/metadata.xml32
8 files changed, 419 insertions, 0 deletions
diff --git a/dev-libs/libpcre/Manifest b/dev-libs/libpcre/Manifest
new file mode 100644
index 000000000000..bd37ef6af42d
--- /dev/null
+++ b/dev-libs/libpcre/Manifest
@@ -0,0 +1,11 @@
+AUX libpcre-8.40-jit-else.patch 2149 SHA256 a6fb7e204a0a33c12c89983f57f8548998b52137f7964a809c5b6031e37d6829 SHA512 d1d8e7c689402bad4ac26785e1a642978a6e76f83f69d4df251fb7b88108106292f73a43c6f476c226a45ccfab008283f269128e3631930b0f5490b2f46e3b48 WHIRLPOOL 35a3593928463bc3fb8c3c51cb110547fbd55be894d968b0569afcac17a5f268d2347be187d267c58f302f60aa7a00df80d72524a99cb8c6b4491b0a7725e9c2
+AUX libpcre-8.40-pcregrep-multiline-1.patch 2688 SHA256 6bc091de8df6715c9cdea6b65d3050112b032915e24e12d5d440434b11d4032a SHA512 c7095a8034db6896c1457e7950a15c00ffd7c08dc29f07ca83e46db63209d42c87e808f328bd2eaaaed0fe4038575629b8e64fa77b4c249ca938fc83415bbe28 WHIRLPOOL 87ae705b53a3227f297cec1036301be32687c02c8b44131b62994663fb2cf2cc0c92c1968627f1238f1985a92a660ccebacc0eda4e05ac315a4672c5b89ab3fa
+AUX libpcre-8.40-pcregrep-multiline-2.patch 803 SHA256 01d27d72071e1fc5e90db5da2795b61b19e519097200b891979b02a63222b5ed SHA512 aae538dcf871618d00e9994ab1fd973f491075fc852c45aedd6e99ffd6726aabc9f93fff3e5aebbc1869fd2dd85d6d24f0eded075df857991b0457ca797a25fd WHIRLPOOL 7dc104231878dad7a51a2d0fd95711002780a6c6190af15facda78595ac93befeb0f63c02315a1c528dd2aac7ef17727a5fed0af0fe996f6a0158ea380ffd0e4
+AUX libpcre-8.41-sljit_mips-label-statement-fix.patch 584 SHA256 d91c7b3f71e1e0982ef9b47094d91dd63bcf1a0c235ed0384baa999be0f91801 SHA512 38f133a539f4e09886084e0ff2d30bf69ceb600095f87f32eae42f8f03ada9c1aae0a1eff6763d473f0edfcef047a0c573859d0ada503419a7d663140a92fbb9 WHIRLPOOL 90049c348516104beeb70934ca2b5ce7bdb25bbba3ceb8f4c30c3e7889d45dc61fe932a01c238fad083486eb709ce2d10041cc0705c988712c468e66eaa0597a
+DIST pcre-8.40.tar.bz2 1560119 SHA256 00e27a29ead4267e3de8111fcaa59b132d0533cdfdbdddf4b0604279acbcf4f4 SHA512 b4c27eafbdf33bd7a1384655b1936f4be3bc6745c072347eb26e988896c52664bd85ac42444da1be78b6e20f45b6c7e5921f5f20f5b0741b5bd3d9844e5bd4e2 WHIRLPOOL 6711688972b3db4b98902d548b84e8b03b61c3a12d24a4e42fc49ddc5e2b4be51f98f91873166e550866e88b6cd55092ea27704a3b7e71d58a2af21148ad3340
+DIST pcre-8.41.tar.bz2 1561874 SHA256 e62c7eac5ae7c0e7286db61ff82912e1c0b7a0c13706616e94a7dd729321b530 SHA512 cc9cdbeb98c010fe4f093a019bebfb91965dae4c6a48f8e49c38ec8df7d9da7f0d32c12fc58f22c51f1c2f010e72b65bcbf8bbf180060e93edf464fa9a7c3551 WHIRLPOOL 24d891c4f6580af20aa07a166038a2bacb52cdb305987f8b91b2fecae65e7b5277d3ef0b26ddbb3a33fd34794e6340e77df6a321e770b3aca4393d1ed144cf64
+EBUILD libpcre-8.40-r1.ebuild 2849 SHA256 71b6ae4b11f222072bf9776f4e701cd17e7819b82ce58d62c65a6380fa87f364 SHA512 b6969ee98be6c15c5e698a03c78956159f147a08fa9646711e75122ebae03df3e154d8a394a033a70ac2d5658b02b67626396433993639491b8753cc03fdd02f WHIRLPOOL 99012339d40a2857e83602e58b7b23f89d9385537df57a84b9ff38492ea443d48445d1151c9a442debee19e3fcfda14ae66ac11c50c702640ef18afc05dc8252
+EBUILD libpcre-8.41.ebuild 2846 SHA256 f41ed4166ce3157850fef339a2f1ff43b262fbd44919e5206a6ae773a2f69a7c SHA512 96f8b9c21755b2b796a203792143e0b8d837427c494991835ea2ec54fda43695a6821adc45744764161ed2bea1ef1385d672585acc2034f67fe4318c6e3f9ace WHIRLPOOL 4ab81d4a5928d779fe079bdb5c4e52cf8286653319f7028eb4763abd466f1f0673701865bbf35f10684a1285b1eb3ef854b2469a0d748dcc84be61f0832a8bf7
+MISC ChangeLog 9358 SHA256 6d71cdef5ca28f5d0c3af958daa73122d374a64088bf960961f9eec235572595 SHA512 ad1c6ff26e6198bda9f8c5d31d03a5337b0bd7c620f564b31b98117982d12677426ec4d703325028c44ea371dc15c3b2530d0c91ccd9e8b40b5710761a2e7ef0 WHIRLPOOL c8f1726ad29d83ee380eeeaae0a385a7de8db1e99751357bbf59dcf0af751e4f6ddb8f88d836dda0d0d6e132ef4db126fa3e64610491ceadce550b3017b2ee5d
+MISC ChangeLog-2015 35335 SHA256 dfdfc43bcff86898d74db532baf46e6d88c70a3e62e82ceab69c285934f802b5 SHA512 94411b185f75967d240777124272d04b13f3cb3e43de6f751baa9944e07086f9fa2972e4854514fb39f85d69422a07fd1ee1cc7fc587dacf54b777bdf68439ea WHIRLPOOL ec71b8c06e85b5ec0a4040def4447e6aa2589bbaf9bd4b5d7479a2b968357a2b5c4a30e7c2739bd1b4607e074cdc9d15e0f730ed1a69cb936d514056d53578e0
+MISC metadata.xml 1112 SHA256 fa2a7f9e7f1ee1c432907cbc5cc0dd23f9636b5f4c51836dbcdbf24f72975c2a SHA512 eb7e2db9932c108442e69bd3ddf04d8d753dede44f7453b1fa33730ec9cda89e618f4444a0adf3f9e7d09baf8c97ff19831906ad7148a26674269f1efd427e6b WHIRLPOOL 7b675f34fbd1f58f42d7ad5c4e39e1d80922474624047165b30d85ecdbbffd1246d68b0dad4d7553c0d2fc900249e3425fc04f9b3821f189b30ebb2d2615dbad
diff --git a/dev-libs/libpcre/files/libpcre-8.40-jit-else.patch b/dev-libs/libpcre/files/libpcre-8.40-jit-else.patch
new file mode 100644
index 000000000000..d347a7f5e1e0
--- /dev/null
+++ b/dev-libs/libpcre/files/libpcre-8.40-jit-else.patch
@@ -0,0 +1,68 @@
+https://bugs.gentoo.org/609592
+https://bugs.exim.org/show_bug.cgi?id=2035
+
+From 7ddfbe9d0b9f43402f8043e940172a318cc407c6 Mon Sep 17 00:00:00 2001
+From: Zoltan Herczeg <hzmester@freemail.hu>
+Date: Tue, 14 Feb 2017 08:48:18 +0000
+Subject: [PATCH] Fix a missing else in the JIT compiler reported by
+ 'idaifish'.
+
+git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1680 2f5784b3-3f2a-0410-8824-cb99058d5e15
+---
+ ChangeLog | 2 ++
+ pcre_jit_compile.c | 2 +-
+ testdata/testinput12 | 2 ++
+ testdata/testoutput12 | 2 ++
+ 4 files changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index 373ee8422ef5..d813935539bd 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -15,6 +15,8 @@ mode with --only-matching matched several lines, it restarted scanning at the
+ next line instead of moving on to the end of the matched string, which can be
+ several lines after the start.
+
++3. Fix a missing else in the JIT compiler reported by 'idaifish'.
++
+
+ Version 8.40 11-January-2017
+ ----------------------------
+diff --git a/pcre_jit_compile.c b/pcre_jit_compile.c
+index c301f05d5e3f..6ef8e48ff5e8 100644
+--- a/pcre_jit_compile.c
++++ b/pcre_jit_compile.c
+@@ -8110,7 +8110,7 @@ if (opcode == OP_COND || opcode == OP_SCOND)
+
+ if (*matchingpath == OP_FAIL)
+ stacksize = 0;
+- if (*matchingpath == OP_RREF)
++ else if (*matchingpath == OP_RREF)
+ {
+ stacksize = GET2(matchingpath, 1);
+ if (common->currententry == NULL)
+diff --git a/testdata/testinput12 b/testdata/testinput12
+index 944be6943f5e..89ed4564bcd4 100644
+--- a/testdata/testinput12
++++ b/testdata/testinput12
+@@ -104,4 +104,6 @@ and a couple of things that are different with JIT. --/
+ /(.|.)*?bx/
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabax
+
++/((?(?!))x)(?'name')(?1)/S++
++
+ /-- End of testinput12 --/
+diff --git a/testdata/testoutput12 b/testdata/testoutput12
+index 87911086f498..7632c4e58013 100644
+--- a/testdata/testoutput12
++++ b/testdata/testoutput12
+@@ -201,4 +201,6 @@ No match, mark = m (JIT)
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabax
+ Error -8 (match limit exceeded)
+
++/((?(?!))x)(?'name')(?1)/S++
++
+ /-- End of testinput12 --/
+--
+2.12.0
+
diff --git a/dev-libs/libpcre/files/libpcre-8.40-pcregrep-multiline-1.patch b/dev-libs/libpcre/files/libpcre-8.40-pcregrep-multiline-1.patch
new file mode 100644
index 000000000000..f15968dfe98e
--- /dev/null
+++ b/dev-libs/libpcre/files/libpcre-8.40-pcregrep-multiline-1.patch
@@ -0,0 +1,69 @@
+From 5be027b624bc866702808abadfe5f99360414086 Mon Sep 17 00:00:00 2001
+From: Philip Hazel <ph10@cam.ac.uk>
+Date: Fri, 10 Feb 2017 17:47:34 +0000
+Subject: [PATCH] Correct fix for pcre2grep multiline with --only-matching.
+
+git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1678 2f5784b3-3f2a-0410-8824-cb99058d5e15
+---
+ ChangeLog | 5 +++++
+ configure.ac | 6 +++---
+ pcregrep.c | 20 +++++++++++++++-----
+ 3 files changed, 23 insertions(+), 8 deletions(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index ab4e053e601e..373ee8422ef5 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -10,6 +10,11 @@ Version 8.41
+ 1. Fixed typo in CMakeLists.txt (wrong number of arguments for
+ PCRE_STATIC_RUNTIME (affects MSVC only).
+
++2. Issue 1 for 8.40 below was not correctly fixed. If pcregrep in multiline
++mode with --only-matching matched several lines, it restarted scanning at the
++next line instead of moving on to the end of the matched string, which can be
++several lines after the start.
++
+
+ Version 8.40 11-January-2017
+ ----------------------------
+diff --git a/pcregrep.c b/pcregrep.c
+index fd2a67622baa..2070c057e4a0 100644
+--- a/pcregrep.c
++++ b/pcregrep.c
+@@ -1804,11 +1804,6 @@ while (ptr < endptr)
+ if (line_buffered) fflush(stdout);
+ rc = 0; /* Had some success */
+
+- /* If the current match ended past the end of the line (only possible
+- in multiline mode), we are done with this line. */
+-
+- if ((unsigned int)offsets[1] > linelength) goto END_ONE_MATCH;
+-
+ startoffset = offsets[1]; /* Restart after the match */
+ if (startoffset <= oldstartoffset)
+ {
+@@ -1818,6 +1813,21 @@ while (ptr < endptr)
+ if (utf8)
+ while ((matchptr[startoffset] & 0xc0) == 0x80) startoffset++;
+ }
++
++ /* If the current match ended past the end of the line (only possible
++ in multiline mode), we must move on to the line in which it did end
++ before searching for more matches. */
++
++ while (startoffset > (int)linelength)
++ {
++ matchptr = ptr += linelength + endlinelength;
++ filepos += (int)(linelength + endlinelength);
++ linenumber++;
++ startoffset -= (int)(linelength + endlinelength);
++ t = end_of_line(ptr, endptr, &endlinelength);
++ linelength = t - ptr - endlinelength;
++ }
++
+ goto ONLY_MATCHING_RESTART;
+ }
+ }
+--
+2.12.0
+
diff --git a/dev-libs/libpcre/files/libpcre-8.40-pcregrep-multiline-2.patch b/dev-libs/libpcre/files/libpcre-8.40-pcregrep-multiline-2.patch
new file mode 100644
index 000000000000..63ad51cd1047
--- /dev/null
+++ b/dev-libs/libpcre/files/libpcre-8.40-pcregrep-multiline-2.patch
@@ -0,0 +1,25 @@
+From 8b0fdf16e57ce9a653a0a03c39f6cc061e8122e8 Mon Sep 17 00:00:00 2001
+From: Philip Hazel <ph10@cam.ac.uk>
+Date: Sun, 12 Feb 2017 13:28:11 +0000
+Subject: [PATCH] Fix bug in most recent fix for multiline pcre2grep.
+
+git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1679 2f5784b3-3f2a-0410-8824-cb99058d5e15
+---
+ pcregrep.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/pcregrep.c b/pcregrep.c
+index 2070c057e4a0..3cd70eeb4261 100644
+--- a/pcregrep.c
++++ b/pcregrep.c
+@@ -1826,6 +1826,7 @@ while (ptr < endptr)
+ startoffset -= (int)(linelength + endlinelength);
+ t = end_of_line(ptr, endptr, &endlinelength);
+ linelength = t - ptr - endlinelength;
++ length = (size_t)(endptr - ptr);
+ }
+
+ goto ONLY_MATCHING_RESTART;
+--
+2.12.0
+
diff --git a/dev-libs/libpcre/files/libpcre-8.41-sljit_mips-label-statement-fix.patch b/dev-libs/libpcre/files/libpcre-8.41-sljit_mips-label-statement-fix.patch
new file mode 100644
index 000000000000..0494ccc25ebc
--- /dev/null
+++ b/dev-libs/libpcre/files/libpcre-8.41-sljit_mips-label-statement-fix.patch
@@ -0,0 +1,15 @@
+diff -Naurp pcre-8.41.orig/sljit/sljitNativeMIPS_common.c pcre-8.41/sljit/sljitNativeMIPS_common.c
+--- pcre-8.41.orig/sljit/sljitNativeMIPS_common.c 2017-05-07 11:32:25.000000000 -0400
++++ pcre-8.41/sljit/sljitNativeMIPS_common.c 2017-07-29 17:50:24.508909742 -0400
+@@ -503,9 +503,11 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit
+ #ifdef SLJIT_IS_FPU_AVAILABLE
+ return SLJIT_IS_FPU_AVAILABLE;
+ #elif defined(__GNUC__)
++ {
+ sljit_sw fir;
+ asm ("cfc1 %0, $0" : "=r"(fir));
+ return (fir >> 22) & 0x1;
++ }
+ #else
+ #error "FIR check is not implemented for this architecture"
+ #endif
diff --git a/dev-libs/libpcre/libpcre-8.40-r1.ebuild b/dev-libs/libpcre/libpcre-8.40-r1.ebuild
new file mode 100644
index 000000000000..3b1c5c161f05
--- /dev/null
+++ b/dev-libs/libpcre/libpcre-8.40-r1.ebuild
@@ -0,0 +1,96 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils multilib libtool flag-o-matic toolchain-funcs multilib-minimal
+
+DESCRIPTION="Perl-compatible regular expression library"
+HOMEPAGE="http://www.pcre.org/"
+MY_P="pcre-${PV/_rc/-RC}"
+if [[ ${PV} != *_rc* ]] ; then
+ # Only the final releases are available here.
+ SRC_URI="mirror://sourceforge/pcre/${MY_P}.tar.bz2
+ ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/${MY_P}.tar.bz2"
+else
+ SRC_URI="ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/Testing/${MY_P}.tar.bz2"
+fi
+
+LICENSE="BSD"
+SLOT="3"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="bzip2 +cxx +jit libedit pcre16 pcre32 +readline +recursion-limit static-libs unicode zlib"
+REQUIRED_USE="readline? ( !libedit )
+ libedit? ( !readline )"
+
+RDEPEND="bzip2? ( app-arch/bzip2 )
+ zlib? ( sys-libs/zlib )
+ libedit? ( dev-libs/libedit )
+ readline? ( sys-libs/readline:0= )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+RDEPEND="${RDEPEND}
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20131008-r2
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+
+S=${WORKDIR}/${MY_P}
+
+MULTILIB_CHOST_TOOLS=(
+ /usr/bin/pcre-config
+)
+
+PATCHES=(
+ "${FILESDIR}"/${P}-pcregrep-multiline-{1,2}.patch
+ "${FILESDIR}"/${P}-jit-else.patch #609592
+)
+
+src_prepare() {
+ epatch "${PATCHES[@]}"
+ sed -i -e "s:-lpcre ::" libpcrecpp.pc.in || die
+ elibtoolize
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE="${S}" econf \
+ --with-match-limit-recursion=$(usex recursion-limit 8192 MATCH_LIMIT) \
+ $(multilib_native_use_enable bzip2 pcregrep-libbz2) \
+ $(use_enable cxx cpp) \
+ $(use_enable jit) $(use_enable jit pcregrep-jit) \
+ $(use_enable pcre16) \
+ $(use_enable pcre32) \
+ $(multilib_native_use_enable libedit pcretest-libedit) \
+ $(multilib_native_use_enable readline pcretest-libreadline) \
+ $(use_enable static-libs static) \
+ $(use_enable unicode utf) $(use_enable unicode unicode-properties) \
+ $(multilib_native_use_enable zlib pcregrep-libz) \
+ --enable-pcre8 \
+ --enable-shared \
+ --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html \
+ --docdir="${EPREFIX}"/usr/share/doc/${PF}
+}
+
+multilib_src_compile() {
+ emake V=1 $(multilib_is_native_abi || echo "bin_PROGRAMS=")
+}
+
+multilib_src_install() {
+ emake \
+ DESTDIR="${D}" \
+ $(multilib_is_native_abi || echo "bin_PROGRAMS= dist_html_DATA=") \
+ install
+ gen_usr_ldscript -a pcre
+}
+
+multilib_src_install_all() {
+ prune_libtool_files
+}
+
+pkg_preinst() {
+ preserve_old_lib /$(get_libdir)/libpcre.so.0
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify /$(get_libdir)/libpcre.so.0
+}
diff --git a/dev-libs/libpcre/libpcre-8.41.ebuild b/dev-libs/libpcre/libpcre-8.41.ebuild
new file mode 100644
index 000000000000..96c3c8993de6
--- /dev/null
+++ b/dev-libs/libpcre/libpcre-8.41.ebuild
@@ -0,0 +1,103 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils multilib libtool flag-o-matic toolchain-funcs multilib-minimal
+
+DESCRIPTION="Perl-compatible regular expression library"
+HOMEPAGE="http://www.pcre.org/"
+MY_P="pcre-${PV/_rc/-RC}"
+if [[ ${PV} != *_rc* ]] ; then
+ # Only the final releases are available here.
+ SRC_URI="mirror://sourceforge/pcre/${MY_P}.tar.bz2
+ ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/${MY_P}.tar.bz2"
+else
+ SRC_URI="ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/Testing/${MY_P}.tar.bz2"
+fi
+
+LICENSE="BSD"
+SLOT="3"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh ~sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="bzip2 +cxx +jit libedit pcre16 pcre32 +readline +recursion-limit static-libs unicode zlib"
+REQUIRED_USE="readline? ( !libedit )
+ libedit? ( !readline )"
+
+RDEPEND="
+ bzip2? ( app-arch/bzip2 )
+ zlib? ( sys-libs/zlib )
+ libedit? ( dev-libs/libedit )
+ readline? ( sys-libs/readline:0= )
+"
+DEPEND="
+ ${RDEPEND}
+ virtual/pkgconfig
+"
+RDEPEND="
+ ${RDEPEND}
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20131008-r2
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )
+"
+
+S="${WORKDIR}/${MY_P}"
+
+MULTILIB_CHOST_TOOLS=(
+ /usr/bin/pcre-config
+)
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-8.41-sljit_mips-label-statement-fix.patch
+)
+
+src_prepare() {
+ epatch "${PATCHES[@]}"
+ sed -i -e "s:-lpcre ::" libpcrecpp.pc.in || die
+ elibtoolize
+}
+
+multilib_src_configure() {
+ local myeconfargs=(
+ --with-match-limit-recursion=$(usex recursion-limit 8192 MATCH_LIMIT)
+ $(multilib_native_use_enable bzip2 pcregrep-libbz2)
+ $(use_enable cxx cpp)
+ $(use_enable jit) $(use_enable jit pcregrep-jit)
+ $(use_enable pcre16)
+ $(use_enable pcre32)
+ $(multilib_native_use_enable libedit pcretest-libedit)
+ $(multilib_native_use_enable readline pcretest-libreadline)
+ $(use_enable static-libs static)
+ $(use_enable unicode utf) $(use_enable unicode unicode-properties)
+ $(multilib_native_use_enable zlib pcregrep-libz)
+ --enable-pcre8
+ --enable-shared
+ --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html
+ --docdir="${EPREFIX}"/usr/share/doc/${PF}
+ )
+ ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
+}
+
+multilib_src_compile() {
+ emake V=1 $(multilib_is_native_abi || echo "bin_PROGRAMS=")
+}
+
+multilib_src_install() {
+ emake \
+ DESTDIR="${D}" \
+ $(multilib_is_native_abi || echo "bin_PROGRAMS= dist_html_DATA=") \
+ install
+ gen_usr_ldscript -a pcre
+}
+
+multilib_src_install_all() {
+ prune_libtool_files
+}
+
+pkg_preinst() {
+ preserve_old_lib /$(get_libdir)/libpcre.so.0
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify /$(get_libdir)/libpcre.so.0
+}
diff --git a/dev-libs/libpcre/metadata.xml b/dev-libs/libpcre/metadata.xml
new file mode 100644
index 000000000000..edde7e11c64f
--- /dev/null
+++ b/dev-libs/libpcre/metadata.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+<use>
+ <flag name="bzip2">
+ Add support for pcregrep command to search within
+ bzip2-compressed files (via <pkg>app-arch/bzip2</pkg>).
+ </flag>
+ <flag name="pcre16">Build PCRE library for 16 bit characters (e.g. UTF-16).</flag>
+ <flag name="pcre32">Build PCRE library for 32 bit characters (e.g. UTF-32).</flag>
+ <flag name="readline">
+ Add support for command line editing to pcretest, through
+ <pkg>sys-libs/readline</pkg>.
+ </flag>
+ <flag name="recursion-limit">
+ Limit match recursion to 8192; if disabled, the default limit is
+ used, which is the same as the match limit.
+ </flag>
+ <flag name="zlib">
+ Add support for pcregrep command to search within
+ gzip-compressed files (via <pkg>sys-libs/zlib</pkg>).
+ </flag>
+</use>
+<upstream>
+ <remote-id type="cpe">cpe:/a:pcre:pcre</remote-id>
+ <remote-id type="sourceforge">pcre</remote-id>
+</upstream>
+</pkgmetadata>