Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] [WIP][Help Needed] Update gjs to 1.65.2.
@ 2020-05-07  9:40 not-chicken
  2020-05-07 13:00 ` sgn
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: not-chicken @ 2020-05-07  9:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 635 bytes --]

There is a new pull request by not-chicken against master on the void-packages repository

https://github.com/not-chicken/void-packages gjs
https://github.com/void-linux/void-packages/pull/21716

[WIP][Help Needed] Update gjs to 1.65.2.
Needed for #21382 

Compilation tested: 

- x86_64
- i686
- armv6l-musl
- armv7l
- aarch64

Runtime: 
- x86_64 - gnome-shell 3.36.2 seems to run fine.

Patched up to disable spidermonkey checks for now. 
https://src.fedoraproject.org/rpms/mozjs68/blob/master/f/mozjs68.spec#_51

CC @Gottox 

A patch file from https://github.com/void-linux/void-packages/pull/21716.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gjs-21716.patch --]
[-- Type: text/x-diff, Size: 14112 bytes --]

From 136ec570117f35d252d91663b64d861405eef97f Mon Sep 17 00:00:00 2001
From: Lorem <notloremipsum@protonmail.com>
Date: Thu, 7 May 2020 14:02:39 +0530
Subject: [PATCH 1/2] New package: mozjs68-68.7.0

[ci skip]
---
 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 ++++
 .../patches/004-remove-rustc-check.patch      | 43 +++++++++++
 .../mozjs68/patches/005-fix-musl-build.patch  | 17 +++++
 .../006-spidermonkey-checks-disable.patch     | 12 +++
 srcpkgs/mozjs68/template                      | 75 +++++++++++++++++++
 srcpkgs/mozjs68/update                        |  1 +
 10 files changed, 215 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-remove-rustc-check.patch
 create mode 100644 srcpkgs/mozjs68/patches/005-fix-musl-build.patch
 create mode 100644 srcpkgs/mozjs68/patches/006-spidermonkey-checks-disable.patch
 create mode 100644 srcpkgs/mozjs68/template
 create mode 100644 srcpkgs/mozjs68/update

diff --git a/common/shlibs b/common/shlibs
index 4bdc03e8b23..f95c646d6d0 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3453,6 +3453,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.7.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 <Marc-Antoine@Perennou.com>
+Date: Wed, 5 Sep 2018 15:05:24 +0200
+Subject: [PATCH] silence sandbox violations
+
+Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
+---
+ 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 <sys/user.h>
diff --git a/srcpkgs/mozjs68/patches/004-remove-rustc-check.patch b/srcpkgs/mozjs68/patches/004-remove-rustc-check.patch
new file mode 100644
index 00000000000..0ca976cac6c
--- /dev/null
+++ b/srcpkgs/mozjs68/patches/004-remove-rustc-check.patch
@@ -0,0 +1,43 @@
+"Taken from firefox-esr"
+Mozilla rustc check does not support crossbuild: let's remove it
+Remove calls to unwrap_rustup, they fail if rustup isn't present
+
+--- a/build/moz.configure/rust.configure	2019-07-06 03:48:30.000000000 +0200
++++ b/build/moz.configure/rust.configure	2019-07-09 22:35:23.326851798 +0200
+@@ -79,9 +79,6 @@
+ 
+     return unwrap
+ 
+-rustc = unwrap_rustup(rustc, 'rustc')
+-cargo = unwrap_rustup(cargo, 'cargo')
+-
+ 
+ set_config('CARGO', cargo)
+ set_config('RUSTC', rustc)
+@@ -294,26 +291,6 @@
+ 
+             os.write(in_fd, source)
+             os.close(in_fd)
+-
+-            cmd = [
+-                rustc,
+-                '--crate-type', 'staticlib',
+-                target_arg,
+-                '-o', out_path,
+-                in_path,
+-            ]
+-
+-            def failed():
+-                die(dedent('''\
+-                Cannot compile for {} with {}
+-                The target may be unsupported, or you may not have
+-                a rust std library for that target installed. Try:
+-
+-                  rustup target add {}
+-                '''.format(host_or_target.alias, rustc, rustc_target.alias)))
+-            check_cmd_output(*cmd, onerror=failed)
+-            if not os.path.exists(out_path) or os.path.getsize(out_path) == 0:
+-                failed()
+         finally:
+             os.remove(in_path)
+             os.remove(out_path)
diff --git a/srcpkgs/mozjs68/patches/005-fix-musl-build.patch b/srcpkgs/mozjs68/patches/005-fix-musl-build.patch
new file mode 100644
index 00000000000..f629fa2ac35
--- /dev/null
+++ b/srcpkgs/mozjs68/patches/005-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/006-spidermonkey-checks-disable.patch b/srcpkgs/mozjs68/patches/006-spidermonkey-checks-disable.patch
new file mode 100644
index 00000000000..2dde755227b
--- /dev/null
+++ b/srcpkgs/mozjs68/patches/006-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/template b/srcpkgs/mozjs68/template
new file mode 100644
index 00000000000..1d25b66ace3
--- /dev/null
+++ b/srcpkgs/mozjs68/template
@@ -0,0 +1,75 @@
+# Template file for 'mozjs68'
+pkgname=mozjs68
+version=68.7.0
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper="rust"
+hostmakedepends="perl python pkg-config automake autoconf213 autoconf-archive
+ which rust cargo clang python3 llvm9"
+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 (68.x series)"
+maintainer="Enno Boland <gottox@voidlinux.org>"
+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=ad3ea069c3d23aab360ad04ff4d0f5e556d3538f7dd4eae0690c4e9241537570
+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-nspr --with-system-zlib --target=${XBPS_TRIPLET} \
+		--host=${XBPS_TRIPLET} \
+		${_args}
+}
+
+do_check() {
+	dist/bin/jsapi-tests --format=none --exclude-random basic
+}
+
+post_install() {
+	# Fix the '-include' directive, otherwise it tries to use the hosts' header
+	vsed 's|^Cflags:.*|Cflags: -include ${pc_sysrootdir}/${includedir}/mozjs-68/js/RequiredDefines.h -I${includedir}/mozjs-68|' \
+		-i ${DESTDIR}/usr/lib/pkgconfig/mozjs-68.pc
+	# 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'

From 75d2fae239a9e4a910baf12f795702f1868f72fa Mon Sep 17 00:00:00 2001
From: Lorem <notloremipsum@protonmail.com>
Date: Thu, 7 May 2020 14:06:06 +0530
Subject: [PATCH 2/2] gjs: update to 1.65.2.

---
 common/shlibs        |  2 +-
 srcpkgs/gjs/template | 21 ++++++---------------
 2 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index f95c646d6d0..695f6137a18 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -830,7 +830,7 @@ libtotem.so.0 libtotem-3.6.2_1
 libclutter-1.0.so.0 clutter-1.14.0_1
 libavfs.so.0 libavfs-1.0.5_1
 libdmr.so.0.1 deepin-movie-reborn-3.2.5_1
-libgjs.so.0 gjs-1.63.3_1
+libgjs.so.0 gjs-1.65.2_1
 libgjs-gi.so gjs-1.63.3_1
 libgjs-dbus.so.0 gjs-1.63.3_1
 libtelepathy-glib.so.0 telepathy-glib-0.15.5_1
diff --git a/srcpkgs/gjs/template b/srcpkgs/gjs/template
index 956fb9d28be..0b5113a5115 100644
--- a/srcpkgs/gjs/template
+++ b/srcpkgs/gjs/template
@@ -1,36 +1,27 @@
 # Template file for 'gjs'
 pkgname=gjs
-version=1.63.3
-revision=2
+version=1.65.2
+revision=1
 build_style=meson
 build_helper="gir qemu"
 configure_args="-Dskip_dbus_tests=true -Dskip_gtk_tests=true
- -Dprofiler=disabled" # Disable test because they need X and GTK.
+ -Dprofiler=disabled" # Disable tests because they need dbus, X and GTK.
 hostmakedepends="glib-devel pkg-config"
-makedepends="dbus-glib-devel mozjs60-devel readline-devel sysprof-devel"
+makedepends="dbus-glib-devel mozjs68-devel readline-devel sysprof-devel"
 short_desc="Mozilla-based javascript bindings for the GNOME platform"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="MIT, LGPL-2.0-or-later"
 homepage="https://wiki.gnome.org/action/show/Projects/Gjs"
 changelog="https://gitlab.gnome.org/GNOME/gjs/blob/gnome-3-30/NEWS"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=09f232c20e986c368e93394b2c10dc21b6fedacfff7de926f0b221ea5b933b5f
-
-pre_configure() {
-	if [ "$CROSS_BUILD" ]; then
-		vsed -i meson.build -e"/subdir('installed-tests')/d"
-	fi
-	if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-		grep -rlw "<sys/signal.h>" | xargs sed -i -e"s;<sys/signal.h>;<signal.h>;"
-	fi
-}
+checksum=a66edad8a5f10027f9b182d88af84b81f13e5ad5840319cfa747d66e77e0214f
 
 post_install() {
 	vlicense COPYING
 }
 
 gjs-devel_package() {
-	depends="libgirepository-devel mozjs60-devel ${sourcepkg}>=${version}_${revision}"
+	depends="libgirepository-devel mozjs68-devel ${sourcepkg}>=${version}_${revision}"
 	short_desc+=" - development files"
 	pkg_install() {
 		vmove usr/include

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [WIP][Help Needed] Update gjs to 1.65.2.
  2020-05-07  9:40 [PR PATCH] [WIP][Help Needed] Update gjs to 1.65.2 not-chicken
@ 2020-05-07 13:00 ` sgn
  2020-05-07 13:40 ` [PR PATCH] [Updated] " not-chicken
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: sgn @ 2020-05-07 13:00 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 270 bytes --]

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/21716#issuecomment-625240292

Comment:
Please carry https://github.com/void-linux/void-packages/blob/master/srcpkgs/mozjs60/patches/0012-mozjs60.pc-honor-sysroot.patch over

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PR PATCH] [Updated] [WIP][Help Needed] Update gjs to 1.65.2.
  2020-05-07  9:40 [PR PATCH] [WIP][Help Needed] Update gjs to 1.65.2 not-chicken
  2020-05-07 13:00 ` sgn
