From a8ead54567c43f59d4d869bd5a89bd799b876232 Mon Sep 17 00:00:00 2001 From: yuanhui Date: Fri, 17 Mar 2023 13:46:45 +0800 Subject: [PATCH] Init package from upstream Signed-off-by: yuanhui --- 0001-fix-soname.patch | 26 ++ 0002-copy-headers.patch | 38 +++ 0003-tests-increase-timeout.patch | 26 ++ ...y-Decouple-from-Mozilla-build-system.patch | 29 +++ ...a-Write-command-output-to-our-stderr.patch | 44 ++++ 0006-emitter.patch | 67 +++++ ...-tests-Use-native-TemporaryDirectory.patch | 66 +++++ 0008-init_patch.patch | 28 +++ ...y-m4-detection-from-bundled-autoconf.patch | 29 +++ 0010-spidermonkey_checks_disable.patch | 22 ++ 0011-Skip-failing-tests-on-aarch64.patch | 26 ++ download | 1 + known_failures.txt | 102 ++++++++ mozjs102.spec | 235 ++++++++++++++++++ 14 files changed, 739 insertions(+) create mode 100644 0001-fix-soname.patch create mode 100644 0002-copy-headers.patch create mode 100644 0003-tests-increase-timeout.patch create mode 100644 0004-icu_sources_data.py-Decouple-from-Mozilla-build-system.patch create mode 100644 0005-icu_sources_data-Write-command-output-to-our-stderr.patch create mode 100644 0006-emitter.patch create mode 100644 0007-tests-Use-native-TemporaryDirectory.patch create mode 100644 0008-init_patch.patch create mode 100644 0009-remove-sloppy-m4-detection-from-bundled-autoconf.patch create mode 100644 0010-spidermonkey_checks_disable.patch create mode 100644 0011-Skip-failing-tests-on-aarch64.patch create mode 100644 download create mode 100644 known_failures.txt create mode 100644 mozjs102.spec diff --git a/0001-fix-soname.patch b/0001-fix-soname.patch new file mode 100644 index 0000000..8323264 --- /dev/null +++ b/0001-fix-soname.patch @@ -0,0 +1,26 @@ +From d21c7cb9343d8c495d987e71be0f35887574c820 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= +Date: Wed, 15 Jul 2020 08:21:47 +0200 +Subject: [PATCH] Add soname switch to linker, regardless of Operating System + +Fix backported from Debian: http://bugs.debian.org/746705 +--- + config/rules.mk | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/config/rules.mk b/config/rules.mk +index 90a9946..dc87789 100644 +--- a/config/rules.mk ++++ b/config/rules.mk +@@ -291,6 +291,8 @@ ifeq ($(OS_ARCH),GNU) + OS_CPPFLAGS += -DPATH_MAX=1024 -DMAXPATHLEN=1024 + endif + ++EXTRA_DSO_LDOPTS += -Wl,-soname,lib$(JS_LIBRARY_NAME).so.0 ++ + # + # MINGW32 + # +-- +2.37.1 + diff --git a/0002-copy-headers.patch b/0002-copy-headers.patch new file mode 100644 index 0000000..dfddcfa --- /dev/null +++ b/0002-copy-headers.patch @@ -0,0 +1,38 @@ +From 3b3c8e37cca418e07bdeceaf3a601805df28d925 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= +Date: Wed, 15 Jul 2020 08:27:39 +0200 +Subject: [PATCH] build: Copy headers on install instead of symlinking + +Patch by Philip Chimento ported forward to mozjs78 +--- + python/mozbuild/mozbuild/backend/recursivemake.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py +index 858d4d4..8c229e8 100644 +--- a/python/mozbuild/mozbuild/backend/recursivemake.py ++++ b/python/mozbuild/mozbuild/backend/recursivemake.py +@@ -1533,9 +1533,9 @@ class RecursiveMakeBackend(MakeBackend): + " of srcdir-relative or absolute paths." + ) + +- install_manifest.add_pattern_link(basepath, wild, dest_dir) ++ install_manifest.add_pattern_copy(basepath, wild, dest_dir) + else: +- install_manifest.add_pattern_link(f.srcdir, f, dest_dir) ++ install_manifest.add_pattern_copy(f.srcdir, f, dest_dir) + elif isinstance(f, AbsolutePath): + if not f.full_path.lower().endswith((".dll", ".pdb", ".so")): + raise Exception( +@@ -1546,7 +1546,7 @@ class RecursiveMakeBackend(MakeBackend): + install_manifest.add_optional_exists(dest_file) + absolute_files.append(f.full_path) + else: +- install_manifest.add_link(f.full_path, dest_file) ++ install_manifest.add_copy(f.full_path, dest_file) + else: + install_manifest.add_optional_exists(dest_file) + objdir_files.append(self._pretty_path(f, backend_file)) +-- +2.37.1 + diff --git a/0003-tests-increase-timeout.patch b/0003-tests-increase-timeout.patch new file mode 100644 index 0000000..2ba725c --- /dev/null +++ b/0003-tests-increase-timeout.patch @@ -0,0 +1,26 @@ +From 9be85b155c6df0454c5faef9e850f572c99e3615 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= +Date: Wed, 15 Jul 2020 08:32:44 +0200 +Subject: [PATCH] Increase the test timeout for slower buildds + +Ported forward from Debian: https://bugs.debian.org/878284 +--- + js/src/Makefile.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/js/src/Makefile.in b/js/src/Makefile.in +index 6daed72..16db2de 100644 +--- a/js/src/Makefile.in ++++ b/js/src/Makefile.in +@@ -53,7 +53,7 @@ check:: check-js-msg + + check-jstests: + $(wildcard $(RUN_TEST_PROGRAM)) $(PYTHON3) -u $(srcdir)/tests/jstests.py \ +- --no-progress --format=automation --timeout 300 \ ++ --no-progress --format=automation --timeout 600 \ + $(JSTESTS_EXTRA_ARGS) \ + $(DIST)/bin/js$(BIN_SUFFIX) + +-- +2.37.1 + diff --git a/0004-icu_sources_data.py-Decouple-from-Mozilla-build-system.patch b/0004-icu_sources_data.py-Decouple-from-Mozilla-build-system.patch new file mode 100644 index 0000000..8572c21 --- /dev/null +++ b/0004-icu_sources_data.py-Decouple-from-Mozilla-build-system.patch @@ -0,0 +1,29 @@ +From: Simon McVittie +Date: Mon, 9 Oct 2017 09:22:12 +0100 +Subject: icu_sources_data.py: Decouple from Mozilla build system + +mozpack.path is a wrapper around os.path that normalizes path +separators on Windows, but on Unix we only have one path separator +so there's nothing to normalize. Avoid needing to import all of it. +--- + intl/icu_sources_data.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/intl/icu_sources_data.py b/intl/icu_sources_data.py +index 2936df9..4db52af 100644 +--- a/intl/icu_sources_data.py ++++ b/intl/icu_sources_data.py +@@ -21,7 +21,9 @@ import subprocess + import sys + import tempfile + +-from mozpack import path as mozpath ++# Close enough ++import os.path as mozpath ++mozpath.normsep = lambda p: p + + # The following files have been determined to be dead/unused by a + # semi-automated analysis. You can just remove any of the files below +-- +2.31.1 + diff --git a/0005-icu_sources_data-Write-command-output-to-our-stderr.patch b/0005-icu_sources_data-Write-command-output-to-our-stderr.patch new file mode 100644 index 0000000..8468425 --- /dev/null +++ b/0005-icu_sources_data-Write-command-output-to-our-stderr.patch @@ -0,0 +1,44 @@ +From: Simon McVittie +Date: Mon, 9 Oct 2017 09:23:14 +0100 +Subject: icu_sources_data: Write command output to our stderr + +Saying "See output in /tmp/foobar" is all very well for a developer +build, but on a buildd our /tmp is going to get thrown away after +the build. Just log the usual way instead. +--- + intl/icu_sources_data.py | 16 ++++------------ + 1 file changed, 4 insertions(+), 12 deletions(-) + +diff --git a/intl/icu_sources_data.py b/intl/icu_sources_data.py +index 4db52af..d62960d 100644 +--- a/intl/icu_sources_data.py ++++ b/intl/icu_sources_data.py +@@ -188,21 +188,13 @@ def update_sources(topsrcdir): + + def try_run(name, command, cwd=None, **kwargs): + try: +- with tempfile.NamedTemporaryFile(prefix=name, delete=False) as f: +- subprocess.check_call( +- command, cwd=cwd, stdout=f, stderr=subprocess.STDOUT, **kwargs +- ) +- except subprocess.CalledProcessError: +- print( +- """Error running "{}" in directory {} +- See output in {}""".format( +- " ".join(command), cwd, f.name +- ), +- file=sys.stderr, ++ subprocess.check_call( ++ command, cwd=cwd, stdout=sys.stderr, stderr=subprocess.STDOUT, **kwargs + ) ++ except subprocess.CalledProcessError: ++ print('''Error running "{}" in directory {}'''.format(' '.join(command), cwd), file=sys.stderr) + return False + else: +- os.unlink(f.name) + return True + + +-- +2.31.1 + diff --git a/0006-emitter.patch b/0006-emitter.patch new file mode 100644 index 0000000..8d5aafb --- /dev/null +++ b/0006-emitter.patch @@ -0,0 +1,67 @@ +From d1d785c169345b81c76213f6dd9be32b4db60294 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= +Date: Wed, 15 Jul 2020 08:39:47 +0200 +Subject: [PATCH] Build: allow LOCAL_INCLUDES paths with topsrcdir or topobjdir + +--- + python/mozbuild/mozbuild/frontend/emitter.py | 10 --------- + .../mozbuild/test/frontend/test_emitter.py | 22 ------------------- + 2 files changed, 32 deletions(-) + +diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozbuild/frontend/emitter.py +index 0b7ccef..a3c7f2f 100644 +--- a/python/mozbuild/mozbuild/frontend/emitter.py ++++ b/python/mozbuild/mozbuild/frontend/emitter.py +@@ -1365,16 +1365,6 @@ class TreeMetadataEmitter(LoggingMixin): + "(resolved to %s)" % (local_include, full_path), + context, + ) +- if ( +- full_path == context.config.topsrcdir +- or full_path == context.config.topobjdir +- ): +- raise SandboxValidationError( +- "Path specified in LOCAL_INCLUDES " +- "(%s) resolves to the topsrcdir or topobjdir (%s), which is " +- "not allowed" % (local_include, full_path), +- context, +- ) + include_obj = LocalInclude(context, local_include) + local_includes.append(include_obj.path.full_path) + yield include_obj +diff --git a/python/mozbuild/mozbuild/test/frontend/test_emitter.py b/python/mozbuild/mozbuild/test/frontend/test_emitter.py +index 99507fc..821de22 100644 +--- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py ++++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py +@@ -1076,28 +1076,6 @@ class TestEmitterBasic(unittest.TestCase): + + self.assertEqual(local_includes, expected) + +- def test_local_includes_invalid(self): +- """Test that invalid LOCAL_INCLUDES are properly detected.""" +- reader = self.reader("local_includes-invalid/srcdir") +- +- with six.assertRaisesRegex( +- self, +- SandboxValidationError, +- "Path specified in LOCAL_INCLUDES.*resolves to the " +- "topsrcdir or topobjdir", +- ): +- self.read_topsrcdir(reader) +- +- reader = self.reader("local_includes-invalid/objdir") +- +- with six.assertRaisesRegex( +- self, +- SandboxValidationError, +- "Path specified in LOCAL_INCLUDES.*resolves to the " +- "topsrcdir or topobjdir", +- ): +- self.read_topsrcdir(reader) +- + def test_local_includes_file(self): + """Test that a filename can't be used in LOCAL_INCLUDES.""" + reader = self.reader("local_includes-filename") +-- +2.37.1 + diff --git a/0007-tests-Use-native-TemporaryDirectory.patch b/0007-tests-Use-native-TemporaryDirectory.patch new file mode 100644 index 0000000..054685c --- /dev/null +++ b/0007-tests-Use-native-TemporaryDirectory.patch @@ -0,0 +1,66 @@ +From 1af9fdd2124547099eb0cf5a71b513ef5592dbf9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= +Date: Tue, 10 Aug 2021 00:00:50 +0200 +Subject: [PATCH] Tests: Use native TemporaryDirectory + +Without ugly wrapper for Py < 3.2 that doesn't work half of the times... +--- + js/src/jit-test/jit_test.py | 2 +- + js/src/tests/jstests.py | 2 +- + js/src/tests/lib/tempfile.py | 17 +---------------- + 3 files changed, 3 insertions(+), 18 deletions(-) + +diff --git a/js/src/jit-test/jit_test.py b/js/src/jit-test/jit_test.py +index f5d7794..8d443aa 100755 +--- a/js/src/jit-test/jit_test.py ++++ b/js/src/jit-test/jit_test.py +@@ -38,7 +38,7 @@ from lib.tests import ( + get_environment_overlay, + change_env, + ) +-from lib.tempfile import TemporaryDirectory ++from tempfile import TemporaryDirectory + + + def which(name): +diff --git a/js/src/tests/jstests.py b/js/src/tests/jstests.py +index 6fa2f5f..53ceff6 100755 +--- a/js/src/tests/jstests.py ++++ b/js/src/tests/jstests.py +@@ -37,7 +37,7 @@ from lib.tests import ( + from lib.results import ResultsSink, TestOutput + from lib.progressbar import ProgressBar + from lib.adaptor import xdr_annotate +-from lib.tempfile import TemporaryDirectory ++from tempfile import TemporaryDirectory + + if sys.platform.startswith("linux") or sys.platform.startswith("darwin"): + from lib.tasks_unix import run_all_tests +diff --git a/js/src/tests/lib/tempfile.py b/js/src/tests/lib/tempfile.py +index ecc21c9..f0a1fa3 100644 +--- a/js/src/tests/lib/tempfile.py ++++ b/js/src/tests/lib/tempfile.py +@@ -2,19 +2,4 @@ + # License, v. 2.0. If a copy of the MPL was not distributed with this + # file, You can obtain one at http://mozilla.org/MPL/2.0/. + from __future__ import absolute_import +- +-try: +- # Python 3.2 +- from tempfile import TemporaryDirectory +-except ImportError: +- import tempfile +- import shutil +- from contextlib import contextmanager +- +- @contextmanager +- def TemporaryDirectory(*args, **kwds): +- d = tempfile.mkdtemp(*args, **kwds) +- try: +- yield d +- finally: +- shutil.rmtree(d) ++from tempfile import TemporaryDirectory +-- +2.31.1 + diff --git a/0008-init_patch.patch b/0008-init_patch.patch new file mode 100644 index 0000000..28ed1d3 --- /dev/null +++ b/0008-init_patch.patch @@ -0,0 +1,28 @@ +From 00414eb67ab0591911167155963b5524fbf2b0c0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= +Date: Mon, 9 Aug 2021 14:38:58 +0200 +Subject: [PATCH] Don't throw InvalidOptionError on invalid options + +--- + python/mozbuild/mozbuild/configure/__init__.py | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/python/mozbuild/mozbuild/configure/__init__.py b/python/mozbuild/mozbuild/configure/__init__.py +index f3167f6..c9e1132 100644 +--- a/python/mozbuild/mozbuild/configure/__init__.py ++++ b/python/mozbuild/mozbuild/configure/__init__.py +@@ -557,10 +557,7 @@ class ConfigureSandbox(dict): + for arg in self._helper: + without_value = arg.split("=", 1)[0] + msg = "Unknown option: %s" % without_value +- if self._help: +- self._logger.warning(msg) +- else: +- raise InvalidOptionError(msg) ++ self._logger.warning(msg) + + # Run the execution queue + for func, args in self._execution_queue: +-- +2.31.1 + diff --git a/0009-remove-sloppy-m4-detection-from-bundled-autoconf.patch b/0009-remove-sloppy-m4-detection-from-bundled-autoconf.patch new file mode 100644 index 0000000..10b8b16 --- /dev/null +++ b/0009-remove-sloppy-m4-detection-from-bundled-autoconf.patch @@ -0,0 +1,29 @@ +From 2d99a7b076578a3394fb9d5be6eb44f9cfebc681 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= +Date: Mon, 9 Aug 2021 16:15:37 +0200 +Subject: [PATCH] Remove sloppy m4 detection from bundled autoconf + +--- + build/autoconf/autoconf.sh | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/build/autoconf/autoconf.sh b/build/autoconf/autoconf.sh +index ceb8a25..606c74e 100644 +--- a/build/autoconf/autoconf.sh ++++ b/build/autoconf/autoconf.sh +@@ -114,12 +114,6 @@ fi + + # Use the frozen version of Autoconf if available. + r= f= +-# Some non-GNU m4's don't reject the --help option, so give them /dev/null. +-case `$M4 --help < /dev/null 2>&1` in +-*reload-state*) test -r $AC_MACRODIR/autoconf.m4f && { r=--reload f=f; } ;; +-*traditional*) ;; +-*) echo Autoconf requires GNU m4 1.1 or later >&2; rm -f $tmpin; exit 1 ;; +-esac + + $M4 -I$AC_MACRODIR $use_localdir $r autoconf.m4$f $infile > $tmpout || + { rm -f $tmpin $tmpout; exit 2; } +-- +2.31.1 + diff --git a/0010-spidermonkey_checks_disable.patch b/0010-spidermonkey_checks_disable.patch new file mode 100644 index 0000000..451d3ee --- /dev/null +++ b/0010-spidermonkey_checks_disable.patch @@ -0,0 +1,22 @@ +From 6ebe8ce6a3267c96454de3cd453269b4c4053a3e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= +Date: Mon, 9 Aug 2021 14:41:14 +0200 +Subject: [PATCH] Don't die on SpiderMonkey checks + +--- + config/run_spidermonkey_checks.py | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/config/run_spidermonkey_checks.py b/config/run_spidermonkey_checks.py +index 0f842d9..b49db52 100644 +--- a/config/run_spidermonkey_checks.py ++++ b/config/run_spidermonkey_checks.py +@@ -11,5 +11,3 @@ import sys + def main(output, lib_file, *scripts): + for script in scripts: + retcode = subprocess.call([sys.executable, script], cwd=buildconfig.topsrcdir) +- if retcode != 0: +- raise Exception(script + " failed") +-- +2.31.1 + diff --git a/0011-Skip-failing-tests-on-aarch64.patch b/0011-Skip-failing-tests-on-aarch64.patch new file mode 100644 index 0000000..aab145f --- /dev/null +++ b/0011-Skip-failing-tests-on-aarch64.patch @@ -0,0 +1,26 @@ +From 147747d2fcfdcf27be8bf4dee89bca9e7cb47dd4 Mon Sep 17 00:00:00 2001 +From: yuanhui +Date: Fri, 17 Mar 2023 10:40:27 +0800 +Subject: [PATCH] Skip failing tests on aarch64 + +--- + js/src/tests/jstests.list | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/js/src/tests/jstests.list b/js/src/tests/jstests.list +index 2a2a3ef0e2..af976465ec 100644 +--- a/js/src/tests/jstests.list ++++ b/js/src/tests/jstests.list +@@ -53,6 +53,9 @@ skip-if(!this.hasOwnProperty("Intl")) include test262/intl402/jstests.list + skip-if(!this.hasOwnProperty("Atomics")) include test262/built-ins/Atomics/jstests.list + skip-if(!this.hasOwnProperty("SharedArrayBuffer")) include test262/built-ins/SharedArrayBuffer/jstests.list + ++# Crashes on aarch64 ++skip-if(xulRuntime.XPCOMABI.match(/aarch64/)) script test262/built-ins/Date/UTC/fp-evaluation-order.js ++ + ##################################### + # Test262 tests disabled on browser # + ##################################### +-- +2.31.1 + diff --git a/download b/download new file mode 100644 index 0000000..9e5c931 --- /dev/null +++ b/download @@ -0,0 +1 @@ +1ae083b6c2b5f265e9a882c5fa365304 firefox-102.9.0esr.source.tar.xz diff --git a/known_failures.txt b/known_failures.txt new file mode 100644 index 0000000..ec563a2 --- /dev/null +++ b/known_failures.txt @@ -0,0 +1,102 @@ +non262/Date/15.9.5.7.js +non262/Date/reset-time-zone-cache-same-offset.js +non262/Date/time-zone-path.js +non262/Date/time-zones-historic.js +non262/Date/time-zones-imported.js +non262/Date/toString-localized-posix.js +non262/Date/toString-localized.js +non262/Intl/Array/toLocaleString-date.js +non262/Intl/available-locales-resolved.js +non262/Intl/available-locales-supported.js +non262/Intl/Collator/collation.js +non262/Intl/Date/toLocaleString_timeZone.js +non262/Intl/Date/toLocaleTimeString_timeZone.js +non262/Intl/DateTimeFormat/day-period-hour-cycle.js +non262/Intl/DateTimeFormat/extended-time-zone-names.js +non262/Intl/DateTimeFormat/field-widths.js +non262/Intl/DateTimeFormat/format_timeZone.js +non262/Intl/DateTimeFormat/format.js +non262/Intl/DateTimeFormat/formatRange-hour-cycle.js +non262/Intl/DateTimeFormat/formatToParts.js +non262/Intl/DateTimeFormat/fractional-second-digits-append-item.js +non262/Intl/DateTimeFormat/hourCycle.js +non262/Intl/DateTimeFormat/implied-script-has-consistent-output.js +non262/Intl/DateTimeFormat/timeZone_backward_links.js +non262/Intl/DateTimeFormat/timeZone_version.js +non262/Intl/DateTimeFormat/tz-environment-variable.js +non262/Intl/DisplayNames/calendar.js +non262/Intl/DisplayNames/dateTimeField.js +non262/Intl/ListFormat/conjunction-type.js +non262/Intl/Locale/likely-subtags-generated.js +non262/Intl/NumberFormat/currency-narrow-symbol.js +non262/Intl/NumberFormat/format.js +non262/Intl/NumberFormat/notation-compact-long.js +non262/Intl/supportedValuesOf-timeZones-canonical.js +test262/built-ins/RegExp/property-escapes/generated/Alphabetic.js +test262/built-ins/RegExp/property-escapes/generated/Assigned.js +test262/built-ins/RegExp/property-escapes/generated/Case_Ignorable.js +test262/built-ins/RegExp/property-escapes/generated/Cased.js +test262/built-ins/RegExp/property-escapes/generated/Changes_When_NFKC_Casefolded.js +test262/built-ins/RegExp/property-escapes/generated/Diacritic.js +test262/built-ins/RegExp/property-escapes/generated/Emoji_Modifier_Base.js +test262/built-ins/RegExp/property-escapes/generated/Emoji_Presentation.js +test262/built-ins/RegExp/property-escapes/generated/Emoji.js +test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Cased_Letter.js +test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Decimal_Number.js +test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Format.js +test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Letter.js +test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Lowercase_Letter.js +test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Mark.js +test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Modifier_Letter.js +test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Nonspacing_Mark.js +test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Number.js +test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Other_Letter.js +test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Other_Number.js +test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Other_Punctuation.js +test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Other_Symbol.js +test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Other.js +test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Punctuation.js +test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Spacing_Mark.js +test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Symbol.js +test262/built-ins/RegExp/property-escapes/generated/General_Category_-_Unassigned.js +test262/built-ins/RegExp/property-escapes/generated/Grapheme_Base.js +test262/built-ins/RegExp/property-escapes/generated/Grapheme_Extend.js +test262/built-ins/RegExp/property-escapes/generated/ID_Continue.js +test262/built-ins/RegExp/property-escapes/generated/ID_Start.js +test262/built-ins/RegExp/property-escapes/generated/Ideographic.js +test262/built-ins/RegExp/property-escapes/generated/Lowercase.js +test262/built-ins/RegExp/property-escapes/generated/Script_-_Arabic.js +test262/built-ins/RegExp/property-escapes/generated/Script_-_Common.js +test262/built-ins/RegExp/property-escapes/generated/Script_-_Cyrillic.js +test262/built-ins/RegExp/property-escapes/generated/Script_-_Devanagari.js +test262/built-ins/RegExp/property-escapes/generated/Script_-_Egyptian_Hieroglyphs.js +test262/built-ins/RegExp/property-escapes/generated/Script_-_Han.js +test262/built-ins/RegExp/property-escapes/generated/Script_-_Hiragana.js +test262/built-ins/RegExp/property-escapes/generated/Script_-_Kannada.js +test262/built-ins/RegExp/property-escapes/generated/Script_-_Katakana.js +test262/built-ins/RegExp/property-escapes/generated/Script_-_Khojki.js +test262/built-ins/RegExp/property-escapes/generated/Script_-_Lao.js +test262/built-ins/RegExp/property-escapes/generated/Script_-_Latin.js +test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Arabic.js +test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Common.js +test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Cyrillic.js +test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Devanagari.js +test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Egyptian_Hieroglyphs.js +test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Han.js +test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Hiragana.js +test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Kannada.js +test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Katakana.js +test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Khojki.js +test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Lao.js +test262/built-ins/RegExp/property-escapes/generated/Script_Extensions_-_Latin.js +test262/built-ins/RegExp/property-escapes/generated/Sentence_Terminal.js +test262/built-ins/RegExp/property-escapes/generated/Soft_Dotted.js +test262/built-ins/RegExp/property-escapes/generated/Terminal_Punctuation.js +test262/built-ins/RegExp/property-escapes/generated/Unified_Ideograph.js +test262/built-ins/RegExp/property-escapes/generated/XID_Continue.js +test262/built-ins/RegExp/property-escapes/generated/XID_Start.js +test262/intl402/DateTimeFormat/prototype/format/timedatestyle-en.js +test262/intl402/DateTimeFormat/prototype/formatRange/en-US.js +test262/intl402/DateTimeFormat/prototype/formatRange/fractionalSecondDigits.js +test262/intl402/DateTimeFormat/prototype/formatRangeToParts/en-US.js +test262/intl402/DateTimeFormat/prototype/formatRangeToParts/fractionalSecondDigits.js diff --git a/mozjs102.spec b/mozjs102.spec new file mode 100644 index 0000000..b94f234 --- /dev/null +++ b/mozjs102.spec @@ -0,0 +1,235 @@ +%define anolis_release 1 + +%global major 102 + +# LTO - Enable in Release builds, but consider disabling for development as it increases compile time +%global build_with_lto 1 + +# Require tests to pass? +%global require_tests 1 + +%if 0%{?build_with_lto} +# LTO is the default +%else +%define _lto_cflags %{nil} +%endif + +# Clean pushed RUSTFLAGS to make it buildable +%if %defined build_rustflags +%global build_rustflags %{nil} +%endif + +Name: mozjs%{major} +Version: 102.9.0 +Release: %{anolis_release}%{dist} + +Summary: SpiderMonkey JavaScript library + +License: MPL-2.0 AND Apache-2.0 AND BSD-3-Clause AND BSD-2-Clause AND MIT AND GPL-3.0-or-later +URL: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey +Source0: https://ftp.mozilla.org/pub/firefox/releases/%{version}esr/source/firefox-%{version}esr.source.tar.xz + +# Known failures with system libicu +Source1: known_failures.txt + +# Patches from mozjs68, rebased for mozjs78: +Patch01: 0001-fix-soname.patch +Patch02: 0002-copy-headers.patch +Patch03: 0003-tests-increase-timeout.patch +Patch04: 0004-icu_sources_data.py-Decouple-from-Mozilla-build-system.patch +Patch05: 0005-icu_sources_data-Write-command-output-to-our-stderr.patch + +# Build fixes - https://hg.mozilla.org/mozilla-central/rev/ca36a6c4f8a4a0ddaa033fdbe20836d87bbfb873 +Patch06: 0006-emitter.patch +Patch07: 0007-tests-Use-native-TemporaryDirectory.patch + +# Build fixes +Patch08: 0008-init_patch.patch +Patch09: 0009-remove-sloppy-m4-detection-from-bundled-autoconf.patch + +# TODO: Check with mozilla for cause of these fails and re-enable spidermonkey compile time checks if needed +Patch10: 0010-spidermonkey_checks_disable.patch + +Patch11: 0011-Skip-failing-tests-on-aarch64.patch + +BuildRequires: cargo +BuildRequires: ccache +BuildRequires: clang-devel +BuildRequires: gcc +BuildRequires: gcc-c++ +BuildRequires: m4 +BuildRequires: make +BuildRequires: nasm +BuildRequires: libicu-devel +BuildRequires: llvm +BuildRequires: rust +BuildRequires: rustfmt +BuildRequires: perl-devel +BuildRequires: pkgconfig(libffi) +BuildRequires: pkgconfig(zlib) +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-six +BuildRequires: readline-devel +BuildRequires: wget +BuildRequires: zip + +%description +SpiderMonkey is the code-name for Mozilla Firefox's C++ implementation of +JavaScript. It is intended to be embedded in other applications +that provide host environments for JavaScript. ' + +%package devel +Summary: Development files for %{name} +Requires: %{name} = %{version}-%{release} + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + +%package doc +Summary: Documentation files for %{name} +Requires: %{name} = %{EVR} +BuildArch: noarch + +%description doc +The %{name}-doc package contains documentation files for %{name}. + +%prep +%autosetup -n firefox-%{version}/js/src -N + +pushd ../.. +%autopatch -p1 + +# Copy out the LICENSE file +cp LICENSE js/src/ + +# Copy out file containing known test failures with system libicu +cp %{SOURCE1} js/src/ + +# Remove zlib directory (to be sure using system version) +rm -rf modules/zlib + +# Remove unneeded bundled stuff +rm -rf js/src/devtools/automation/variants/ +rm -rf js/src/octane/ +rm -rf js/src/ctypes/libffi/ + +popd + +%build +%if 0%{?build_with_lto} +# https://github.com/ptomato/mozjs/commit/36bb7982b41e0ef9a65f7174252ab996cd6777bd +export CARGO_PROFILE_RELEASE_LTO=true +%endif + +# Use bundled autoconf +export M4=m4 +export AWK=awk +export AC_MACRODIR=/builddir/build/BUILD/firefox-%{version}/build/autoconf/ + +sh ../../build/autoconf/autoconf.sh --localdir=/builddir/build/BUILD/firefox-%{version}/js/src configure.in > configure +chmod +x configure + +%configure \ + --with-system-icu \ + --with-system-zlib \ + --disable-tests \ + --disable-strip \ + --with-intl-api \ + --enable-readline \ + --enable-shared-js \ + --enable-optimize \ + --disable-debug \ + --enable-pie \ + --disable-jemalloc + +%make_build + +%install +%make_install + +# Fix permissions +chmod -x %{buildroot}%{_libdir}/pkgconfig/*.pc + +# Avoid multilib conflicts +case `uname -i` in + x86_64 ) + wordsize="64" + ;; + *) + wordsize="" + ;; +esac + +if test -n "$wordsize" +then + mv %{buildroot}%{_includedir}/mozjs-%{major}/js-config.h \ + %{buildroot}%{_includedir}/mozjs-%{major}/js-config-$wordsize.h + + cat >%{buildroot}%{_includedir}/mozjs-%{major}/js-config.h < + +#if __WORDSIZE == 32 +# include "js-config-32.h" +#elif __WORDSIZE == 64 +# include "js-config-64.h" +#else +# error "unexpected value for __WORDSIZE macro" +#endif + +#endif +EOF + +fi + +# Remove unneeded files +rm %{buildroot}%{_bindir}/js%{major}-config +rm %{buildroot}%{_libdir}/libjs_static.ajs + +# Rename library and create symlinks, following fix-soname.patch +mv %{buildroot}%{_libdir}/libmozjs-%{major}.so \ + %{buildroot}%{_libdir}/libmozjs-%{major}.so.0.0.0 +ln -s libmozjs-%{major}.so.0.0.0 %{buildroot}%{_libdir}/libmozjs-%{major}.so.0 +ln -s libmozjs-%{major}.so.0 %{buildroot}%{_libdir}/libmozjs-%{major}.so + +%check +# Run SpiderMonkey tests +%if 0%{?require_tests} +%{python3} tests/jstests.py -d -s -t 2400 --exclude-file=known_failures.txt --no-progress --wpt=disabled ../../js/src/dist/bin/js%{major} +%else +%{python3} tests/jstests.py -d -s -t 2400 --exclude-file=known_failures.txt --no-progress --wpt=disabled ../../js/src/dist/bin/js%{major} || : +%endif + +# Run basic JIT tests +%if 0%{?require_tests} +%{python3} jit-test/jit_test.py -s -t 2400 --no-progress ../../js/src/dist/bin/js%{major} basic +%else +%{python3} jit-test/jit_test.py -s -t 2400 --no-progress ../../js/src/dist/bin/js%{major} basic || : +%endif + +%generate_compatibility_deps + +%files +%license LICENSE +%dir %{abidir} +%{_libdir}/libmozjs-%{major}.so.0* + + +%files devel +%{_bindir}/js%{major} +%{abidir}/js102-option.list +%{_libdir}/libmozjs-%{major}.so +%{_libdir}/pkgconfig/*.pc +%{_includedir}/mozjs-%{major}/ + + +%files doc +%doc README.html + +%changelog +* Fri Mar 17 2023 yuanhui - 102.9.0-1 +- Init package from upstream -- Gitee