dev-libs/libpcre: Bump to version 8.41
[gentoo.git] / dev-libs / libpcre / libpcre-8.41.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 inherit eutils multilib libtool flag-o-matic toolchain-funcs multilib-minimal
7
8 DESCRIPTION="Perl-compatible regular expression library"
9 HOMEPAGE="http://www.pcre.org/"
10 MY_P="pcre-${PV/_rc/-RC}"
11 if [[ ${PV} != *_rc* ]] ; then
12         # Only the final releases are available here.
13         SRC_URI="mirror://sourceforge/pcre/${MY_P}.tar.bz2
14                 ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/${MY_P}.tar.bz2"
15 else
16         SRC_URI="ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/Testing/${MY_P}.tar.bz2"
17 fi
18
19 LICENSE="BSD"
20 SLOT="3"
21 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"
22 IUSE="bzip2 +cxx +jit libedit pcre16 pcre32 +readline +recursion-limit static-libs unicode zlib"
23 REQUIRED_USE="readline? ( !libedit )
24         libedit? ( !readline )"
25
26 RDEPEND="
27         bzip2? ( app-arch/bzip2 )
28         zlib? ( sys-libs/zlib )
29         libedit? ( dev-libs/libedit )
30         readline? ( sys-libs/readline:0= )
31 "
32 DEPEND="
33         ${RDEPEND}
34         virtual/pkgconfig
35 "
36 RDEPEND="
37         ${RDEPEND}
38         abi_x86_32? (
39                 !<=app-emulation/emul-linux-x86-baselibs-20131008-r2
40                 !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
41         )
42 "
43
44 S="${WORKDIR}/${MY_P}"
45
46 MULTILIB_CHOST_TOOLS=(
47         /usr/bin/pcre-config
48 )
49
50 #PATCHES=(
51 #)
52
53 src_prepare() {
54         #epatch "${PATCHES[@]}"
55         sed -i -e "s:-lpcre ::" libpcrecpp.pc.in || die
56         elibtoolize
57 }
58
59 multilib_src_configure() {
60         local myeconfargs=(
61                 --with-match-limit-recursion=$(usex recursion-limit 8192 MATCH_LIMIT)
62                 $(multilib_native_use_enable bzip2 pcregrep-libbz2)
63                 $(use_enable cxx cpp)
64                 $(use_enable jit) $(use_enable jit pcregrep-jit)
65                 $(use_enable pcre16)
66                 $(use_enable pcre32)
67                 $(multilib_native_use_enable libedit pcretest-libedit)
68                 $(multilib_native_use_enable readline pcretest-libreadline)
69                 $(use_enable static-libs static)
70                 $(use_enable unicode utf) $(use_enable unicode unicode-properties)
71                 $(multilib_native_use_enable zlib pcregrep-libz)
72                 --enable-pcre8
73                 --enable-shared
74                 --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html
75                 --docdir="${EPREFIX}"/usr/share/doc/${PF}
76         )
77         ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
78 }
79
80 multilib_src_compile() {
81         emake V=1 $(multilib_is_native_abi || echo "bin_PROGRAMS=")
82 }
83
84 multilib_src_install() {
85         emake \
86                 DESTDIR="${D}" \
87                 $(multilib_is_native_abi || echo "bin_PROGRAMS= dist_html_DATA=") \
88                 install
89         gen_usr_ldscript -a pcre
90 }
91
92 multilib_src_install_all() {
93         prune_libtool_files
94 }
95
96 pkg_preinst() {
97         preserve_old_lib /$(get_libdir)/libpcre.so.0
98 }
99
100 pkg_postinst() {
101         preserve_old_lib_notify /$(get_libdir)/libpcre.so.0
102 }