@ 2020-05-07 13:40 ` not-chicken
  2020-05-07 13:42 ` not-chicken
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: not-chicken @ 2020-05-07 13:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 712 bytes --]

There is an updated pull request by not-chicken against master on the void-packages repository

https://github.com/not-chicken/void-packages gjs
https://github.com/void-linux/void-packages/pull/21716

[WIP][Help Needed] Update gjs to 1.65.2.
Needed for #21382 

Compilation tested: 

- x86_64
- i686
- armv6l-musl
- armv7l
- aarch64

Runtime: 
- x86_64 - gnome-shell 3.36.2 seems to run fine.

Edit: I underestimated travis I guess. It's able to build this fine.

Patched up to disable spidermonkey checks for now. 
https://src.fedoraproject.org/rpms/mozjs68/blob/master/f/mozjs68.spec#_51

CC @Gottox 

A patch file from https://github.com/void-linux/void-packages/pull/21716.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gjs-21716.patch --]
[-- Type: text/x-diff, Size: 15079 bytes --]

From bb2d7640d06f7a8bd7594cb86a8f63d0222460fa Mon Sep 17 00:00:00 2001
From: Lorem <notloremipsum@protonmail.com>
Date: Thu, 7 May 2020 14:02:39 +0530
Subject: [PATCH 1/2] New package: mozjs68-68.7.0

---
 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 ++++
 .../patches/004-remove-rustc-check.patch      | 43 +++++++++++
 .../mozjs68/patches/005-fix-musl-build.patch  | 17 +++++
 .../006-spidermonkey-checks-disable.patch     | 12 +++
 .../007-mozjs68.pc-honor-sysroot.patch        | 11 +++
 srcpkgs/mozjs68/template                      | 75 +++++++++++++++++++
 srcpkgs/mozjs68/update                        |  1 +
 11 files changed, 226 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-remove-rustc-check.patch
 create mode 100644 srcpkgs/mozjs68/patches/005-fix-musl-build.patch
 create mode 100644 srcpkgs/mozjs68/patches/006-spidermonkey-checks-disable.patch
 create mode 100644 srcpkgs/mozjs68/patches/007-mozjs68.pc-honor-sysroot.patch
 create mode 100644 srcpkgs/mozjs68/template
 create mode 100644 srcpkgs/mozjs68/update

