From 79599515788b85b18aa655e7b7f8cc05c1bbddd8 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 16 Feb 2019 12:59:29 +0000 Subject: gentoo resync : 16.02.1018 --- dev-lua/lua-cjson/Manifest | 5 ++- .../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 | 18 +++++++-- 4 files changed, 109 insertions(+), 5 deletions(-) create mode 100644 dev-lua/lua-cjson/files/sparse_array_test_fix.patch create mode 100644 dev-lua/lua-cjson/lua-cjson-2.1.0.6.ebuild (limited to 'dev-lua/lua-cjson') diff --git a/dev-lua/lua-cjson/Manifest b/dev-lua/lua-cjson/Manifest index f56776b59c14..12b7fc98055d 100644 --- a/dev-lua/lua-cjson/Manifest +++ b/dev-lua/lua-cjson/Manifest @@ -1,3 +1,6 @@ +AUX sparse_array_test_fix.patch 1643 BLAKE2B 6967eefee4a1bf3bdf14f7c2cd56814642adf4321007fc3a9b7f5e4022f468006e8674e6832d3a5fe1ef995b360de6e60bf738a6c3664f78d80d1000380939ae SHA512 597a4eeb180177ccb72f025b9abefe339b845ad188cd6287036905ab613aa36df24f0b51a515bb1718a0286e64b5b12a0cb8864dea2203b69407f9bc665ce393 +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 +EBUILD lua-cjson-2.1.0.6.ebuild 1024 BLAKE2B f9d94540e16acde7fc069d59aba199385bbd386557019ef2f4097c57581943774d27918e29c29d85cb4ab20d319716924d33662dd89575eb03e91d3c804a264f SHA512 80eaa499fb235553ed685e8011b2ce91a18a967fbc55fa32f5fbaf9622763dac5e7e1d334ed27fee9a3e9784807d12b55c908a5d4c6671b452125da90963868d EBUILD lua-cjson-2.1.0.ebuild 784 BLAKE2B 4a64cbd26700a4ad9240862f9c5beb708a97f1a6fa51141f05bd4a1bad80212fd07cc822715b34f6d38f6b6c83b13f366b43bea18f8ef2e8be8065f38eb91a6b SHA512 2b10a5c31ba56e72920049081060433ecb93f0832b795c50ee60e06e44ce4544ea41edad71c9f6418ce89f7b0326a53b676c0ac34c396b2c31ab6e6141aa3b2d -MISC metadata.xml 250 BLAKE2B b6882e74d55aa6fb27d372e6b27adc8751cd6bcbc6bbddf7b60b8a666d866a9ea95675b1ea1f0ab644eeeef2ca0ca599fadade594d80b649b2914b0581d805c2 SHA512 c9d378944a0bf99a43e176e333e565fe0e7af8000dbeac1b65e5d0f850eba07d88b15917d3b9bcbe05e927a94b36e310aff905e2147707b674a62f67bb048da5 +MISC metadata.xml 707 BLAKE2B cb106113b61f5e44d5ed58368b72e5d1b5832a82cf344d00b77ae12cc7bd45027e9e41326b322cbe75ff354629577ce6155788958b49f38855edcb46159dd566 SHA512 14d0e00ab5fcf0ae9780ee4b7c9e8c80b50230391f46babbb758869e97483e85b677c1de6e0475e05b5abd4d2aeb090030c0362204508bacd25a2435786d42fe 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 000000000000..0c1d138cbadf --- /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 000000000000..d8443f9f6901 --- /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 441a4c3c3128..351070af8a91 100644 --- a/dev-lua/lua-cjson/metadata.xml +++ b/dev-lua/lua-cjson/metadata.xml @@ -1,8 +1,18 @@ - - - mpx/lua-cjson - + + 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% + + + openresty/lua-cjson + -- cgit v1.2.3