flex-2.6.1.ebuild 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. inherit eutils flag-o-matic multilib-minimal
  5. DESCRIPTION="The Fast Lexical Analyzer"
  6. HOMEPAGE="https://flex.sourceforge.net/ https://github.com/westes/flex"
  7. SRC_URI="https://github.com/westes/flex/releases/download/v${PV}/${P}.tar.xz"
  8. LICENSE="FLEX"
  9. SLOT="0"
  10. KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
  11. IUSE="nls static test"
  12. # We want bison explicitly and not yacc in general #381273
  13. RDEPEND="sys-devel/m4"
  14. DEPEND="${RDEPEND}
  15. app-arch/xz-utils
  16. nls? ( sys-devel/gettext )
  17. test? ( sys-devel/bison )"
  18. src_prepare() {
  19. # Disable running in the tests/ subdir as it has a bunch of built sources
  20. # that cannot be made conditional (automake limitation). #568842
  21. if ! use test ; then
  22. sed -i \
  23. -e '/^SUBDIRS =/,/^$/{/tests/d}' \
  24. Makefile.in || die
  25. fi
  26. }
  27. src_configure() {
  28. use static && append-ldflags -static
  29. multilib-minimal_src_configure
  30. }
  31. multilib_src_configure() {
  32. # Do not install shared libs #503522
  33. ECONF_SOURCE=${S} \
  34. econf \
  35. --disable-shared \
  36. $(use_enable nls) \
  37. --docdir='$(datarootdir)/doc/'${PF}
  38. }
  39. multilib_src_compile() {
  40. if multilib_is_native_abi; then
  41. default
  42. else
  43. cd src || die
  44. emake -f Makefile -f - lib <<< 'lib: $(lib_LTLIBRARIES)'
  45. fi
  46. }
  47. multilib_src_test() {
  48. multilib_is_native_abi && emake check
  49. }
  50. multilib_src_install() {
  51. if multilib_is_native_abi; then
  52. default
  53. else
  54. cd src || die
  55. emake DESTDIR="${D}" install-libLTLIBRARIES install-includeHEADERS
  56. fi
  57. }
  58. multilib_src_install_all() {
  59. einstalldocs
  60. dodoc ONEWS
  61. prune_libtool_files --all
  62. rm "${ED}"/usr/share/doc/${PF}/COPYING || die
  63. dosym flex /usr/bin/lex
  64. }