1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit eutils flag-o-matic libtool ltprune multilib-minimal
8 DESCRIPTION="The Fast Lexical Analyzer"
9 HOMEPAGE="https://flex.sourceforge.net/ https://github.com/westes/flex"
10 SRC_URI="https://github.com/westes/${PN}/releases/download/v${PV}/${P}.tar.gz"
14 KEYWORDS="~alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 ~riscv s390 sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
15 IUSE="nls static test"
16 RESTRICT="!test? ( test )"
18 # We want bison explicitly and not yacc in general #381273
19 RDEPEND="sys-devel/m4"
22 nls? ( sys-devel/gettext )
23 test? ( sys-devel/bison )"
26 "${FILESDIR}"/${PN}-2.6.4-libobjdir.patch
27 "${FILESDIR}"/${PN}-2.6.4-fix-build-with-glibc2.6+.patch
33 # Disable running in the tests/ subdir as it has a bunch of built sources
34 # that cannot be made conditional (automake limitation). #568842
37 -e '/^SUBDIRS =/,/^$/{/tests/d}' \
40 elibtoolize # Prefix always needs this
44 use static && append-ldflags -static
46 multilib-minimal_src_configure
49 multilib_src_configure() {
50 # Do not install shared libs #503522
55 --docdir='$(datarootdir)/doc/'${PF}
58 multilib_src_compile() {
59 if multilib_is_native_abi; then
63 emake -f Makefile -f - lib <<< 'lib: $(lib_LTLIBRARIES)'
68 multilib_is_native_abi && emake check
71 multilib_src_install() {
72 if multilib_is_native_abi; then
76 emake DESTDIR="${D}" install-libLTLIBRARIES install-includeHEADERS
80 multilib_src_install_all() {
83 prune_libtool_files --all
84 rm "${ED}"/usr/share/doc/${PF}/COPYING || die
85 dosym flex /usr/bin/lex