Gentoo Archives: gentoo-commits

From: Conrad Kostecki <conikost@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lua/lua-cjson/files/
Date: Tue, 01 Dec 2020 16:52:40
Message-Id: 1606841495.cc00f3b7bf26f9e01cd30180139bea6bbc6f2444.conikost@gentoo
1 commit: cc00f3b7bf26f9e01cd30180139bea6bbc6f2444
2 Author: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
3 AuthorDate: Tue Dec 1 16:51:25 2020 +0000
4 Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
5 CommitDate: Tue Dec 1 16:51:35 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cc00f3b7
7
8 dev-lua/lua-cjson: add missing patch
9
10 Closes: https://bugs.gentoo.org/757888
11 Package-Manager: Portage-3.0.9, Repoman-3.0.2
12 Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>
13
14 .../lua-cjson/files/lanes-3.13.0-makefile.patch | 93 ----------------------
15 .../lua-cjson-2.1.0.8-sparse_array_test_fix.patch | 31 ++++++++
16 2 files changed, 31 insertions(+), 93 deletions(-)
17
18 diff --git a/dev-lua/lua-cjson/files/lanes-3.13.0-makefile.patch b/dev-lua/lua-cjson/files/lanes-3.13.0-makefile.patch
19 deleted file mode 100644
20 index 178a3c5c5ec..00000000000
21 --- a/dev-lua/lua-cjson/files/lanes-3.13.0-makefile.patch
22 +++ /dev/null
23 @@ -1,93 +0,0 @@
24 ---- a/Makefile
25 -+++ b/Makefile
26 -@@ -33,7 +33,7 @@
27 -
28 - # Autodetect LUA
29 - #
30 --LUA=$(word 1,$(shell which lua5.1$(_LUAEXT)) $(shell which lua51$(_LUAEXT)) lua$(_LUAEXT))
31 -+LUA ?= $(word 1,$(shell which lua5.1$(_LUAEXT)) $(shell which lua51$(_LUAEXT)) lua$(_LUAEXT))
32 -
33 - _TARGET_SO=$(_TARGET_DIR)/core.$(_SO)
34 -
35 ---- lanes-3.13.0.old/src/Makefile 2018-11-30 13:28:50.000000000 +0100
36 -+++ lanes-3.13.0/src/Makefile 2020-11-30 21:40:06.399382894 +0100
37 -@@ -15,7 +15,7 @@
38 - #
39 - LIBFLAG=-shared
40 -
41 --OPT_FLAGS=-O2
42 -+OPT_FLAGS ?=
43 - # -O0 -g
44 -
45 - _SO=so
46 -@@ -38,50 +38,8 @@
47 - LUA_LIBS:="$(LUA_DEV)/lua5.1.dll" -lgcc
48 - LIBFLAG=-shared -Wl,-Map,lanes.map
49 - else
50 -- # Autodetect LUA_FLAGS and/or LUA_LIBS
51 -- #
52 -- ifneq "$(shell which pkg-config)" ""
53 -- ifeq "$(shell pkg-config --exists luajit && echo 1)" "1"
54 -- LUA_FLAGS:=$(shell pkg-config --cflags luajit)
55 -- LUA_LIBS:=$(shell pkg-config --libs luajit)
56 -- #
57 -- # Debian: -I/usr/include/luajit-2.0
58 -- # -lluajit-5.1
59 -- else
60 -- ifeq "$(shell pkg-config --exists lua5.1 && echo 1)" "1"
61 -- LUA_FLAGS:=$(shell pkg-config --cflags lua5.1)
62 -- LUA_LIBS:=$(shell pkg-config --libs lua5.1)
63 -- #
64 -- # Ubuntu: -I/usr/include/lua5.1
65 -- # -llua5.1
66 -- else
67 -- ifeq "$(shell pkg-config --exists lua && echo 1)" "1"
68 -- LUA_FLAGS:=$(shell pkg-config --cflags lua)
69 -- LUA_LIBS:=$(shell pkg-config --libs lua)
70 -- #
71 -- # OS X fink with pkg-config:
72 -- # -I/sw/include
73 -- # -L/sw/lib -llua -lm
74 -- else
75 -- $(warning *** 'pkg-config' existed but did not know of 'lua[5.1]' - Good luck!)
76 -- LUA_FLAGS:=
77 -- LUA_LIBS:=-llua
78 -- endif
79 -- endif
80 -- endif
81 -- else
82 -- # No 'pkg-config'; try defaults
83 -- #
84 -- ifeq "$(shell uname -s)" "Darwin"
85 -- $(warning *** Assuming 'fink' at default path)
86 -- LUA_FLAGS:=-I/sw/include
87 -- LUA_LIBS:=-L/sw/lib -llua
88 -- else
89 -- $(warning *** Assuming an arbitrary Lua installation; try installing 'pkg-config')
90 -- LUA_FLAGS:=
91 -- LUA_LIBS:=-llua
92 -- endif
93 -- endif
94 -+ LUA_FLAGS ?= $(shell pkg-config --cflags lua)
95 -+ LUA_LIBS ?= $(shell pkg-config --libs lua)
96 - endif
97 -
98 - ifeq "$(shell uname -s)" "Darwin"
99 -@@ -92,7 +50,7 @@
100 - LIBFLAG = -bundle -undefined dynamic_lookup
101 - endif
102 -
103 -- CFLAGS=-Wall -Werror $(OPT_FLAGS) $(LUA_FLAGS)
104 -+ CFLAGS=-Wall $(OPT_FLAGS) $(LUA_FLAGS)
105 - LIBS=$(LUA_LIBS)
106 - endif
107 -
108 -@@ -125,7 +83,7 @@
109 - #
110 - $(MODULE_DIR)/core.$(_SO): $(OBJ)
111 - mkdir -p $(MODULE_DIR)
112 -- $(CC) $(LIBFLAG) $^ $(LIBS) $(LUA_LIBS) -o $@
113 -+ $(CC) $(LDFLAGS) $(LIBFLAG) $^ $(LIBS) $(LUA_LIBS) -o $@
114 -
115 - clean:
116 - -rm -rf $(MODULE)/core.$(_SO) *.o *.map
117
118 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
119 new file mode 100644
120 index 00000000000..e031672dae3
121 --- /dev/null
122 +++ b/dev-lua/lua-cjson/files/lua-cjson-2.1.0.8-sparse_array_test_fix.patch
123 @@ -0,0 +1,31 @@
124 +--- a/tests/test.lua
125 ++++ b/tests/test.lua
126 +@@ -10,6 +10,17 @@
127 + local json_safe = require "cjson.safe"
128 + local util = require "cjson.util"
129 +
130 ++local function json_encode_output_type(value)
131 ++ local text = json.encode(value)
132 ++ if string.match(text, "{.*}") then
133 ++ return "object"
134 ++ elseif string.match(text, "%[.*%]") then
135 ++ return "array"
136 ++ else
137 ++ return "scalar"
138 ++ end
139 ++end
140 ++
141 + local function gen_raw_octets()
142 + local chars = {}
143 + for i = 0, 255 do chars[i + 1] = string.char(i) end
144 +@@ -292,8 +303,8 @@
145 + json.encode, { { [1] = "one", [4] = "sparse test" } },
146 + true, { '["one",null,null,"sparse test"]' } },
147 + { "Encode sparse array as object",
148 +- json.encode, { { [1] = "one", [5] = "sparse test" } },
149 +- true, { '{"5":"sparse test","1":"one"}' } },
150 ++ json_encode_output_type, { { [1] = "one", [5] = "sparse test" } },
151 ++ true, { 'object' } },
152 + { "Encode table with numeric string key as object",
153 + json.encode, { { ["2"] = "numeric string key test" } },
154 + true, { '{"2":"numeric string key test"}' } },