git: 0b3ec4bd7b7a - main - Mk/bsd.gecko.mk: release python limitation

From: Christoph Moench-Tegeder <cmt_at_FreeBSD.org>
Date: Wed, 16 Nov 2022 22:23:24 UTC
The branch main has been updated by cmt:

URL: https://cgit.FreeBSD.org/ports/commit/?id=0b3ec4bd7b7a21467fb1f0d2ee6e9699947b811d

commit 0b3ec4bd7b7a21467fb1f0d2ee6e9699947b811d
Author:     Christoph Moench-Tegeder <cmt@FreeBSD.org>
AuthorDate: 2022-11-16 22:21:55 +0000
Commit:     Christoph Moench-Tegeder <cmt@FreeBSD.org>
CommitDate: 2022-11-16 22:21:55 +0000

    Mk/bsd.gecko.mk: release python limitation
    
    upstream patch should allow building with newer pythons, while the
    old python still works
---
 Mk/bsd.gecko.mk                         |  2 +-
 mail/thunderbird/files/patch-bug1799982 | 60 +++++++++++++++++++++++++++++++++
 www/firefox-esr/files/patch-bug1799982  | 60 +++++++++++++++++++++++++++++++++
 www/firefox/files/patch-bug1799982      | 60 +++++++++++++++++++++++++++++++++
 4 files changed, 181 insertions(+), 1 deletion(-)

diff --git a/Mk/bsd.gecko.mk b/Mk/bsd.gecko.mk
index c0e9e999b3b5..4e2a77c5107c 100644
--- a/Mk/bsd.gecko.mk
+++ b/Mk/bsd.gecko.mk
@@ -61,7 +61,7 @@ MOZILLA_VER?=	${PORTVERSION}
 MOZILLA_BIN?=	${PORTNAME}-bin
 MOZILLA_EXEC_NAME?=${MOZILLA}
 USES+=		compiler:c++17-lang cpe gl gmake gnome iconv localbase perl5 pkgconfig \
-			python:3.6-3.10,build desktop-file-utils
+			python:3.6+,build desktop-file-utils
 CPE_VENDOR?=mozilla
 USE_GL=		gl
 USE_GNOME=	cairo gdkpixbuf2 gtk30
