Gentoo Archives: gentoo-commits

From: Conrad Kostecki <conikost@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lua/luaexpat/files/, dev-lua/luaexpat/
Date: Mon, 05 Oct 2020 21:34:59
Message-Id: 1601933439.e446a4d2f404914db7caaeb99c9b8f6879ad9e4c.conikost@gentoo
1 commit: e446a4d2f404914db7caaeb99c9b8f6879ad9e4c
2 Author: Azamat H. Hackimov <azamat.hackimov <AT> gmail <DOT> com>
3 AuthorDate: Sun Oct 4 20:14:52 2020 +0000
4 Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
5 CommitDate: Mon Oct 5 21:30:39 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e446a4d2
7
8 dev-lua/luaexpat: add getcurrentbytecount() func
9
10 Restore missed getcurrentbytecount() from upstream, required by net-im/prosody.
11 See:
12 * https://github.com/tomasguisasola/luaexpat/issues/3
13 * https://issues.prosody.im/1375
14
15 Closes: https://github.com/gentoo/gentoo/pull/17770
16 Package-Manager: Portage-3.0.4, Repoman-3.0.1
17 Signed-off-by: Azamat H. Hackimov <azamat.hackimov <AT> gmail.com>
18 Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>
19
20 .../files/luaexpat-1.3.3_getcurrentbytecount.patch | 33 +++++++++++++++
21 dev-lua/luaexpat/luaexpat-1.3.3-r1.ebuild | 48 ++++++++++++++++++++++
22 2 files changed, 81 insertions(+)
23
24 diff --git a/dev-lua/luaexpat/files/luaexpat-1.3.3_getcurrentbytecount.patch b/dev-lua/luaexpat/files/luaexpat-1.3.3_getcurrentbytecount.patch
25 new file mode 100644
26 index 00000000000..7366163d9d8
27 --- /dev/null
28 +++ b/dev-lua/luaexpat/files/luaexpat-1.3.3_getcurrentbytecount.patch
29 @@ -0,0 +1,33 @@
30 +From 0926f2d705109b7d35b721344264b39c1169e0de Mon Sep 17 00:00:00 2001
31 +From: =?UTF-8?q?Fran=C3=A7ois=20Perrad?= <francois.perrad@××××.org>
32 +Date: Sat, 16 Feb 2019 16:08:25 +0100
33 +Subject: [PATCH] restore method getcurrentbytecount
34 +
35 +fix #3
36 +---
37 + src/lxplib.c | 7 +++++++
38 + 1 file changed, 7 insertions(+)
39 +
40 +diff --git a/src/lxplib.c b/src/lxplib.c
41 +index 7726913..35bec3c 100644
42 +--- a/src/lxplib.c
43 ++++ b/src/lxplib.c
44 +@@ -538,11 +538,18 @@ static int lxp_stop (lua_State *L) {
45 + return 1;
46 + }
47 +
48 ++static int lxp_getcurrentbytecount (lua_State* L) {
49 ++ lxp_userdata *xpu = checkparser(L, 1);
50 ++ lua_pushinteger(L, XML_GetCurrentByteCount(xpu->parser));
51 ++ return 1;
52 ++}
53 ++
54 + static const luaL_Reg lxp_meths[] = {
55 + {"parse", lxp_parse},
56 + {"close", lxp_close},
57 + {"__gc", parser_gc},
58 + {"pos", lxp_pos},
59 ++ {"getcurrentbytecount", lxp_getcurrentbytecount},
60 + {"setencoding", lxp_setencoding},
61 + {"getcallbacks", getcallbacks},
62 + {"getbase", getbase},
63
64 diff --git a/dev-lua/luaexpat/luaexpat-1.3.3-r1.ebuild b/dev-lua/luaexpat/luaexpat-1.3.3-r1.ebuild
65 new file mode 100644
66 index 00000000000..72168a4d532
67 --- /dev/null
68 +++ b/dev-lua/luaexpat/luaexpat-1.3.3-r1.ebuild
69 @@ -0,0 +1,48 @@
70 +# Copyright 1999-2020 Gentoo Authors
71 +# Distributed under the terms of the GNU General Public License v2
72 +
73 +EAPI=7
74 +
75 +inherit multilib-minimal toolchain-funcs
76 +
77 +DESCRIPTION="LuaExpat is a SAX XML parser based on the Expat library"
78 +HOMEPAGE="https://matthewwild.co.uk/projects/luaexpat/ https://github.com/tomasguisasola/luaexpat"
79 +SRC_URI="https://github.com/tomasguisasola/luaexpat/archive/v${PV}.tar.gz -> ${P}.tar.gz"
80 +
81 +LICENSE="MIT"
82 +SLOT="0"
83 +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86"
84 +
85 +RDEPEND=">=dev-lang/lua-5.1.5-r2:0[${MULTILIB_USEDEP}]
86 + >=dev-libs/expat-2.1.0-r3[${MULTILIB_USEDEP}]"
87 +DEPEND="${RDEPEND}"
88 +BDEPEND="virtual/pkgconfig"
89 +
90 +PATCHES=(
91 + "${FILESDIR}/${P}_makefile.patch"
92 + "${FILESDIR}/${P}_getcurrentbytecount.patch"
93 +)
94 +
95 +src_prepare() {
96 + default
97 + multilib_copy_sources
98 +}
99 +
100 +multilib_src_compile() {
101 + emake \
102 + CFLAGS="${CFLAGS}" \
103 + LDFLAGS="${LDFLAGS}" \
104 + CC="$(tc-getCC)" \
105 + LUA_INC="$($(tc-getPKG_CONFIG) --variable INSTALL_INC lua)"
106 +}
107 +
108 +multilib_src_install() {
109 + emake \
110 + LUA_DIR="${D}/$($(tc-getPKG_CONFIG) --variable INSTALL_LMOD lua)" \
111 + LUA_LIBDIR="${D}/$($(tc-getPKG_CONFIG) --variable INSTALL_CMOD lua)" \
112 + install
113 +}
114 +
115 +multilib_src_install_all() {
116 + dodoc -r README.md doc/*
117 +}