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 AD6C6138334 for ; Tue, 12 Feb 2019 23:41:36 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EC009E08AB; Tue, 12 Feb 2019 23:41:35 +0000 (UTC) Received: from smtp.gentoo.org (smtp.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 AF620E08AB for ; Tue, 12 Feb 2019 23:41:35 +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 2EE6D340D8D for ; Tue, 12 Feb 2019 23:41:34 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9D5F153A for ; Tue, 12 Feb 2019 23:41:32 +0000 (UTC) From: "Georgy Yakovlev" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Georgy Yakovlev" Message-ID: <1550014884.49c1855687a1f95cefbf9d97baf1479950c16991.gyakovlev@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lua/lua-cjson/, dev-lua/lua-cjson/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-lua/lua-cjson/Manifest dev-lua/lua-cjson/files/sparse_array_test_fix.patch dev-lua/lua-cjson/lua-cjson-2.1.0.6.ebuild dev-lua/lua-cjson/metadata.xml X-VCS-Directories: dev-lua/lua-cjson/ dev-lua/lua-cjson/files/ X-VCS-Committer: gyakovlev X-VCS-Committer-Name: Georgy Yakovlev X-VCS-Revision: 49c1855687a1f95cefbf9d97baf1479950c16991 X-VCS-Branch: master Date: Tue, 12 Feb 2019 23:41:32 +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: 1530b66a-844e-4fe7-9dee-6ea2a1a3ac5a X-Archives-Hash: ff914b6fc51954c7d4d061972f92e7ff commit: 49c1855687a1f95cefbf9d97baf1479950c16991 Author: Georgy Yakovlev gentoo org> AuthorDate: Tue Feb 12 23:36:23 2019 +0000 Commit: Georgy Yakovlev gentoo org> CommitDate: Tue Feb 12 23:41:24 2019 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=49c18556 dev-lua/lua-cjson: switch to fork, bump to 2.1.0.6 Openresty fork is maintained, has more features. Package-Manager: Portage-2.3.60, Repoman-2.3.12 Signed-off-by: Georgy Yakovlev gentoo.org> dev-lua/lua-cjson/Manifest | 1 + .../lua-cjson/files/sparse_array_test_fix.patch | 47 ++++++++++++++++++++++ dev-lua/lua-cjson/lua-cjson-2.1.0.6.ebuild | 44 ++++++++++++++++++++ dev-lua/lua-cjson/metadata.xml | 9 ++++- 4 files changed, 100 insertions(+), 1 deletion(-) diff --git a/dev-lua/lua-cjson/Manifest b/dev-lua/lua-cjson/Manifest index 136a3200bc4..e22ea3d3d87 100644 --- a/dev-lua/lua-cjson/Manifest +++ b/dev-lua/lua-cjson/Manifest @@ -1 +1,2 @@ +DIST lua-cjson-2.1.0.6.tar.gz 76820 BLAKE2B 1056fefc8d9c802e068e1e7801cc1eb3a0279371ab72e4e8517e22ad68224dd4892f4e4cbfe0a407af71f1008affded41d7bcc05d89c4ddb0c437d93d67708a7 SHA512 71d25f4ec82641d56e33e13c0ecd8c60186b3c4faf3d30de81706d1305d4e61691a1e84210462942674e50ca2ff19e126cb04025d9645d5d26ef3b3b0e46f64b DIST lua-cjson-2.1.0.tar.gz 86024 BLAKE2B 21dbf84cda2c973088dc9ba165351f3af35d4f604ef465abd91f37807a6c037f612f36c87b9458abef9afa06e1738e933fcce7be9edd2f9a5e301985f413a1db SHA512 4343513b942f2ed98dc1ea6d7e852303bc1263f8acc5c70c8d674aec7adfc8279c5af7d5173a417b6f9a74543b8f6c8f98742d002f4f75832bbf23bb5a30ad2f diff --git a/dev-lua/lua-cjson/files/sparse_array_test_fix.patch b/dev-lua/lua-cjson/files/sparse_array_test_fix.patch new file mode 100644 index 00000000000..0c1d138cbad --- /dev/null +++ b/dev-lua/lua-cjson/files/sparse_array_test_fix.patch @@ -0,0 +1,47 @@ +From 75678e4b0d1b25fc15f0399f1496db6e0287b72f Mon Sep 17 00:00:00 2001 +From: Georgy Yakovlev +Date: Tue, 12 Feb 2019 13:32:38 -0800 +Subject: [PATCH] Fix Encode sparse array as object test + +Port of this commit from upstream +https://github.com/mpx/lua-cjson/commit/98eb1d01e952fc60a36f47846f905b86c92a4f58 +--- + tests/test.lua | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +diff --git a/tests/test.lua b/tests/test.lua +index d1bf7e4..be5e19c 100755 +--- a/tests/test.lua ++++ b/tests/test.lua +@@ -10,6 +10,17 @@ local json = require "cjson" + local json_safe = require "cjson.safe" + local util = require "cjson.util" + ++local function json_encode_output_type(value) ++ local text = json.encode(value) ++ if string.match(text, "{.*}") then ++ return "object" ++ elseif string.match(text, "%[.*%]") then ++ return "array" ++ else ++ return "scalar" ++ end ++end ++ + local function gen_raw_octets() + local chars = {} + for i = 0, 255 do chars[i + 1] = string.char(i) end +@@ -292,8 +303,8 @@ local cjson_tests = { + json.encode, { { [1] = "one", [4] = "sparse test" } }, + true, { '["one",null,null,"sparse test"]' } }, + { "Encode sparse array as object", +- json.encode, { { [1] = "one", [5] = "sparse test" } }, +- true, { '{"5":"sparse test","1":"one"}' } }, ++ json_encode_output_type, { { [1] = "one", [5] = "sparse test" } }, ++ true, { 'object' } }, + { "Encode table with numeric string key as object", + json.encode, { { ["2"] = "numeric string key test" } }, + true, { '{"2":"numeric string key test"}' } }, +-- +2.20.1 + diff --git a/dev-lua/lua-cjson/lua-cjson-2.1.0.6.ebuild b/dev-lua/lua-cjson/lua-cjson-2.1.0.6.ebuild new file mode 100644 index 00000000000..d8443f9f690 --- /dev/null +++ b/dev-lua/lua-cjson/lua-cjson-2.1.0.6.ebuild @@ -0,0 +1,44 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake-utils + +DESCRIPTION="A fast JSON encoding/parsing module for Lua" +HOMEPAGE="https://www.kyne.com.au/~mark/software/lua-cjson.php https://github.com/openresty/lua-cjson" +SRC_URI="https://github.com/openresty/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="+internal-fpconv luajit test +threads" + +REQUIRED_USE="threads? ( internal-fpconv )" + +RDEPEND=">=dev-lang/lua-5.1:0" +DEPEND="${RDEPEND}" +BDEPEND="test? ( dev-lang/perl )" + +DOCS=( NEWS README.md THANKS manual.txt performance.txt ) + +PATCHES=( + "${FILESDIR}"/sparse_array_test_fix.patch +) + +src_configure() { + local mycmakeargs=( + -DUSE_INTERNAL_FPCONV="$(usex internal-fpconv)" + -DMULTIPLE_THREADS="$(usex threads)" + ) + + cmake-utils_src_configure +} + +src_test() { + cd tests || die + ln -s "${BUILD_DIR}"/cjson.so ./ || die + ln -s "${S}"/lua/cjson ./ || die + ./genutf8.pl || die + ./test.lua || die +} diff --git a/dev-lua/lua-cjson/metadata.xml b/dev-lua/lua-cjson/metadata.xml index 117a96f008a..351070af8a9 100644 --- a/dev-lua/lua-cjson/metadata.xml +++ b/dev-lua/lua-cjson/metadata.xml @@ -5,7 +5,14 @@ gyakovlev@gentoo.org Georgy Yakovlev + + Fork of mpx/lua-cjson is included in the OpenResty bundle and includes a few bugfixes and improvements, + especially to facilitate the encoding of empty tables as JSON Arrays. + + + Enable internal number conversion routines, can increase overall performance by up to 50% + - mpx/lua-cjson + openresty/lua-cjson