1 # Copyright 2003-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit multilib-minimal
8 if [[ "${PV}" == "9999" ]]; then
9 inherit autotools git-r3
11 EGIT_REPO_URI="https://github.com/kkos/oniguruma"
14 DESCRIPTION="Regular expression library for different character encodings"
15 HOMEPAGE="https://github.com/kkos/oniguruma"
16 if [[ "${PV}" == "9999" ]]; then
19 SRC_URI="https://github.com/kkos/${PN}/releases/download/v${PV}/onig-${PV}.tar.gz"
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"
27 if [[ "${PV}" != "9999" ]]; then
28 S="${WORKDIR}/onig-${PV}"
31 DOCS=(AUTHORS HISTORY README{,_japanese} doc/{API,CALLOUTS.API,CALLOUTS.BUILTIN,FAQ,RE}{,.ja} doc/{SYNTAX.md,UNICODE_PROPERTIES})
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
40 if [[ "${PV}" == "9999" ]]; then
45 multilib_src_configure() {
46 ECONF_SOURCE="${S}" econf \
47 $(use_enable crnl-as-line-terminator) \
48 $(use_enable static-libs static)
51 multilib_src_install_all() {
53 find "${D}" -name "*.la" -type f -delete || die