dev-libs/kuserfeedback: x86 stable wrt bug #721452
[gentoo.git] / dev-libs / oniguruma / oniguruma-6.9.4.ebuild
1 # Copyright 2003-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="7"
5
6 inherit multilib-minimal
7
8 if [[ "${PV}" == "9999" ]]; then
9         inherit autotools git-r3
10
11         EGIT_REPO_URI="https://github.com/kkos/oniguruma"
12 fi
13
14 DESCRIPTION="Regular expression library for different character encodings"
15 HOMEPAGE="https://github.com/kkos/oniguruma"
16 if [[ "${PV}" == "9999" ]]; then
17         SRC_URI=""
18 else
19         SRC_URI="https://github.com/kkos/${PN}/releases/download/v${PV}/onig-${PV}.tar.gz"
20 fi
21
22 LICENSE="BSD-2"
23 SLOT="0/5"
24 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x86-solaris"
25 IUSE="crnl-as-line-terminator static-libs"
26
27 if [[ "${PV}" != "9999" ]]; then
28         S="${WORKDIR}/onig-${PV}"
29 fi
30
31 DOCS=(AUTHORS HISTORY README{,_japanese} doc/{API,CALLOUTS.API,CALLOUTS.BUILTIN,FAQ,RE}{,.ja} doc/{SYNTAX.md,UNICODE_PROPERTIES})
32
33 src_prepare() {
34         # https://github.com/kkos/oniguruma/issues/167
35         # https://github.com/kkos/oniguruma/commit/603f4db48efb49307b7515500496e9e7a92fb779
36         sed -e "/^#define MATCH_AT_ERROR_RETURN(err_code)/s/best_len = err_code; goto match_at_end/do {&;} while(0)/" -i src/regexec.c || die
37
38         default
39
40         if [[ "${PV}" == "9999" ]]; then
41                 eautoreconf
42         fi
43 }
44
45 multilib_src_configure() {
46         ECONF_SOURCE="${S}" econf \
47                 $(use_enable crnl-as-line-terminator) \
48                 $(use_enable static-libs static)
49 }
50
51 multilib_src_install_all() {
52         einstalldocs
53         find "${D}" -name "*.la" -type f -delete || die
54 }