summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzamat H. Hackimov <azamat.hackimov@gmail.com>2020-10-04 23:14:52 +0300
committerConrad Kostecki <conikost@gentoo.org>2020-10-05 23:30:39 +0200
commite446a4d2f404914db7caaeb99c9b8f6879ad9e4c (patch)
tree3d2e2670142e4077bfe427600a96078660c0f724 /dev-lua/luaexpat
parentdev-perl/Linux-Smaps: Bump to version 0.140.0 (diff)
downloadgentoo-e446a4d2f404914db7caaeb99c9b8f6879ad9e4c.tar.gz
gentoo-e446a4d2f404914db7caaeb99c9b8f6879ad9e4c.tar.bz2
gentoo-e446a4d2f404914db7caaeb99c9b8f6879ad9e4c.zip
dev-lua/luaexpat: add getcurrentbytecount() func
Restore missed getcurrentbytecount() from upstream, required by net-im/prosody. See: * https://github.com/tomasguisasola/luaexpat/issues/3 * https://issues.prosody.im/1375 Closes: https://github.com/gentoo/gentoo/pull/17770 Package-Manager: Portage-3.0.4, Repoman-3.0.1 Signed-off-by: Azamat H. Hackimov <azamat.hackimov@gmail.com> Signed-off-by: Conrad Kostecki <conikost@gentoo.org>
Diffstat (limited to 'dev-lua/luaexpat')
-rw-r--r--dev-lua/luaexpat/files/luaexpat-1.3.3_getcurrentbytecount.patch33
-rw-r--r--dev-lua/luaexpat/luaexpat-1.3.3-r1.ebuild48
2 files changed, 81 insertions, 0 deletions
diff --git a/dev-lua/luaexpat/files/luaexpat-1.3.3_getcurrentbytecount.patch b/dev-lua/luaexpat/files/luaexpat-1.3.3_getcurrentbytecount.patch
new file mode 100644
index 000000000000..7366163d9d82
--- /dev/null
+++ b/dev-lua/luaexpat/files/luaexpat-1.3.3_getcurrentbytecount.patch
@@ -0,0 +1,33 @@
+From 0926f2d705109b7d35b721344264b39c1169e0de Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Fran=C3=A7ois=20Perrad?= <francois.perrad@gadz.org>
+Date: Sat, 16 Feb 2019 16:08:25 +0100
+Subject: [PATCH] restore method getcurrentbytecount
+
+fix #3
+---
+ src/lxplib.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/lxplib.c b/src/lxplib.c
+index 7726913..35bec3c 100644
+--- a/src/lxplib.c
++++ b/src/lxplib.c
+@@ -538,11 +538,18 @@ static int lxp_stop (lua_State *L) {
+ return 1;
+ }
+
++static int lxp_getcurrentbytecount (lua_State* L) {
++ lxp_userdata *xpu = checkparser(L, 1);
++ lua_pushinteger(L, XML_GetCurrentByteCount(xpu->parser));
++ return 1;
++}
++
+ static const luaL_Reg lxp_meths[] = {
+ {"parse", lxp_parse},
+ {"close", lxp_close},
+ {"__gc", parser_gc},
+ {"pos", lxp_pos},
++ {"getcurrentbytecount", lxp_getcurrentbytecount},
+ {"setencoding", lxp_setencoding},
+ {"getcallbacks", getcallbacks},
+ {"getbase", getbase},
diff --git a/dev-lua/luaexpat/luaexpat-1.3.3-r1.ebuild b/dev-lua/luaexpat/luaexpat-1.3.3-r1.ebuild
new file mode 100644
index 000000000000..72168a4d5329
--- /dev/null
+++ b/dev-lua/luaexpat/luaexpat-1.3.3-r1.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit multilib-minimal toolchain-funcs
+
+DESCRIPTION="LuaExpat is a SAX XML parser based on the Expat library"
+HOMEPAGE="https://matthewwild.co.uk/projects/luaexpat/ https://github.com/tomasguisasola/luaexpat"
+SRC_URI="https://github.com/tomasguisasola/luaexpat/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86"
+
+RDEPEND=">=dev-lang/lua-5.1.5-r2:0[${MULTILIB_USEDEP}]
+ >=dev-libs/expat-2.1.0-r3[${MULTILIB_USEDEP}]"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}/${P}_makefile.patch"
+ "${FILESDIR}/${P}_getcurrentbytecount.patch"
+)
+
+src_prepare() {
+ default
+ multilib_copy_sources
+}
+
+multilib_src_compile() {
+ emake \
+ CFLAGS="${CFLAGS}" \
+ LDFLAGS="${LDFLAGS}" \
+ CC="$(tc-getCC)" \
+ LUA_INC="$($(tc-getPKG_CONFIG) --variable INSTALL_INC lua)"
+}
+
+multilib_src_install() {
+ emake \
+ LUA_DIR="${D}/$($(tc-getPKG_CONFIG) --variable INSTALL_LMOD lua)" \
+ LUA_LIBDIR="${D}/$($(tc-getPKG_CONFIG) --variable INSTALL_CMOD lua)" \
+ install
+}
+
+multilib_src_install_all() {
+ dodoc -r README.md doc/*
+}