Github messages for voidlinux
 help / color / mirror / Atom feed
From: not-chicken <not-chicken@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] [WIP][Help Needed] Update gjs to 1.65.2.
Date: Thu, 07 May 2020 15:40:55 +0200	[thread overview]
Message-ID: <20200507134055.64cziVU2AmsNFP6F2xadTPObVal87b-0LEe3zskcD5E@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-21716@inbox.vuxu.org>

[-- 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

  parent reply	other threads:[~2020-05-07 13:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-07  9:40 [PR PATCH] " not-chicken
2020-05-07 13:00 ` sgn
2020-05-07 13:40 ` not-chicken [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200507134055.64cziVU2AmsNFP6F2xadTPObVal87b-0LEe3zskcD5E@z \
    --to=not-chicken@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).