dev-libs/libpcre: stable 8.42 for sparc, bug #678646
[gentoo.git] / dev-libs / libpcre / libpcre-8.43.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit 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 ~x86-fbsd ~amd64-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
37 S="${WORKDIR}/${MY_P}"
38
39 MULTILIB_CHOST_TOOLS=(
40         /usr/bin/pcre-config
41 )
42
43 PATCHES=(
44         "${FILESDIR}"/${PN}-8.41-fix-stack-size-detection.patch
45 )
46
47 src_prepare() {
48         default
49         sed -i -e "s:-lpcre ::" libpcrecpp.pc.in || die
50         elibtoolize
51 }
52
53 multilib_src_configure() {
54         local myeconfargs=(
55                 --with-match-limit-recursion=$(usex recursion-limit 8192 MATCH_LIMIT)
56                 $(multilib_native_use_enable bzip2 pcregrep-libbz2)
57                 $(use_enable cxx cpp)
58                 $(use_enable jit)
59                 $(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)
66                 $(use_enable unicode unicode-properties)
67                 $(multilib_native_use_enable zlib pcregrep-libz)
68                 --enable-pcre8
69                 --enable-shared
70         )
71         ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
72 }
73
74 multilib_src_compile() {
75         emake V=1 $(multilib_is_native_abi || echo "bin_PROGRAMS=")
76 }
77
78 multilib_src_install() {
79         emake \
80                 DESTDIR="${D}" \
81                 $(multilib_is_native_abi || echo "bin_PROGRAMS= dist_html_DATA=") \
82                 install
83         gen_usr_ldscript -a pcre
84 }
85
86 multilib_src_install_all() {
87         find "${ED}" -name "*.la" -delete || die
88 }
89
90 pkg_preinst() {
91         preserve_old_lib /$(get_libdir)/libpcre.so.0
92 }
93
94 pkg_postinst() {
95         preserve_old_lib_notify /$(get_libdir)/libpcre.so.0
96 }