forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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> |