diff options
Diffstat (limited to 'dev-lua/lua-cjson')
-rw-r--r-- | dev-lua/lua-cjson/Manifest | 3 | ||||
-rw-r--r-- | dev-lua/lua-cjson/files/sparse_array_test_fix.patch | 47 | ||||
-rw-r--r-- | dev-lua/lua-cjson/lua-cjson-2.1.0.10-r1.ebuild | 94 | ||||
-rw-r--r-- | dev-lua/lua-cjson/lua-cjson-2.1.0.6.ebuild | 45 | ||||
-rw-r--r-- | dev-lua/lua-cjson/lua-cjson-2.1.0.7.ebuild | 45 | ||||
-rw-r--r-- | dev-lua/lua-cjson/metadata.xml | 8 |
6 files changed, 99 insertions, 143 deletions
diff --git a/dev-lua/lua-cjson/Manifest b/dev-lua/lua-cjson/Manifest index 5543b65fbe32..d07c1321b4b4 100644 --- a/dev-lua/lua-cjson/Manifest +++ b/dev-lua/lua-cjson/Manifest @@ -1,2 +1 @@ -DIST lua-cjson-2.1.0.6.tar.gz 76820 BLAKE2B 1056fefc8d9c802e068e1e7801cc1eb3a0279371ab72e4e8517e22ad68224dd4892f4e4cbfe0a407af71f1008affded41d7bcc05d89c4ddb0c437d93d67708a7 SHA512 71d25f4ec82641d56e33e13c0ecd8c60186b3c4faf3d30de81706d1305d4e61691a1e84210462942674e50ca2ff19e126cb04025d9645d5d26ef3b3b0e46f64b -DIST lua-cjson-2.1.0.7.tar.gz 76949 BLAKE2B 9189890f24885191001e79cf0f48aaee74026572eda3e767b0e5e63d44634156fd2b972287cb23e243b3fd0f44f8e87a1fcb0c0b8e26197c63e5e0ff30cb3a94 SHA512 c66fbb608dcd1b7daef8c70ad9a60ab442bf8b851b8d8c5e3b11854ab476dff115e2eef31f171a40ce364778682ce351114caf36c995521ec589bd9dd94415c5 +DIST lua-cjson-2.1.0.10.tar.gz 78651 BLAKE2B c215f0a78ba306831a9aa147df9edcb693164a82a0b0505265425124adb40c918da826d128c2dcd048e2c3040d191e177c78b143abb28608b38b3c2b21760539 SHA512 889761b6381b2d10b7aa2e5687e5059705352c0f7fbbca9bc5f7c9d89aed8b1e283c18e217183042cc6f1ec4f19d1c4cf720e3efc6f5a06e81aa1bec8a6b93c4 diff --git a/dev-lua/lua-cjson/files/sparse_array_test_fix.patch b/dev-lua/lua-cjson/files/sparse_array_test_fix.patch deleted file mode 100644 index 0c1d138cbadf..000000000000 --- a/dev-lua/lua-cjson/files/sparse_array_test_fix.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 75678e4b0d1b25fc15f0399f1496db6e0287b72f Mon Sep 17 00:00:00 2001 -From: Georgy Yakovlev <gyakovlev@gentoo.org> -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.10-r1.ebuild b/dev-lua/lua-cjson/lua-cjson-2.1.0.10-r1.ebuild new file mode 100644 index 000000000000..dd196fb7ded8 --- /dev/null +++ b/dev-lua/lua-cjson/lua-cjson-2.1.0.10-r1.ebuild @@ -0,0 +1,94 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +LUA_COMPAT=( lua5-{1..4} luajit ) + +inherit lua toolchain-funcs + +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 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86" +IUSE="+internal-fpconv test +threads" +REQUIRED_USE=" + threads? ( internal-fpconv ) + ${LUA_REQUIRED_USE} +" +RESTRICT="!test? ( test )" + +RDEPEND="${LUA_DEPS}" +DEPEND="${RDEPEND}" +BDEPEND="test? ( dev-lang/perl )" + +DOCS=( "manual.txt" "NEWS" "performance.txt" "README.md" "THANKS" ) + +src_prepare() { + default + + # Don't install tests + sed -e '/cd tests/d' -i Makefile || die + + lua_copy_sources +} + +lua_src_compile() { + pushd "${BUILD_DIR}" || die + + local myemakeargs=( + "CC=$(tc-getCC)" + "CFLAGS=${CFLAGS}" + "LDFLAGS=${LDFLAGS}" + "LUA_INCLUDE_DIR=$(lua_get_include_dir)" + ) + + emake "${myemakeargs[@]}" + + popd +} + +src_compile() { + lua_foreach_impl lua_src_compile +} + +lua_src_test() { + pushd "${BUILD_DIR}" || die + cd tests || die + + ln -s "${BUILD_DIR}"/cjson.so ./ || die + ln -s "${S}"/lua/cjson ./ || die + + ./genutf8.pl || die + ./test.lua || die + + popd +} + +src_test() { + lua_foreach_impl lua_src_test +} + +lua_src_install() { + pushd "${BUILD_DIR}" || die + + local myemakeargs=( + "DESTDIR=${D}" + "LUA_CMODULE_DIR=$(lua_get_cmod_dir)" + "LUA_MODULE_DIR=$(lua_get_lmod_dir)" + "PREFIX=${EPREFIX}/usr" + ) + + emake "${myemakeargs[@]}" install install-extra + + popd +} + +src_install() { + lua_foreach_impl lua_src_install + + einstalldocs +} 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 deleted file mode 100644 index 7170add189d9..000000000000 --- a/dev-lua/lua-cjson/lua-cjson-2.1.0.6.ebuild +++ /dev/null @@ -1,45 +0,0 @@ -# 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" -RESTRICT="!test? ( test )" - -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/lua-cjson-2.1.0.7.ebuild b/dev-lua/lua-cjson/lua-cjson-2.1.0.7.ebuild deleted file mode 100644 index 7170add189d9..000000000000 --- a/dev-lua/lua-cjson/lua-cjson-2.1.0.7.ebuild +++ /dev/null @@ -1,45 +0,0 @@ -# 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" -RESTRICT="!test? ( test )" - -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 5b6408370bec..b87098d6b587 100644 --- a/dev-lua/lua-cjson/metadata.xml +++ b/dev-lua/lua-cjson/metadata.xml @@ -1,11 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> <maintainer type="person"> - <email>gyakovlev@gentoo.org</email> - <name>Georgy Yakovlev</name> + <email>conikost@gentoo.org</email> + <name>Conrad Kostecki</name> </maintainer> - <longdescription lang="en"> + <longdescription> OpenResty fork of mpx/lua-cjson, includes a few bugfixes and improvements, especially to facilitate the encoding of empty tables as JSON Arrays. </longdescription> |