diff --git a/common/shlibs b/common/shlibs
index 4bdc03e8b23..f95c646d6d0 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3453,6 +3453,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.7.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 <Marc-Antoine@Perennou.com>
+Date: Wed, 5 Sep 2018 15:05:24 +0200
+Subject: [PATCH] silence sandbox violations
+
+Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
+---
+ 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 <sys/user.h>
diff --git a/srcpkgs/mozjs68/patches/004-remove-rustc-check.patch b/srcpkgs/mozjs68/patches/004-remove-rustc-check.patch
new file mode 100644
index 00000000000..0ca976cac6c
--- /dev/null
+++ b/srcpkgs/mozjs68/patches/004-remove-rustc-check.patch
@@ -0,0 +1,43 @@
+"Taken from firefox-esr"
+Mozilla rustc check does not support crossbuild: let's remove it
+Remove calls to unwrap_rustup, they fail if rustup isn't present
+
+--- a/build/moz.configure/rust.configure	2019-07-06 03:48:30.000000000 +0200
++++ b/build/moz.configure/rust.configure	2019-07-09 22:35:23.326851798 +0200
+@@ -79,9 +79,6 @@
+ 
+     return unwrap
+ 
+-rustc = unwrap_rustup(rustc, 'rustc')
+-cargo = unwrap_rustup(cargo, 'cargo')
+-
+ 
+ set_config('CARGO', cargo)
+ set_config('RUSTC', rustc)
+@@ -294,26 +291,6 @@
+ 
+             os.write(in_fd, source)
+             os.close(in_fd)
+-
+-            cmd = [
+-                rustc,
+-                '--crate-type', 'staticlib',
+-                target_arg,
+-                '-o', out_path,
+-                in_path,
+-            ]
+-
+-            def failed():
+-                die(dedent('''\
+-                Cannot compile for {} with {}
+-                The target may be unsupported, or you may not have
+-                a rust std library for that target installed. Try:
+-
+-                  rustup target add {}
+-                '''.format(host_or_target.alias, rustc, rustc_target.alias)))
+-            check_cmd_output(*cmd, onerror=failed)
+-            if not os.path.exists(out_path) or os.path.getsize(out_path) == 0:
+-                failed()
+         finally:
+             os.remove(in_path)
+             os.remove(out_path)
diff --git a/srcpkgs/mozjs68/patches/005-fix-musl-build.patch b/srcpkgs/mozjs68/patches/005-fix-musl-build.patch
new file mode 100644
index 00000000000..f629fa2ac35
--- /dev/null
+++ b/srcpkgs/mozjs68/patches/005-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/006-spidermonkey-checks-disable.patch b/srcpkgs/mozjs68/patches/006-spidermonkey-checks-disable.patch
new file mode 100644
index 00000000000..f6eababd1f2
--- /dev/null
+++ b/srcpkgs/mozjs68/patches/006-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/007-mozjs68.pc-honor-sysroot.patch b/srcpkgs/mozjs68/patches/007-mozjs68.pc-honor-sysroot.patch
new file mode 100644
index 00000000000..76311243084
--- /dev/null
+++ b/srcpkgs/mozjs68/patches/007-mozjs68.pc-honor-sysroot.patch
@@ -0,0 +1,11 @@
+"Carried over from mozjs60"
+
+--- a/js/src/build/js.pc.in
++++ b/js/src/build/js.pc.in
+@@ -11,4 +11,5 @@
+ # 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/template b/srcpkgs/mozjs68/template
new file mode 100644
index 00000000000..aebead38a1c
--- /dev/null
+++ b/srcpkgs/mozjs68/template
@@ -0,0 +1,75 @@
+# Template file for 'mozjs68'
+pkgname=mozjs68
+version=68.7.0
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper="rust"
+hostmakedepends="perl python pkg-config automake autoconf213 autoconf-archive
+ which rust cargo clang python3 llvm9"
+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 (68.x series)"
+maintainer="Enno Boland <gottox@voidlinux.org>"
+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=ad3ea069c3d23aab360ad04ff4d0f5e556d3538f7dd4eae0690c4e9241537570
+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() {
+	# Fix the '-include' directive, otherwise it tries to use the hosts' header
+	vsed 's|^Cflags:.*|Cflags: -include ${pc_sysrootdir}/${includedir}/mozjs-68/js/RequiredDefines.h -I${includedir}/mozjs-68|' \
+		-i ${DESTDIR}/usr/lib/pkgconfig/mozjs-68.pc
+	# 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'

From 6e6bb31a3a6cf734f73ffa9637fbd4e82991f790 Mon Sep 17 00:00:00 2001
From: Lorem <notloremipsum@protonmail.com>
Date: Thu, 7 May 2020 14:06:06 +0530
Subject: [PATCH 2/2] gjs: update to 1.65.2.

---
 common/shlibs        |  2 +-
 srcpkgs/gjs/template | 21 ++++++---------------
 2 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index f95c646d6d0..695f6137a18 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -830,7 +830,7 @@ libtotem.so.0 libtotem-3.6.2_1
 libclutter-1.0.so.0 clutter-1.14.0_1
 libavfs.so.0 libavfs-1.0.5_1
 libdmr.so.0.1 deepin-movie-reborn-3.2.5_1
-libgjs.so.0 gjs-1.63.3_1
+libgjs.so.0 gjs-1.65.2_1
 libgjs-gi.so gjs-1.63.3_1
 libgjs-dbus.so.0 gjs-1.63.3_1
 libtelepathy-glib.so.0 telepathy-glib-0.15.5_1
diff --git a/srcpkgs/gjs/template b/srcpkgs/gjs/template
index 956fb9d28be..ec48baddf11 100644
--- a/srcpkgs/gjs/template
+++ b/srcpkgs/gjs/template
@@ -1,36 +1,27 @@
 # Template file for 'gjs'
 pkgname=gjs
-version=1.63.3
-revision=2
+version=1.65.2
+revision=1
 build_style=meson
 build_helper="gir qemu"
 configure_args="-Dskip_dbus_tests=true -Dskip_gtk_tests=true
- -Dprofiler=disabled" # Disable test because they need X and GTK.
+ -Dprofiler=disabled -Dinstalled_tests=false" # Disable tests because they need dbus, X and GTK.
 hostmakedepends="glib-devel pkg-config"
-makedepends="dbus-glib-devel mozjs60-devel readline-devel sysprof-devel"
+makedepends="dbus-glib-devel mozjs68-devel readline-devel sysprof-devel"
 short_desc="Mozilla-based javascript bindings for the GNOME platform"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="MIT, LGPL-2.0-or-later"
 homepage="https://wiki.gnome.org/action/show/Projects/Gjs"
 changelog="https://gitlab.gnome.org/GNOME/gjs/blob/gnome-3-30/NEWS"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=09f232c20e986c368e93394b2c10dc21b6fedacfff7de926f0b221ea5b933b5f
-
-pre_configure() {
-	if [ "$CROSS_BUILD" ]; then
-		vsed -i meson.build -e"/subdir('installed-tests')/d"
-	fi
-	if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-		grep -rlw "<sys/signal.h>" | xargs sed -i -e"s;<sys/signal.h>;<signal.h>;"
-	fi
-}
+checksum=a66edad8a5f10027f9b182d88af84b81f13e5ad5840319cfa747d66e77e0214f
 
 post_install() {
 	vlicense COPYING
 }
 
 gjs-devel_package() {
-	depends="libgirepository-devel mozjs60-devel ${sourcepkg}>=${version}_${revision}"
+	depends="libgirepository-devel mozjs68-devel ${sourcepkg}>=${version}_${revision}"
 	short_desc+=" - development files"
 	pkg_install() {
 		vmove usr/include

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [WIP][Help Needed] Update gjs to 1.65.2.
  2020-05-07  9:40 [PR PATCH] [WIP][Help Needed] Update gjs to 1.65.2 not-chicken
  2020-05-07 13:00 ` sgn
  2020-05-07 13:40 ` [PR PATCH] [Updated] " not-chicken
@ 2020-05-07 13:42 ` not-chicken
  2020-05-07 14:35 ` [PR PATCH] [Updated] " not-chicken
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: not-chicken @ 2020-05-07 13:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 298 bytes --]

New comment by not-chicken on void-packages repository

https://github.com/void-linux/void-packages/pull/21716#issuecomment-625263379

Comment:
> Please carry https://github.com/void-linux/void-packages/blob/master/srcpkgs/mozjs60/patches/0012-mozjs60.pc-honor-sysroot.patch over

Added, thanks!

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PR PATCH] [Updated] [WIP][Help Needed] Update gjs to 1.65.2.
  2020-05-07  9:40 [PR PATCH] [WIP][Help Needed] Update gjs to 1.65.2 not-chicken
                   ` (2 preceding siblings ...)
  2020-05-07 13:42 ` not-chicken
@ 2020-05-07 14:35 ` not-chicken
  2020-05-07 14:41 ` not-chicken
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: not-chicken @ 2020-05-07 14:35 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 712 bytes --]

There is an updated pull request by not-chicken against master on the void-packages repository

https://github.com/not-chicken/void-packages gjs
https://github.com/void-linux/void-packages/pull/21716

[WIP][Help Needed] Update gjs to 1.65.2.
Needed for #21382 

Compilation tested: 

- x86_64
- i686
- armv6l-musl
- armv7l
- aarch64

Runtime: 
- x86_64 - gnome-shell 3.36.2 seems to run fine.

Edit: I underestimated travis I guess. It's able to build this fine.

Patched up to disable spidermonkey checks for now. 
https://src.fedoraproject.org/rpms/mozjs68/blob/master/f/mozjs68.spec#_51

CC @Gottox 

A patch file from https://github.com/void-linux/void-packages/pull/21716.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gjs-21716.patch --]
[-- Type: text/x-diff, Size: 15076 bytes --]

From c02121b06a51b4b2f241dccf161647351657ebad Mon Sep 17 00:00:00 2001
From: Lorem <notloremipsum@protonmail.com>
Date: Thu, 7 May 2020 14:02:39 +0530
Subject: [PATCH 1/2] New package: mozjs68-68.7.0

---
 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 ++++
 .../patches/004-remove-rustc-check.patch      | 43 +++++++++++
 .../mozjs68/patches/005-fix-musl-build.patch  | 17 +++++
 .../006-spidermonkey-checks-disable.patch     | 12 +++
 .../007-mozjs68.pc-honor-sysroot.patch        | 10 +++
 srcpkgs/mozjs68/template                      | 75 +++++++++++++++++++
 srcpkgs/mozjs68/update                        |  1 +
 11 files changed, 225 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-remove-rustc-check.patch
 create mode 100644 srcpkgs/mozjs68/patches/005-fix-musl-build.patch
 create mode 100644 srcpkgs/mozjs68/patches/006-spidermonkey-checks-disable.patch
 create mode 100644 srcpkgs/mozjs68/patches/007-mozjs68.pc-honor-sysroot.patch
 create mode 100644 srcpkgs/mozjs68/template
 create mode 100644 srcpkgs/mozjs68/update

