1 |
commit: e5aaa5e9720a86fee7a0978772468653d0dec7ae |
2 |
Author: Conrad Kostecki <conikost <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Nov 28 22:23:58 2020 +0000 |
4 |
Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Nov 28 22:24:20 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e5aaa5e9 |
7 |
|
8 |
dev-lua/lpeg: migrate to lua eclass |
9 |
|
10 |
Closes: https://bugs.gentoo.org/752612 |
11 |
Package-Manager: Portage-3.0.9, Repoman-3.0.2 |
12 |
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org> |
13 |
|
14 |
dev-lua/lpeg/lpeg-1.0.2-r100.ebuild | 77 +++++++++++++++++++++++++++++++++++++ |
15 |
profiles/package.mask | 1 + |
16 |
2 files changed, 78 insertions(+) |
17 |
|
18 |
diff --git a/dev-lua/lpeg/lpeg-1.0.2-r100.ebuild b/dev-lua/lpeg/lpeg-1.0.2-r100.ebuild |
19 |
new file mode 100644 |
20 |
index 00000000000..a6d27c94e39 |
21 |
--- /dev/null |
22 |
+++ b/dev-lua/lpeg/lpeg-1.0.2-r100.ebuild |
23 |
@@ -0,0 +1,77 @@ |
24 |
+# Copyright 1999-2020 Gentoo Authors |
25 |
+# Distributed under the terms of the GNU General Public License v2 |
26 |
+ |
27 |
+EAPI=7 |
28 |
+ |
29 |
+LUA_COMPAT=( lua5-{1..3} luajit ) |
30 |
+ |
31 |
+inherit lua flag-o-matic toolchain-funcs |
32 |
+ |
33 |
+DESCRIPTION="Parsing Expression Grammars for Lua" |
34 |
+HOMEPAGE="http://www.inf.puc-rio.br/~roberto/lpeg/" |
35 |
+SRC_URI="http://www.inf.puc-rio.br/~roberto/${PN}/${P}.tar.gz" |
36 |
+ |
37 |
+LICENSE="MIT" |
38 |
+SLOT="0" |
39 |
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86" |
40 |
+IUSE="debug test" |
41 |
+REQUIRED_USE="${LUA_REQUIRED_USE}" |
42 |
+RESTRICT="!test? ( test )" |
43 |
+ |
44 |
+RDEPEND="${LUA_DEPS}" |
45 |
+DEPEND="${RDEPEND}" |
46 |
+BDEPEND="virtual/pkgconfig" |
47 |
+ |
48 |
+HTML_DOCS=( "lpeg.html" "lpeg-128.gif" "re.html" ) |
49 |
+ |
50 |
+PATCHES=( "${FILESDIR}/${PN}-1.0.2-makefile.patch" ) |
51 |
+ |
52 |
+src_prepare() { |
53 |
+ default |
54 |
+ |
55 |
+ use debug && append-cflags -DLPEG_DEBUG |
56 |
+} |
57 |
+ |
58 |
+lua_src_compile() { |
59 |
+ # Clean project to compile it for every lua slot |
60 |
+ emake clean |
61 |
+ |
62 |
+ local myemakeargs=( |
63 |
+ CC="$(tc-getCC)" |
64 |
+ LUADIR="$(lua_get_include_dir)" |
65 |
+ ) |
66 |
+ |
67 |
+ emake "${myemakeargs[@]}" |
68 |
+ |
69 |
+ # Copy module to match the choosen LUA implementation |
70 |
+ cp "lpeg.so" "lpeg-${ELUA}.so" || die |
71 |
+} |
72 |
+ |
73 |
+src_compile() { |
74 |
+ lua_foreach_impl lua_src_compile |
75 |
+} |
76 |
+ |
77 |
+lua_src_test() { |
78 |
+ LUA_CPATH="${S}/lpeg-${ELUA}.so" ${ELUA} test.lua || die |
79 |
+} |
80 |
+ |
81 |
+src_test() { |
82 |
+ lua_foreach_impl lua_src_test |
83 |
+} |
84 |
+ |
85 |
+lua_src_install() { |
86 |
+ # Use correct module for the choosen LUA implementation |
87 |
+ cp "lpeg-${ELUA}.so" "lpeg.so" || die |
88 |
+ |
89 |
+ exeinto $(lua_get_cmod_dir) |
90 |
+ doexe lpeg.so |
91 |
+ |
92 |
+ insinto $(lua_get_lmod_dir) |
93 |
+ doins re.lua |
94 |
+} |
95 |
+ |
96 |
+src_install() { |
97 |
+ lua_foreach_impl lua_src_install |
98 |
+ |
99 |
+ einstalldocs |
100 |
+} |
101 |
|
102 |
diff --git a/profiles/package.mask b/profiles/package.mask |
103 |
index b8ba6285bc4..e2cfd555d13 100644 |
104 |
--- a/profiles/package.mask |
105 |
+++ b/profiles/package.mask |
106 |
@@ -508,6 +508,7 @@ dev-lua/luacrypto |
107 |
=dev-libs/efl-1.25.1-r10 |
108 |
>=dev-lua/busted-2.0.0-r100 |
109 |
>=dev-lua/dkjson-2.5-r100 |
110 |
+>=dev-lua/lpeg-1.0.2-r100 |
111 |
>=dev-lua/lua-bit32-5.3.5-r100 |
112 |
>=dev-lua/lua-zlib-1.2-r100 |
113 |
>=dev-lua/luadbi-0.7.2-r100 |