public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/jerryscript/, dev-lang/jerryscript/files/
@ 2021-05-23 23:27 Zac Medico
  0 siblings, 0 replies; 4+ messages in thread
From: Zac Medico @ 2021-05-23 23:27 UTC (permalink / raw
  To: gentoo-commits

commit:     272c2ca3526d0219b3902ca4cb2cb085588aa93b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 23 23:24:43 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 23 23:26:58 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=272c2ca3

dev-lang/jerryscript: 2.4.0-r2 revbump for python3 debugger fixes

Package-Manager: Portage-3.0.18, Repoman-3.0.3
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 .../files/jerryscript-2.4.0-python3.patch          | 42 +++++++++++++++++++---
 ...2.4.0-r1.ebuild => jerryscript-2.4.0-r2.ebuild} |  0
 2 files changed, 38 insertions(+), 4 deletions(-)

diff --git a/dev-lang/jerryscript/files/jerryscript-2.4.0-python3.patch b/dev-lang/jerryscript/files/jerryscript-2.4.0-python3.patch
index 4a358ac5ce9..7da285c5d3c 100644
--- a/dev-lang/jerryscript/files/jerryscript-2.4.0-python3.patch
+++ b/dev-lang/jerryscript/files/jerryscript-2.4.0-python3.patch
@@ -16,7 +16,7 @@ JerryScript-DCO-1.0-Signed-off-by: Zac Medico <zmedico@gmail.com>
  2 files changed, 31 insertions(+), 9 deletions(-)
 
 diff --git a/jerry-debugger/jerry_client_main.py b/jerry-debugger/jerry_client_main.py
-index e65d0e14..b877a159 100644
+index e65d0e14..e3176c86 100644
 --- a/jerry-debugger/jerry_client_main.py
 +++ b/jerry-debugger/jerry_client_main.py
 @@ -151,2 +151,12 @@ def arguments_parse():
@@ -32,7 +32,16 @@ index e65d0e14..b877a159 100644
 +
 +
  class JerryBreakpoint(object):
-@@ -866,5 +876,5 @@ class JerryDebugger(object):
+@@ -563,2 +573,3 @@ class JerryDebugger(object):
+     def _send_string(self, args, message_type, index=0):
++        args = args.encode("utf8")
+ 
+@@ -810,3 +821,3 @@ class JerryDebugger(object):
+             elif buffer_type in [JERRY_DEBUGGER_SCOPE_VARIABLES, JERRY_DEBUGGER_SCOPE_VARIABLES_END]:
+-                self.scope_vars += "".join(data[1:])
++                self.scope_vars += "".join(data[1:].decode("utf8"))
+ 
+@@ -866,5 +877,5 @@ class JerryDebugger(object):
      def _parse_source(self, data):
 -        source_code = ""
 -        source_code_name = ""
