1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit eutils flag-o-matic 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/flex/releases/download/v${PV}/${P}.tar.xz"
14 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 m68k ~mips ppc ppc64 s390 sparc x86 ~ppc-aix ~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 # Disable running in the tests/ subdir as it has a bunch of built sources
27 # that cannot be made conditional (automake limitation). #568842
30 -e '/^SUBDIRS =/,/^$/{/tests/d}' \
36 use static && append-ldflags -static
38 multilib-minimal_src_configure
41 multilib_src_configure() {
42 # Do not install shared libs #503522
47 --docdir='$(datarootdir)/doc/'${PF}
50 multilib_src_compile() {
51 if multilib_is_native_abi; then
55 emake -f Makefile -f - lib <<< 'lib: $(lib_LTLIBRARIES)'
60 multilib_is_native_abi && emake check
63 multilib_src_install() {
64 if multilib_is_native_abi; then
68 emake DESTDIR="${D}" install-libLTLIBRARIES install-includeHEADERS
72 multilib_src_install_all() {
75 prune_libtool_files --all
76 rm "${ED}"/usr/share/doc/${PF}/COPYING || die
77 dosym flex /usr/bin/lex