From acd46e2002d6f40bf6dd6ab49a63a68f720ab45dc347b502097f67d98984f016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Lie?= Date: Tue, 8 Feb 2022 11:07:05 +0000 Subject: [PATCH] Accepting request 952635 from GNOME:Next - Update to version 1.70.1: + Build and crash fixes backported from the development branch. + Closed bugs and merge requests: - Handle optional out parameters in callbacks - Link fails on Debian armel|mipsel|powerpc: needs more -latomic - gjs/jsapi-util.cpp: fix build on gcc-12 - Drop patches fixed upstream: + b9e122044a7ccc1e2a3374c680b6ea82066bfa59.patch + 62025d4a2738a36ea5f1a7cebef08b22b5eef613.patch OBS-URL: https://build.opensuse.org/request/show/952635 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gjs?expand=0&rev=204 --- ...5d4a2738a36ea5f1a7cebef08b22b5eef613.patch | 106 ------------------ ...22044a7ccc1e2a3374c680b6ea82066bfa59.patch | 27 ----- gjs-1.70.0.tar.xz | 3 - gjs-1.70.1.tar.xz | 3 + gjs.changes | 14 +++ gjs.spec | 8 +- 6 files changed, 19 insertions(+), 142 deletions(-) delete mode 100644 62025d4a2738a36ea5f1a7cebef08b22b5eef613.patch delete mode 100644 b9e122044a7ccc1e2a3374c680b6ea82066bfa59.patch delete mode 100644 gjs-1.70.0.tar.xz create mode 100644 gjs-1.70.1.tar.xz diff --git a/62025d4a2738a36ea5f1a7cebef08b22b5eef613.patch b/62025d4a2738a36ea5f1a7cebef08b22b5eef613.patch deleted file mode 100644 index bf44c68..0000000 --- a/62025d4a2738a36ea5f1a7cebef08b22b5eef613.patch +++ /dev/null @@ -1,106 +0,0 @@ -From 62025d4a2738a36ea5f1a7cebef08b22b5eef613 Mon Sep 17 00:00:00 2001 -From: Evan Welsh -Date: Fri, 24 Sep 2021 22:17:04 +0000 -Subject: [PATCH] Handle optional out parameters in callbacks - -Fixes #439 ---- - gi/arg.cpp | 26 ++++++++++++++++++++------ - gi/arg.h | 6 ++---- - gi/function.cpp | 14 ++++++++------ - 3 files changed, 30 insertions(+), 16 deletions(-) - -diff --git a/gi/arg.cpp b/gi/arg.cpp -index 0b8af141..49f36d76 100644 ---- a/gi/arg.cpp -+++ b/gi/arg.cpp -@@ -1861,17 +1861,31 @@ void gjs_gi_argument_init_default(GITypeInfo* type_info, GIArgument* arg) { - } - } - --bool --gjs_value_to_arg(JSContext *context, -- JS::HandleValue value, -- GIArgInfo *arg_info, -- GIArgument *arg) --{ -+bool gjs_value_to_callback_out_arg(JSContext* context, JS::HandleValue value, -+ GIArgInfo* arg_info, GIArgument* arg) { -+ GIDirection direction [[maybe_unused]] = g_arg_info_get_direction(arg_info); -+ g_assert( -+ (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) && -+ "gjs_value_to_callback_out_arg does not handle in arguments."); -+ - GjsArgumentFlags flags = GjsArgumentFlags::NONE; - GITypeInfo type_info; - - g_arg_info_load_type(arg_info, &type_info); - -+ // If the argument is optional and we're passed nullptr, -+ // ignore the GJS value. -+ if (g_arg_info_is_optional(arg_info) && !arg) -+ return true; -+ -+ // Otherwise, throw an error to prevent a segfault. -+ if (!arg) { -+ gjs_throw(context, -+ "Return value %s is not optional but was passed NULL", -+ g_base_info_get_name(arg_info)); -+ return false; -+ } -+ - if (g_arg_info_may_be_null(arg_info)) - flags |= GjsArgumentFlags::MAY_BE_NULL; - if (g_arg_info_is_caller_allocates(arg_info)) -diff --git a/gi/arg.h b/gi/arg.h -index c81c2979..c5c81760 100644 ---- a/gi/arg.h -+++ b/gi/arg.h -@@ -44,10 +44,8 @@ enum class GjsArgumentFlags : uint8_t { - GjsArgumentType arg_type); - - GJS_JSAPI_RETURN_CONVENTION --bool gjs_value_to_arg(JSContext *context, -- JS::HandleValue value, -- GIArgInfo *arg_info, -- GIArgument *arg); -+bool gjs_value_to_callback_out_arg(JSContext* context, JS::HandleValue value, -+ GIArgInfo* arg_info, GIArgument* arg); - - GJS_JSAPI_RETURN_CONVENTION - bool gjs_array_to_explicit_array(JSContext* cx, JS::HandleValue value, -diff --git a/gi/function.cpp b/gi/function.cpp -index 25fea26f..da060607 100644 ---- a/gi/function.cpp -+++ b/gi/function.cpp -@@ -532,9 +532,10 @@ bool GjsCallbackTrampoline::callback_closure_inner( - if (g_arg_info_get_direction(&arg_info) == GI_DIRECTION_IN) - continue; - -- if (!gjs_value_to_arg(context, rval, &arg_info, -- get_argument_for_arg_info(&arg_info, args, -- i + c_args_offset))) -+ if (!gjs_value_to_callback_out_arg( -+ context, rval, &arg_info, -+ get_argument_for_arg_info(&arg_info, args, -+ i + c_args_offset))) - return false; - - break; -@@ -587,9 +588,10 @@ bool GjsCallbackTrampoline::callback_closure_inner( - if (!JS_GetElement(context, out_array, elem_idx, &elem)) - return false; - -- if (!gjs_value_to_arg(context, elem, &arg_info, -- get_argument_for_arg_info(&arg_info, args, -- i + c_args_offset))) -+ if (!gjs_value_to_callback_out_arg( -+ context, elem, &arg_info, -+ get_argument_for_arg_info(&arg_info, args, -+ i + c_args_offset))) - return false; - - elem_idx++; --- -GitLab - diff --git a/b9e122044a7ccc1e2a3374c680b6ea82066bfa59.patch b/b9e122044a7ccc1e2a3374c680b6ea82066bfa59.patch deleted file mode 100644 index 38ca34b..0000000 --- a/b9e122044a7ccc1e2a3374c680b6ea82066bfa59.patch +++ /dev/null @@ -1,27 +0,0 @@ -From b9e122044a7ccc1e2a3374c680b6ea82066bfa59 Mon Sep 17 00:00:00 2001 -From: Evan Miller -Date: Sun, 12 Sep 2021 15:22:22 -0400 -Subject: [PATCH] arg: Replace gsize with size_t - -This is causing problems on 32-bit ppc architecture; see -https://gitlab.gnome.org/GNOME/glib/-/issues/2493 ---- - gi/arg.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gi/arg.cpp b/gi/arg.cpp -index cff40e10..0b8af141 100644 ---- a/gi/arg.cpp -+++ b/gi/arg.cpp -@@ -1706,7 +1706,7 @@ bool gjs_value_to_g_argument(JSContext* context, JS::HandleValue value, - - case GI_TYPE_TAG_ARRAY: { - GjsAutoPointer data; -- gsize length; -+ size_t length; - GIArrayType array_type = g_type_info_get_array_type(type_info); - - /* First, let's handle the case where we're passed an instance --- -GitLab - diff --git a/gjs-1.70.0.tar.xz b/gjs-1.70.0.tar.xz deleted file mode 100644 index 6c853e9..0000000 --- a/gjs-1.70.0.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4b0629341a318a02374e113ab97f9a9f3325423269fc1e0b043a5ffb01861c5f -size 595292 diff --git a/gjs-1.70.1.tar.xz b/gjs-1.70.1.tar.xz new file mode 100644 index 0000000..d96528c --- /dev/null +++ b/gjs-1.70.1.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bbdc0eec7cf25fbc534769f6a1fb2c7a18e17b871efdb0ca58e9abf08b28003f +size 598444 diff --git a/gjs.changes b/gjs.changes index 4d7de00..7b729c5 100644 --- a/gjs.changes +++ b/gjs.changes @@ -1,3 +1,17 @@ +------------------------------------------------------------------- +Tue Feb 8 09:07:55 UTC 2022 - Bjørn Lie + +- Update to version 1.70.1: + + Build and crash fixes backported from the development branch. + + Closed bugs and merge requests: + - Handle optional out parameters in callbacks + - Link fails on Debian armel|mipsel|powerpc: needs more + -latomic + - gjs/jsapi-util.cpp: fix build on gcc-12 +- Drop patches fixed upstream: + + b9e122044a7ccc1e2a3374c680b6ea82066bfa59.patch + + 62025d4a2738a36ea5f1a7cebef08b22b5eef613.patch + ------------------------------------------------------------------- Mon Oct 4 17:12:28 UTC 2021 - Bjørn Lie diff --git a/gjs.spec b/gjs.spec index 8f769bd..5629e02 100644 --- a/gjs.spec +++ b/gjs.spec @@ -1,7 +1,7 @@ # # spec file for package gjs # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,17 +17,13 @@ Name: gjs -Version: 1.70.0 +Version: 1.70.1 Release: 0 Summary: JavaScript bindings based on gobject-introspection and Mozilla License: LGPL-2.0-or-later AND MIT Group: Development/Libraries/GNOME URL: https://wiki.gnome.org/Projects/Gjs Source0: https://download.gnome.org/sources/gjs/1.70/%{name}-%{version}.tar.xz -# PATCH-FIX-UPSTREAM b9e122044a7ccc1e2a3374c680b6ea82066bfa59.patch -- arg: Replace gsize with size_t -Patch0: b9e122044a7ccc1e2a3374c680b6ea82066bfa59.patch -# PATCH-FIX-UPSTREAM 62025d4a2738a36ea5f1a7cebef08b22b5eef613.patch -- Handle optional out parameters in callbacks -Patch1: 62025d4a2738a36ea5f1a7cebef08b22b5eef613.patch BuildRequires: c++_compiler BuildRequires: git