This is an automated email from the ASF dual-hosted git repository. kocolosk pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/couchdb-pkg.git
commit 7c7eb6dc0f181f717872bbce9a8a7e2a00dccaa4 Author: mokou <[email protected]> AuthorDate: Wed Jan 12 11:59:55 2022 +0100 feat: initial js68 support --- .gitignore | 1 + Makefile | 5 + js68/SOURCES/Exclude-failing-tests-on-s390x.patch | 29 ++ ...e-unused-LLVM-and-Rust-build-dependencies.patch | 72 +++++ ...able_WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS.patch | 10 + js68/SOURCES/build-icu-big-endian.patch | 12 + js68/SOURCES/copy-headers.patch | 29 ++ js68/SOURCES/emitter.patch | 14 + js68/SOURCES/emitter_test.patch | 27 ++ js68/SOURCES/fix-soname.patch | 25 ++ ...s_data-Write-command-output-to-our-stderr.patch | 34 +++ ...ata.py-Decouple-from-Mozilla-build-system.patch | 26 ++ js68/SOURCES/init_patch.patch | 13 + js68/SOURCES/jstests_python-3.patch | 57 ++++ js68/SOURCES/sources | 1 + js68/SOURCES/spidermonkey_checks_disable.patch | 10 + .../spidermonkey_style_check_disable_s390x.patch | 11 + js68/SOURCES/tests-increase-timeout.patch | 22 ++ js68/SPECS/js68.spec | 336 +++++++++++++++++++++ 19 files changed, 734 insertions(+) diff --git a/.gitignore b/.gitignore index d630ae8..395f1d0 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ stage/ *.tar.gz *.bak *~ +.idea/ diff --git a/Makefile b/Makefile index 8366e15..77fdfa0 100644 --- a/Makefile +++ b/Makefile @@ -243,3 +243,8 @@ couch-js-rpms: couch-js-clean cp js/src/js185-1.0.0.tar.gz ../rpmbuild/SOURCES cd ../rpmbuild && rpmbuild --verbose -bb SPECS/js.spec +couch-js-68-rpms: couch-js-clean + mkdir -p ../rpmbuild + cp -R js68/* ../rpmbuild + cd ../rpmbuild/SOURCES && curl -O https://ftp.mozilla.org/pub/firefox/releases/68.12.0esr/source/firefox-68.12.0esr.source.tar.xz + cd ../rpmbuild && rpmbuild --verbose -bb SPECS/js68.spec diff --git a/js68/SOURCES/Exclude-failing-tests-on-s390x.patch b/js68/SOURCES/Exclude-failing-tests-on-s390x.patch new file mode 100644 index 0000000..064f868 --- /dev/null +++ b/js68/SOURCES/Exclude-failing-tests-on-s390x.patch @@ -0,0 +1,29 @@ +From b9e1976edca1af828a219d5ac35d07202170e5ba Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <[email protected]> +Date: Mon, 24 Aug 2020 15:45:36 +0200 +Subject: [PATCH] Exclude failing tests on s390x + +--- + js/src/tests/jstests.list | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/js/src/tests/jstests.list b/js/src/tests/jstests.list +index 8f5c0df..75f80f8 100644 +--- a/js/src/tests/jstests.list ++++ b/js/src/tests/jstests.list +@@ -493,6 +493,12 @@ skip script test262/language/expressions/class/elements/derived-cls-direct-eval- + skip script test262/language/statements/class/elements/derived-cls-direct-eval-err-contains-superproperty-1.js + skip script test262/language/statements/class/elements/derived-cls-direct-eval-err-contains-superproperty-2.js + ++# Crashes on s390x and ppc64, avoid it ++skip-if(xulRuntime.XPCOMABI.match(/s390x|ppc64-/)) script non262/extensions/clone-errors.js ++ ++# Crashes on s390x ++skip-if(xulRuntime.XPCOMABI.match(/s390x/)) script test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-other-type.js ++skip-if(xulRuntime.XPCOMABI.match(/s390x/)) script non262/Intl/DateTimeFormat/timeZone_backward_links.js + + ########################################################### + # Tests disabled due to issues in test262 importer script # +-- +2.26.2 + diff --git a/js68/SOURCES/Remove-unused-LLVM-and-Rust-build-dependencies.patch b/js68/SOURCES/Remove-unused-LLVM-and-Rust-build-dependencies.patch new file mode 100644 index 0000000..d98b577 --- /dev/null +++ b/js68/SOURCES/Remove-unused-LLVM-and-Rust-build-dependencies.patch @@ -0,0 +1,72 @@ +Description: Remove unused LLVM and Rust build dependencies + Since the Javascript engine is normally part of Firefox, its build + system has dependencies on the LLVM and Rust toolchains. This limits + the number of architectures which mozjs68 can be built on. + . + It turns out, however, that neither LLVM nor Rust are used when mozjs68 + is being built and these build dependencies are therefore not necessary. + . + This patch removes them and allows mozjs68 to be built on any architecture. + . +Author: John Paul Adrian Glaubitz <[email protected]> +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=959144 +Forwarded: no +Last-Update: 2020-04-30 + +Index: mozjs68-68.6.0/js/moz.configure +=================================================================== +--- mozjs68-68.6.0.orig/js/moz.configure ++++ mozjs68-68.6.0/js/moz.configure +@@ -18,11 +18,6 @@ def building_js(build_project): + option(env='JS_STANDALONE', default=building_js, + help='Reserved for internal use') + +-include('../build/moz.configure/rust.configure', +- when='--enable-compile-environment') +-include('../build/moz.configure/bindgen.configure', +- when='--enable-compile-environment') +- + @depends('JS_STANDALONE') + def js_standalone(value): + if value: +Index: mozjs68-68.6.0/moz.configure +=================================================================== +--- mozjs68-68.6.0.orig/moz.configure ++++ mozjs68-68.6.0/moz.configure +@@ -598,36 +598,6 @@ set_config('MAKENSISU_FLAGS', nsis_flags + + check_prog('7Z', ('7z', '7za'), allow_missing=True, when=target_is_windows) + +- +-@depends(host_c_compiler, c_compiler, bindgen_config_paths) +-def llvm_objdump(host_c_compiler, c_compiler, bindgen_config_paths): +- clang = None +- for compiler in (host_c_compiler, c_compiler): +- if compiler and compiler.type == 'clang': +- clang = compiler.compiler +- break +- elif compiler and compiler.type == 'clang-cl': +- clang = os.path.join(os.path.dirname(compiler.compiler), 'clang') +- break +- +- if not clang and bindgen_config_paths: +- clang = bindgen_config_paths.clang_path +- llvm_objdump = 'llvm-objdump' +- if clang: +- out = check_cmd_output(clang, '--print-prog-name=llvm-objdump', +- onerror=lambda: None) +- if out: +- llvm_objdump = out.rstrip() +- return (llvm_objdump,) +- +- +-llvm_objdump = check_prog('LLVM_OBJDUMP', llvm_objdump, what='llvm-objdump', +- when='--enable-compile-environment', +- paths=toolchain_search_path) +- +-add_old_configure_assignment('LLVM_OBJDUMP', llvm_objdump) +- +- + # Please do not add configure checks from here on. + + # Fallthrough to autoconf-based configure diff --git a/js68/SOURCES/armv7_disable_WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS.patch b/js68/SOURCES/armv7_disable_WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS.patch new file mode 100644 index 0000000..0cb26ac --- /dev/null +++ b/js68/SOURCES/armv7_disable_WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS.patch @@ -0,0 +1,10 @@ +--- firefox-68.0/js/src/wasm/WasmSignalHandlers.cpp ++++ firefox-68.0/js/src/wasm/WasmSignalHandlers.cpp +@@ -243,7 +243,7 @@ + // If you run into compile problems on a tier-3 platform, you can disable the + // emulation here. + +-#if defined(__linux__) && defined(__arm__) ++#if 0 && defined(__linux__) && defined(__arm__) + # define WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS + #endif diff --git a/js68/SOURCES/build-icu-big-endian.patch b/js68/SOURCES/build-icu-big-endian.patch new file mode 100644 index 0000000..70a5481 --- /dev/null +++ b/js68/SOURCES/build-icu-big-endian.patch @@ -0,0 +1,12 @@ +diff -up firefox-68.0/build/autoconf/icu.m4.icu firefox-68.0/build/autoconf/icu.m4 +--- firefox-68.0/build/autoconf/icu.m4.icu 2018-04-24 13:13:03.938961958 +0200 ++++ firefox-68.0/build/autoconf/icu.m4 2018-04-24 13:14:44.472714375 +0200 +@@ -78,7 +78,7 @@ + # TODO: the l is actually endian-dependent + # We could make this set as 'l' or 'b' for little or big, respectively, + # but we'd need to check in a big-endian version of the file. +- ICU_DATA_FILE="icudt${version}l.dat" ++ ICU_DATA_FILE="icudt${version}b.dat" + fi + + AC_SUBST(MOZ_ICU_VERSION) diff --git a/js68/SOURCES/copy-headers.patch b/js68/SOURCES/copy-headers.patch new file mode 100644 index 0000000..aec3b10 --- /dev/null +++ b/js68/SOURCES/copy-headers.patch @@ -0,0 +1,29 @@ +From: Rico Tzschichholz <[email protected]> +Date: Wed, 5 Jul 2017 22:45:59 -0700 +Subject: build: Copy headers on install instead of symlinking + +Patch ported forward to mozjs52 by Philip Chimento +<[email protected]>. +--- + 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 dd9020d..6918ef8 100644 +--- a/python/mozbuild/mozbuild/backend/recursivemake.py ++++ b/python/mozbuild/mozbuild/backend/recursivemake.py +@@ -1427,11 +1427,11 @@ class RecursiveMakeBackend(CommonBackend): + raise Exception("Wildcards are only supported in the filename part of " + "srcdir-relative or absolute paths.") + +- install_manifest.add_pattern_link(basepath, wild, path) ++ install_manifest.add_pattern_copy(basepath, wild, path) + else: +- install_manifest.add_pattern_link(f.srcdir, f, path) ++ install_manifest.add_pattern_copy(f.srcdir, f, path) + else: +- install_manifest.add_link(f.full_path, dest) ++ install_manifest.add_copy(f.full_path, dest) + else: + install_manifest.add_optional_exists(dest) + backend_file.write('%s_FILES += %s\n' % ( diff --git a/js68/SOURCES/emitter.patch b/js68/SOURCES/emitter.patch new file mode 100644 index 0000000..4254553 --- /dev/null +++ b/js68/SOURCES/emitter.patch @@ -0,0 +1,14 @@ +--- a/python/mozbuild/mozbuild/frontend/emitter.py ++++ b/python/mozbuild/mozbuild/frontend/emitter.py +@@ -1195,11 +1195,6 @@ + raise SandboxValidationError('Path specified in LOCAL_INCLUDES ' + 'is a filename, but a directory is required: %s ' + '(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/js68/SOURCES/emitter_test.patch b/js68/SOURCES/emitter_test.patch new file mode 100644 index 0000000..59366d3 --- /dev/null +++ b/js68/SOURCES/emitter_test.patch @@ -0,0 +1,27 @@ +--- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py ++++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py +@@ -1051,24 +1051,6 @@ + + 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 self.assertRaisesRegexp( +- SandboxValidationError, +- 'Path specified in LOCAL_INCLUDES.*resolves to the ' +- 'topsrcdir or topobjdir'): +- objs = self.read_topsrcdir(reader) +- +- reader = self.reader('local_includes-invalid/objdir') +- +- with self.assertRaisesRegexp( +- SandboxValidationError, +- 'Path specified in LOCAL_INCLUDES.*resolves to the ' +- 'topsrcdir or topobjdir'): +- objs = 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') diff --git a/js68/SOURCES/fix-soname.patch b/js68/SOURCES/fix-soname.patch new file mode 100644 index 0000000..fc8052a --- /dev/null +++ b/js68/SOURCES/fix-soname.patch @@ -0,0 +1,25 @@ +From: "Laszlo Boszormenyi (GCS)" <[email protected]> +Date: Fri, 2 May 2014 22:20:45 +0200 +Subject: fix soname + +Add soname switch to linker, regardless of Operating System + +Bug-Debian: http://bugs.debian.org/746705 +--- + config/rules.mk | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/config/rules.mk b/config/rules.mk +index eb86b0c..1bb3988 100644 +--- a/config/rules.mk ++++ b/config/rules.mk +@@ -359,6 +359,9 @@ endif + endif + EXTRA_DEPS += $(SYMBOLS_FILE) + endif ++ ++EXTRA_DSO_LDOPTS += -Wl,-soname,lib$(JS_LIBRARY_NAME).so.0 ++ + # + # GNU doesn't have path length limitation + # diff --git a/js68/SOURCES/icu_sources_data-Write-command-output-to-our-stderr.patch b/js68/SOURCES/icu_sources_data-Write-command-output-to-our-stderr.patch new file mode 100644 index 0000000..e2ed484 --- /dev/null +++ b/js68/SOURCES/icu_sources_data-Write-command-output-to-our-stderr.patch @@ -0,0 +1,34 @@ +From: Simon McVittie <[email protected]> +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 | 7 ++----- + 1 file changed, 2 insertions(+), 5 deletions(-) + +diff --git a/intl/icu_sources_data.py b/intl/icu_sources_data.py +index 8cf9290..7d2d983 100644 +--- a/intl/icu_sources_data.py ++++ b/intl/icu_sources_data.py +@@ -187,16 +187,13 @@ + + 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) ++ subprocess.check_call(command, cwd=cwd, stdout=sys.stderr, ++ stderr=subprocess.STDOUT, **kwargs) + except subprocess.CalledProcessError: +- print('''Error running "{}" in directory {} +- See output in {}'''.format(' '.join(command), cwd, f.name), +- file=sys.stderr) ++ print('''Error running "{}" in directory {}'''.format(' '.join(command), cwd), ++ file=sys.stderr) + return False + else: +- os.unlink(f.name) + return True diff --git a/js68/SOURCES/icu_sources_data.py-Decouple-from-Mozilla-build-system.patch b/js68/SOURCES/icu_sources_data.py-Decouple-from-Mozilla-build-system.patch new file mode 100644 index 0000000..a853a16 --- /dev/null +++ b/js68/SOURCES/icu_sources_data.py-Decouple-from-Mozilla-build-system.patch @@ -0,0 +1,26 @@ +From: Simon McVittie <[email protected]> +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 98c0ccb..8cf9290 100644 +--- a/intl/icu_sources_data.py ++++ b/intl/icu_sources_data.py +@@ -21,7 +21,9 @@ + 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 diff --git a/js68/SOURCES/init_patch.patch b/js68/SOURCES/init_patch.patch new file mode 100644 index 0000000..fd09eb7 --- /dev/null +++ b/js68/SOURCES/init_patch.patch @@ -0,0 +1,13 @@ +--- a/python/mozbuild/mozbuild/configure/__init__.py ++++ b/python/mozbuild/mozbuild/configure/__init__.py +@@ -473,8 +473,8 @@ + msg = 'Unknown option: %s' % without_value + if self._help: + self._logger.warning(msg) +- else: +- raise InvalidOptionError(msg) ++ #else: ++ # raise InvalidOptionError(msg) + + # Run the execution queue + for func, args in self._execution_queue: diff --git a/js68/SOURCES/jstests_python-3.patch b/js68/SOURCES/jstests_python-3.patch new file mode 100644 index 0000000..484a02c --- /dev/null +++ b/js68/SOURCES/jstests_python-3.patch @@ -0,0 +1,57 @@ +From e75a1c531767f3efd158fd8309084cf5157307be Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <[email protected]> +Date: Tue, 5 Nov 2019 19:14:38 +0100 +Subject: [PATCH] Python 3 + +--- + js/src/jit-test/jit_test.py | 2 +- + js/src/tests/lib/manifest.py | 5 ++++- + js/src/tests/lib/tasks_unix.py | 3 +++ + 3 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/js/src/jit-test/jit_test.py b/js/src/jit-test/jit_test.py +index 8fcd0c5..f51c544 100755 +--- a/js/src/jit-test/jit_test.py ++++ b/js/src/jit-test/jit_test.py +@@ -138,7 +138,7 @@ def main(argv): + help='With --write-failures=FILE, additionally write the' + ' output of failed tests to [FILE]') + op.add_option('--jitflags', dest='jitflags', default='none', +- choices=valid_jitflags(), ++ choices=list(valid_jitflags()), + help='IonMonkey option combinations. One of %s.' % ', '.join(valid_jitflags())) + op.add_option('--ion', dest='jitflags', action='store_const', const='ion', + help='Run tests once with --ion-eager and once with' +diff --git a/js/src/tests/lib/manifest.py b/js/src/tests/lib/manifest.py +index 617f0f1..f54cc1e 100644 +--- a/js/src/tests/lib/manifest.py ++++ b/js/src/tests/lib/manifest.py +@@ -105,7 +105,10 @@ class XULInfoTester: + '-e', self.js_prologue, + '-e', 'print(!!({}))'.format(cond) + ] +- p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE) ++ try: ++ p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE, encoding="utf-8") ++ except TypeError: ++ p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE) + out, err = p.communicate() + if out in ('true\n', 'true\r\n'): + ans = True +diff --git a/js/src/tests/lib/tasks_unix.py b/js/src/tests/lib/tasks_unix.py +index 40528b8..5edfe92 100644 +--- a/js/src/tests/lib/tasks_unix.py ++++ b/js/src/tests/lib/tasks_unix.py +@@ -182,6 +182,9 @@ def reap_zombies(tasks, timeout): + if os.WIFSIGNALED(status): + returncode = -os.WTERMSIG(status) + ++ ended.out=[x.decode('utf-8') for x in ended.out] ++ ended.err=[x.decode('utf-8') for x in ended.err] ++ + finished.append( + TestOutput( + ended.test, +-- +2.23.0 + diff --git a/js68/SOURCES/sources b/js68/SOURCES/sources new file mode 100644 index 0000000..ca61a0b --- /dev/null +++ b/js68/SOURCES/sources @@ -0,0 +1 @@ +SHA512 (firefox-68.12.0esr.source.tar.xz) = 839b02422e4c87bdb12e0995cd35ca8c1996f3fba00bbb46b419e46b67df5ec48a264cb14632db777ce29166ee4fdcb06e2ee3ce847e64328c58c9a2f9129f4c diff --git a/js68/SOURCES/spidermonkey_checks_disable.patch b/js68/SOURCES/spidermonkey_checks_disable.patch new file mode 100644 index 0000000..14ba0ad --- /dev/null +++ b/js68/SOURCES/spidermonkey_checks_disable.patch @@ -0,0 +1,10 @@ +--- a/config/run_spidermonkey_checks.py ++++ b/config/run_spidermonkey_checks.py +@@ -11,5 +11,5 @@ + for script in scripts: + retcode = subprocess.call( + [sys.executable, script], cwd=buildconfig.topsrcdir) +- if retcode != 0: +- raise Exception(script + " failed") ++ #if retcode != 0: ++ # raise Exception(script + " failed") diff --git a/js68/SOURCES/spidermonkey_style_check_disable_s390x.patch b/js68/SOURCES/spidermonkey_style_check_disable_s390x.patch new file mode 100644 index 0000000..690c1c5 --- /dev/null +++ b/js68/SOURCES/spidermonkey_style_check_disable_s390x.patch @@ -0,0 +1,11 @@ +--- a/config/check_spidermonkey_style.py ++++ b/config/check_spidermonkey_style.py + +@@ -766,6 +766,7 @@ + + + def main(): ++ sys.exit(0) + if sys.argv[1:] == ["--fixup"]: + # Sort #include directives in-place. Fixup mode doesn't solve + # all possible silliness that the script checks for; it's just a diff --git a/js68/SOURCES/tests-increase-timeout.patch b/js68/SOURCES/tests-increase-timeout.patch new file mode 100644 index 0000000..91f5fa7 --- /dev/null +++ b/js68/SOURCES/tests-increase-timeout.patch @@ -0,0 +1,22 @@ +From: Adrian Bunk <[email protected]> +Date: Tue, 3 Jul 2018 10:03:37 +0100 +Subject: Increase the test timeout for slower buildds + +Bug-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 4ac9f48..6ab5582 100644 +--- a/js/src/Makefile.in ++++ b/js/src/Makefile.in +@@ -72,7 +72,7 @@ check:: check-style check-masm check-js-msg check-opcode + + check-jstests: + $(wildcard $(RUN_TEST_PROGRAM)) $(PYTHON) -u $(srcdir)/tests/jstests.py \ +- --no-progress --format=automation --timeout 300 \ ++ --no-progress --format=automation --timeout 600 \ + $(JSTESTS_EXTRA_ARGS) \ + $(DIST)/bin/$(JS_SHELL_NAME)$(BIN_SUFFIX) + diff --git a/js68/SPECS/js68.spec b/js68/SPECS/js68.spec new file mode 100644 index 0000000..bd72b24 --- /dev/null +++ b/js68/SPECS/js68.spec @@ -0,0 +1,336 @@ +%global major 68 + +# 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} +%global optflags %{optflags} -flto +%global build_ldflags %{build_ldflags} -flto +%endif + +# Require libatomic for ppc +%ifarch ppc +%global system_libatomic 1 +%endif + +# Big endian platforms +%ifarch ppc ppc64 s390 s390x +%global big_endian 1 +%endif + +Name: couch-js-68 +Version: 68.12.0 +Release: 4%{?dist} +Summary: SpiderMonkey JavaScript library + +License: MPLv2.0 and MPLv1.1 and BSD and GPLv2+ and GPLv3+ and LGPLv2+ and AFL and ASL 2.0 +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 + +# Patches from Debian mozjs60, rebased for mozjs68: +Patch01: fix-soname.patch +Patch02: copy-headers.patch +Patch03: tests-increase-timeout.patch +Patch09: icu_sources_data.py-Decouple-from-Mozilla-build-system.patch +Patch10: icu_sources_data-Write-command-output-to-our-stderr.patch + +# Build fixes - https://hg.mozilla.org/mozilla-central/rev/ca36a6c4f8a4a0ddaa033fdbe20836d87bbfb873 +Patch12: emitter.patch +Patch13: emitter_test.patch + +# Build fixes +Patch14: init_patch.patch +# TODO: Check with mozilla for cause of these fails and re-enable spidermonkey compile time checks if needed +Patch15: spidermonkey_checks_disable.patch +Patch16: Remove-unused-LLVM-and-Rust-build-dependencies.patch + +# armv7 fixes +Patch17: armv7_disable_WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS.patch + +# s390x fixes, TODO: file bug report upstream? +Patch18: spidermonkey_style_check_disable_s390x.patch +Patch19: Exclude-failing-tests-on-s390x.patch + +# Patches from Fedora firefox package: +Patch26: build-icu-big-endian.patch + +# Support Python 3 in js tests +Patch30: jstests_python-3.patch + +BuildRequires: make +BuildRequires: autoconf213 +BuildRequires: cargo +BuildRequires: clang-devel +BuildRequires: gcc +BuildRequires: gcc-c++ +BuildRequires: perl-devel +BuildRequires: pkgconfig(libffi) +BuildRequires: pkgconfig(zlib) +# Build requires Python 2, tests are patched to run with Python 3 +BuildRequires: python2-devel +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-six +BuildRequires: readline-devel +BuildRequires: zip +%if 0%{?system_libatomic} +BuildRequires: libatomic +%endif + +%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}%{?_isa} = %{version}-%{release} + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + +%prep +%setup -q -n firefox-%{version}/js/src + +pushd ../.. +%patch01 -p1 +%patch02 -p1 +%patch03 -p1 +%patch09 -p1 +%patch10 -p1 + +%patch12 -p1 +%patch13 -p1 +%patch14 -p1 +%patch15 -p1 +%patch16 -p1 + +%ifarch armv7hl +# Disable WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS as it causes the compilation to fail +# https://bugzilla.mozilla.org/show_bug.cgi?id=1526653 +%patch17 -p1 +%endif + +%ifarch s390x +%patch18 -p1 +%patch19 -p1 +%endif + +# Patch for big endian platforms only +%if 0%{?big_endian} +%patch26 -p1 -b .icu +%endif + +# Execute tests with Python 3 +%patch30 -p1 + +# make sure we don't ever accidentally link against bundled security libs +rm -rf security/ +popd + +# Remove zlib directory (to be sure using system version) +rm -rf ../../modules/zlib + +%build +# Prefer GCC, because clang doesn't support -fstack-clash-protection yet +export CC=gcc +export CXX=g++ + +%if 0%{?build_with_lto} && 0%{?fedora} < 33 +export AR=%{_bindir}/gcc-ar +export RANLIB=%{_bindir}/gcc-ranlib +export NM=%{_bindir}/gcc-nm +%endif + +export CFLAGS="%{optflags}" +export CXXFLAGS="$CFLAGS" +export LINKFLAGS="%{?__global_ldflags}" +export PYTHON="%{__python2}" + +autoconf-2.13 +%configure \ + --without-system-icu \ + --enable-posix-nspr-emulation \ + --with-system-zlib \ + --disable-tests \ + --disable-strip \ + --with-intl-api \ + --enable-readline \ + --enable-shared-js \ + --disable-optimize \ + --enable-pie \ + --disable-jemalloc \ + --enable-unaligned-private-values + +%if 0%{?big_endian} +echo "Generate big endian version of config/external/icu/data/icud58l.dat" +pushd ../.. + ./mach python intl/icu_sources_data.py . + ls -l config/external/icu/data + rm -f config/external/icu/data/icudt*l.dat +popd +%endif + +%make_build + +%install +%make_install + +# Fix permissions +chmod -x %{buildroot}%{_libdir}/pkgconfig/*.pc + +# Avoid multilib conflicts +case `uname -i` in + i386 | ppc | s390 | sparc ) + wordsize="32" + ;; + x86_64 | ppc64 | s390x | sparc64 ) + 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 <<EOF +#ifndef JS_CONFIG_H_MULTILIB +#define JS_CONFIG_H_MULTILIB + +#include <bits/wordsize.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} +PYTHONPATH=tests/lib %{__python3} tests/jstests.py -d -s -t 1800 --no-progress --wpt=disabled ../../js/src/dist/bin/js%{major} +%else +PYTHONPATH=tests/lib %{__python3} tests/jstests.py -d -s -t 1800 --no-progress --wpt=disabled ../../js/src/dist/bin/js%{major} || : +%endif + +# Run basic JIT tests +%if 0%{?require_tests} +PYTHONPATH=tests/lib %{__python3} jit-test/jit_test.py -s -t 1800 --no-progress ../../js/src/dist/bin/js%{major} basic +%else +PYTHONPATH=tests/lib %{__python3} jit-test/jit_test.py -s -t 1800 --no-progress ../../js/src/dist/bin/js%{major} basic || : +%endif + +%ldconfig_scriptlets + +%files +%doc README.html +%{_libdir}/libmozjs-%{major}.so.0* + +%files devel +%{_bindir}/js%{major} +%{_libdir}/libmozjs-%{major}.so +%{_libdir}/pkgconfig/*.pc +%{_includedir}/mozjs-%{major}/ + +%changelog +* Wed Jan 22 2022 Olivia Hugger <[email protected]> - 88.12.0-4 +- Port to CouchDB's internal packaging infrastucture + +* Thu Jul 22 2021 Fedora Release Engineering <[email protected]> - 68.12.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Tue Jan 26 2021 Fedora Release Engineering <[email protected]> - 68.12.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Mon Aug 24 2020 Frantisek Zatloukal <[email protected]> - 68.12.0-1 +- Update to 68.12.0 +- Force tests to pass even on s390x, disable the failing ones + +* Fri Jul 31 2020 Frantisek Zatloukal <[email protected]> - 68.11.0-1 +- Update to 68.11.0 + +* Thu Jul 30 2020 Tom Stellard <[email protected]> - 68.10.0-3 +- Stop using gcc specific binutils + +* Tue Jul 28 2020 Fedora Release Engineering <[email protected]> - 68.10.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue Jun 30 2020 Frantisek Zatloukal <[email protected]> - 68.10.0-1 +- Update to 68.10.0 + +* Tue Jun 02 2020 Frantisek Zatloukal <[email protected]> - 68.9.0-1 +- Update to 68.9.0 +- Drop llvm and rust deps + +* Wed May 06 2020 Frantisek Zatloukal <[email protected]> - 68.8.0-1 +- Update to 68.8.0 + +* Tue Apr 07 2020 Frantisek Zatloukal <[email protected]> - 68.7.0-1 +- Update to 68.7.0 + +* Tue Mar 17 2020 Frantisek Zatloukal <[email protected]> - 68.6.0-2 +- Rebuild with GCC 10 +- Nuke check_spidermonkey_style.py on s390x + +* Wed Mar 11 2020 Kalev Lember <[email protected]> - 68.6.0-1 +- Update to 68.6.0 + +* Mon Feb 10 2020 Frantisek Zatloukal <[email protected]> - 68.5.0-1 +- Update to 68.5.0 + +* Mon Feb 03 2020 Kalev Lember <[email protected]> - 68.4.2-3 +- Build with --enable-unaligned-private-values + +* Wed Jan 29 2020 Fedora Release Engineering <[email protected]> - 68.4.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Wed Jan 22 2020 Frantisek Zatloukal <[email protected]> - 68.4.2-1 +- Update to 68.4.2 + +* Tue Jan 07 2020 Frantisek Zatloukal <[email protected]> - 68.4.0-1 +- Update to 68.4.0 + +* Sat Dec 07 2019 Frantisek Zatloukal <[email protected]> - 68.3.0-1 +- Update to 68.3.0 + +* Wed Nov 20 2019 Frantisek Zatloukal <[email protected]> - 68.2.0-5 +- Don't enforce tests to pass on s390 and s390x again + +* Tue Nov 19 2019 Frantisek Zatloukal <[email protected]> - 68.2.0-4 +- Enable LTO +- Enforce SpiderMonkey tests in check section on all architectures + +* Sun Nov 17 2019 Frantisek Zatloukal <[email protected]> - 68.2.0-3 +- Fix armv7 build + +* Thu Nov 14 2019 Frantisek Zatloukal <[email protected]> - 68.2.0-2 +- Fix s390x build +- Exclude armv7 for now, see comment up in the spec + +* Mon Nov 04 2019 Frantisek Zatloukal <[email protected]> - 68.2.0-1 +- Initial mozjs68 package based on mozjs60
