From 447e1ef21f78d7fa44c502b46e14787ed889b2f5 Mon Sep 17 00:00:00 2001 From: Kevin Mihelich Date: Mon, 8 Apr 2024 12:51:25 +0000 Subject: [PATCH] extra/js91 to 91.13.0-2 --- extra/js91/.SRCINFO | 34 +++++ ...ve-U-from-mode-parameters-for-variou.patch | 130 ++++++++++++++++++ extra/js91/PKGBUILD | 64 +++++++-- ...F26682D0916CDD81E37B6D61B7B526D98F0353.asc | 97 ++++++------- 4 files changed, 263 insertions(+), 62 deletions(-) create mode 100644 extra/js91/.SRCINFO create mode 100644 extra/js91/0001-Bug-1769631-Remove-U-from-mode-parameters-for-variou.patch diff --git a/extra/js91/.SRCINFO b/extra/js91/.SRCINFO new file mode 100644 index 000000000..3c007de33 --- /dev/null +++ b/extra/js91/.SRCINFO @@ -0,0 +1,34 @@ +pkgbase = js91 + pkgdesc = JavaScript interpreter and libraries - Version 91 + pkgver = 91.13.0 + pkgrel = 2 + url = https://spidermonkey.dev/ + arch = x86_64 + license = MPL-2.0 + checkdepends = git + checkdepends = mercurial + makedepends = autoconf2.13 + makedepends = clang + makedepends = lld + makedepends = llvm + makedepends = python + makedepends = python-setuptools + makedepends = rustup + makedepends = zip + depends = gcc-libs + depends = readline + depends = sh + depends = zlib + options = !lto + source = https://archive.mozilla.org/pub/firefox/releases/91.13.0esr/source/firefox-91.13.0esr.source.tar.xz + source = https://archive.mozilla.org/pub/firefox/releases/91.13.0esr/source/firefox-91.13.0esr.source.tar.xz.asc + source = 0001-Bug-1769631-Remove-U-from-mode-parameters-for-variou.patch + validpgpkeys = 14F26682D0916CDD81E37B6D61B7B526D98F0353 + sha256sums = 53be2bcde0b5ee3ec106bd8ba06b8ae95e7d489c484e881dfbe5360e4c920762 + sha256sums = SKIP + sha256sums = 1b6fcec05714c0fbc52549059d570dddd79302ca787dec9983b046d54fa7a6ff + b2sums = 75d0daa512b3a2d41974a0169778be9ef19a100de2bd382add9831860ca93976585a41e760b6a7ec753268fb78f9f61049780fa7961834248bc8157cfdcc2827 + b2sums = SKIP + b2sums = 216206c7f0356267f4f29880b8b8e8e388f9dd483a56cd427de57756d64ef26ea6d6b36e33ca96dbc54c45bf78bbf2b9a666aa8b2029fa28d07dc41342101158 + +pkgname = js91 diff --git a/extra/js91/0001-Bug-1769631-Remove-U-from-mode-parameters-for-variou.patch b/extra/js91/0001-Bug-1769631-Remove-U-from-mode-parameters-for-variou.patch new file mode 100644 index 000000000..0720121a5 --- /dev/null +++ b/extra/js91/0001-Bug-1769631-Remove-U-from-mode-parameters-for-variou.patch @@ -0,0 +1,130 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: ahochheiden +Date: Thu, 2 Jun 2022 06:27:44 +0000 +Subject: [PATCH] Bug 1769631 - Remove 'U' from 'mode' parameters for various + 'open' calls to ensure Python3.11 compatibility + r=firefox-build-system-reviewers,glandium a=RyanVM + +The 'U' flag represents "universal newline". It has been deprecated +since Python3.3. Since then "universal newline" is the default when a +file is opened in text mode (not bytes). In Python3.11 using the 'U' +flag throws errors. There should be no harm in removing 'U' from 'open' +everywhere it is used, and doing allows the use of Python3.11. + +For more reading see: https://docs.python.org/3.11/whatsnew/3.11.html#changes-in-the-python-api + +Differential Revision: https://phabricator.services.mozilla.com/D147721 +--- + dom/base/usecounters.py | 2 +- + python/mozbuild/mozbuild/action/process_define_files.py | 2 +- + python/mozbuild/mozbuild/backend/base.py | 2 +- + python/mozbuild/mozbuild/preprocessor.py | 6 +++--- + python/mozbuild/mozbuild/util.py | 2 +- + python/mozbuild/mozpack/files.py | 4 ++-- + 6 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/dom/base/usecounters.py b/dom/base/usecounters.py +index 780e3b32b213..7e2c7148ece5 100644 +--- a/dom/base/usecounters.py ++++ b/dom/base/usecounters.py +@@ -8,7 +8,7 @@ import re + + def read_conf(conf_filename): + # Can't read/write from a single StringIO, so make a new one for reading. +- stream = open(conf_filename, "rU") ++ stream = open(conf_filename, "r") + + def parse_counters(stream): + for line_num, line in enumerate(stream): +diff --git a/python/mozbuild/mozbuild/action/process_define_files.py b/python/mozbuild/mozbuild/action/process_define_files.py +index f1d401ac2600..aca59d0f0517 100644 +--- a/python/mozbuild/mozbuild/action/process_define_files.py ++++ b/python/mozbuild/mozbuild/action/process_define_files.py +@@ -36,7 +36,7 @@ def process_define_file(output, input): + ) and not config.substs.get("JS_STANDALONE"): + config = PartialConfigEnvironment(mozpath.join(topobjdir, "js", "src")) + +- with open(path, "rU") as input: ++ with open(path, "r") as input: + r = re.compile( + "^\s*#\s*(?P[a-z]+)(?:\s+(?P\S+)(?:\s+(?P\S+))?)?", re.U + ) +diff --git a/python/mozbuild/mozbuild/backend/base.py b/python/mozbuild/mozbuild/backend/base.py +index 7bc1986d863b..b64a70946863 100644 +--- a/python/mozbuild/mozbuild/backend/base.py ++++ b/python/mozbuild/mozbuild/backend/base.py +@@ -272,7 +272,7 @@ class BuildBackend(LoggingMixin): + return status + + @contextmanager +- def _write_file(self, path=None, fh=None, readmode="rU"): ++ def _write_file(self, path=None, fh=None, readmode="r"): + """Context manager to write a file. + + This is a glorified wrapper around FileAvoidWrite with integration to +diff --git a/python/mozbuild/mozbuild/preprocessor.py b/python/mozbuild/mozbuild/preprocessor.py +index f7820b9c9147..857f1a6c9bfd 100644 +--- a/python/mozbuild/mozbuild/preprocessor.py ++++ b/python/mozbuild/mozbuild/preprocessor.py +@@ -531,7 +531,7 @@ class Preprocessor: + + if args: + for f in args: +- with io.open(f, "rU", encoding="utf-8") as input: ++ with io.open(f, "r", encoding="utf-8") as input: + self.processFile(input=input, output=out) + if depfile: + mk = Makefile() +@@ -860,7 +860,7 @@ class Preprocessor: + args = self.applyFilters(args) + if not os.path.isabs(args): + args = os.path.join(self.curdir, args) +- args = io.open(args, "rU", encoding="utf-8") ++ args = io.open(args, "r", encoding="utf-8") + except Preprocessor.Error: + raise + except Exception: +@@ -914,7 +914,7 @@ class Preprocessor: + def preprocess(includes=[sys.stdin], defines={}, output=sys.stdout, marker="#"): + pp = Preprocessor(defines=defines, marker=marker) + for f in includes: +- with io.open(f, "rU", encoding="utf-8") as input: ++ with io.open(f, "r", encoding="utf-8") as input: + pp.processFile(input=input, output=output) + return pp.includes + +diff --git a/python/mozbuild/mozbuild/util.py b/python/mozbuild/mozbuild/util.py +index 071daecc397b..81de4730dac9 100644 +--- a/python/mozbuild/mozbuild/util.py ++++ b/python/mozbuild/mozbuild/util.py +@@ -225,7 +225,7 @@ class FileAvoidWrite(BytesIO): + still occur, as well as diff capture if requested. + """ + +- def __init__(self, filename, capture_diff=False, dry_run=False, readmode="rU"): ++ def __init__(self, filename, capture_diff=False, dry_run=False, readmode="r"): + BytesIO.__init__(self) + self.name = filename + assert type(capture_diff) == bool +diff --git a/python/mozbuild/mozpack/files.py b/python/mozbuild/mozpack/files.py +index 8150e72d6fa2..001c497b2796 100644 +--- a/python/mozbuild/mozpack/files.py ++++ b/python/mozbuild/mozpack/files.py +@@ -574,7 +574,7 @@ class PreprocessedFile(BaseFile): + pp = Preprocessor(defines=self.defines, marker=self.marker) + pp.setSilenceDirectiveWarnings(self.silence_missing_directive_warnings) + +- with _open(self.path, "rU") as input: ++ with _open(self.path, "r") as input: + with _open(os.devnull, "w") as output: + pp.processFile(input=input, output=output) + +@@ -631,7 +631,7 @@ class PreprocessedFile(BaseFile): + pp = Preprocessor(defines=self.defines, marker=self.marker) + pp.setSilenceDirectiveWarnings(self.silence_missing_directive_warnings) + +- with _open(self.path, "rU") as input: ++ with _open(self.path, "r") as input: + pp.processFile(input=input, output=dest, depfile=deps_out) + + dest.close() diff --git a/extra/js91/PKGBUILD b/extra/js91/PKGBUILD index af4f7577e..bc9ffed68 100644 --- a/extra/js91/PKGBUILD +++ b/extra/js91/PKGBUILD @@ -5,20 +5,48 @@ pkgname=js91 pkgver=91.13.0 -pkgrel=1 +pkgrel=2 pkgdesc="JavaScript interpreter and libraries - Version 91" -arch=(x86_64) url="https://spidermonkey.dev/" -license=(MPL) -depends=(gcc-libs readline zlib sh) -makedepends=(zip autoconf2.13 python-setuptools python-psutil rustup llvm clang lld) -checkdepends=(mercurial git) -options=(!lto debug) +arch=(x86_64) +license=(MPL-2.0) +depends=( + gcc-libs + readline + sh + zlib +) +makedepends=( + autoconf2.13 + clang + lld + llvm + python + python-setuptools + rustup + zip +) +checkdepends=( + git + mercurial +) +options=(!lto) _relver=${pkgver}esr -source=(https://archive.mozilla.org/pub/firefox/releases/$_relver/source/firefox-$_relver.source.tar.xz{,.asc}) +source=( + https://archive.mozilla.org/pub/firefox/releases/$_relver/source/firefox-$_relver.source.tar.xz{,.asc} + 0001-Bug-1769631-Remove-U-from-mode-parameters-for-variou.patch +) +validpgpkeys=( + # Mozilla Software Releases + # https://blog.mozilla.org/security/2023/05/11/updated-gpg-key-for-signing-firefox-releases/ + 14F26682D0916CDD81E37B6D61B7B526D98F0353 +) sha256sums=('53be2bcde0b5ee3ec106bd8ba06b8ae95e7d489c484e881dfbe5360e4c920762' - 'SKIP') -validpgpkeys=('14F26682D0916CDD81E37B6D61B7B526D98F0353') # Mozilla Software Releases + 'SKIP' + '1b6fcec05714c0fbc52549059d570dddd79302ca787dec9983b046d54fa7a6ff') +b2sums=('75d0daa512b3a2d41974a0169778be9ef19a100de2bd382add9831860ca93976585a41e760b6a7ec753268fb78f9f61049780fa7961834248bc8157cfdcc2827' + 'SKIP' + '216206c7f0356267f4f29880b8b8e8e388f9dd483a56cd427de57756d64ef26ea6d6b36e33ca96dbc54c45bf78bbf2b9a666aa8b2029fa28d07dc41342101158') # Make sure the duplication between bin and lib is found COMPRESSZST+=(--long) @@ -31,6 +59,9 @@ prepare() { mkdir mozbuild cd firefox-$pkgver + # Python 3.11 + patch -Np1 -i ../0001-Bug-1769631-Remove-U-from-mode-parameters-for-variou.patch + cat >../mozconfig <