forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lpeg-1.0.0-r1.ebuild
51 lines (40 loc) · 1.21 KB
/
lpeg-1.0.0-r1.ebuild
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# 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() {
local instdir
instdir="$($(tc-getPKG_CONFIG) --variable INSTALL_CMOD $(usex luajit 'luajit' 'lua'))"
exeinto "${instdir#${EPREFIX}}"
doexe lpeg.so
instdir="$($(tc-getPKG_CONFIG) --variable INSTALL_LMOD $(usex luajit 'luajit' 'lua'))"
insinto "${instdir#${EPREFIX}}"
doins re.lua
use doc && einstalldocs
}