diff --git a/common/shlibs b/common/shlibs
index 4bdc03e8b23..f95c646d6d0 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3453,6 +3453,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.7.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 <Marc-Antoine@Perennou.com>
+Date: Wed, 5 Sep 2018 15:05:24 +0200
+Subject: [PATCH] silence sandbox violations
+
+Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
+---
+ 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 <sys/user.h>
diff --git a/srcpkgs/mozjs68/patches/004-remove-rustc-check.patch b/srcpkgs/mozjs68/patches/004-remove-rustc-check.patch
new file mode 100644
index 00000000000..0ca976cac6c
--- /dev/null
+++ b/srcpkgs/mozjs68/patches/004-remove-rustc-check.patch
@@ -0,0 +1,43 @@
+"Taken from firefox-esr"
+Mozilla rustc check does not support crossbuild: let's remove it
+Remove calls to unwrap_rustup, they fail if rustup isn't present
+
+--- a/build/moz.configure/rust.configure	2019-07-06 03:48:30.000000000 +0200
++++ b/build/moz.configure/rust.configure	2019-07-09 22:35:23.326851798 +0200
+@@ -79,9 +79,6 @@
+ 
+     return unwrap
+ 
+-rustc = unwrap_rustup(rustc, 'rustc')
+-cargo = unwrap_rustup(cargo, 'cargo')
+-
+ 
+ set_config('CARGO', cargo)
+ set_config('RUSTC', rustc)
+@@ -294,26 +291,6 @@
+ 
+             os.write(in_fd, source)
+             os.close(in_fd)
+-
+-            cmd = [
+-                rustc,
+-                '--crate-type', 'staticlib',
+-                target_arg,
+-                '-o', out_path,
+-                in_path,
+-            ]
+-
+-            def failed():
+-                die(dedent('''\
+-                Cannot compile for {} with {}
+-                The target may be unsupported, or you may not have
+-                a rust std library for that target installed. Try:
+-
+-                  rustup target add {}
+-                '''.format(host_or_target.alias, rustc, rustc_target.alias)))
+-            check_cmd_output(*cmd, onerror=failed)
+-            if not os.path.exists(out_path) or os.path.getsize(out_path) == 0:
+-                failed()
+         finally:
+             os.remove(in_path)
+             os.remove(out_path)
diff --git a/srcpkgs/mozjs68/patches/005-fix-musl-build.patch b/srcpkgs/mozjs68/patches/005-fix-musl-build.patch
new file mode 100644
index 00000000000..f629fa2ac35
--- /dev/null
+++ b/srcpkgs/mozjs68/patches/005-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/006-spidermonkey-checks-disable.patch b/srcpkgs/mozjs68/patches/006-spidermonkey-checks-disable.patch
new file mode 100644
index 00000000000..f6eababd1f2
--- /dev/null
+++ b/srcpkgs/mozjs68/patches/006-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/007-mozjs68.pc-honor-sysroot.patch b/srcpkgs/mozjs68/patches/007-mozjs68.pc-honor-sysroot.patch
new file mode 100644
index 00000000000..1400dcacde9
--- /dev/null
+++ b/srcpkgs/mozjs68/patches/007-mozjs68.pc-honor-sysroot.patch
@@ -0,0 +1,10 @@
+"Carried over from mozjs60"
+
+--- 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/template b/srcpkgs/mozjs68/template
new file mode 100644
index 00000000000..1e0131d609b
--- /dev/null
+++ b/srcpkgs/mozjs68/template
@@ -0,0 +1,75 @@
+# Template file for 'mozjs68'
+pkgname=mozjs68
+version=68.7.0
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper="rust"
+hostmakedepends="perl python pkg-config automake autoconf213 autoconf-archive
+ which rust cargo clang python3 llvm9"
+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 (68.x series)"
+maintainer="Enno Boland <gottox@voidlinux.org>"
+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=ad3ea069c3d23aab360ad04ff4d0f5e556d3538f7dd4eae0690c4e9241537570
+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() {
+	# Fix the '-include' directive, otherwise it tries to use the hosts' header
+	vsed 's|^Cflags:.*|Cflags: -include ${pc_sysrootdir}/${includedir}/mozjs-68/js/RequiredDefines.h -I${includedir}/mozjs-68|' \
+		-i ${DESTDIR}/usr/lib/pkgconfig/mozjs-68.pc
+	# 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'

From dc30b172fedee5c65e30fbf06b08bb36a7e79917 Mon Sep 17 00:00:00 2001
From: Lorem <notloremipsum@protonmail.com>
Date: Thu, 7 May 2020 14:06:06 +0530
Subject: [PATCH 2/2] gjs: update to 1.65.2.

---
 common/shlibs        |  2 +-
 srcpkgs/gjs/template | 21 ++++++---------------
 2 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index f95c646d6d0..695f6137a18 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -830,7 +830,7 @@ libtotem.so.0 libtotem-3.6.2_1
 libclutter-1.0.so.0 clutter-1.14.0_1
 libavfs.so.0 libavfs-1.0.5_1
 libdmr.so.0.1 deepin-movie-reborn-3.2.5_1
-libgjs.so.0 gjs-1.63.3_1
+libgjs.so.0 gjs-1.65.2_1
 libgjs-gi.so gjs-1.63.3_1
 libgjs-dbus.so.0 gjs-1.63.3_1
 libtelepathy-glib.so.0 telepathy-glib-0.15.5_1
diff --git a/srcpkgs/gjs/template b/srcpkgs/gjs/template
index 956fb9d28be..ec48baddf11 100644
--- a/srcpkgs/gjs/template
+++ b/srcpkgs/gjs/template
@@ -1,36 +1,27 @@
 # Template file for 'gjs'
 pkgname=gjs
-version=1.63.3
-revision=2
+version=1.65.2
+revision=1
 build_style=meson
 build_helper="gir qemu"
 configure_args="-Dskip_dbus_tests=true -Dskip_gtk_tests=true
- -Dprofiler=disabled" # Disable test because they need X and GTK.
+ -Dprofiler=disabled -Dinstalled_tests=false" # Disable tests because they need dbus, X and GTK.
 hostmakedepends="glib-devel pkg-config"
-makedepends="dbus-glib-devel mozjs60-devel readline-devel sysprof-devel"
+makedepends="dbus-glib-devel mozjs68-devel readline-devel sysprof-devel"
 short_desc="Mozilla-based javascript bindings for the GNOME platform"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="MIT, LGPL-2.0-or-later"
 homepage="https://wiki.gnome.org/action/show/Projects/Gjs"
 changelog="https://gitlab.gnome.org/GNOME/gjs/blob/gnome-3-30/NEWS"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=09f232c20e986c368e93394b2c10dc21b6fedacfff7de926f0b221ea5b933b5f
-
-pre_configure() {
-	if [ "$CROSS_BUILD" ]; then
-		vsed -i meson.build -e"/subdir('installed-tests')/d"
-	fi
-	if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-		grep -rlw "<sys/signal.h>" | xargs sed -i -e"s;<sys/signal.h>;<signal.h>;"
-	fi
-}
+checksum=a66edad8a5f10027f9b182d88af84b81f13e5ad5840319cfa747d66e77e0214f
 
 post_install() {
 	vlicense COPYING
 }
 
 gjs-devel_package() {
-	depends="libgirepository-devel mozjs60-devel ${sourcepkg}>=${version}_${revision}"
+	depends="libgirepository-devel mozjs68-devel ${sourcepkg}>=${version}_${revision}"
 	short_desc+=" - development files"
 	pkg_install() {
 		vmove usr/include

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [WIP][Help Needed] Update gjs to 1.65.2.
  2020-05-07  9:40 [PR PATCH] [WIP][Help Needed] Update gjs to 1.65.2 not-chicken
                   ` (3 preceding siblings ...)
  2020-05-07 14:35 ` [PR PATCH] [Updated] " not-chicken
@ 2020-05-07 14:41 ` not-chicken
  2020-05-08  9:24 ` [PR PATCH] [Updated] " not-chicken
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: not-chicken @ 2020-05-07 14:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 385 bytes --]

New comment by not-chicken on void-packages repository

https://github.com/void-linux/void-packages/pull/21716#issuecomment-625263379

Comment:
> Please carry https://github.com/void-linux/void-packages/blob/master/srcpkgs/mozjs60/patches/0012-mozjs60.pc-honor-sysroot.patch over

Added, thanks!
```
Files of mozjs68:
/usr/lib/libjs_static.ajs
```
Oops! That wasn't intended.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PR PATCH] [Updated] [WIP][Help Needed] Update gjs to 1.65.2.
  2020-05-07  9:40 [PR PATCH] [WIP][Help Needed] Update gjs to 1.65.2 not-chicken
                   ` (4 preceding siblings ...)
  2020-05-07 14:41 ` not-chicken
@ 2020-05-08  9:24 ` not-chicken
  2020-05-08 15:13 ` toluschr
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: not-chicken @ 2020-05-08  9:24 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 712 bytes --]

There is an updated pull request by not-chicken against master on the void-packages repository

https://github.com/not-chicken/void-packages gjs
https://github.com/void-linux/void-packages/pull/21716

[WIP][Help Needed] Update gjs to 1.65.2.
Needed for #21382 

Compilation tested: 

- x86_64
- i686
- armv6l-musl
- armv7l
- aarch64

Runtime: 
- x86_64 - gnome-shell 3.36.2 seems to run fine.

Edit: I underestimated travis I guess. It's able to build this fine.

Patched up to disable spidermonkey checks for now. 
https://src.fedoraproject.org/rpms/mozjs68/blob/master/f/mozjs68.spec#_51

CC @Gottox 

A patch file from https://github.com/void-linux/void-packages/pull/21716.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gjs-21716.patch --]
[-- Type: text/x-diff, Size: 14906 bytes --]

From 3e61d1d724e9dd84e9058ba19875177e9fd126f0 Mon Sep 17 00:00:00 2001
From: Lorem <notloremipsum@protonmail.com>
Date: Thu, 7 May 2020 14:02:39 +0530
Subject: [PATCH 1/2] New package: mozjs68-68.7.0

---
 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 +++++
 .../patches/004-remove-rustc-check.patch      | 43 +++++++++++
 .../mozjs68/patches/005-fix-musl-build.patch  | 17 +++++
 .../006-spidermonkey-checks-disable.patch     | 12 ++++
 .../007-mozjs68.pc-honor-sysroot.patch        | 10 +++
 srcpkgs/mozjs68/template                      | 72 +++++++++++++++++++
 srcpkgs/mozjs68/update                        |  1 +
 11 files changed, 222 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-remove-rustc-check.patch
 create mode 100644 srcpkgs/mozjs68/patches/005-fix-musl-build.patch
 create mode 100644 srcpkgs/mozjs68/patches/006-spidermonkey-checks-disable.patch
 create mode 100644 srcpkgs/mozjs68/patches/007-mozjs68.pc-honor-sysroot.patch
 create mode 100644 srcpkgs/mozjs68/template
 create mode 100644 srcpkgs/mozjs68/update

diff --git a/common/shlibs b/common/shlibs
index fa8af66f925..ed128ae0746 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3453,6 +3453,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.7.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 <Marc-Antoine@Perennou.com>
+Date: Wed, 5 Sep 2018 15:05:24 +0200
+Subject: [PATCH] silence sandbox violations
+
+Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
+---
+ 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 <sys/user.h>
diff --git a/srcpkgs/mozjs68/patches/004-remove-rustc-check.patch b/srcpkgs/mozjs68/patches/004-remove-rustc-check.patch
new file mode 100644
index 00000000000..0ca976cac6c
--- /dev/null
+++ b/srcpkgs/mozjs68/patches/004-remove-rustc-check.patch
@@ -0,0 +1,43 @@
+"Taken from firefox-esr"
+Mozilla rustc check does not support crossbuild: let's remove it
+Remove calls to unwrap_rustup, they fail if rustup isn't present
+
+--- a/build/moz.configure/rust.configure	2019-07-06 03:48:30.000000000 +0200
++++ b/build/moz.configure/rust.configure	2019-07-09 22:35:23.326851798 +0200
+@@ -79,9 +79,6 @@
+ 
+     return unwrap
+ 
+-rustc = unwrap_rustup(rustc, 'rustc')
+-cargo = unwrap_rustup(cargo, 'cargo')
+-
+ 
+ set_config('CARGO', cargo)
+ set_config('RUSTC', rustc)
+@@ -294,26 +291,6 @@
+ 
+             os.write(in_fd, source)
+             os.close(in_fd)
+-
+-            cmd = [
+-                rustc,
+-                '--crate-type', 'staticlib',
+-                target_arg,
+-                '-o', out_path,
+-                in_path,
+-            ]
+-
+-            def failed():
+-                die(dedent('''\
+-                Cannot compile for {} with {}
+-                The target may be unsupported, or you may not have
+-                a rust std library for that target installed. Try:
+-
+-                  rustup target add {}
+-                '''.format(host_or_target.alias, rustc, rustc_target.alias)))
+-            check_cmd_output(*cmd, onerror=failed)
+-            if not os.path.exists(out_path) or os.path.getsize(out_path) == 0:
+-                failed()
+         finally:
+             os.remove(in_path)
+             os.remove(out_path)
diff --git a/srcpkgs/mozjs68/patches/005-fix-musl-build.patch b/srcpkgs/mozjs68/patches/005-fix-musl-build.patch
new file mode 100644
index 00000000000..f629fa2ac35
--- /dev/null
+++ b/srcpkgs/mozjs68/patches/005-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/006-spidermonkey-checks-disable.patch b/srcpkgs/mozjs68/patches/006-spidermonkey-checks-disable.patch
new file mode 100644
index 00000000000..f6eababd1f2
--- /dev/null
+++ b/srcpkgs/mozjs68/patches/006-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/007-mozjs68.pc-honor-sysroot.patch b/srcpkgs/mozjs68/patches/007-mozjs68.pc-honor-sysroot.patch
new file mode 100644
index 00000000000..71214b8eccf
--- /dev/null
+++ b/srcpkgs/mozjs68/patches/007-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/template b/srcpkgs/mozjs68/template
new file mode 100644
index 00000000000..1165113c430
--- /dev/null
+++ b/srcpkgs/mozjs68/template
@@ -0,0 +1,72 @@
+# Template file for 'mozjs68'
+pkgname=mozjs68
+version=68.7.0
+revision=1
+wrksrc="firefox-${version}"
+build_wrksrc=js/src
+build_style=gnu-configure
+build_helper="rust"
+hostmakedepends="perl python pkg-config automake autoconf213 autoconf-archive
+ which rust cargo clang python3 llvm9"
+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 (68.x series)"
+maintainer="Enno Boland <gottox@voidlinux.org>"
+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=ad3ea069c3d23aab360ad04ff4d0f5e556d3538f7dd4eae0690c4e9241537570
+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'

From 08913b4fbe78e99536408bdb7cbd14fab519b5fe Mon Sep 17 00:00:00 2001
From: Lorem <notloremipsum@protonmail.com>
Date: Thu, 7 May 2020 14:06:06 +0530
Subject: [PATCH 2/2] gjs: update to 1.65.2.

---
 common/shlibs        |  2 +-
 srcpkgs/gjs/template | 21 ++++++---------------
 2 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index ed128ae0746..0e25d0f4a2c 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -830,7 +830,7 @@ libtotem.so.0 libtotem-3.6.2_1
 libclutter-1.0.so.0 clutter-1.14.0_1
 libavfs.so.0 libavfs-1.0.5_1
 libdmr.so.0.1 deepin-movie-reborn-3.2.5_1
-libgjs.so.0 gjs-1.63.3_1
+libgjs.so.0 gjs-1.65.2_1
 libgjs-gi.so gjs-1.63.3_1
 libgjs-dbus.so.0 gjs-1.63.3_1
 libtelepathy-glib.so.0 telepathy-glib-0.15.5_1
diff --git a/srcpkgs/gjs/template b/srcpkgs/gjs/template
index 956fb9d28be..ec48baddf11 100644
--- a/srcpkgs/gjs/template
+++ b/srcpkgs/gjs/template
@@ -1,36 +1,27 @@
 # Template file for 'gjs'
 pkgname=gjs
-version=1.63.3
-revision=2
+version=1.65.2
+revision=1
 build_style=meson
 build_helper="gir qemu"
 configure_args="-Dskip_dbus_tests=true -Dskip_gtk_tests=true
- -Dprofiler=disabled" # Disable test because they need X and GTK.
+ -Dprofiler=disabled -Dinstalled_tests=false" # Disable tests because they need dbus, X and GTK.
 hostmakedepends="glib-devel pkg-config"
-makedepends="dbus-glib-devel mozjs60-devel readline-devel sysprof-devel"
+makedepends="dbus-glib-devel mozjs68-devel readline-devel sysprof-devel"
 short_desc="Mozilla-based javascript bindings for the GNOME platform"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="MIT, LGPL-2.0-or-later"
 homepage="https://wiki.gnome.org/action/show/Projects/Gjs"
 changelog="https://gitlab.gnome.org/GNOME/gjs/blob/gnome-3-30/NEWS"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=09f232c20e986c368e93394b2c10dc21b6fedacfff7de926f0b221ea5b933b5f
-
-pre_configure() {
-	if [ "$CROSS_BUILD" ]; then
-		vsed -i meson.build -e"/subdir('installed-tests')/d"
-	fi
-	if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-		grep -rlw "<sys/signal.h>" | xargs sed -i -e"s;<sys/signal.h>;<signal.h>;"
-	fi
-}
+checksum=a66edad8a5f10027f9b182d88af84b81f13e5ad5840319cfa747d66e77e0214f
 
 post_install() {
 	vlicense COPYING
 }
 
 gjs-devel_package() {
-	depends="libgirepository-devel mozjs60-devel ${sourcepkg}>=${version}_${revision}"
+	depends="libgirepository-devel mozjs68-devel ${sourcepkg}>=${version}_${revision}"
 	short_desc+=" - development files"
 	pkg_install() {
 		vmove usr/include

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [WIP][Help Needed] Update gjs to 1.65.2.
  2020-05-07  9:40 [PR PATCH] [WIP][Help Needed] Update gjs to 1.65.2 not-chicken
                   ` (5 preceding siblings ...)
  2020-05-08  9:24 ` [PR PATCH] [Updated] " not-chicken
@ 2020-05-08 15:13 ` toluschr
  2020-05-08 15:21 ` toluschr
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: toluschr @ 2020-05-08 15:13 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 517 bytes --]

New comment by toluschr on void-packages repository

https://github.com/void-linux/void-packages/pull/21716#issuecomment-625863855

Comment:
![17:05:09](https://user-images.githubusercontent.com/44272603/81419194-2b690180-914e-11ea-8810-867250ee80c9.png)

Compiles ans works fine!

Cloned using `git pull origin pull/21382/head pull/20413/head pull/21716/head`
Resolved merge conflicts (`srcpkgs/mutter/template`)
```
version=3.36.2
revision=1
```
and removed ` srcpkgs/mutter/patches/pipewire-0.3.patch`


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [WIP][Help Needed] Update gjs to 1.65.2.
  2020-05-07  9:40 [PR PATCH] [WIP][Help Needed] Update gjs to 1.65.2 not-chicken
                   ` (6 preceding siblings ...)
  2020-05-08 15:13 ` toluschr
@ 2020-05-08 15:21 ` toluschr
  2020-05-09  1:12 ` [PR PATCH] [Updated] " not-chicken
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: toluschr @ 2020-05-08 15:21 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 517 bytes --]

New comment by toluschr on void-packages repository

https://github.com/void-linux/void-packages/pull/21716#issuecomment-625863855

Comment:
![17:05:09](https://user-images.githubusercontent.com/44272603/81419194-2b690180-914e-11ea-8810-867250ee80c9.png)

Compiles ans works fine!

Cloned using `git pull origin pull/21382/head pull/20413/head pull/21716/head`
Resolved merge conflicts (`srcpkgs/mutter/template`)
```
version=3.36.2
revision=1
```
and removed ` srcpkgs/mutter/patches/pipewire-0.3.patch`


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PR PATCH] [Updated] [WIP][Help Needed] Update gjs to 1.65.2.
  2020-05-07  9:40 [PR PATCH] [WIP][Help Needed] Update gjs to 1.65.2 not-chicken
                   ` (7 preceding siblings ...)
  2020-05-08 15:21 ` toluschr
@ 2020-05-09  1:12 ` not-chicken
  2020-05-09  1:15 ` not-chicken
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: not-chicken @ 2020-05-09  1:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 712 bytes --]

There is an updated pull request by not-chicken against master on the void-packages repository

https://github.com/not-chicken/void-packages gjs
https://github.com/void-linux/void-packages/pull/21716

[WIP][Help Needed] Update gjs to 1.65.2.
Needed for #21382 

Compilation tested: 

- x86_64
- i686
- armv6l-musl
- armv7l
- aarch64

Runtime: 
- x86_64 - gnome-shell 3.36.2 seems to run fine.

Edit: I underestimated travis I guess. It's able to build this fine.

Patched up to disable spidermonkey checks for now. 
https://src.fedoraproject.org/rpms/mozjs68/blob/master/f/mozjs68.spec#_51

CC @Gottox 

A patch file from https://github.com/void-linux/void-packages/pull/21716.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gjs-21716.patch --]
[-- Type: text/x-diff, Size: 18148 bytes --]

From 7da63031015c235f35090e376a2d67f7baae7d65 Mon Sep 17 00:00:00 2001
From: Lorem <notloremipsum@protonmail.com>
Date: Thu, 7 May 2020 14:02:39 +0530
Subject: [PATCH 1/2] New package: mozjs68-68.8.0

---
 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 ++++
 .../patches/004-remove-rustc-check.patch      | 43 +++++++++++
 .../mozjs68/patches/005-fix-musl-build.patch  | 17 +++++
 .../006-spidermonkey-checks-disable.patch     | 12 +++
 .../007-mozjs68.pc-honor-sysroot.patch        | 10 +++
 ...sed-LLVM-and-Rust-build-dependencies.patch | 74 +++++++++++++++++++
 srcpkgs/mozjs68/template                      | 71 ++++++++++++++++++
 srcpkgs/mozjs68/update                        |  1 +
 12 files changed, 295 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-remove-rustc-check.patch
 create mode 100644 srcpkgs/mozjs68/patches/005-fix-musl-build.patch
 create mode 100644 srcpkgs/mozjs68/patches/006-spidermonkey-checks-disable.patch
 create mode 100644 srcpkgs/mozjs68/patches/007-mozjs68.pc-honor-sysroot.patch
 create mode 100644 srcpkgs/mozjs68/patches/008-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 fa8af66f925..3362dd3c0ed 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3453,6 +3453,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 <Marc-Antoine@Perennou.com>
+Date: Wed, 5 Sep 2018 15:05:24 +0200
+Subject: [PATCH] silence sandbox violations
+
+Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
+---
+ 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 <sys/user.h>
diff --git a/srcpkgs/mozjs68/patches/004-remove-rustc-check.patch b/srcpkgs/mozjs68/patches/004-remove-rustc-check.patch
new file mode 100644
index 00000000000..0ca976cac6c
--- /dev/null
+++ b/srcpkgs/mozjs68/patches/004-remove-rustc-check.patch
@@ -0,0 +1,43 @@
+"Taken from firefox-esr"
+Mozilla rustc check does not support crossbuild: let's remove it
+Remove calls to unwrap_rustup, they fail if rustup isn't present
+
+--- a/build/moz.configure/rust.configure	2019-07-06 03:48:30.000000000 +0200
++++ b/build/moz.configure/rust.configure	2019-07-09 22:35:23.326851798 +0200
+@@ -79,9 +79,6 @@
+ 
+     return unwrap
+ 
+-rustc = unwrap_rustup(rustc, 'rustc')
+-cargo = unwrap_rustup(cargo, 'cargo')
+-
+ 
+ set_config('CARGO', cargo)
+ set_config('RUSTC', rustc)
+@@ -294,26 +291,6 @@
+ 
+             os.write(in_fd, source)
+             os.close(in_fd)
+-
+-            cmd = [
+-                rustc,
+-                '--crate-type', 'staticlib',
+-                target_arg,
+-                '-o', out_path,
+-                in_path,
+-            ]
+-
+-            def failed():
+-                die(dedent('''\
+-                Cannot compile for {} with {}
+-                The target may be unsupported, or you may not have
+-                a rust std library for that target installed. Try:
+-
+-                  rustup target add {}
+-                '''.format(host_or_target.alias, rustc, rustc_target.alias)))
+-            check_cmd_output(*cmd, onerror=failed)
+-            if not os.path.exists(out_path) or os.path.getsize(out_path) == 0:
+-                failed()
+         finally:
+             os.remove(in_path)
+             os.remove(out_path)
diff --git a/srcpkgs/mozjs68/patches/005-fix-musl-build.patch b/srcpkgs/mozjs68/patches/005-fix-musl-build.patch
new file mode 100644
index 00000000000..f629fa2ac35
--- /dev/null
+++ b/srcpkgs/mozjs68/patches/005-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/006-spidermonkey-checks-disable.patch b/srcpkgs/mozjs68/patches/006-spidermonkey-checks-disable.patch
new file mode 100644
index 00000000000..f6eababd1f2
--- /dev/null
+++ b/srcpkgs/mozjs68/patches/006-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/007-mozjs68.pc-honor-sysroot.patch b/srcpkgs/mozjs68/patches/007-mozjs68.pc-honor-sysroot.patch
new file mode 100644
index 00000000000..71214b8eccf
--- /dev/null
+++ b/srcpkgs/mozjs68/patches/007-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/008-Remove-unused-LLVM-and-Rust-build-dependencies.patch b/srcpkgs/mozjs68/patches/008-Remove-unused-LLVM-and-Rust-build-dependencies.patch
new file mode 100644
index 00000000000..b1c7782adbf
--- /dev/null
+++ b/srcpkgs/mozjs68/patches/008-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 <glaubitz@physik.fu-berlin.de>
+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 <gottox@voidlinux.org>"
+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'

From 271486b55955c9678c0561086b7b2f1740cdf8ad Mon Sep 17 00:00:00 2001
From: Lorem <notloremipsum@protonmail.com>
Date: Thu, 7 May 2020 14:06:06 +0530
Subject: [PATCH 2/2] gjs: update to 1.65.2.

---
 common/shlibs        |  2 +-
 srcpkgs/gjs/template | 21 ++++++---------------
 2 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 3362dd3c0ed..d673589d6b9 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -830,7 +830,7 @@ libtotem.so.0 libtotem-3.6.2_1
 libclutter-1.0.so.0 clutter-1.14.0_1
 libavfs.so.0 libavfs-1.0.5_1
 libdmr.so.0.1 deepin-movie-reborn-3.2.5_1
-libgjs.so.0 gjs-1.63.3_1
+libgjs.so.0 gjs-1.65.2_1
 libgjs-gi.so gjs-1.63.3_1
 libgjs-dbus.so.0 gjs-1.63.3_1
 libtelepathy-glib.so.0 telepathy-glib-0.15.5_1
diff --git a/srcpkgs/gjs/template b/srcpkgs/gjs/template
index 956fb9d28be..ec48baddf11 100644
--- a/srcpkgs/gjs/template
+++ b/srcpkgs/gjs/template
@@ -1,36 +1,27 @@
 # Template file for 'gjs'
 pkgname=gjs
-version=1.63.3
-revision=2
+version=1.65.2
+revision=1
 build_style=meson
 build_helper="gir qemu"
 configure_args="-Dskip_dbus_tests=true -Dskip_gtk_tests=true
- -Dprofiler=disabled" # Disable test because they need X and GTK.
+ -Dprofiler=disabled -Dinstalled_tests=false" # Disable tests because they need dbus, X and GTK.
 hostmakedepends="glib-devel pkg-config"
-makedepends="dbus-glib-devel mozjs60-devel readline-devel sysprof-devel"
+makedepends="dbus-glib-devel mozjs68-devel readline-devel sysprof-devel"
 short_desc="Mozilla-based javascript bindings for the GNOME platform"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="MIT, LGPL-2.0-or-later"
 homepage="https://wiki.gnome.org/action/show/Projects/Gjs"
 changelog="https://gitlab.gnome.org/GNOME/gjs/blob/gnome-3-30/NEWS"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=09f232c20e986c368e93394b2c10dc21b6fedacfff7de926f0b221ea5b933b5f
-
-pre_configure() {
-	if [ "$CROSS_BUILD" ]; then
-		vsed -i meson.build -e"/subdir('installed-tests')/d"
-	fi
-	if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-		grep -rlw "<sys/signal.h>" | xargs sed -i -e"s;<sys/signal.h>;<signal.h>;"
-	fi
-}
+checksum=a66edad8a5f10027f9b182d88af84b81f13e5ad5840319cfa747d66e77e0214f
 
 post_install() {
 	vlicense COPYING
 }
 
 gjs-devel_package() {
-	depends="libgirepository-devel mozjs60-devel ${sourcepkg}>=${version}_${revision}"
+	depends="libgirepository-devel mozjs68-devel ${sourcepkg}>=${version}_${revision}"
 	short_desc+=" - development files"
 	pkg_install() {
 		vmove usr/include

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [WIP][Help Needed] Update gjs to 1.65.2.
  2020-05-07  9:40 [PR PATCH] [WIP][Help Needed] Update gjs to 1.65.2 not-chicken
                   ` (8 preceding siblings ...)
  2020-05-09  1:12 ` [PR PATCH] [Updated] " not-chicken
@ 2020-05-09  1:15 ` not-chicken
  2020-05-09  2:17 ` sgn
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: not-chicken @ 2020-05-09  1:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 241 bytes --]

New comment by not-chicken on void-packages repository

https://github.com/void-linux/void-packages/pull/21716#issuecomment-626081714

Comment:
- Updated mozjs to 68.8.0
- Added patch from openSUSE to remove unnecessary build dependencies.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [WIP][Help Needed] Update gjs to 1.65.2.
  2020-05-07  9:40 [PR PATCH] [WIP][Help Needed] Update gjs to 1.65.2 not-chicken
                   ` (9 preceding siblings ...)
  2020-05-09  1:15 ` not-chicken
@ 2020-05-09  2:17 ` sgn
  2020-05-09  2:18 ` sgn
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: sgn @ 2020-05-09  2:17 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 199 bytes --]

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/21716#issuecomment-626089776

Comment:
I tested with mozjs68-68.7.0

Works fine with current GNOME.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [WIP][Help Needed] Update gjs to 1.65.2.
  2020-05-07  9:40 [PR PATCH] [WIP][Help Needed] Update gjs to 1.65.2 not-chicken
                   ` (10 preceding siblings ...)
  2020-05-09  2:17 ` sgn
@ 2020-05-09  2:18 ` sgn
  2020-05-09  2:19 ` sgn
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: sgn @ 2020-05-09  2:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 266 bytes --]

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/21716#issuecomment-626089776

