PolicyKit: Branch 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jan 27 10:16:34 UTC 2022


 .gitlab-ci.yml                                 |    2 +-
 Makefile.am                                    |    2 ++
 configure.ac                                   |    2 +-
 meson.build                                    |    2 +-
 src/polkitbackend/polkitbackendjsauthority.cpp |    9 +++++++--
 5 files changed, 12 insertions(+), 5 deletions(-)

New commits:
commit a6bedfd09b7bba753de7a107dc471da0db801858
Author: Xi Ruoyao <xry111 at mengyan1223.wang>
Date:   Thu Jan 27 10:16:32 2022 +0000

    jsauthority: port to mozjs-91

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 942415d..fbc7940 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -13,7 +13,7 @@ variables:
                 make
                 libxslt
                 pkgconfig(gio-2.0)
-                pkgconfig(mozjs-78)
+                pkgconfig(mozjs-91)
                 pkgconfig(duktape)
                 expat-devel
                 pkgconfig(libsystemd)
diff --git a/Makefile.am b/Makefile.am
index 199576a..bfdfa8c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -22,6 +22,8 @@ DISTCHECK_CONFIGURE_FLAGS=							\
 	--disable-introspection							\
 	--enable-gtk-doc 							\
 	--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)	\
+        --enable-libsystemd-login=yes						\
+        --enable-libelogind=no							\
 	$(NULL)
 
 sign : dist
diff --git a/configure.ac b/configure.ac
index e182238..0280dde 100644
--- a/configure.ac
+++ b/configure.ac
@@ -89,7 +89,7 @@ AS_IF([test x${with_duktape} == xyes], [
   AC_SUBST(LIBJS_CFLAGS)
   AC_SUBST(LIBJS_LIBS)
 ], [
-  PKG_CHECK_MODULES(LIBJS, [mozjs-78])
+  PKG_CHECK_MODULES(LIBJS, [mozjs-91])
 
   AC_SUBST(LIBJS_CFLAGS)
   AC_SUBST(LIBJS_CXXFLAGS)
diff --git a/meson.build b/meson.build
index ad9ab07..dd09b28 100644
--- a/meson.build
+++ b/meson.build
@@ -143,7 +143,7 @@ if js_engine == 'duktape'
   func = 'pthread_condattr_setclock'
   config_h.set('HAVE_' + func.to_upper(), cc.has_function(func, prefix : '#include <pthread.h>'))
 elif js_engine == 'mozjs'
-  js_dep = dependency('mozjs-78')
+  js_dep = dependency('mozjs-91')
 endif
 
 dbus_dep = dependency('dbus-1', required: false)
diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp b/src/polkitbackend/polkitbackendjsauthority.cpp
index 11e91c0..660407f 100644
--- a/src/polkitbackend/polkitbackendjsauthority.cpp
+++ b/src/polkitbackend/polkitbackendjsauthority.cpp
@@ -53,6 +53,13 @@
 
 /* ---------------------------------------------------------------------------------------------------- */
 
+static class JsInitHelperType
+{
+public:
+	JsInitHelperType() { JS_Init(); }
+	~JsInitHelperType() { JS_ShutDown(); }
+} JsInitHelper;
+
 struct _PolkitBackendJsAuthorityPrivate
 {
   gchar **rules_dirs;
@@ -458,7 +465,6 @@ polkit_backend_common_js_authority_finalize (GObject *object)
   delete authority->priv->js_polkit;
 
   JS_DestroyContext (authority->priv->cx);
-  /* JS_ShutDown (); */
 
   G_OBJECT_CLASS (polkit_backend_js_authority_parent_class)->finalize (object);
 }
@@ -490,7 +496,6 @@ polkit_backend_js_authority_class_init (PolkitBackendJsAuthorityClass *klass)
   polkit_backend_common_js_authority_class_init_common (klass);
 
   g_type_class_add_private (klass, sizeof (PolkitBackendJsAuthorityPrivate));
-  JS_Init ();
 }
 
 /* ---------------------------------------------------------------------------------------------------- */


More information about the hal-commit mailing list