From f10e5b83c926a44cd3de3ce846483e61e2eb1993 Mon Sep 17 00:00:00 2001 From: Lorem Date: Thu, 7 May 2020 14:02:39 +0530 Subject: [PATCH] New package: mozjs68-68.8.0 Closes: #21716 --- common/shlibs | 1 + srcpkgs/mozjs68-devel | 1 + .../001-silence-sandbox-violations.patch | 27 +++++++ srcpkgs/mozjs68/patches/002-fix-soname.patch | 22 ++++++ .../mozjs68/patches/003-fix-wasm-arm.patch | 16 ++++ .../mozjs68/patches/004-fix-musl-build.patch | 17 +++++ .../005-spidermonkey-checks-disable.patch | 12 +++ .../006-mozjs68.pc-honor-sysroot.patch | 10 +++ ...sed-LLVM-and-Rust-build-dependencies.patch | 74 +++++++++++++++++++ srcpkgs/mozjs68/template | 71 ++++++++++++++++++ srcpkgs/mozjs68/update | 1 + 11 files changed, 252 insertions(+) create mode 120000 srcpkgs/mozjs68-devel create mode 100644 srcpkgs/mozjs68/patches/001-silence-sandbox-violations.patch create mode 100644 srcpkgs/mozjs68/patches/002-fix-soname.patch create mode 100644 srcpkgs/mozjs68/patches/003-fix-wasm-arm.patch create mode 100644 srcpkgs/mozjs68/patches/004-fix-musl-build.patch create mode 100644 srcpkgs/mozjs68/patches/005-spidermonkey-checks-disable.patch create mode 100644 srcpkgs/mozjs68/patches/006-mozjs68.pc-honor-sysroot.patch create mode 100644 srcpkgs/mozjs68/patches/007-Remove-unused-LLVM-and-Rust-build-dependencies.patch create mode 100644 srcpkgs/mozjs68/template create mode 100644 srcpkgs/mozjs68/update diff --git a/common/shlibs b/common/shlibs index df2ecdd45a9..4fccee620f7 100644 --- a/common/shlibs +++ b/common/shlibs @@ -3456,6 +3456,7 @@ libmysqlpp.so.3 mysql++-3.2.5_1 libKF5Syndication.so.5 syndication-5.50.0_1 liblqr-1.so.0 liblqr-0.4.2_1 libmozjs-60.so.0 mozjs60-60.0.2_1 +libmozjs-68.so.0 mozjs68-68.8.0_1 libebur128.so.1 libebur128-1.2.4_1 libgtksourceview-4.so.0 gtksourceview4-4.0.2_1 libwx_gtk3u_propgrid-3.0.so.0 wxWidgets-gtk3-3.0.4_1 diff --git a/srcpkgs/mozjs68-devel b/srcpkgs/mozjs68-devel new file mode 120000 index 00000000000..0843c595e78 --- /dev/null +++ b/srcpkgs/mozjs68-devel @@ -0,0 +1 @@ +mozjs68 \ No newline at end of file diff --git a/srcpkgs/mozjs68/patches/001-silence-sandbox-violations.patch b/srcpkgs/mozjs68/patches/001-silence-sandbox-violations.patch new file mode 100644 index 00000000000..51208e9438b --- /dev/null +++ b/srcpkgs/mozjs68/patches/001-silence-sandbox-violations.patch @@ -0,0 +1,27 @@ +"Carried over from mozjs60" +Upstream: no +From 9ad10569e11a2fb96377188f895bc66abcc9511d Mon Sep 17 00:00:00 2001 +From: Marc-Antoine Perennou +Date: Wed, 5 Sep 2018 15:05:24 +0200 +Subject: [PATCH] silence sandbox violations + +Signed-off-by: Marc-Antoine Perennou +--- + python/mozbuild/mozbuild/frontend/emitter.py | 5 ----- + 1 file changed, 5 deletions(-) + +--- 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/srcpkgs/mozjs68/patches/002-fix-soname.patch b/srcpkgs/mozjs68/patches/002-fix-soname.patch new file mode 100644 index 00000000000..26cd1847929 --- /dev/null +++ b/srcpkgs/mozjs68/patches/002-fix-soname.patch @@ -0,0 +1,22 @@ +"Carried over from mozjs60" +--- a/js/src/build/Makefile.in ++++ b/js/src/build/Makefile.in +@@ -78,6 +78,8 @@ + endif + ifneq (,$(SHARED_LIBRARY)) + $(SYSINSTALL) $(SHARED_LIBRARY) $(DESTDIR)$(libdir) ++ mv -f $(DESTDIR)$(libdir)/$(SHARED_LIBRARY) $(DESTDIR)$(libdir)/$(SHARED_LIBRARY).0 ++ ln -s $(SHARED_LIBRARY).0 $(DESTDIR)$(libdir)/$(SHARED_LIBRARY) + ifeq ($(OS_ARCH),Darwin) + install_name_tool -id $(abspath $(libdir)/$(SHARED_LIBRARY)) $(DESTDIR)$(libdir)/$(SHARED_LIBRARY) + endif +--- a/js/src/build/moz.build ++++ b/js/src/build/moz.build +@@ -25,6 +25,7 @@ + if CONFIG['JS_SHARED_LIBRARY']: + GeckoSharedLibrary('js', linkage=None) + SHARED_LIBRARY_NAME = CONFIG['JS_LIBRARY_NAME'] ++ LDFLAGS += ['-Wl,-soname,lib{}.so.0'.format(SHARED_LIBRARY_NAME)] + + # Ensure symbol versions of shared library on Linux do not conflict + # with those in libxul. diff --git a/srcpkgs/mozjs68/patches/003-fix-wasm-arm.patch b/srcpkgs/mozjs68/patches/003-fix-wasm-arm.patch new file mode 100644 index 00000000000..891a7652056 --- /dev/null +++ b/srcpkgs/mozjs68/patches/003-fix-wasm-arm.patch @@ -0,0 +1,16 @@ +"Taken from firefox-esr" +--- a/js/src/wasm/WasmSignalHandlers.cpp ++++ b/js/src/wasm/WasmSignalHandlers.cpp +@@ -243,9 +243,9 @@ + // If you run into compile problems on a tier-3 platform, you can disable the + // emulation here. + +-#if defined(__linux__) && defined(__arm__) +-# define WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS +-#endif ++// #if defined(__linux__) && defined(__arm__) ++// # define WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS ++// #endif + + #ifdef WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS + # include diff --git a/srcpkgs/mozjs68/patches/004-fix-musl-build.patch b/srcpkgs/mozjs68/patches/004-fix-musl-build.patch new file mode 100644 index 00000000000..f629fa2ac35 --- /dev/null +++ b/srcpkgs/mozjs68/patches/004-fix-musl-build.patch @@ -0,0 +1,17 @@ +"Carried over from mozjs60" +Upstream: No +Reason: mozjs68 miscompiles on musl if built with HAVE_THREAD_TLS_KEYWORD: +https://github.com/void-linux/void-packages/issues/2598 +diff --git a/js/src/old-configure.in b/js/src/old-configure.in +--- a/js/src/old-configure.in ++++ b/js/src/old-configure.in +@@ -1272,6 +1272,9 @@ + *-android*|*-linuxandroid*) + : + ;; ++ *-musl*) ++ : ++ ;; + *) + AC_DEFINE(HAVE_THREAD_TLS_KEYWORD) + ;; diff --git a/srcpkgs/mozjs68/patches/005-spidermonkey-checks-disable.patch b/srcpkgs/mozjs68/patches/005-spidermonkey-checks-disable.patch new file mode 100644 index 00000000000..f6eababd1f2 --- /dev/null +++ b/srcpkgs/mozjs68/patches/005-spidermonkey-checks-disable.patch @@ -0,0 +1,12 @@ +Source:Fedora +Reason: Checks failed(Todo: Figure out why) ++++ 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/srcpkgs/mozjs68/patches/006-mozjs68.pc-honor-sysroot.patch b/srcpkgs/mozjs68/patches/006-mozjs68.pc-honor-sysroot.patch new file mode 100644 index 00000000000..71214b8eccf --- /dev/null +++ b/srcpkgs/mozjs68/patches/006-mozjs68.pc-honor-sysroot.patch @@ -0,0 +1,10 @@ +"Carried over from mozjs60" +Reason: Fix the '-include' directive, otherwise it tries to use the host's header +--- a/js/src/build/js.pc.in ++++ b/js/src/build/js.pc.in +@@ -11,4 +11,4 @@ + # Use -isystem for includes rather than -I, to mark them as "system headers" + # that don't generate warning diagnostics. For justification, see + # https://bugzilla.mozilla.org/show_bug.cgi?id=1539036 +-Cflags: -include ${includedir}/@JS_LIBRARY_NAME@/js/RequiredDefines.h -isystem ${includedir}/@JS_LIBRARY_NAME@ ++Cflags: -include ${pc_sysrootdir}${includedir}/@JS_LIBRARY_NAME@/js/RequiredDefines.h -isystem ${includedir}/@JS_LIBRARY_NAME@ diff --git a/srcpkgs/mozjs68/patches/007-Remove-unused-LLVM-and-Rust-build-dependencies.patch b/srcpkgs/mozjs68/patches/007-Remove-unused-LLVM-and-Rust-build-dependencies.patch new file mode 100644 index 00000000000..b1c7782adbf --- /dev/null +++ b/srcpkgs/mozjs68/patches/007-Remove-unused-LLVM-and-Rust-build-dependencies.patch @@ -0,0 +1,74 @@ +Source: openSUSE +Upstream: No +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 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=959144 +Forwarded: no +Last-Update: 2020-04-30 + +Index: js/moz.configure +=================================================================== +--- a/js/moz.configure ++++ a/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: moz.configure +=================================================================== +--- a/moz.configure ++++ b/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/srcpkgs/mozjs68/template b/srcpkgs/mozjs68/template new file mode 100644 index 00000000000..0b54c56f763 --- /dev/null +++ b/srcpkgs/mozjs68/template @@ -0,0 +1,71 @@ +# Template file for 'mozjs68' +pkgname=mozjs68 +version=68.8.0 +revision=1 +wrksrc="firefox-${version}" +build_wrksrc=js/src +build_style=gnu-configure +hostmakedepends="perl python pkg-config automake autoconf213 autoconf-archive + which python3" +makedepends="icu-devel libffi-devel nspr-devel python-devel readline-devel zlib-devel + python3-devel" +depends="nspr>=4.19" +short_desc="Mozilla JavaScript interpreter and library (68.x series)" +maintainer="Enno Boland " +license="MPL-2.0" +homepage="https://www.mozilla.org/js/" +distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz" +checksum=fa5b2266d225878d4b35694678f79fd7e7a6d3c62759a40326129bd90f63e842 +patch_args="-Np1" +CXXFLAGS="-Wno-class-memaccess" +LDFLAGS+=" -Wl,-z,stack-size=1048576" + +if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then + makedepends+=" libatomic-devel" + LDFLAGS+=" -latomic" +fi + +do_configure() { + local _args + + if [ "$CROSS_BUILD" ]; then + export HOST_CC=cc + export TARGET_CC="${CC}" + export HOST_CFLAGS="-Os" + export HOST_CXXFLAGS="-Os" + _args+=" --target=$XBPS_CROSS_TRIPLET --enable-linker=bfd" + fi + + autoconf-2.13 old-configure.in > old-configure + + touch ${wrksrc}/js/src/configure + touch ${wrksrc}/js/src/old-configure + SHELL=/bin/bash PYTHON=/usr/bin/python2 ./configure --prefix=/usr \ + --disable-jemalloc --disable-optimize --enable-ctypes \ + --enable-readline --enable-shared-js --enable-system-ffi \ + --enable-tests --with-intl-api --with-system-icu --with-system-nspr \ + --enable-unaligned-private-values --enable-hardening \ + --enable-release --with-system-zlib --target=${XBPS_TRIPLET} \ + --host=${XBPS_TRIPLET} \ + ${_args} +} + +do_check() { + dist/bin/jsapi-tests --format=none --exclude-random basic +} + +post_install() { + # Remove unneeded static library + rm -f "${DESTDIR}"/usr/lib/*.ajs +} + +mozjs68-devel_package() { + depends="nspr-devel ${sourcepkg}>=${version}_${revision}" + short_desc+=" - development files" + pkg_install() { + vmove usr/bin/js68-config + vmove usr/include + vmove "usr/lib/*.so" + vmove usr/lib/pkgconfig + } +} diff --git a/srcpkgs/mozjs68/update b/srcpkgs/mozjs68/update new file mode 100644 index 00000000000..1947e19217f --- /dev/null +++ b/srcpkgs/mozjs68/update @@ -0,0 +1 @@ +pkgname='mozjs'