From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 45E42138359 for ; Thu, 8 Oct 2020 19:14:08 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5AF8DE0880; Thu, 8 Oct 2020 19:14:07 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0DDAAE0880 for ; Thu, 8 Oct 2020 19:14:07 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 11130340E4D for ; Thu, 8 Oct 2020 19:14:05 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8DD95332 for ; Thu, 8 Oct 2020 19:14:03 +0000 (UTC) From: "Conrad Kostecki" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Conrad Kostecki" Message-ID: <1602184421.f8051ee00cc653d5e43febbf00b05dc24959ee8c.conikost@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lua/luaexpat/files/, dev-lua/luaexpat/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-lua/luaexpat/files/luaexpat-1.3.3_makefile.patch dev-lua/luaexpat/files/luaexpat-1.3.3_restore_functionality.patch dev-lua/luaexpat/luaexpat-1.3.3-r2.ebuild X-VCS-Directories: dev-lua/luaexpat/ dev-lua/luaexpat/files/ X-VCS-Committer: conikost X-VCS-Committer-Name: Conrad Kostecki X-VCS-Revision: f8051ee00cc653d5e43febbf00b05dc24959ee8c X-VCS-Branch: master Date: Thu, 8 Oct 2020 19:14:03 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 8cca0511-f626-489d-9400-1722a817da34 X-Archives-Hash: e243f13c71a804732ee2ade435d1e5f3 commit: f8051ee00cc653d5e43febbf00b05dc24959ee8c Author: Azamat H. Hackimov gmail com> AuthorDate: Mon Oct 5 22:05:59 2020 +0000 Commit: Conrad Kostecki gentoo org> CommitDate: Thu Oct 8 19:13:41 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f8051ee0 dev-lua/luaexpat: restore more functionality Restore more features that sill missed in forked 1.3.3 See: https://github.com/tomasguisasola/luaexpat/pull/5 Closes: https://github.com/gentoo/gentoo/pull/17813 Package-Manager: Portage-3.0.4, Repoman-3.0.1 Signed-off-by: Azamat H. Hackimov gmail.com> Signed-off-by: Conrad Kostecki gentoo.org> .../luaexpat/files/luaexpat-1.3.3_makefile.patch | 10 +- .../luaexpat-1.3.3_restore_functionality.patch | 109 +++++++++++++++++++++ dev-lua/luaexpat/luaexpat-1.3.3-r2.ebuild | 49 +++++++++ 3 files changed, 167 insertions(+), 1 deletion(-) diff --git a/dev-lua/luaexpat/files/luaexpat-1.3.3_makefile.patch b/dev-lua/luaexpat/files/luaexpat-1.3.3_makefile.patch index 95de7be6069..a780dddea83 100644 --- a/dev-lua/luaexpat/files/luaexpat-1.3.3_makefile.patch +++ b/dev-lua/luaexpat/files/luaexpat-1.3.3_makefile.patch @@ -1,5 +1,5 @@ diff --git a/makefile b/makefile -index 1a5a145..df09239 100644 +index 1a5a145..50912f0 100644 --- a/makefile +++ b/makefile @@ -45,7 +45,7 @@ OBJS= src/lxplib.o @@ -11,3 +11,11 @@ index 1a5a145..df09239 100644 install: mkdir -p $(LUA_LIBDIR) +@@ -53,6 +53,7 @@ install: + cd $(LUA_LIBDIR); ln -f -s $(LIBNAME) $T.so + mkdir -p $(LUA_DIR)/$T + cp src/$T/lom.lua $(LUA_DIR)/$T ++ cp src/$T/totable.lua $(LUA_DIR)/$T + + clean: + rm -f src/$(LIBNAME) $(OBJS) diff --git a/dev-lua/luaexpat/files/luaexpat-1.3.3_restore_functionality.patch b/dev-lua/luaexpat/files/luaexpat-1.3.3_restore_functionality.patch new file mode 100644 index 00000000000..c0bc8c1a7b4 --- /dev/null +++ b/dev-lua/luaexpat/files/luaexpat-1.3.3_restore_functionality.patch @@ -0,0 +1,109 @@ +From 4ef48128bd9a725daca1d5a4aabe0c1665d78742 Mon Sep 17 00:00:00 2001 +From: Matthew Wild +Date: Wed, 2 Apr 2014 21:02:29 +0100 +Subject: [PATCH] Make merging of CharacterData events optional, controlled by + the 3rd parameter of lxp.new() + +--- + src/lxplib.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/src/lxplib.c b/src/lxplib.c +index a7d6c42..794f6e3 100644 +--- a/src/lxplib.c ++++ b/src/lxplib.c +@@ -57,6 +57,7 @@ struct lxp_userdata { + int tableref; /* table with callbacks for this parser */ + enum XPState state; + luaL_Buffer *b; /* to concatenate sequences of cdata pieces */ ++ int bufferCharData; /* whether to buffer cdata pieces */ + }; + + typedef struct lxp_userdata lxp_userdata; +@@ -171,8 +172,13 @@ static void f_CharData (void *ud, const char *s, int len) { + lxp_userdata *xpu = (lxp_userdata *)ud; + if (xpu->state == XPSok) { + if (getHandle(xpu, CharDataKey) == 0) return; /* no handle */ +- xpu->state = XPSstring; +- luaL_buffinit(xpu->L, xpu->b); ++ if(xpu->bufferCharData != 0) { ++ xpu->state = XPSstring; ++ luaL_buffinit(xpu->L, xpu->b); ++ } else { ++ lua_pushlstring(xpu->L, s, len); ++ docall(xpu, 1, 0); ++ } + } + if (xpu->state == XPSstring) + luaL_addlstring(xpu->b, s, len); +@@ -393,8 +399,10 @@ static void checkcallbacks (lua_State *L) { + + static int lxp_make_parser (lua_State *L) { + XML_Parser p; ++ int bufferCharData = (lua_type(L, 3) != LUA_TBOOLEAN) || (lua_toboolean(L, 3) != 0); + char sep = *luaL_optstring(L, 2, ""); + lxp_userdata *xpu = createlxp(L); ++ xpu->bufferCharData = bufferCharData; + p = xpu->parser = (sep == '\0') ? XML_ParserCreate(NULL) : + XML_ParserCreateNS(NULL, sep); + if (!p) +From cbaf85740f6032cfc025c7bde3f9861d15825928 Mon Sep 17 00:00:00 2001 +From: Matthew Wild +Date: Wed, 2 Apr 2014 20:56:58 +0100 +Subject: [PATCH] Add support for XmlDecl handlers + +--- + src/lxplib.c | 14 +++++++++++++- + src/lxplib.h | 1 + + 2 files changed, 14 insertions(+), 1 deletion(-) + +diff --git a/src/lxplib.c b/src/lxplib.c +index 35bec3c..a7d6c42 100644 +--- a/src/lxplib.c ++++ b/src/lxplib.c +@@ -345,6 +345,16 @@ static void f_StartDoctypeDecl (void *ud, const XML_Char *doctypeName, + docall(xpu, 4, 0); + } + ++static void f_XmlDecl (void *ud, const XML_Char *version, ++ const XML_Char *encoding, ++ int standalone) { ++ lxp_userdata *xpu = (lxp_userdata *)ud; ++ if (getHandle(xpu, XmlDeclKey) == 0) return; /* no handle */ ++ lua_pushstring(xpu->L, version); ++ lua_pushstring(xpu->L, encoding); ++ lua_pushboolean(xpu->L, standalone); ++ docall(xpu, 3, 0); ++} + /* }====================================================== */ + + +@@ -365,7 +375,7 @@ static void checkcallbacks (lua_State *L) { + "Default", "DefaultExpand", "StartElement", "EndElement", + "ExternalEntityRef", "StartNamespaceDecl", "EndNamespaceDecl", + "NotationDecl", "NotStandalone", "ProcessingInstruction", +- "UnparsedEntityDecl", "StartDoctypeDecl", NULL}; ++ "UnparsedEntityDecl", "StartDoctypeDecl", "XmlDecl", NULL}; + if (hasfield(L, "_nonstrict")) return; + lua_pushnil(L); + while (lua_next(L, 1)) { +@@ -420,6 +430,8 @@ static int lxp_make_parser (lua_State *L) { + XML_SetUnparsedEntityDeclHandler(p, f_UnparsedEntityDecl); + if (hasfield(L, StartDoctypeDeclKey)) + XML_SetStartDoctypeDeclHandler(p, f_StartDoctypeDecl); ++ if (hasfield(L, XmlDeclKey)) ++ XML_SetXmlDeclHandler(p, f_XmlDecl); + return 1; + } + +diff --git a/src/lxplib.h b/src/lxplib.h +index 9c0be4f..4c7084c 100644 +--- a/src/lxplib.h ++++ b/src/lxplib.h +@@ -20,5 +20,6 @@ + #define ProcessingInstructionKey "ProcessingInstruction" + #define UnparsedEntityDeclKey "UnparsedEntityDecl" + #define StartDoctypeDeclKey "StartDoctypeDecl" ++#define XmlDeclKey "XmlDecl" + + int luaopen_lxp (lua_State *L); diff --git a/dev-lua/luaexpat/luaexpat-1.3.3-r2.ebuild b/dev-lua/luaexpat/luaexpat-1.3.3-r2.ebuild new file mode 100644 index 00000000000..5b99b5d96ba --- /dev/null +++ b/dev-lua/luaexpat/luaexpat-1.3.3-r2.ebuild @@ -0,0 +1,49 @@ +# 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" + "${FILESDIR}/${P}_restore_functionality.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/* +}