diff options
Diffstat (limited to 'dev-lua/lpeg')
-rw-r--r-- | dev-lua/lpeg/lpeg-0.12.ebuild | 50 |
1 files changed, 16 insertions, 34 deletions
diff --git a/dev-lua/lpeg/lpeg-0.12.ebuild b/dev-lua/lpeg/lpeg-0.12.ebuild index e0141e9..7d3d240 100644 --- a/dev-lua/lpeg/lpeg-0.12.ebuild +++ b/dev-lua/lpeg/lpeg-0.12.ebuild @@ -4,7 +4,8 @@ EAPI="5" -inherit flag-o-matic toolchain-funcs eutils multilib +IS_MULTILIB=true +inherit lua DESCRIPTION="Parsing Expression Grammars for Lua" HOMEPAGE="http://www.inf.puc-rio.br/~roberto/lpeg/" @@ -13,44 +14,25 @@ SRC_URI="http://www.inf.puc-rio.br/~roberto/${PN}/${P}.tar.gz" LICENSE="MIT" SLOT="0" KEYWORDS="amd64 ~arm ~hppa ~mips x86" -IUSE="debug doc luajit" - -RDEPEND=" - virtual/lua[luajit=] -" -DEPEND="${RDEPEND} - virtual/pkgconfig" - -src_prepare() { - local lua=lua - use luajit && lua=luajit - - epatch "${FILESDIR}"/${P}-makefile.patch - sed -r \ - -e "2s#^(LUADIR).*#\1 = $($(tc-getPKG_CONFIG) --variable includedir ${lua})#" \ - -i makefile +IUSE="debug doc" + +PATCHES=( "${FILESDIR}"/${P}-makefile.patch ) +DOCS=( HISTORY ) +HTML_DOCS=( {lpeg,re}.html ) + +all_lua_prepare() { use debug && append-cflags -DLPEG_DEBUG } -src_compile() { - emake CC="$(tc-getCC)" +each_lua_compile() { + _lua_setCFLAGS + emake CC="$(tc-getCC)" DLLFLAGS="${CFLAGS} ${LDFLAGS}" lpeg.so } -src_test() { - local lua=lua - use luajit && lua=luajit - - ${lua} test.lua || die +each_lua_test() { + ${LUA} test.lua } -src_install() { - local lua=lua - use luajit && lua=luajit - - exeinto "$($(tc-getPKG_CONFIG) --variable INSTALL_CMOD ${lua})" - doexe lpeg.so - - dodoc HISTORY - - use doc && dohtml *.html +each_lua_install() { + dolua lpeg.so } |