lpeg-1.0.0-r1.ebuild 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit flag-o-matic toolchain-funcs
  5. DESCRIPTION="Parsing Expression Grammars for Lua"
  6. HOMEPAGE="http://www.inf.puc-rio.br/~roberto/lpeg/"
  7. SRC_URI="http://www.inf.puc-rio.br/~roberto/${PN}/${P}.tar.gz"
  8. LICENSE="MIT"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~arm ~hppa ~ppc ~x86"
  11. IUSE="debug doc luajit"
  12. RDEPEND="!luajit? ( >=dev-lang/lua-5.1:= )
  13. luajit? ( dev-lang/luajit:2= )"
  14. DEPEND="${RDEPEND}
  15. virtual/pkgconfig"
  16. DOCS=( "HISTORY" )
  17. HTML_DOCS=( "lpeg.html" "re.html" )
  18. PATCHES=( "${FILESDIR}"/${PN}-0.12.1-makefile.patch )
  19. src_prepare() {
  20. default
  21. use debug && append-cflags -DLPEG_DEBUG
  22. }
  23. src_compile() {
  24. emake CC="$(tc-getCC)" \
  25. LUADIR="$($(tc-getPKG_CONFIG) --variable includedir $(usex luajit 'luajit' 'lua'))"
  26. }
  27. src_test() {
  28. $(usex luajit 'luajit' 'lua') test.lua || die
  29. }
  30. src_install() {
  31. local instdir
  32. instdir="$($(tc-getPKG_CONFIG) --variable INSTALL_CMOD $(usex luajit 'luajit' 'lua'))"
  33. exeinto "${instdir#${EPREFIX}}"
  34. doexe lpeg.so
  35. instdir="$($(tc-getPKG_CONFIG) --variable INSTALL_LMOD $(usex luajit 'luajit' 'lua'))"
  36. insinto "${instdir#${EPREFIX}}"
  37. doins re.lua
  38. use doc && einstalldocs
  39. }