From 7f79d53c81f0f0dccdbdab3dcacdb9e775c7ab80 Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Sun, 16 Aug 2020 06:23:04 +0200 Subject: [PATCH] New package: mozjs78-78.2.0 --- common/shlibs | 1 + srcpkgs/mozjs78-devel | 1 + .../001-silence-sandbox-violations.patch | 27 +++++++ srcpkgs/mozjs78/patches/002-fix-soname.patch | 22 ++++++ .../mozjs78/patches/003-fix-wasm-arm.patch | 16 ++++ .../mozjs78/patches/004-fix-musl-build.patch | 17 +++++ .../005-spidermonkey-checks-disable.patch | 12 +++ .../006-mozjs78.pc-honor-sysroot.patch | 10 +++ .../patches/007-fix-mips-sgidefs_h.patch | 11 +++ srcpkgs/mozjs78/patches/disable-jslint.patch | 17 +++++ ...47c9416f9eebde636e21d794d25d1be8791d.patch | 37 ++++++++++ srcpkgs/mozjs78/template | 73 +++++++++++++++++++ srcpkgs/mozjs78/update | 1 + 13 files changed, 245 insertions(+) create mode 120000 srcpkgs/mozjs78-devel create mode 100644 srcpkgs/mozjs78/patches/001-silence-sandbox-violations.patch create mode 100644 srcpkgs/mozjs78/patches/002-fix-soname.patch create mode 100644 srcpkgs/mozjs78/patches/003-fix-wasm-arm.patch create mode 100644 srcpkgs/mozjs78/patches/004-fix-musl-build.patch create mode 100644 srcpkgs/mozjs78/patches/005-spidermonkey-checks-disable.patch create mode 100644 srcpkgs/mozjs78/patches/006-mozjs78.pc-honor-sysroot.patch create mode 100644 srcpkgs/mozjs78/patches/007-fix-mips-sgidefs_h.patch create mode 100644 srcpkgs/mozjs78/patches/disable-jslint.patch create mode 100644 srcpkgs/mozjs78/patches/fd6847c9416f9eebde636e21d794d25d1be8791d.patch create mode 100644 srcpkgs/mozjs78/template create mode 100644 srcpkgs/mozjs78/update diff --git a/common/shlibs b/common/shlibs index c8d9916c2c1..df821efb151 100644 --- a/common/shlibs +++ b/common/shlibs @@ -3538,6 +3538,7 @@ 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 +libmozjs-78.so.0 mozjs78-78.1.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/mozjs78-devel b/srcpkgs/mozjs78-devel new file mode 120000 index 00000000000..7713599356f --- /dev/null +++ b/srcpkgs/mozjs78-devel @@ -0,0 +1 @@ +mozjs78 \ No newline at end of file diff --git a/srcpkgs/mozjs78/patches/001-silence-sandbox-violations.patch b/srcpkgs/mozjs78/patches/001-silence-sandbox-violations.patch new file mode 100644 index 00000000000..dc01194b646 --- /dev/null +++ b/srcpkgs/mozjs78/patches/001-silence-sandbox-violations.patch @@ -0,0 +1,27 @@ +"Carried over + updated from mozjs68" +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 +@@ -1239,12 +1239,6 @@ class TreeMetadataEmitter(LoggingMixin): + '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/mozjs78/patches/002-fix-soname.patch b/srcpkgs/mozjs78/patches/002-fix-soname.patch new file mode 100644 index 00000000000..cc543109398 --- /dev/null +++ b/srcpkgs/mozjs78/patches/002-fix-soname.patch @@ -0,0 +1,22 @@ +"Carried over from mozjs68" +--- 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/mozjs78/patches/003-fix-wasm-arm.patch b/srcpkgs/mozjs78/patches/003-fix-wasm-arm.patch new file mode 100644 index 00000000000..891a7652056 --- /dev/null +++ b/srcpkgs/mozjs78/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/mozjs78/patches/004-fix-musl-build.patch b/srcpkgs/mozjs78/patches/004-fix-musl-build.patch new file mode 100644 index 00000000000..f629fa2ac35 --- /dev/null +++ b/srcpkgs/mozjs78/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/mozjs78/patches/005-spidermonkey-checks-disable.patch b/srcpkgs/mozjs78/patches/005-spidermonkey-checks-disable.patch new file mode 100644 index 00000000000..f6eababd1f2 --- /dev/null +++ b/srcpkgs/mozjs78/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/mozjs78/patches/006-mozjs78.pc-honor-sysroot.patch b/srcpkgs/mozjs78/patches/006-mozjs78.pc-honor-sysroot.patch new file mode 100644 index 00000000000..71214b8eccf --- /dev/null +++ b/srcpkgs/mozjs78/patches/006-mozjs78.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/mozjs78/patches/007-fix-mips-sgidefs_h.patch b/srcpkgs/mozjs78/patches/007-fix-mips-sgidefs_h.patch new file mode 100644 index 00000000000..abb140233a0 --- /dev/null +++ b/srcpkgs/mozjs78/patches/007-fix-mips-sgidefs_h.patch @@ -0,0 +1,11 @@ +--- a/mfbt/RandomNum.cpp 2020-04-29 23:49:40.000000000 +0200 ++++ b/mfbt/RandomNum.cpp 2020-08-04 19:29:36.127471301 +0200 +@@ -52,7 +52,7 @@ + # elif defined(__s390__) + # define GETRANDOM_NR 349 + # elif defined(__mips__) +-# include ++# include + # if _MIPS_SIM == _MIPS_SIM_ABI32 + # define GETRANDOM_NR 4353 + # elif _MIPS_SIM == _MIPS_SIM_ABI64 diff --git a/srcpkgs/mozjs78/patches/disable-jslint.patch b/srcpkgs/mozjs78/patches/disable-jslint.patch new file mode 100644 index 00000000000..04a8b3edef4 --- /dev/null +++ b/srcpkgs/mozjs78/patches/disable-jslint.patch @@ -0,0 +1,17 @@ +--- a/js/src/build/moz.build ++++ b/js/src/build/moz.build +@@ -80,14 +80,3 @@ + NO_EXPAND_LIBS = True + + DIST_INSTALL = True +- +-# Run SpiderMonkey style checker after linking the static library. This avoids +-# running the script for no-op builds. +-GeneratedFile( +- 'spidermonkey_checks', script='/config/run_spidermonkey_checks.py', +- inputs=[ +- '!%sjs_static.%s' % (CONFIG['LIB_PREFIX'], CONFIG['LIB_SUFFIX']), +- '/config/check_spidermonkey_style.py', +- '/config/check_macroassembler_style.py', +- '/config/check_js_opcode.py' +- ]) diff --git a/srcpkgs/mozjs78/patches/fd6847c9416f9eebde636e21d794d25d1be8791d.patch b/srcpkgs/mozjs78/patches/fd6847c9416f9eebde636e21d794d25d1be8791d.patch new file mode 100644 index 00000000000..1af68d93c62 --- /dev/null +++ b/srcpkgs/mozjs78/patches/fd6847c9416f9eebde636e21d794d25d1be8791d.patch @@ -0,0 +1,37 @@ +See https://bugzilla.mozilla.org/show_bug.cgi?id=1539739 + +From fd6847c9416f9eebde636e21d794d25d1be8791d Mon Sep 17 00:00:00 2001 +From: Mike Hommey +Date: Sat, 1 Jun 2019 09:06:01 +0900 +Subject: [PATCH] Bug 1526653 - Include struct definitions for user_vfp and + user_vfp_exc. + +--- + js/src/wasm/WasmSignalHandlers.cpp | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/js/src/wasm/WasmSignalHandlers.cpp b/js/src/wasm/WasmSignalHandlers.cpp +index 636537f8478..383c380f04c 100644 +--- a/js/src/wasm/WasmSignalHandlers.cpp ++++ b/js/src/wasm/WasmSignalHandlers.cpp +@@ -248,7 +248,16 @@ using mozilla::DebugOnly; + #endif + + #ifdef WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS +-# include ++struct user_vfp { ++ unsigned long long fpregs[32]; ++ unsigned long fpscr; ++}; ++ ++struct user_vfp_exc { ++ unsigned long fpexc; ++ unsigned long fpinst; ++ unsigned long fpinst2; ++}; + #endif + + #if defined(ANDROID) +-- +2.20.1 + diff --git a/srcpkgs/mozjs78/template b/srcpkgs/mozjs78/template new file mode 100644 index 00000000000..db58ad05a3f --- /dev/null +++ b/srcpkgs/mozjs78/template @@ -0,0 +1,73 @@ +# Template file for 'mozjs78' +pkgname=mozjs78 +version=78.2.0 +revision=1 +wrksrc="firefox-${version}" +build_wrksrc=js/src +build_style=gnu-configure +hostmakedepends="perl python pkg-config automake autoconf213 autoconf-archive + cargo rust llvm clang which python3" +makedepends="icu-devel libffi-devel nspr-devel python-devel readline-devel + zlib-devel python3-devel rust-std" +depends="nspr>=4.19" +short_desc="Mozilla JavaScript interpreter and library (78.x series)" +maintainer="q66 " +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=965ccfcbb8c0aa97639911997c54be0fcf896fd388b03138952089af675ea918 +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 + # use gcc as assembler to avoid errors + unset AS + + 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-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 +} + +mozjs78-devel_package() { + depends="nspr-devel ${sourcepkg}>=${version}_${revision}" + short_desc+=" - development files" + pkg_install() { + vmove usr/bin/js78-config + vmove usr/include + vmove "usr/lib/*.so" + vmove usr/lib/pkgconfig + } +} diff --git a/srcpkgs/mozjs78/update b/srcpkgs/mozjs78/update new file mode 100644 index 00000000000..1947e19217f --- /dev/null +++ b/srcpkgs/mozjs78/update @@ -0,0 +1 @@ +pkgname='mozjs'