gjs: upgrade 1.58.8 -> 1.70.0

License checked: Still MIT and LGPLv2+

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Andreas Müller
2021-11-01 12:49:15 +01:00
committed by Khem Raj
parent 2a254bc827
commit 94f5b82c42
6 changed files with 122 additions and 152 deletions
@@ -1,33 +0,0 @@
From 95379de2132786f855e8caec1fd5869225774d02 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
Date: Sat, 18 May 2019 01:14:07 +0200
Subject: [PATCH] Disable tests on host
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Upstream-Status: Inappropriate [OE-specific]
Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
---
configure.ac | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac
index fa4e136..056e96e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -335,9 +335,7 @@ AS_IF([test "x$with_dbus_tests" != "xno"], [
])
AM_CONDITIONAL([DBUS_TESTS], [test "x$with_dbus_tests" != "xno"])
-AC_MSG_CHECKING([for a suitable UTF-8 locale to run the tests in])
-TESTS_LOCALE=$($srcdir/build/choose-tests-locale.sh)
-AC_MSG_RESULT([$TESTS_LOCALE])
+TESTS_LOCALE=C
AC_SUBST([TESTS_LOCALE])
AC_SUBST([gjsjsdir], [\${datadir}/gjs-1.0])
--
2.20.1
@@ -0,0 +1,50 @@
From 550e98013b0e003c1a6771d8e811375913adf16b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
Date: Wed, 27 Oct 2021 20:18:47 +0200
Subject: [PATCH] Support cross builds a bit better
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* Do not build/run mozjs-linked program
* Do not try to run test applications
Upstream-Status: Submitted[https://gitlab.gnome.org/GNOME/gjs/-/merge_requests/690]
Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
---
meson.build | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index dfcc2c3..192b1b5 100644
--- a/meson.build
+++ b/meson.build
@@ -234,6 +234,7 @@ release builds of SpiderMonkey. Try configuring SpiderMonkey with
--disable-debug.''')
endif
+if not meson.is_cross_build()
# Check if a minimal SpiderMonkey program compiles, links, and runs. If not,
# it's most likely the case that SpiderMonkey was configured incorrectly, for
# example by building mozglue as a shared library.
@@ -254,6 +255,7 @@ could not be compiled, linked, or run. Most likely you should build it with a
different configuration. Check the recommended configuration:
https://github.com/spidermonkey-embedders/spidermonkey-embedding-examples/blob/esr78/docs/Building%20SpiderMonkey.md''')
endif
+endif # not meson.is_cross_build()
have_printf_alternative_int = cc.compiles('''
#include <stdio.h>
@@ -662,7 +664,7 @@ endif
# Note: The test program in test/ needs to be ported
# to Windows before we can build it on Windows.
-if host_machine.system() != 'windows'
+if host_machine.system() != 'windows' and not meson.is_cross_build()
subdir('test')
endif
--
2.31.1
@@ -1,77 +0,0 @@
From dae0055be61937fe70252f3f4ee09b355aba2b8f Mon Sep 17 00:00:00 2001
From: Philip Chimento <philip.chimento@gmail.com>
Date: Sun, 14 Feb 2021 12:20:09 -0800
Subject: [PATCH] maint: Avoid g_once_init_enter error in GCC 11
On platforms where g_once_init_enter() is defined to use C11 atomic
builtins, passing a pointer to a volatile value is an error in GCC 11 and
later, in C++.
More info about the GCC change:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95378
https://gcc.gnu.org/pipermail/gcc-patches/2020-June/548283.html
However, it's my understanding that in modern C++ there is no longer a
need to guard the initialization of these variables. Since C++11, static
local variables in a function are guaranteed to be initialized only once,
the first time control passes through that function. So we can just remove
the g_once_init_enter guard.
More info:
https://en.cppreference.com/w/cpp/language/storage_duration#Static_local_variables
Stack Overflow answers with quotations from the C++ standard:
https://stackoverflow.com/a/58804/172999
https://stackoverflow.com/a/8102145/172999
Closes: #376
---
gjs/error-types.cpp | 32 +++++++++++++-------------------
1 file changed, 13 insertions(+), 19 deletions(-)
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/gjs/-/commit/f02eaf3a9d3465915eb849428c2d9615e2184a4c]
diff --git a/gjs/error-types.cpp b/gjs/error-types.cpp
index 86cb878..5eba61b 100644
--- a/gjs/error-types.cpp
+++ b/gjs/error-types.cpp
@@ -31,24 +31,18 @@ G_DEFINE_QUARK(gjs-js-error-quark, gjs_js_error)
// clang-format on
GType gjs_js_error_get_type(void) {
- static volatile GType g_type_id;
-
- if (g_once_init_enter(&g_type_id)) {
- static GEnumValue errors[] = {
- { GJS_JS_ERROR_ERROR, "Error", "error" },
- { GJS_JS_ERROR_EVAL_ERROR, "EvalError", "eval-error" },
- { GJS_JS_ERROR_INTERNAL_ERROR, "InternalError", "internal-error" },
- { GJS_JS_ERROR_RANGE_ERROR, "RangeError", "range-error" },
- { GJS_JS_ERROR_REFERENCE_ERROR, "ReferenceError", "reference-error" },
- { GJS_JS_ERROR_STOP_ITERATION, "StopIteration", "stop-iteration" },
- { GJS_JS_ERROR_SYNTAX_ERROR, "SyntaxError", "syntax-error" },
- { GJS_JS_ERROR_TYPE_ERROR, "TypeError", "type-error" },
- { GJS_JS_ERROR_URI_ERROR, "URIError", "uri-error" },
- { 0, nullptr, nullptr }
- };
-
- g_type_id = g_enum_register_static("GjsJSError", errors);
- }
-
+ static const GEnumValue errors[] = {
+ {GJS_JS_ERROR_ERROR, "Error", "error"},
+ {GJS_JS_ERROR_EVAL_ERROR, "EvalError", "eval-error"},
+ {GJS_JS_ERROR_INTERNAL_ERROR, "InternalError", "internal-error"},
+ {GJS_JS_ERROR_RANGE_ERROR, "RangeError", "range-error"},
+ {GJS_JS_ERROR_REFERENCE_ERROR, "ReferenceError", "reference-error"},
+ {GJS_JS_ERROR_STOP_ITERATION, "StopIteration", "stop-iteration"},
+ {GJS_JS_ERROR_SYNTAX_ERROR, "SyntaxError", "syntax-error"},
+ {GJS_JS_ERROR_TYPE_ERROR, "TypeError", "type-error"},
+ {GJS_JS_ERROR_URI_ERROR, "URIError", "uri-error"},
+ {0, nullptr, nullptr}};
+ // Initialization of static local variable guaranteed only once in C++11
+ static GType g_type_id = g_enum_register_static("GjsJSError", errors);
return g_type_id;
}
--
2.31.1
@@ -0,0 +1,34 @@
From 6a29818204e647d5fad68ed7ca8cac53d301cae6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
Date: Wed, 27 Oct 2021 20:04:02 +0200
Subject: [PATCH] meson.build: Do not add dir installed-tests when
installed_tests is false
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Upstream-Status: Submitted[https://gitlab.gnome.org/GNOME/gjs/-/merge_requests/690]
Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
---
meson.build | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 6878e2e..edbbf79 100644
--- a/meson.build
+++ b/meson.build
@@ -635,7 +635,9 @@ if not get_option('skip_gtk_tests')
have_gtk4 = dependency('gtk4', required: false).found()
endif
-subdir('installed-tests')
+if get_option('installed_tests')
+ subdir('installed-tests')
+endif
# Note: The test program in test/ needs to be ported
# to Windows before we can build it on Windows.
--
2.31.1
@@ -1,42 +0,0 @@
SUMMARY = "Javascript bindings for GNOME"
LICENSE = "MIT & LGPLv2+"
LIC_FILES_CHKSUM = " \
file://COPYING;md5=beb29cf17fabe736f0639b09ee6e76fa \
file://COPYING.LGPL;md5=3bf50002aefd002f49e7bb854063f7e7 \
"
GNOMEBASEBUILDCLASS = "autotools"
DEPENDS = "mozjs gtk+3"
inherit gnomebase gsettings gobject-introspection vala gettext features_check upstream-version-is-even pkgconfig
SRC_URI[archive.sha256sum] = "7fb3eb746c17363d9ee47f4a5d0bb048f0075611763eb0da11d85e0e57aff381"
SRC_URI += "file://0001-Disable-tests-on-host.patch \
file://0001-maint-Avoid-g_once_init_enter-error-in-GCC-11.patch \
"
# gobject-introspection is mandatory and cannot be configured
REQUIRED_DISTRO_FEATURES = "gobject-introspection-data"
UNKNOWN_CONFIGURE_WHITELIST:append = " --enable-introspection --disable-introspection"
EXTRA_OECONF = " \
--without-dbus-tests \
--disable-installed-tests \
"
do_configure:prepend() {
# make configure find gobject-introspection test code. Although we set
# --disable-installed-tests gjs builds them
sed -i 's|:$GI_DATADIR|:${STAGING_DIR_NATIVE}$GI_DATADIR|g' ${S}/configure.ac
}
FILES:${PN} += "${datadir}/gjs-1.0/lsan"
PACKAGES =+ "${PN}-valgrind"
FILES:${PN}-valgrind = "${datadir}/gjs-1.0/valgrind"
RDEPENDS:${PN}-valgrind += "valgrind"
# Valgrind not yet available on rv32/rv64
RDEPENDS:${PN}-valgrind:remove:riscv32 = "valgrind"
RDEPENDS:${PN}-valgrind:remove:riscv64 = "valgrind"
@@ -0,0 +1,38 @@
SUMMARY = "Javascript bindings for GNOME"
LICENSE = "MIT & LGPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=8dcea832f6acf45d856abfeb2d51ec48"
GNOMEBASEBUILDCLASS = "meson"
DEPENDS = "mozjs-78 gtk4"
inherit gnomebase gsettings gobject-introspection vala gettext features_check upstream-version-is-even pkgconfig
SRC_URI[archive.sha256sum] = "4b0629341a318a02374e113ab97f9a9f3325423269fc1e0b043a5ffb01861c5f"
SRC_URI += " \
file://0001-Support-cross-builds-a-bit-better.patch \
file://0002-meson.build-Do-not-add-dir-installed-tests-when-inst.patch \
"
# gobject-introspection is mandatory and cannot be configured
REQUIRED_DISTRO_FEATURES = "gobject-introspection-data"
UNKNOWN_CONFIGURE_WHITELIST:append = " introspection"
EXTRA_OEMESON = " \
-Dinstalled_tests=false \
-Dskip_dbus_tests=true \
"
LDFLAGS:append:mipsarch = " -latomic"
LDFLAGS:append:powerpc = " -latomic"
LDFLAGS:append:powerpc64 = " -latomic"
FILES:${PN} += "${datadir}/gjs-1.0/lsan"
PACKAGES =+ "${PN}-valgrind"
FILES:${PN}-valgrind = "${datadir}/gjs-1.0/valgrind"
RDEPENDS:${PN}-valgrind += "valgrind"
# Valgrind not yet available on rv32/rv64
RDEPENDS:${PN}-valgrind:remove:riscv32 = "valgrind"
RDEPENDS:${PN}-valgrind:remove:riscv64 = "valgrind"