Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/jerryscript/files/, dev-lang/jerryscript/
Date: Sun, 02 Jan 2022 00:28:24
Message-Id: 1641083286.d96caa26a673684a877edb0aceaa0c0b03739171.zmedico@gentoo
1 commit: d96caa26a673684a877edb0aceaa0c0b03739171
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jan 2 00:27:30 2022 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Sun Jan 2 00:28:06 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d96caa26
7
8 dev-lang/jerryscript: Remove old ebuild
9
10 Package-Manager: Portage-3.0.30, Repoman-3.0.3
11 Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>
12
13 .../files/jerryscript-2.4.0-python3.patch | 128 ---------------------
14 dev-lang/jerryscript/jerryscript-2.4.0-r3.ebuild | 71 ------------
15 2 files changed, 199 deletions(-)
16
17 diff --git a/dev-lang/jerryscript/files/jerryscript-2.4.0-python3.patch b/dev-lang/jerryscript/files/jerryscript-2.4.0-python3.patch
18 deleted file mode 100644
19 index a7046b4b6453..000000000000
20 --- a/dev-lang/jerryscript/files/jerryscript-2.4.0-python3.patch
21 +++ /dev/null
22 @@ -1,128 +0,0 @@
23 -From 3f725c9a6e62048dcc7e1d0dd0f9c3e8d2e092f6 Mon Sep 17 00:00:00 2001
24 -From: Zac Medico <zmedico@×××××.com>
25 -Date: Sun, 23 May 2021 13:46:30 -0700
26 -Subject: [PATCH] Python debugger support for Python 3 (in addition to Python 2)
27 -
28 -https://github.com/jerryscript-project/jerryscript/pull/4678
29 -
30 -- Added ord builtin compatibility to pass through int arguments
31 -- Fixed JerryDebugger _parse_source method to decode bytes as utf8 strings
32 -- Fixed WebSocket send_message method to use packed_data[0:1] bytes slice
33 -
34 -JerryScript-DCO-1.0-Signed-off-by: Zac Medico <zmedico@×××××.com>
35 ----
36 - jerry-debugger/jerry_client_main.py | 26 ++++++++++++++++--------
37 - jerry-debugger/jerry_client_websocket.py | 14 ++++++++++++-
38 - 2 files changed, 31 insertions(+), 9 deletions(-)
39 -
40 -diff --git a/jerry-debugger/jerry_client_main.py b/jerry-debugger/jerry_client_main.py
41 -index e65d0e14..b465955f 100644
42 ---- a/jerry-debugger/jerry_client_main.py
43 -+++ b/jerry-debugger/jerry_client_main.py
44 -@@ -151,2 +151,13 @@ def arguments_parse():
45 -
46 -+if sys.version_info.major >= 3:
47 -+ # pylint: disable=invalid-name
48 -+ _ord_orig = ord
49 -+ def _ord_compat(c):
50 -+ if isinstance(c, int):
51 -+ return c
52 -+ return _ord_orig(c)
53 -+ # pylint: disable=redefined-builtin
54 -+ ord = _ord_compat
55 -+
56 -+
57 - class JerryBreakpoint(object):
58 -@@ -563,2 +574,3 @@ class JerryDebugger(object):
59 - def _send_string(self, args, message_type, index=0):
60 -+ args = args.encode("utf8")
61 -
62 -@@ -810,3 +822,3 @@ class JerryDebugger(object):
63 - elif buffer_type in [JERRY_DEBUGGER_SCOPE_VARIABLES, JERRY_DEBUGGER_SCOPE_VARIABLES_END]:
64 -- self.scope_vars += "".join(data[1:])
65 -+ self.scope_vars += "".join(data[1:].decode("utf8"))
66 -
67 -@@ -866,5 +878,5 @@ class JerryDebugger(object):
68 - def _parse_source(self, data):
69 -- source_code = ""
70 -- source_code_name = ""
71 -- function_name = ""
72 -+ source_code = b""
73 -+ source_code_name = b""
74 -+ function_name = b""
75 - stack = [{"line": 1,
76 -@@ -905,7 +917,7 @@ class JerryDebugger(object):
77 -
78 -- stack.append({"source": source_code,
79 -- "source_name": source_code_name,
80 -+ stack.append({"source": source_code.decode("utf8"),
81 -+ "source_name": source_code_name.decode("utf8"),
82 - "line": position[0],
83 - "column": position[1],
84 -- "name": function_name,
85 -+ "name": function_name.decode("utf8"),
86 - "lines": [],
87 -@@ -939,4 +951,4 @@ class JerryDebugger(object):
88 - if not stack:
89 -- func_desc["source"] = source_code
90 -- func_desc["source_name"] = source_code_name
91 -+ func_desc["source"] = source_code.decode("utf8")
92 -+ func_desc["source_name"] = source_code_name.decode("utf8")
93 -
94 -@@ -1153,4 +1165,4 @@ class JerryDebugger(object):
95 - message = self.current_out + message
96 -- lines = message.split("\n")
97 -- self.current_out = lines.pop()
98 -+ lines = message.decode("utf8").split("\n")
99 -+ self.current_out = lines.pop().encode("utf8")
100 -
101 -@@ -1162,4 +1174,4 @@ class JerryDebugger(object):
102 - message = self.current_log + message
103 -- lines = message.split("\n")
104 -- self.current_log = lines.pop()
105 -+ lines = message.decode("utf8").split("\n")
106 -+ self.current_log = lines.pop().encode("utf8")
107 -
108 -@@ -1171,7 +1183,7 @@ class JerryDebugger(object):
109 - if subtype == JERRY_DEBUGGER_OUTPUT_WARNING:
110 -- return "%swarning: %s%s" % (self.yellow, self.nocolor, message)
111 -+ return "%swarning: %s%s" % (self.yellow, self.nocolor, message.decode("utf8"))
112 - elif subtype == JERRY_DEBUGGER_OUTPUT_ERROR:
113 -- return "%serr: %s%s" % (self.red, self.nocolor, message)
114 -+ return "%serr: %s%s" % (self.red, self.nocolor, message.decode("utf8"))
115 - elif subtype == JERRY_DEBUGGER_OUTPUT_TRACE:
116 -- return "%strace: %s%s" % (self.blue, self.nocolor, message)
117 -+ return "%strace: %s%s" % (self.blue, self.nocolor, message.decode("utf8"))
118 -
119 -@@ -1180,2 +1192,3 @@ class JerryDebugger(object):
120 -
121 -+ message = message.decode("utf8")
122 - if not message.endswith("\n"):
123 -diff --git a/jerry-debugger/jerry_client_websocket.py b/jerry-debugger/jerry_client_websocket.py
124 -index fe2c761a..9c755966 100644
125 ---- a/jerry-debugger/jerry_client_websocket.py
126 -+++ b/jerry-debugger/jerry_client_websocket.py
127 -@@ -17,2 +17,3 @@
128 - import struct
129 -+import sys
130 -
131 -@@ -22,2 +23,14 @@ WEBSOCKET_FIN_BIT = 0x80
132 -
133 -+
134 -+if sys.version_info.major >= 3:
135 -+ # pylint: disable=invalid-name
136 -+ _ord_orig = ord
137 -+ def _ord_compat(c):
138 -+ if isinstance(c, int):
139 -+ return c
140 -+ return _ord_orig(c)
141 -+ # pylint: disable=redefined-builtin
142 -+ ord = _ord_compat
143 -+
144 -+
145 - class WebSocket(object):
146 -@@ -94,3 +107,3 @@ class WebSocket(object):
147 - WEBSOCKET_BINARY_FRAME | WEBSOCKET_FIN_BIT,
148 -- WEBSOCKET_FIN_BIT + struct.unpack(byte_order + "B", packed_data[0])[0],
149 -+ WEBSOCKET_FIN_BIT + struct.unpack(byte_order + "B", packed_data[0:1])[0],
150 - 0) + packed_data[1:]
151
152 diff --git a/dev-lang/jerryscript/jerryscript-2.4.0-r3.ebuild b/dev-lang/jerryscript/jerryscript-2.4.0-r3.ebuild
153 deleted file mode 100644
154 index 618eb5259a29..000000000000
155 --- a/dev-lang/jerryscript/jerryscript-2.4.0-r3.ebuild
156 +++ /dev/null
157 @@ -1,71 +0,0 @@
158 -# Copyright 2021-2022 Gentoo Authors
159 -# Distributed under the terms of the GNU General Public License v2
160 -
161 -EAPI=7
162 -
163 -PYTHON_COMPAT=(python3_{7,8,9,10})
164 -inherit cmake python-any-r1
165 -
166 -DESCRIPTION="Ultra-lightweight JavaScript engine for the Internet of Things"
167 -HOMEPAGE="https://github.com/jerryscript-project/jerryscript"
168 -SRC_URI="https://github.com/jerryscript-project/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
169 -
170 -LICENSE="Apache-2.0"
171 -SLOT="0"
172 -KEYWORDS="~amd64"
173 -IUSE="debugger"
174 -RDEPEND="debugger? ( ${PYTHON_DEPS} )"
175 -BDEPEND="${RDEPEND}"
176 -RESTRICT+=" test"
177 -
178 -PATCHES=(
179 - "${FILESDIR}/jerryscript-2.4.0-python3.patch"
180 -)
181 -
182 -src_prepare() {
183 - find . -name CMakeLists.txt -print0 | xargs -0 sed -i \
184 - -e "s:lib/pkgconfig:$(get_libdir)/pkgconfig:" \
185 - -e "s:DESTINATION lib):DESTINATION $(get_libdir)):" \
186 - || die
187 - find . -name '*.pc.in' -print0 | xargs -0 sed -i \
188 - -e "s|/lib\$|/$(get_libdir)|" \
189 - || die
190 - cmake_src_prepare
191 -}
192 -
193 -src_configure() {
194 - local mycmakeargs=(
195 - -DENABLE_STRIP=OFF
196 - -DJERRY_DEBUGGER=ON
197 - -DJERRY_ERROR_MESSAGES=ON
198 - -DJERRY_EXTERNAL_CONTEXT=ON
199 - -DJERRY_LINE_INFO=ON
200 - -DJERRY_LOGGING=ON
201 - -DJERRY_PARSER_DUMP_BYTE_CODE=ON
202 - -DJERRY_PARSER=ON
203 - -DJERRY_REGEXP_DUMP_BYTE_CODE=ON
204 - -DJERRY_SNAPSHOT_EXEC=ON
205 - -DJERRY_SNAPSHOT_SAVE=ON
206 - )
207 - cmake_src_configure
208 -}
209 -
210 -src_install() {
211 - local jerry_debugger_dir
212 - cmake_src_install
213 -
214 - if use debugger; then
215 - jerry_debugger_dir=/usr/$(get_libdir)/jerryscript/jerry-debugger
216 - insinto "${jerry_debugger_dir}"
217 - doins jerry-debugger/*.py
218 - python_optimize "${ED}${jerry_debugger_dir}"
219 -
220 - cat <<-EOF > "${T}/jerry-debugger"
221 - #!/bin/sh
222 - export PYTHONPATH=${EPREFIX}${jerry_debugger_dir}
223 - exec python "${jerry_debugger_dir}/jerry_client.py" "\$@"
224 - EOF
225 -
226 - dobin "${T}"/jerry-debugger
227 - fi
228 -}