Skip to content

Commit

Permalink
dev-lua/lpeg: revbump to 1.0.0-r1
Browse files Browse the repository at this point in the history
Bring up to EAPI 6
Add LuaJIT Support
Install re.lua

Gentoo-Bug: https://bugs.gentoo.org/577250
Closes: gentoo#1317

Signed-off-by: Patrice Clement <[email protected]>
  • Loading branch information
lluixhi authored and monsieurp committed Apr 21, 2016
1 parent 280f0e7 commit 03538dc
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
48 changes: 48 additions & 0 deletions dev-lua/lpeg/lpeg-1.0.0-r1.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=6

inherit flag-o-matic toolchain-funcs

DESCRIPTION="Parsing Expression Grammars for Lua"
HOMEPAGE="http://www.inf.puc-rio.br/~roberto/lpeg/"
SRC_URI="http://www.inf.puc-rio.br/~roberto/${PN}/${P}.tar.gz"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~arm ~hppa ~ppc ~x86"
IUSE="debug doc luajit"

RDEPEND="!luajit? ( >=dev-lang/lua-5.1:= )
luajit? ( dev-lang/luajit:2= )"
DEPEND="${RDEPEND}
virtual/pkgconfig"

DOCS=( "HISTORY" )
HTML_DOCS=( "lpeg.html" "re.html" )
PATCHES=( "${FILESDIR}"/${PN}-0.12.1-makefile.patch )

src_prepare() {
default
use debug && append-cflags -DLPEG_DEBUG
}

src_compile() {
emake CC="$(tc-getCC)" \
LUADIR="$($(tc-getPKG_CONFIG) --variable includedir $(usex luajit 'luajit' 'lua'))"
}

src_test() {
$(usex luajit 'luajit' 'lua') test.lua || die
}

src_install() {
exeinto "$($(tc-getPKG_CONFIG) --variable INSTALL_CMOD $(usex luajit 'luajit' 'lua'))"
doexe lpeg.so
insinto "$($(tc-getPKG_CONFIG) --variable INSTALL_LMOD $(usex luajit 'luajit' 'lua'))"
doins re.lua

use doc && einstalldocs
}
4 changes: 4 additions & 0 deletions dev-lua/lpeg/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@
<email>[email protected]</email>
<name>Aric Belsito</name>
</maintainer>
<use>
<flag name="luajit">Use <pkg>dev-lang/luajit</pkg> instead of
<pkg>dev-lang/lua</pkg></flag>
</use>
</pkgmetadata>

0 comments on commit 03538dc

Please sign in to comment.