Comment:
I tested with mozjs68-68.7.0

Works fine with current GNOME.

If noone steps in and complains, I'll merge in end of Sunday ;)

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [WIP][Help Needed] Update gjs to 1.65.2.
  2020-05-07  9:40 [PR PATCH] [WIP][Help Needed] Update gjs to 1.65.2 not-chicken
                   ` (11 preceding siblings ...)
  2020-05-09  2:18 ` sgn
@ 2020-05-09  2:19 ` sgn
  2020-05-10 11:30 ` [PR PATCH] [Updated] " not-chicken
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: sgn @ 2020-05-09  2:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 282 bytes --]

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/21716#issuecomment-626089776

Comment:
I tested with mozjs68-68.7.0

Works fine with current GNOME.

If noone steps in and complains, please ping me for a merge in end of Sunday ;)

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PR PATCH] [Updated] [WIP][Help Needed] Update gjs to 1.65.2.
  2020-05-07  9:40 [PR PATCH] [WIP][Help Needed] Update gjs to 1.65.2 not-chicken
                   ` (12 preceding siblings ...)
  2020-05-09  2:19 ` sgn
@ 2020-05-10 11:30 ` not-chicken
  2020-05-10 12:28 ` not-chicken
  2020-05-14 14:51 ` [PR PATCH] [Closed]: " sgn
  15 siblings, 0 replies; 17+ messages in thread
From: not-chicken @ 2020-05-10 11:30 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 712 bytes --]

There is an updated pull request by not-chicken against master on the void-packages repository

https://github.com/not-chicken/void-packages gjs
https://github.com/void-linux/void-packages/pull/21716

[WIP][Help Needed] Update gjs to 1.65.2.
Needed for #21382 

Compilation tested: 

- x86_64
- i686
- armv6l-musl
- armv7l
- aarch64

Runtime: 
- x86_64 - gnome-shell 3.36.2 seems to run fine.

Edit: I underestimated travis I guess. It's able to build this fine.

Patched up to disable spidermonkey checks for now. 
https://src.fedoraproject.org/rpms/mozjs68/blob/master/f/mozjs68.spec#_51

CC @Gottox 

A patch file from https://github.com/void-linux/void-packages/pull/21716.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gjs-21716.patch --]
[-- Type: text/x-diff, Size: 16405 bytes --]

From 1396ef0ef8e18c5c904fbbe1b302a7e2aa5429ad Mon Sep 17 00:00:00 2001
From: Lorem <notloremipsum@protonmail.com>
Date: Thu, 7 May 2020 14:02:39 +0530
Subject: [PATCH 1/2] New package: mozjs68-68.8.0

---
 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 8342e117092..381e758c35a 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3454,6 +3454,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 <Marc-Antoine@Perennou.com>
+Date: Wed, 5 Sep 2018 15:05:24 +0200
+Subject: [PATCH] silence sandbox violations
+
+Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
+---
+ 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 <sys/user.h>
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 <glaubitz@physik.fu-berlin.de>
+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 <gottox@voidlinux.org>"
+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'

From 450d528f9a7ce788fea9e898f5ca470984aa64ac Mon Sep 17 00:00:00 2001
From: Lorem <notloremipsum@protonmail.com>
Date: Thu, 7 May 2020 14:06:06 +0530
Subject: [PATCH 2/2] gjs: update to 1.65.2.

---
 common/shlibs        |  4 +---
 srcpkgs/gjs/template | 21 ++++++---------------
 2 files changed, 7 insertions(+), 18 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 381e758c35a..02ffe39b4e5 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -830,9 +830,7 @@ libtotem.so.0 libtotem-3.6.2_1
 libclutter-1.0.so.0 clutter-1.14.0_1
 libavfs.so.0 libavfs-1.0.5_1
 libdmr.so.0.1 deepin-movie-reborn-3.2.5_1
-libgjs.so.0 gjs-1.63.3_1
-libgjs-gi.so gjs-1.63.3_1
-libgjs-dbus.so.0 gjs-1.63.3_1
+libgjs.so.0 gjs-1.65.2_1
 libtelepathy-glib.so.0 telepathy-glib-0.15.5_1
 libaccountsservice.so.0 accountsservice-0.6.4_1
 libfolks.so.25 folks-0.9.5_1
diff --git a/srcpkgs/gjs/template b/srcpkgs/gjs/template
index 956fb9d28be..ec48baddf11 100644
--- a/srcpkgs/gjs/template
+++ b/srcpkgs/gjs/template
@@ -1,36 +1,27 @@
 # Template file for 'gjs'
 pkgname=gjs
-version=1.63.3
-revision=2
+version=1.65.2
+revision=1
 build_style=meson
 build_helper="gir qemu"
 configure_args="-Dskip_dbus_tests=true -Dskip_gtk_tests=true
- -Dprofiler=disabled" # Disable test because they need X and GTK.
+ -Dprofiler=disabled -Dinstalled_tests=false" # Disable tests because they need dbus, X and GTK.
 hostmakedepends="glib-devel pkg-config"
-makedepends="dbus-glib-devel mozjs60-devel readline-devel sysprof-devel"
+makedepends="dbus-glib-devel mozjs68-devel readline-devel sysprof-devel"
 short_desc="Mozilla-based javascript bindings for the GNOME platform"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="MIT, LGPL-2.0-or-later"
 homepage="https://wiki.gnome.org/action/show/Projects/Gjs"
 changelog="https://gitlab.gnome.org/GNOME/gjs/blob/gnome-3-30/NEWS"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
-checksum=09f232c20e986c368e93394b2c10dc21b6fedacfff7de926f0b221ea5b933b5f
-
-pre_configure() {
-	if [ "$CROSS_BUILD" ]; then
-		vsed -i meson.build -e"/subdir('installed-tests')/d"
-	fi
-	if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-		grep -rlw "<sys/signal.h>" | xargs sed -i -e"s;<sys/signal.h>;<signal.h>;"
-	fi
-}
+checksum=a66edad8a5f10027f9b182d88af84b81f13e5ad5840319cfa747d66e77e0214f
 
 post_install() {
 	vlicense COPYING
 }
 
 gjs-devel_package() {
-	depends="libgirepository-devel mozjs60-devel ${sourcepkg}>=${version}_${revision}"
+	depends="libgirepository-devel mozjs68-devel ${sourcepkg}>=${version}_${revision}"
 	short_desc+=" - development files"
 	pkg_install() {
 		vmove usr/include

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Update gjs to 1.65.2.
  2020-05-07  9:40 [PR PATCH] [WIP][Help Needed] Update gjs to 1.65.2 not-chicken
                   ` (13 preceding siblings ...)
  2020-05-10 11:30 ` [PR PATCH] [Updated] " not-chicken
@ 2020-05-10 12:28 ` not-chicken
  2020-05-14 14:51 ` [PR PATCH] [Closed]: " sgn
  15 siblings, 0 replies; 17+ messages in thread
From: not-chicken @ 2020-05-10 12:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 290 bytes --]

New comment by not-chicken on void-packages repository

https://github.com/void-linux/void-packages/pull/21716#issuecomment-626320758

Comment:
> If noone steps in and complains, please ping me for a merge in end of Sunday ;)

Latest push passed the CI as well. I think it's ready to go!

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PR PATCH] [Closed]: Update gjs to 1.65.2.
  2020-05-07  9:40 [PR PATCH] [WIP][Help Needed] Update gjs to 1.65.2 not-chicken
                   ` (14 preceding siblings ...)
  2020-05-10 12:28 ` not-chicken
@ 2020-05-14 14:51 ` sgn
  15 siblings, 0 replies; 17+ messages in thread