@@ -41,7 +50,7 @@ index e65d0e14..b877a159 100644
 +        source_code_name = b""
 +        function_name = b""
          stack = [{"line": 1,
-@@ -905,7 +915,7 @@ class JerryDebugger(object):
+@@ -905,7 +916,7 @@ class JerryDebugger(object):
  
 -                stack.append({"source": source_code,
 -                              "source_name": source_code_name,
@@ -52,13 +61,38 @@ index e65d0e14..b877a159 100644
 -                              "name": function_name,
 +                              "name": function_name.decode("utf8"),
                                "lines": [],
-@@ -939,4 +949,4 @@ class JerryDebugger(object):
+@@ -939,4 +950,4 @@ class JerryDebugger(object):
                  if not stack:
 -                    func_desc["source"] = source_code
 -                    func_desc["source_name"] = source_code_name
 +                    func_desc["source"] = source_code.decode("utf8")
 +                    func_desc["source_name"] = source_code_name.decode("utf8")
  
+@@ -1153,3 +1164,3 @@ class JerryDebugger(object):
+                 message = self.current_out + message
+-                lines = message.split("\n")
++                lines = message.decode("utf8").split("\n")
+                 self.current_out = lines.pop()
+@@ -1162,3 +1173,3 @@ class JerryDebugger(object):
+                 message = self.current_log + message
+-                lines = message.split("\n")
++                lines = message.decode("utf8").split("\n")
+                 self.current_log = lines.pop()
+@@ -1171,7 +1182,7 @@ class JerryDebugger(object):
+             if subtype == JERRY_DEBUGGER_OUTPUT_WARNING:
+-                return "%swarning: %s%s" % (self.yellow, self.nocolor, message)
++                return "%swarning: %s%s" % (self.yellow, self.nocolor, message.decode("utf8"))
+             elif subtype == JERRY_DEBUGGER_OUTPUT_ERROR:
+-                return "%serr: %s%s" % (self.red, self.nocolor, message)
++                return "%serr: %s%s" % (self.red, self.nocolor, message.decode("utf8"))
+             elif subtype == JERRY_DEBUGGER_OUTPUT_TRACE:
+-                return "%strace: %s%s" % (self.blue, self.nocolor, message)
++                return "%strace: %s%s" % (self.blue, self.nocolor, message.decode("utf8"))
+ 
+@@ -1180,2 +1191,3 @@ class JerryDebugger(object):
+ 
++        message = message.decode("utf8")
+         if not message.endswith("\n"):
 diff --git a/jerry-debugger/jerry_client_websocket.py b/jerry-debugger/jerry_client_websocket.py
 index fe2c761a..07c75e53 100644
 --- a/jerry-debugger/jerry_client_websocket.py

diff --git a/dev-lang/jerryscript/jerryscript-2.4.0-r1.ebuild b/dev-lang/jerryscript/jerryscript-2.4.0-r2.ebuild
similarity index 100%
rename from dev-lang/jerryscript/jerryscript-2.4.0-r1.ebuild
rename to dev-lang/jerryscript/jerryscript-2.4.0-r2.ebuild


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/jerryscript/, dev-lang/jerryscript/files/
@ 2021-06-11  4:51 Zac Medico
  0 siblings, 0 replies; 4+ messages in thread
From: Zac Medico @ 2021-06-11  4:51 UTC (permalink / raw
  To: gentoo-commits

commit:     6e1ba2b4b685a9fc91424629c7e41222c27a58ee
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 11 04:47:04 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jun 11 04:51:01 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6e1ba2b4

dev-lang/jerryscript: 2.4.0-r3 revbump more python3 debugger fixes

Package-Manager: Portage-3.0.19, Repoman-3.0.3
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 .../files/jerryscript-2.4.0-python3.patch          | 38 +++++++++++++---------
 ...2.4.0-r2.ebuild => jerryscript-2.4.0-r3.ebuild} |  0
 2 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/dev-lang/jerryscript/files/jerryscript-2.4.0-python3.patch b/dev-lang/jerryscript/files/jerryscript-2.4.0-python3.patch
index 7da285c5d3c..a7046b4b645 100644
--- a/dev-lang/jerryscript/files/jerryscript-2.4.0-python3.patch
+++ b/dev-lang/jerryscript/files/jerryscript-2.4.0-python3.patch
@@ -16,12 +16,13 @@ JerryScript-DCO-1.0-Signed-off-by: Zac Medico <zmedico@gmail.com>
  2 files changed, 31 insertions(+), 9 deletions(-)
 
 diff --git a/jerry-debugger/jerry_client_main.py b/jerry-debugger/jerry_client_main.py
-index e65d0e14..e3176c86 100644
+index e65d0e14..b465955f 100644
 --- a/jerry-debugger/jerry_client_main.py
 +++ b/jerry-debugger/jerry_client_main.py
-@@ -151,2 +151,12 @@ def arguments_parse():
+@@ -151,2 +151,13 @@ def arguments_parse():
  
 +if sys.version_info.major >= 3:
++    # pylint: disable=invalid-name
 +    _ord_orig = ord
 +    def _ord_compat(c):
 +        if isinstance(c, int):
@@ -32,16 +33,16 @@ index e65d0e14..e3176c86 100644
 +
 +
  class JerryBreakpoint(object):
-@@ -563,2 +573,3 @@ class JerryDebugger(object):
+@@ -563,2 +574,3 @@ class JerryDebugger(object):
      def _send_string(self, args, message_type, index=0):
 +        args = args.encode("utf8")
  
-@@ -810,3 +821,3 @@ class JerryDebugger(object):
+@@ -810,3 +822,3 @@ class JerryDebugger(object):
              elif buffer_type in [JERRY_DEBUGGER_SCOPE_VARIABLES, JERRY_DEBUGGER_SCOPE_VARIABLES_END]:
 -                self.scope_vars += "".join(data[1:])
 +                self.scope_vars += "".join(data[1:].decode("utf8"))
  
-@@ -866,5 +877,5 @@ class JerryDebugger(object):
+@@ -866,5 +878,5 @@ class JerryDebugger(object):
      def _parse_source(self, data):
 -        source_code = ""
 -        source_code_name = ""
@@ -50,7 +51,7 @@ index e65d0e14..e3176c86 100644
 +        source_code_name = b""
 +        function_name = b""
          stack = [{"line": 1,
-@@ -905,7 +916,7 @@ class JerryDebugger(object):
+@@ -905,7 +917,7 @@ class JerryDebugger(object):
  
 -                stack.append({"source": source_code,
 -                              "source_name": source_code_name,
@@ -61,24 +62,28 @@ index e65d0e14..e3176c86 100644
 -                              "name": function_name,
 +                              "name": function_name.decode("utf8"),
                                "lines": [],
-@@ -939,4 +950,4 @@ class JerryDebugger(object):
+@@ -939,4 +951,4 @@ class JerryDebugger(object):
                  if not stack:
 -                    func_desc["source"] = source_code
 -                    func_desc["source_name"] = source_code_name
 +                    func_desc["source"] = source_code.decode("utf8")
 +                    func_desc["source_name"] = source_code_name.decode("utf8")
  
-@@ -1153,3 +1164,3 @@ class JerryDebugger(object):
+@@ -1153,4 +1165,4 @@ class JerryDebugger(object):
                  message = self.current_out + message
 -                lines = message.split("\n")
+-                self.current_out = lines.pop()
 +                lines = message.decode("utf8").split("\n")
-                 self.current_out = lines.pop()
-@@ -1162,3 +1173,3 @@ class JerryDebugger(object):
++                self.current_out = lines.pop().encode("utf8")
+ 
+@@ -1162,4 +1174,4 @@ class JerryDebugger(object):
                  message = self.current_log + message
 -                lines = message.split("\n")
+-                self.current_log = lines.pop()
 +                lines = message.decode("utf8").split("\n")
-                 self.current_log = lines.pop()
-@@ -1171,7 +1182,7 @@ class JerryDebugger(object):
++                self.current_log = lines.pop().encode("utf8")
+ 
+@@ -1171,7 +1183,7 @@ class JerryDebugger(object):
              if subtype == JERRY_DEBUGGER_OUTPUT_WARNING:
 -                return "%swarning: %s%s" % (self.yellow, self.nocolor, message)
 +                return "%swarning: %s%s" % (self.yellow, self.nocolor, message.decode("utf8"))
@@ -89,22 +94,23 @@ index e65d0e14..e3176c86 100644
 -                return "%strace: %s%s" % (self.blue, self.nocolor, message)
 +                return "%strace: %s%s" % (self.blue, self.nocolor, message.decode("utf8"))
  
-@@ -1180,2 +1191,3 @@ class JerryDebugger(object):
+@@ -1180,2 +1192,3 @@ class JerryDebugger(object):
  
 +        message = message.decode("utf8")
          if not message.endswith("\n"):
 diff --git a/jerry-debugger/jerry_client_websocket.py b/jerry-debugger/jerry_client_websocket.py
-index fe2c761a..07c75e53 100644
+index fe2c761a..9c755966 100644
 --- a/jerry-debugger/jerry_client_websocket.py
 +++ b/jerry-debugger/jerry_client_websocket.py
 @@ -17,2 +17,3 @@
  import struct
 +import sys
  
-@@ -22,2 +23,13 @@ WEBSOCKET_FIN_BIT = 0x80
+@@ -22,2 +23,14 @@ WEBSOCKET_FIN_BIT = 0x80
  
 +
 +if sys.version_info.major >= 3:
++    # pylint: disable=invalid-name
 +    _ord_orig = ord
 +    def _ord_compat(c):
 +        if isinstance(c, int):
@@ -115,7 +121,7 @@ index fe2c761a..07c75e53 100644
 +
 +
  class WebSocket(object):
-@@ -94,3 +106,3 @@ class WebSocket(object):
+@@ -94,3 +107,3 @@ class WebSocket(object):
                                WEBSOCKET_BINARY_FRAME | WEBSOCKET_FIN_BIT,
 -                              WEBSOCKET_FIN_BIT + struct.unpack(byte_order + "B", packed_data[0])[0],
 +                              WEBSOCKET_FIN_BIT + struct.unpack(byte_order + "B", packed_data[0:1])[0],

diff --git a/dev-lang/jerryscript/jerryscript-2.4.0-r2.ebuild b/dev-lang/jerryscript/jerryscript-2.4.0-r3.ebuild
similarity index 100%
rename from dev-lang/jerryscript/jerryscript-2.4.0-r2.ebuild
rename to dev-lang/jerryscript/jerryscript-2.4.0-r3.ebuild


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/jerryscript/, dev-lang/jerryscript/files/
@ 2022-01-02  0:28 Zac Medico
  0 siblings, 0 replies; 4+ messages in thread
From: Zac Medico @ 2022-01-02  0:28 UTC (permalink / raw
  To: gentoo-commits

commit:     164bf869e338666239e7c1b9cdd6c399acaa9c7c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jan  2 00:05:22 2022 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jan  2 00:28:06 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=164bf869

dev-lang/jerryscript: 2.4.0-r4 using python-single-r1

Closes: https://bugs.gentoo.org/830388
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 .../files/jerryscript-2.4.0-python3-r4.patch       | 236 +++++++++++++++++++++
 dev-lang/jerryscript/jerryscript-2.4.0-r4.ebuild   |  74 +++++++
 2 files changed, 310 insertions(+)

diff --git a/dev-lang/jerryscript/files/jerryscript-2.4.0-python3-r4.patch b/dev-lang/jerryscript/files/jerryscript-2.4.0-python3-r4.patch
new file mode 100644
index 000000000000..92198f3901d4
--- /dev/null
+++ b/dev-lang/jerryscript/files/jerryscript-2.4.0-python3-r4.patch
@@ -0,0 +1,236 @@
+From 22d8b904d85e548aa06d2d665aeaaee510a2435a Mon Sep 17 00:00:00 2001
+From: Zac Medico <zmedico@gmail.com>
+Date: Sun, 23 May 2021 13:46:30 -0700
+Subject: [PATCH] Python debugger support for Python 3 (in addition to Python
+ 2)
+
+- Added safe_ord compatibility to pass through int arguments
+- Fixed JerryDebugger to decode bytes as utf8 strings when necessary
+- Fixed WebSocket send_message method to use packed_data[0:1] bytes slice
+
+JerryScript-DCO-1.0-Signed-off-by: Zac Medico <zmedico@gmail.com>
+---
+ jerry-debugger/jerry_client_main.py      | 82 ++++++++++++++----------
+ jerry-debugger/jerry_client_rawpacket.py | 13 +++-
+ jerry-debugger/jerry_client_websocket.py | 15 ++++-
+ 3 files changed, 74 insertions(+), 36 deletions(-)
+
+diff --git a/jerry-debugger/jerry_client_main.py b/jerry-debugger/jerry_client_main.py
+index e65d0e14..ee3ffd26 100644
+--- a/jerry-debugger/jerry_client_main.py
++++ b/jerry-debugger/jerry_client_main.py
+@@ -151,2 +151,11 @@ def arguments_parse():
+ 
++if sys.version_info.major >= 3:
++    def safe_ord(c):
++        if isinstance(c, int):
++            return c
++        return ord(c)
++else:
++	safe_ord = ord
++
++
+ class JerryBreakpoint(object):
+@@ -309,8 +318,8 @@ class JerryDebugger(object):
+ 
+-        if len(result) != config_size or ord(result[0]) != JERRY_DEBUGGER_CONFIGURATION:
++        if len(result) != config_size or safe_ord(result[0]) != JERRY_DEBUGGER_CONFIGURATION:
+             raise Exception("Unexpected configuration")
+ 
+-        self.little_endian = ord(result[1]) & JERRY_DEBUGGER_LITTLE_ENDIAN
+-        self.max_message_size = ord(result[6])
+-        self.cp_size = ord(result[7])
++        self.little_endian = safe_ord(result[1]) & JERRY_DEBUGGER_LITTLE_ENDIAN
++        self.max_message_size = safe_ord(result[6])
++        self.cp_size = safe_ord(result[7])
+ 
+@@ -402,3 +411,3 @@ class JerryDebugger(object):
+             if args != "pending":
+-                for i in self.active_breakpoint_list.values():
++                for i in list(self.active_breakpoint_list.values()):
+                     breakpoint = self.active_breakpoint_list[i.active_index]
+@@ -563,2 +572,3 @@ class JerryDebugger(object):
+     def _send_string(self, args, message_type, index=0):
++        args = args.encode("utf8")
+ 
+@@ -686,3 +696,3 @@ class JerryDebugger(object):
+ 
+-            buffer_type = ord(data[0])
++            buffer_type = safe_ord(data[0])
+             buffer_size = len(data) -1
+@@ -740,6 +750,6 @@ class JerryDebugger(object):
+             elif buffer_type == JERRY_DEBUGGER_EXCEPTION_STR:
+-                self.exception_string += data[1:]
++                self.exception_string += data[1:].decode("utf8")
+ 
+             elif buffer_type == JERRY_DEBUGGER_EXCEPTION_STR_END:
+-                self.exception_string += data[1:]
++                self.exception_string += data[1:].decode("utf8")
+ 
+@@ -810,3 +820,3 @@ class JerryDebugger(object):
+             elif buffer_type in [JERRY_DEBUGGER_SCOPE_VARIABLES, JERRY_DEBUGGER_SCOPE_VARIABLES_END]:
+-                self.scope_vars += "".join(data[1:])
++                self.scope_vars += "".join(data[1:].decode("utf8"))
+ 
+@@ -866,5 +876,5 @@ class JerryDebugger(object):
+     def _parse_source(self, data):
+-        source_code = ""
+-        source_code_name = ""
+-        function_name = ""
++        source_code = b""
++        source_code_name = b""
++        function_name = b""
+         stack = [{"line": 1,
+@@ -881,3 +891,3 @@ class JerryDebugger(object):
+ 
+-            buffer_type = ord(data[0])
++            buffer_type = safe_ord(data[0])
+             buffer_size = len(data) - 1
+@@ -905,10 +915,10 @@ class JerryDebugger(object):
+ 
+-                stack.append({"source": source_code,
+-                              "source_name": source_code_name,
++                stack.append({"source": source_code.decode("utf8"),
++                              "source_name": source_code_name.decode("utf8"),
+                               "line": position[0],
+                               "column": position[1],
+-                              "name": function_name,
++                              "name": function_name.decode("utf8"),
+                               "lines": [],
+                               "offsets": []})
+-                function_name = ""
++                function_name = b""
+ 
+@@ -939,4 +949,4 @@ class JerryDebugger(object):
+                 if not stack:
+-                    func_desc["source"] = source_code
+-                    func_desc["source_name"] = source_code_name
++                    func_desc["source"] = source_code.decode("utf8")
++                    func_desc["source_name"] = source_code_name.decode("utf8")
+ 
+@@ -991,3 +1001,3 @@ class JerryDebugger(object):
+ 
+-            for breakpoint_index, breakpoint in bp_list.items():
++            for breakpoint_index, breakpoint in list(bp_list.items()):
+                 source_lines = 0
+@@ -1134,3 +1144,3 @@ class JerryDebugger(object):
+                                JERRY_DEBUGGER_OUTPUT_RESULT_END]:
+-                subtype = ord(data[-1])
++                subtype = safe_ord(data[-1])
+                 message += data[1:-1]
+@@ -1141,3 +1151,3 @@ class JerryDebugger(object):
+             data = self.channel.get_message(True)
+-            buffer_type = ord(data[0])
++            buffer_type = safe_ord(data[0])
+             # Checks if the next frame would be an invalid data frame.
+@@ -1153,4 +1163,4 @@ class JerryDebugger(object):
+                 message = self.current_out + message
+-                lines = message.split("\n")
+-                self.current_out = lines.pop()
++                lines = message.decode("utf8").split("\n")
++                self.current_out = lines.pop().encode("utf8")
+ 
+@@ -1162,4 +1172,4 @@ class JerryDebugger(object):
+                 message = self.current_log + message
+-                lines = message.split("\n")
+-                self.current_log = lines.pop()
++                lines = message.decode("utf8").split("\n")
++                self.current_log = lines.pop().encode("utf8")
+ 
+@@ -1167,2 +1177,3 @@ class JerryDebugger(object):
+ 
++            message = message.decode("utf8")
+             if not message.endswith("\n"):
+@@ -1176,2 +1187,5 @@ class JerryDebugger(object):
+                 return "%strace: %s%s" % (self.blue, self.nocolor, message)
++        else:
++            message = message.decode("utf8")
++
+ 
+@@ -1195,3 +1209,3 @@ class JerryDebugger(object):
+             # Process name
+-            name_length = ord(self.scope_vars[buff_pos:buff_pos + 1])
++            name_length = safe_ord(self.scope_vars[buff_pos:buff_pos + 1])
+             buff_pos += 1
+@@ -1201,3 +1215,3 @@ class JerryDebugger(object):
+             # Process type
+-            value_type = ord(self.scope_vars[buff_pos:buff_pos + 1])
++            value_type = safe_ord(self.scope_vars[buff_pos:buff_pos + 1])
+ 
+@@ -1205,3 +1219,3 @@ class JerryDebugger(object):
+ 
+-            value_length = ord(self.scope_vars[buff_pos:buff_pos + 1])
++            value_length = safe_ord(self.scope_vars[buff_pos:buff_pos + 1])
+             buff_pos += 1
+@@ -1236,12 +1250,12 @@ class JerryDebugger(object):
+         for i, level in enumerate(self.scope_data):
+-            if ord(level) == JERRY_DEBUGGER_SCOPE_WITH:
++            if safe_ord(level) == JERRY_DEBUGGER_SCOPE_WITH:
+                 table.append([str(i), 'with'])
+-            elif ord(level) == JERRY_DEBUGGER_SCOPE_GLOBAL:
++            elif safe_ord(level) == JERRY_DEBUGGER_SCOPE_GLOBAL:
+                 table.append([str(i), 'global'])
+-            elif ord(level) == JERRY_DEBUGGER_SCOPE_NON_CLOSURE:
++            elif safe_ord(level) == JERRY_DEBUGGER_SCOPE_NON_CLOSURE:
+                 # Currently it is only marks the catch closure.
+                 table.append([str(i), 'catch'])
+-            elif ord(level) == JERRY_DEBUGGER_SCOPE_LOCAL:
++            elif safe_ord(level) == JERRY_DEBUGGER_SCOPE_LOCAL:
+                 table.append([str(i), 'local'])
+-            elif ord(level) == JERRY_DEBUGGER_SCOPE_CLOSURE:
++            elif safe_ord(level) == JERRY_DEBUGGER_SCOPE_CLOSURE:
+                 table.append([str(i), 'closure'])
+diff --git a/jerry-debugger/jerry_client_rawpacket.py b/jerry-debugger/jerry_client_rawpacket.py
+index 5c3304ed..275be83c 100644
+--- a/jerry-debugger/jerry_client_rawpacket.py
++++ b/jerry-debugger/jerry_client_rawpacket.py
+@@ -17,2 +17,3 @@
+ import struct
++import sys
+ 
+@@ -20,2 +21,12 @@ MAX_BUFFER_SIZE = 256
+ 
++
++if sys.version_info.major >= 3:
++    def safe_ord(c):
++        if isinstance(c, int):
++            return c
++        return ord(c)
++else:
++	safe_ord = ord
++
++
+ class RawPacket(object):
+@@ -72,3 +83,3 @@ class RawPacket(object):
+             if len(self.data_buffer) >= 1:
+-                size = ord(self.data_buffer[0])
++                size = safe_ord(self.data_buffer[0])
+                 if size == 0:
+diff --git a/jerry-debugger/jerry_client_websocket.py b/jerry-debugger/jerry_client_websocket.py
+index fe2c761a..9c755966 100644
+--- a/jerry-debugger/jerry_client_websocket.py
++++ b/jerry-debugger/jerry_client_websocket.py
+@@ -17,2 +17,3 @@
+ import struct
++import sys
+ 
+@@ -22,2 +23,14 @@ WEBSOCKET_FIN_BIT = 0x80
+ 
++
++if sys.version_info.major >= 3:
++    # pylint: disable=invalid-name
++    _ord_orig = ord
++    def _ord_compat(c):
++        if isinstance(c, int):
++            return c
++        return _ord_orig(c)
++    # pylint: disable=redefined-builtin
++    ord = _ord_compat
++
++
+ class WebSocket(object):
+@@ -94,3 +107,3 @@ class WebSocket(object):
+                               WEBSOCKET_BINARY_FRAME | WEBSOCKET_FIN_BIT,
+-                              WEBSOCKET_FIN_BIT + struct.unpack(byte_order + "B", packed_data[0])[0],
++                              WEBSOCKET_FIN_BIT + struct.unpack(byte_order + "B", packed_data[0:1])[0],
+                               0) + packed_data[1:]

diff --git a/dev-lang/jerryscript/jerryscript-2.4.0-r4.ebuild b/dev-lang/jerryscript/jerryscript-2.4.0-r4.ebuild
new file mode 100644
index 000000000000..bc0002817e91
--- /dev/null
+++ b/dev-lang/jerryscript/jerryscript-2.4.0-r4.ebuild
@@ -0,0 +1,74 @@
+# Copyright 2021-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=(python3_{7,8,9,10})
+inherit cmake python-single-r1
+
+DESCRIPTION="Ultra-lightweight JavaScript engine for the Internet of Things"
+HOMEPAGE="https://github.com/jerryscript-project/jerryscript"
+SRC_URI="https://github.com/jerryscript-project/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="debugger"
+RDEPEND="debugger? ( ${PYTHON_DEPS} )"
+BDEPEND="${RDEPEND}"
+REQUIRED_USE="debugger? ( ${PYTHON_REQUIRED_USE} )"
+RESTRICT+=" test"
+
+PATCHES=(
+	"${FILESDIR}/jerryscript-2.4.0-python3-r4.patch"
+)
+
+src_prepare() {
+	find . -name CMakeLists.txt -print0 | xargs -0 sed -i \
+		-e "s:lib/pkgconfig:$(get_libdir)/pkgconfig:" \
+		-e "s:DESTINATION lib):DESTINATION $(get_libdir)):" \
+		|| die
+	find . -name '*.pc.in' -print0 | xargs -0 sed -i \
+		-e "s|/lib\$|/$(get_libdir)|" \
+		|| die
+	cmake_src_prepare
+}
+
+src_configure() {
+	local mycmakeargs=(
+		-DENABLE_STRIP=OFF
+		-DJERRY_DEBUGGER=ON
+		-DJERRY_ERROR_MESSAGES=ON
+		-DJERRY_EXTERNAL_CONTEXT=ON
+		-DJERRY_LINE_INFO=ON
+		-DJERRY_LOGGING=ON
+		-DJERRY_PARSER_DUMP_BYTE_CODE=ON
+		-DJERRY_PARSER=ON
+		-DJERRY_REGEXP_DUMP_BYTE_CODE=ON
+		-DJERRY_SNAPSHOT_EXEC=ON
+		-DJERRY_SNAPSHOT_SAVE=ON
+	)
+	cmake_src_configure
+}
+
+src_install() {
+	local jerry_debugger_dir
+	cmake_src_install
+
+	if use debugger; then
+		jerry_debugger_dir=/usr/$(get_libdir)/jerryscript/jerry-debugger
+		insinto "${jerry_debugger_dir}"
+		doins jerry-debugger/*.py
+		python_optimize "${ED}${jerry_debugger_dir}"
+
+		cat <<-EOF > "${T}/jerry-debugger"
+		#!/usr/bin/python
+		import sys
+		sys.path.insert(0, "${EPREFIX}${jerry_debugger_dir}")
+		with open("${jerry_debugger_dir}/jerry_client.py") as f:
+		    exec(f.read())
+		EOF
+
+		python_doscript "${T}"/jerry-debugger
+	fi
+}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/jerryscript/, dev-lang/jerryscript/files/
@ 2022-06-10 11:02 Sam James
  0 siblings, 0 replies; 4+ messages in thread
From: Sam James @ 2022-06-10 11:02 UTC (permalink / raw
  To: gentoo-commits

commit:     0c800e1cf627a83ca4b8b9bbdca11026bcf8def8
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 10 10:31:53 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jun 10 11:01:57 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0c800e1c

dev-lang/jerryscript: drop -Werror; fix build with GCC 12

Closes: https://bugs.gentoo.org/840263
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/jerryscript-2.4.0-no-werror.patch        | 33 ++++++++++++++++++++++
 dev-lang/jerryscript/jerryscript-2.4.0-r4.ebuild   |  1 +
 2 files changed, 34 insertions(+)

diff --git a/dev-lang/jerryscript/files/jerryscript-2.4.0-no-werror.patch b/dev-lang/jerryscript/files/jerryscript-2.4.0-no-werror.patch
new file mode 100644
index 000000000000..216e72758a25
--- /dev/null
+++ b/dev-lang/jerryscript/files/jerryscript-2.4.0-no-werror.patch
@@ -0,0 +1,33 @@
+https://bugs.gentoo.org/840263
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -167,7 +167,6 @@ endmacro()
+ macro(jerry_add_compile_warnings)
+   foreach(_warning ${ARGV})
+     jerry_add_compile_flags(-W${_warning})
+-    jerry_add_compile_flags(-Werror=${_warning})
+   endforeach()
+ endmacro()
+ 
+@@ -212,7 +211,7 @@ if(USING_GCC OR USING_CLANG)
+     jerry_add_compile_flags(-fno-builtin)
+   endif()
+   jerry_add_compile_warnings(all extra format-nonliteral init-self conversion sign-conversion format-security missing-declarations shadow strict-prototypes undef old-style-definition)
+-  jerry_add_compile_flags(-Wno-stack-protector -Wno-attributes -Werror)
++  jerry_add_compile_flags(-Wno-stack-protector -Wno-attributes)
+ endif()
+ 
+ if(USING_GCC)
+--- a/targets/zephyr/Makefile.zephyr
++++ b/targets/zephyr/Makefile.zephyr
+@@ -55,9 +55,8 @@ EXT_CFLAGS += -ffunction-sections -fno-inline-functions
+ EXT_CFLAGS += $(KBUILD_CFLAGS) $(NOSTDINC_FLAGS) $(subst -I,-isystem,$(ZEPHYRINCLUDE))
+ 
+ EXT_CFLAGS += -Wall -Wno-format-zero-length -Wno-pointer-sign
+-EXT_CFLAGS += -Werror=format -Werror=implicit-int -Wno-unused-but-set-variable
++EXT_CFLAGS += -Wformat -Wimplicit-int -Wno-unused-but-set-variable
+ EXT_CFLAGS += -Wno-main -Wno-strict-aliasing -Wno-old-style-declaration
+-EXT_CFLAGS += -Wno-error=format=
+ EXT_CFLAGS += -D_XOPEN_SOURCE=700
+ 
+ EXT_CFLAGS += -Wno-error=conversion

diff --git a/dev-lang/jerryscript/jerryscript-2.4.0-r4.ebuild b/dev-lang/jerryscript/jerryscript-2.4.0-r4.ebuild
index 8d851e7d9a8a..53553aaabb7d 100644
--- a/dev-lang/jerryscript/jerryscript-2.4.0-r4.ebuild
+++ b/dev-lang/jerryscript/jerryscript-2.4.0-r4.ebuild
@@ -21,6 +21,7 @@ RESTRICT+=" test"
 
 PATCHES=(
 	"${FILESDIR}/jerryscript-2.4.0-python3-r4.patch"
+	"${FILESDIR}/jerryscript-2.4.0-no-werror.patch"
 )
 
 src_prepare() {


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-06-10 11:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-11  4:51 [gentoo-commits] repo/gentoo:master commit in: dev-lang/jerryscript/, dev-lang/jerryscript/files/ Zac Medico
  -- strict thread matches above, loose matches on Subject: below --
2022-06-10 11:02 Sam James
2022-01-02  0:28 Zac Medico
2021-05-23 23:27 Zac Medico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox