summaryrefslogtreecommitdiff
path: root/dev-lua/lua-cjson
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-12-16 03:35:12 +0000
committerV3n3RiX <venerix@koprulu.sector>2022-12-16 03:35:12 +0000
commitb62381b18b4bf2e919cbfbae11ebcad391e38e77 (patch)
tree0ea03896aa0bf5f376fdba3e25b9ecb8add6e65c /dev-lua/lua-cjson
parentda407288bb9fc771488c3fee13fc2f8561681e66 (diff)
gentoo auto-resync : 16:12:2022 - 03:35:12
Diffstat (limited to 'dev-lua/lua-cjson')
-rw-r--r--dev-lua/lua-cjson/Manifest6
-rw-r--r--dev-lua/lua-cjson/files/lua-cjson-2.1.0.8-lua52.patch143
-rw-r--r--dev-lua/lua-cjson/files/lua-cjson-2.1.0.8-sparse_array_test_fix.patch31
-rw-r--r--dev-lua/lua-cjson/lua-cjson-2.1.0.10.ebuild (renamed from dev-lua/lua-cjson/lua-cjson-2.1.0.8-r1.ebuild)31
4 files changed, 12 insertions, 199 deletions
diff --git a/dev-lua/lua-cjson/Manifest b/dev-lua/lua-cjson/Manifest
index 3ccf8a3aadae..be5d0e4d0e99 100644
--- a/dev-lua/lua-cjson/Manifest
+++ b/dev-lua/lua-cjson/Manifest
@@ -1,5 +1,3 @@
-AUX lua-cjson-2.1.0.8-lua52.patch 3588 BLAKE2B 989bd667dd62cf7b39c0188c1fcf94d6890e9839c662e75782bba26faf9fa35c7def97c172c74ec8cb3eb07a0413aa66e7b860d07c2caf459be52ec37450dd1f SHA512 9f16ae9d7885d835252a49208e00199ee8d4bf10790a9b2e696026171831b4a579938ecf7f980631f3fccee55f1d000212dfea80d1ebc22743550847d43f1d26
-AUX lua-cjson-2.1.0.8-sparse_array_test_fix.patch 1084 BLAKE2B 3f6e439b54602a8fb07badb87bd53ce8affbb53f7434a32677b1de0cfc92b6f9f75f21a7c09763649c5cbadf59a8647d704cce1e0e98207e72bb696c9cb8ddbe SHA512 31358192ecff4a06ef045cf8b3d8f717e65674752e1ae70a8e87a487e89a4819448285c537ef5393b05bbb285a0708be37bd7dafa9b8bacbf4bb0e8bdd9fdb67
-DIST lua-cjson-2.1.0.8.tar.gz 77211 BLAKE2B 227171576318939ab48abe26e87fa905cf9a15e6ff44065c0713b6a6fedac571f1dbbb88526b957836a4368e71c4d19a748b2a3250221572f580f1d32ccf50a0 SHA512 577278ccb58a23ea56ea9ad34c5fb0a07c13c6691a3b666f58fa6427bca269aaec26271d7400dcd253c922d1bb0b3b322915a2ce139880c1ed4c1d2c15437580
-EBUILD lua-cjson-2.1.0.8-r1.ebuild 2065 BLAKE2B 016a94b68065d9a9ce76933ce546b2082a36511a17531d74d92ebdfcd258632fc56e61a30e14b41ab77956d58bf2016a5dbe26c66307f3c9a9f162659ddc2e6c SHA512 423e198199706d68e301d3d851ddca8236d707350c4972e334ffcfbfb8eb6cd0672d92e09535a889d2a0e9cfe27f57257fb7925432dcb044a397c6ec53fb3cd2
+DIST lua-cjson-2.1.0.10.tar.gz 78651 BLAKE2B c215f0a78ba306831a9aa147df9edcb693164a82a0b0505265425124adb40c918da826d128c2dcd048e2c3040d191e177c78b143abb28608b38b3c2b21760539 SHA512 889761b6381b2d10b7aa2e5687e5059705352c0f7fbbca9bc5f7c9d89aed8b1e283c18e217183042cc6f1ec4f19d1c4cf720e3efc6f5a06e81aa1bec8a6b93c4
+EBUILD lua-cjson-2.1.0.10.ebuild 1732 BLAKE2B 48d00ce767bb28901c7aaccb4a5ca9afe53d010a21be2804b97889e35174df3a6ae412bf523b0521afddf7d783915bb8f0f561e7a8d89055dadc91b04936e067 SHA512 15e09e98581acc4c247d081db41b10f750c61008c8b7f8263b68100661962b03c93831e4a492842b0f6eb4ca069fce80bfd219ec5d534ea6d2ac9952cd388f9c
MISC metadata.xml 668 BLAKE2B 56cddfcf51cdb1233262dffec606bdfecf6ef9fe9e311b88a205bb0ec14b484a95d51c09e9a83e4d9e5befe547a1ea520e909837832bddcd3e492f3cf7f26e27 SHA512 a1d8e067f4d142e52de026c83ea2104978668708bb78f212249dd4e1365abaa78ef6d7694afa6c4b7c8834bd456fff98c11c332e9a1d7f939251fe1d6d872c63
diff --git a/dev-lua/lua-cjson/files/lua-cjson-2.1.0.8-lua52.patch b/dev-lua/lua-cjson/files/lua-cjson-2.1.0.8-lua52.patch
deleted file mode 100644
index 8f8c98243f1f..000000000000
--- a/dev-lua/lua-cjson/files/lua-cjson-2.1.0.8-lua52.patch
+++ /dev/null
@@ -1,143 +0,0 @@
-From e8dddaf2c9c370f3676441304955d81543c5cceb Mon Sep 17 00:00:00 2001
-From: leaf corcoran <leafot@gmail.com>
-Date: Sat, 21 Sep 2019 17:31:38 -0700
-Subject: [PATCH 1/5] support lua 5.2 with LUA_COMPAT_ALL
-
----
- lua_cjson.c | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/lua_cjson.c b/lua_cjson.c
-index 2a69699..83118b1 100644
---- a/lua_cjson.c
-+++ b/lua_cjson.c
-@@ -36,6 +36,9 @@
- * difficult to know object/array sizes ahead of time.
- */
-
-+
-+#define LUA_COMPAT_ALL 1
-+
- #include <assert.h>
- #include <stdint.h>
- #include <string.h>
-
-From 2b3c3c866701a0110a6ac50a9bec9f23adc2956e Mon Sep 17 00:00:00 2001
-From: leaf corcoran <leafot@gmail.com>
-Date: Sat, 21 Sep 2019 18:01:05 -0700
-Subject: [PATCH 2/5] support lua 5.3 with LUA_COMPAT_5_1
-
----
- lua_cjson.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/lua_cjson.c b/lua_cjson.c
-index 83118b1..9d25f7c 100644
---- a/lua_cjson.c
-+++ b/lua_cjson.c
-@@ -38,6 +38,7 @@
-
-
- #define LUA_COMPAT_ALL 1
-+#define LUA_COMPAT_5_1 1
-
- #include <assert.h>
- #include <stdint.h>
-
-From 639c4a38bf0b1bddef4bfdb22bb6a3f8493cc3fe Mon Sep 17 00:00:00 2001
-From: leaf corcoran <leafot@gmail.com>
-Date: Sat, 21 Sep 2019 18:18:27 -0700
-Subject: [PATCH 3/5] Lua 5.2+ unpack support
-
----
- lua/cjson/util.lua | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/lua/cjson/util.lua b/lua/cjson/util.lua
-index 5d80106..48fa33c 100644
---- a/lua/cjson/util.lua
-+++ b/lua/cjson/util.lua
-@@ -1,5 +1,7 @@
- local json = require "cjson"
-
-+local unpack = unpack or table.unpack
-+
- -- Various common routines used by the Lua CJSON package
- --
- -- Mark Pulford <mark@kyne.com.au>
-
-From 9163dd3c431bd7ab45bdb218c32c8c9633ddf2cc Mon Sep 17 00:00:00 2001
-From: leaf corcoran <leafot@gmail.com>
-Date: Sat, 21 Sep 2019 18:43:47 -0700
-Subject: [PATCH 4/5] Lua 5.2+ maxn support
-
----
- lua/cjson/util.lua | 12 +++++++++++-
- 1 file changed, 11 insertions(+), 1 deletion(-)
-
-diff --git a/lua/cjson/util.lua b/lua/cjson/util.lua
-index 48fa33c..2405257 100644
---- a/lua/cjson/util.lua
-+++ b/lua/cjson/util.lua
-@@ -2,6 +2,16 @@ local json = require "cjson"
-
- local unpack = unpack or table.unpack
-
-+local maxn = table.maxn or function(t)
-+ local max = 0
-+ for k,v in pairs(t) do
-+ if type(k) == "number" and k > max then
-+ max = k
-+ end
-+ end
-+ return max
-+end
-+
- -- Various common routines used by the Lua CJSON package
- --
- -- Mark Pulford <mark@kyne.com.au>
-@@ -194,7 +204,7 @@ local function run_test(testname, func, input, should_work, output)
- local result = {}
- local tmp = { pcall(func, unpack(input)) }
- local success = tmp[1]
-- for i = 2, table.maxn(tmp) do
-+ for i = 2, maxn(tmp) do
- result[i - 1] = tmp[i]
- end
-
-
-From c390998582b959389d0fc039743c96e861902587 Mon Sep 17 00:00:00 2001
-From: leaf corcoran <leafot@gmail.com>
-Date: Sun, 22 Sep 2019 13:43:18 -0700
-Subject: [PATCH 5/5] use macro instead of header defines for Lua 5.2+ support
-
----
- lua_cjson.c | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/lua_cjson.c b/lua_cjson.c
-index 9d25f7c..718a5b9 100644
---- a/lua_cjson.c
-+++ b/lua_cjson.c
-@@ -36,10 +36,6 @@
- * difficult to know object/array sizes ahead of time.
- */
-
--
--#define LUA_COMPAT_ALL 1
--#define LUA_COMPAT_5_1 1
--
- #include <assert.h>
- #include <stdint.h>
- #include <string.h>
-@@ -105,6 +101,10 @@
- #define json_lightudata_mask(ludata) (ludata)
- #endif
-
-+#if LUA_VERSION_NUM > 501
-+#define lua_objlen(L,i) lua_rawlen(L, (i))
-+#endif
-+
- static const char * const *json_empty_array;
- static const char * const *json_array;
-
diff --git a/dev-lua/lua-cjson/files/lua-cjson-2.1.0.8-sparse_array_test_fix.patch b/dev-lua/lua-cjson/files/lua-cjson-2.1.0.8-sparse_array_test_fix.patch
deleted file mode 100644
index e031672dae33..000000000000
--- a/dev-lua/lua-cjson/files/lua-cjson-2.1.0.8-sparse_array_test_fix.patch
+++ /dev/null
@@ -1,31 +0,0 @@
---- a/tests/test.lua
-+++ b/tests/test.lua
-@@ -10,6 +10,17 @@
- 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 @@
- 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"}' } },
diff --git a/dev-lua/lua-cjson/lua-cjson-2.1.0.8-r1.ebuild b/dev-lua/lua-cjson/lua-cjson-2.1.0.10.ebuild
index 90bef7a81942..22b79720590f 100644
--- a/dev-lua/lua-cjson/lua-cjson-2.1.0.8-r1.ebuild
+++ b/dev-lua/lua-cjson/lua-cjson-2.1.0.10.ebuild
@@ -27,11 +27,6 @@ BDEPEND="test? ( dev-lang/perl )"
DOCS=( "manual.txt" "NEWS" "performance.txt" "README.md" "THANKS" )
-PATCHES=(
- "${FILESDIR}/${PN}-2.1.0.8-sparse_array_test_fix.patch"
- "${FILESDIR}/${PN}-2.1.0.8-lua52.patch"
-)
-
src_prepare() {
default
@@ -61,22 +56,16 @@ src_compile() {
}
lua_src_test() {
- if ! [[ ${ELUA} == "lua5.3" || ${ELUA} == "lua5.4" ]]; then
- 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
- else
- ewarn "Not running tests under ${ELUA} because they are known to fail"
- ewarn "See: https://github.com/openresty/lua-cjson/pull/50"
- return
- fi
+ 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() {