From: sgn @ 2020-05-14 14:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 533 bytes --]

There's a closed pull request on the void-packages repository

Update gjs to 1.65.2.
https://github.com/void-linux/void-packages/pull/21716

Description:
Needed for #21382 

Compilation tested: 

- x86_64
- i686
- armv6l-musl
- armv7l
- aarch64

Runtime: 
- x86_64 - gnome-shell 3.36.2 seems to run fine.

Edit: I underestimated travis I guess. It's able to build this fine.

Patched up to disable spidermonkey checks for now. 
https://src.fedoraproject.org/rpms/mozjs68/blob/master/f/mozjs68.spec#_51

CC @Gottox 

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2020-05-14 14:51 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-07  9:40 [PR PATCH] [WIP][Help Needed] Update gjs to 1.65.2 not-chicken
2020-05-07 13:00 ` sgn
2020-05-07 13:40 ` [PR PATCH] [Updated] " not-chicken
2020-05-07 13:42 ` not-chicken
2020-05-07 14:35 ` [PR PATCH] [Updated] " not-chicken
2020-05-07 14:41 ` not-chicken
2020-05-08  9:24 ` [PR PATCH] [Updated] " not-chicken
2020-05-08 15:13 ` toluschr
2020-05-08 15:21 ` toluschr
2020-05-09  1:12 ` [PR PATCH] [Updated] " not-chicken
2020-05-09  1:15 ` not-chicken
2020-05-09  2:17 ` sgn
2020-05-09  2:18 ` sgn
2020-05-09  2:19 ` sgn
2020-05-10 11:30 ` [PR PATCH] [Updated] " not-chicken
2020-05-10 12:28 ` not-chicken
2020-05-14 14:51 ` [PR PATCH] [Closed]: " sgn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).