diff --git a/mail/thunderbird/files/patch-bug1799982 b/mail/thunderbird/files/patch-bug1799982
new file mode 100644
index 000000000000..dac77d73390b
--- /dev/null
+++ b/mail/thunderbird/files/patch-bug1799982
@@ -0,0 +1,60 @@
+Bug 1799982 - Remove uses of inline flags from XPIDL regexps. r=xpcom-reviewers,kmag
+
+Apparently the use of these is being turned into an error in Python 3.11.
+Fortunately, our uses appears to be rather trivial.
+
+For t_multilinecomment and t_LCDATA, I dropped the (?s) flag and just
+replaced the one use of . with (\n|.). (?s) means DOTALL, which means
+that dot includes any character, including a newline. Otherwise it means
+dot includes any character except a newline.
+
+I took the new t_singlelinecomment from IPDL's parser.py, so I assume
+it is reasonable enough. t_multilinecomment is also now the same as
+in IPDL.
+
+Differential Revision: https://phabricator.services.mozilla.com/D161738
+
+diff --git xpcom/idl-parser/xpidl/xpidl.py xpcom/idl-parser/xpidl/xpidl.py
+--- xpcom/idl-parser/xpidl/xpidl.py
++++ xpcom/idl-parser/xpidl/xpidl.py
+@@ -1634,36 +1634,36 @@ class IDLParser(object):
+     t_LSHIFT = r"<<"
+     t_RSHIFT = r">>"
+ 
+     literals = '"(){}[]<>,;:=|+-*'
+ 
+     t_ignore = " \t"
+ 
+     def t_multilinecomment(self, t):
+-        r"/\*(?s).*?\*/"
++        r"/\*(\n|.)*?\*/"
+         t.lexer.lineno += t.value.count("\n")
+         if t.value.startswith("/**"):
+             self._doccomments.append(t.value)
+ 
+     def t_singlelinecomment(self, t):
+-        r"(?m)//.*?$"
++        r"//[^\n]*"
+ 
+     def t_IID(self, t):
+         return t
+ 
+     t_IID.__doc__ = r"%(c)s{8}-%(c)s{4}-%(c)s{4}-%(c)s{4}-%(c)s{12}" % {"c": hexchar}
+ 
+     def t_IDENTIFIER(self, t):
+         r"(unsigned\ long\ long|unsigned\ short|unsigned\ long|long\ long)(?!_?[A-Za-z][A-Za-z_0-9])|_?[A-Za-z][A-Za-z_0-9]*"  # NOQA: E501
+         t.type = self.keywords.get(t.value, "IDENTIFIER")
+         return t
+ 
+     def t_LCDATA(self, t):
+-        r"(?s)%\{[ ]*C\+\+[ ]*\n(?P<cdata>.*?\n?)%\}[ ]*(C\+\+)?"
++        r"%\{[ ]*C\+\+[ ]*\n(?P<cdata>(\n|.)*?\n?)%\}[ ]*(C\+\+)?"
+         t.type = "CDATA"
+         t.value = t.lexer.lexmatch.group("cdata")
+         t.lexer.lineno += t.value.count("\n")
+         return t
+ 
+     def t_INCLUDE(self, t):
+         r'\#include[ \t]+"[^"\n]+"'
+         inc, value, end = t.value.split('"')
+
diff --git a/www/firefox-esr/files/patch-bug1799982 b/www/firefox-esr/files/patch-bug1799982
new file mode 100644
index 000000000000..dac77d73390b
--- /dev/null
+++ b/www/firefox-esr/files/patch-bug1799982
@@ -0,0 +1,60 @@
+Bug 1799982 - Remove uses of inline flags from XPIDL regexps. r=xpcom-reviewers,kmag
+
+Apparently the use of these is being turned into an error in Python 3.11.
+Fortunately, our uses appears to be rather trivial.
+
+For t_multilinecomment and t_LCDATA, I dropped the (?s) flag and just
+replaced the one use of . with (\n|.). (?s) means DOTALL, which means
+that dot includes any character, including a newline. Otherwise it means
+dot includes any character except a newline.
+
+I took the new t_singlelinecomment from IPDL's parser.py, so I assume
+it is reasonable enough. t_multilinecomment is also now the same as
+in IPDL.
+
+Differential Revision: https://phabricator.services.mozilla.com/D161738
+
+diff --git xpcom/idl-parser/xpidl/xpidl.py xpcom/idl-parser/xpidl/xpidl.py
+--- xpcom/idl-parser/xpidl/xpidl.py
++++ xpcom/idl-parser/xpidl/xpidl.py
+@@ -1634,36 +1634,36 @@ class IDLParser(object):
+     t_LSHIFT = r"<<"
+     t_RSHIFT = r">>"
+ 
+     literals = '"(){}[]<>,;:=|+-*'
+ 
+     t_ignore = " \t"
+ 
+     def t_multilinecomment(self, t):
+-        r"/\*(?s).*?\*/"
++        r"/\*(\n|.)*?\*/"
+         t.lexer.lineno += t.value.count("\n")
+         if t.value.startswith("/**"):
+             self._doccomments.append(t.value)
+ 
+     def t_singlelinecomment(self, t):
+-        r"(?m)//.*?$"
++        r"//[^\n]*"
+ 
+     def t_IID(self, t):
+         return t
+ 
+     t_IID.__doc__ = r"%(c)s{8}-%(c)s{4}-%(c)s{4}-%(c)s{4}-%(c)s{12}" % {"c": hexchar}
+ 
+     def t_IDENTIFIER(self, t):
+         r"(unsigned\ long\ long|unsigned\ short|unsigned\ long|long\ long)(?!_?[A-Za-z][A-Za-z_0-9])|_?[A-Za-z][A-Za-z_0-9]*"  # NOQA: E501
+         t.type = self.keywords.get(t.value, "IDENTIFIER")
+         return t
+ 
+     def t_LCDATA(self, t):
+-        r"(?s)%\{[ ]*C\+\+[ ]*\n(?P<cdata>.*?\n?)%\}[ ]*(C\+\+)?"
++        r"%\{[ ]*C\+\+[ ]*\n(?P<cdata>(\n|.)*?\n?)%\}[ ]*(C\+\+)?"
+         t.type = "CDATA"
+         t.value = t.lexer.lexmatch.group("cdata")
+         t.lexer.lineno += t.value.count("\n")
+         return t
+ 
+     def t_INCLUDE(self, t):
+         r'\#include[ \t]+"[^"\n]+"'
+         inc, value, end = t.value.split('"')
+
diff --git a/www/firefox/files/patch-bug1799982 b/www/firefox/files/patch-bug1799982
new file mode 100644
index 000000000000..dac77d73390b
--- /dev/null
+++ b/www/firefox/files/patch-bug1799982
@@ -0,0 +1,60 @@
+Bug 1799982 - Remove uses of inline flags from XPIDL regexps. r=xpcom-reviewers,kmag
+
+Apparently the use of these is being turned into an error in Python 3.11.
+Fortunately, our uses appears to be rather trivial.
+
+For t_multilinecomment and t_LCDATA, I dropped the (?s) flag and just
+replaced the one use of . with (\n|.). (?s) means DOTALL, which means
+that dot includes any character, including a newline. Otherwise it means
+dot includes any character except a newline.
+
+I took the new t_singlelinecomment from IPDL's parser.py, so I assume
+it is reasonable enough. t_multilinecomment is also now the same as
+in IPDL.
+
+Differential Revision: https://phabricator.services.mozilla.com/D161738
+
+diff --git xpcom/idl-parser/xpidl/xpidl.py xpcom/idl-parser/xpidl/xpidl.py
+--- xpcom/idl-parser/xpidl/xpidl.py
++++ xpcom/idl-parser/xpidl/xpidl.py
+@@ -1634,36 +1634,36 @@ class IDLParser(object):
+     t_LSHIFT = r"<<"
+     t_RSHIFT = r">>"
+ 
+     literals = '"(){}[]<>,;:=|+-*'
+ 
+     t_ignore = " \t"
+ 
+     def t_multilinecomment(self, t):
+-        r"/\*(?s).*?\*/"
++        r"/\*(\n|.)*?\*/"
+         t.lexer.lineno += t.value.count("\n")
+         if t.value.startswith("/**"):
+             self._doccomments.append(t.value)
+ 
+     def t_singlelinecomment(self, t):
+-        r"(?m)//.*?$"
++        r"//[^\n]*"
+ 
+     def t_IID(self, t):
+         return t
+ 
+     t_IID.__doc__ = r"%(c)s{8}-%(c)s{4}-%(c)s{4}-%(c)s{4}-%(c)s{12}" % {"c": hexchar}
+ 
+     def t_IDENTIFIER(self, t):
+         r"(unsigned\ long\ long|unsigned\ short|unsigned\ long|long\ long)(?!_?[A-Za-z][A-Za-z_0-9])|_?[A-Za-z][A-Za-z_0-9]*"  # NOQA: E501
+         t.type = self.keywords.get(t.value, "IDENTIFIER")
+         return t
+ 
+     def t_LCDATA(self, t):
+-        r"(?s)%\{[ ]*C\+\+[ ]*\n(?P<cdata>.*?\n?)%\}[ ]*(C\+\+)?"
++        r"%\{[ ]*C\+\+[ ]*\n(?P<cdata>(\n|.)*?\n?)%\}[ ]*(C\+\+)?"
+         t.type = "CDATA"
+         t.value = t.lexer.lexmatch.group("cdata")
+         t.lexer.lineno += t.value.count("\n")
+         return t
+ 
+     def t_INCLUDE(self, t):
+         r'\#include[ \t]+"[^"\n]+"'
+         inc, value, end = t.value.split('"')
+