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