Update to the develop branch
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gjs/gplugin-gjs-core.cc Sat Feb 15 01:33:13 2020 -0600
@@ -0,0 +1,67 @@
+ * Copyright (C) 2011-2019 Gary Kramlich <grim@reaperworld.com> + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see <http://www.gnu.org/licenses/>. +#include <gplugin-native.h> +#include "gplugin-gjs-loader.h" +#include "gplugin-gjs-plugin.h" +extern "C" G_MODULE_EXPORT GPluginPluginInfo * +gplugin_query(G_GNUC_UNUSED GError **error) { + const gchar * const authors[] = { + "Gary Kramlich <grim@reaperworld.com>", + return gplugin_plugin_info_new( + GPLUGIN_NATIVE_PLUGIN_ABI_VERSION, + "name", "Gjs JavaScript Plugin Loader", + "version", GPLUGIN_VERSION, + "summary", "A plugin that can load Gjs JavaScript plugins", + "description", "This plugin allows the loading of plugins written in " + "website", GPLUGIN_WEBSITE, +extern "C" G_MODULE_EXPORT gboolean +gplugin_load(GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) + gplugin_gjs_loader_register(plugin); + gplugin_gjs_plugin_register(plugin); + gplugin_manager_register_loader(gplugin_gjs_loader_get_type()); +extern "C" G_MODULE_EXPORT gboolean +gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gjs/gplugin-gjs-loader.cc Sat Feb 15 01:33:13 2020 -0600
@@ -0,0 +1,192 @@
+ * Copyright (C) 2011-2019 Gary Kramlich <grim@reaperworld.com> + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see <http://www.gnu.org/licenses/>. +#include "gplugin-gjs-loader.h" +#include "gplugin-gjs-plugin.h" +G_DEFINE_DYNAMIC_TYPE(GPluginGjsLoader, gplugin_gjs_loader, GPLUGIN_TYPE_LOADER); +static GjsContext *global_ctx = NULL; +/****************************************************************************** + *****************************************************************************/ +_gplugin_gjs_loader_eval_file(GjsContext *ctx, + if(!gjs_context_eval_file(ctx, filename, &exit_code, error)) { +/****************************************************************************** + * GPluginLoaderInterface API + *****************************************************************************/ +gplugin_gjs_loader_class_supported_extensions(G_GNUC_UNUSED const GPluginLoaderClass *klass) { + return g_slist_append(NULL, (gpointer)"js"); +gplugin_gjs_loader_query(GPluginLoader *loader, + GPluginPluginInfo *info = NULL; + GjsContext *context = NULL; + JSObject *jsobj = NULL; + context = gjs_context_new(); + g_message("context: %p", context); + if(!_gplugin_gjs_loader_eval_file(context, filename, error)) { + g_object_unref(G_OBJECT(context)); + cx = (JSContext*)gjs_context_get_native_context(context); + /* now call the query function */ + JS::RootedValue rval(cx); + JS::AutoValueArray<0> argv(cx); + if(!JS_CallFunctionName(cx, NULL, "gplugin_query", argv, &rval)) { + *error = g_error_new(GPLUGIN_DOMAIN, 0, + "Failed to call the query function"); + g_object_unref(G_OBJECT(context)); + /* now grab the plugin info */ + if(!JS_ValueToObject(cx, rval, &jsobj)) { + *error = g_error_new(GPLUGIN_DOMAIN, 0, + "Query function did not return a GObject"); + g_object_unref(G_OBJECT(context)); + gobj = gjs_g_object_from_object(cx, jsobj); + if(!GPLUGIN_IS_PLUGIN_INFO(gobj)) { + *error = g_error_new(GPLUGIN_DOMAIN, 0, + "Query function did not return a " + "GPluginPluginInfo object"); + g_object_unref(G_OBJECT(context)); + info = GPLUGIN_PLUGIN_INFO(gobj); + return (GPluginPlugin *)g_object_new(GPLUGIN_TYPE_GJS_PLUGIN, +gplugin_gjs_loader_load_unload(G_GNUC_UNUSED GPluginLoader *loader, + G_GNUC_UNUSED GError **error) + g_set_error_literal(error, GPLUGIN_DOMAIN, 0, "unimplemented"); +gplugin_gjs_loader_load(GPluginLoader *loader, GPluginPlugin *plugin, + return gplugin_gjs_loader_load_unload(loader, plugin, TRUE, error); +gplugin_gjs_loader_unload(GPluginLoader *loader, GPluginPlugin *plugin, + return gplugin_gjs_loader_load_unload(loader, plugin, FALSE, error); +/****************************************************************************** + *****************************************************************************/ +gplugin_gjs_loader_init(G_GNUC_UNUSED GPluginGjsLoader *loader) { +gplugin_gjs_loader_class_init(G_GNUC_UNUSED GPluginGjsLoaderClass *klass) { + GPluginLoaderClass *loader_class = GPLUGIN_LOADER_CLASS(klass); + loader_class->supported_extensions = + gplugin_gjs_loader_class_supported_extensions; + loader_class->query = gplugin_gjs_loader_query; + loader_class->load = gplugin_gjs_loader_load; + loader_class->unload = gplugin_gjs_loader_unload; + g_warning("current-context: %p", gjs_context_get_current()); + global_ctx = (GjsContext *)g_object_new(GJS_TYPE_CONTEXT, "program-name", "gplugin", NULL); +gplugin_gjs_loader_class_finalize(G_GNUC_UNUSED GPluginGjsLoaderClass *klass) { + g_clear_object(&global_ctx); +/****************************************************************************** + *****************************************************************************/ +gplugin_gjs_loader_register(GPluginNativePlugin *plugin) { + gplugin_gjs_loader_register_type(G_TYPE_MODULE(plugin)); --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gjs/gplugin-gjs-loader.h Sat Feb 15 01:33:13 2020 -0600
@@ -0,0 +1,60 @@
+ * Copyright (C) 2011-2019 Gary Kramlich <grim@reaperworld.com> + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see <http://www.gnu.org/licenses/>. +#ifndef GPLUGIN_GJS_LOADER_H +#define GPLUGIN_GJS_LOADER_H +#define GPLUGIN_TYPE_GJS_LOADER (gplugin_gjs_loader_get_type()) +#define GPLUGIN_GJS_LOADER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GPLUGIN_TYPE_GJS_LOADER, GPluginGjsLoader)) +#define GPLUGIN_GJS_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((obj), GPLUGIN_TYPE_GJS_LOADER, GPluginGjsLoaderClass)) +#define GPLUGIN_IS_GJS_LOADER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GPLUGIN_TYPE_GJS_LOADER)) +#define GPLUGIN_IS_GJS_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((obj), GPLUGIN_TYPE_GJS_LOADER)) +#define GPLUGIN_GJS_LOADER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GPLUGIN_TYPE_GJS_LOADER, GPluginGjsLoaderClass)) +typedef struct _GPluginGjsLoader GPluginGjsLoader; +typedef struct _GPluginGjsLoaderClass GPluginGjsLoaderClass; +#include <gplugin-native.h> +struct _GPluginGjsLoader { + void (*_gplugin_reserved_1)(void); + void (*_gplugin_reserved_2)(void); + void (*_gplugin_reserved_3)(void); + void (*_gplugin_reserved_4)(void); +struct _GPluginGjsLoaderClass { + GPluginLoaderClass parent; + void (*_gplugin_reserved_1)(void); + void (*_gplugin_reserved_2)(void); + void (*_gplugin_reserved_3)(void); + void (*_gplugin_reserved_4)(void); +void gplugin_gjs_loader_register(GPluginNativePlugin *plugin); +GType gplugin_gjs_loader_get_type(void); +#endif /* GPLUGIN_GJS_LOADER_H */ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gjs/gplugin-gjs-plugin.cc Sat Feb 15 01:33:13 2020 -0600
@@ -0,0 +1,159 @@
+ * Copyright (C) 2011-2014 Gary Kramlich <grim@reaperworld.com> + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see <http://www.gnu.org/licenses/>. +#include "gplugin-gjs-plugin.h" +#define GPLUGIN_GJS_PLUGIN_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE((obj), GPLUGIN_TYPE_GJS_PLUGIN, GPluginGjsPluginPrivate)) +/****************************************************************************** + *****************************************************************************/ +} GPluginGjsPluginPrivate; +/****************************************************************************** + *****************************************************************************/ +static GParamSpec *properties[N_PROPERTIES] = {NULL, }; +static void gplugin_gjs_plugin_iface_init(GPluginPluginInterface *iface); +G_DEFINE_DYNAMIC_TYPE_EXTENDED( + G_ADD_PRIVATE_DYNAMIC(GPluginGjsPlugin) + G_IMPLEMENT_INTERFACE(GPLUGIN_TYPE_PLUGIN, gplugin_gjs_plugin_iface_init) +/****************************************************************************** + * GPluginPlugin Implementation + *****************************************************************************/ +gplugin_gjs_plugin_iface_init(G_GNUC_UNUSED GPluginPluginInterface *iface) { +/****************************************************************************** + * GObject Implementation + *****************************************************************************/ +gplugin_gjs_plugin_set_context(GPluginGjsPlugin *plugin, GjsContext *context) { + GPluginGjsPluginPrivate *priv = GPLUGIN_GJS_PLUGIN_GET_PRIVATE(plugin); + g_object_unref(G_OBJECT(priv->context)); + if(GJS_IS_CONTEXT(context)) { + priv->context = (GjsContext*)g_object_ref(G_OBJECT(context)); +gplugin_gjs_plugin_get_property(GObject *obj, guint param_id, GValue *value, + GPluginGjsPlugin *plugin = GPLUGIN_GJS_PLUGIN(obj); + g_value_set_object(value, gplugin_gjs_plugin_get_context(plugin)); + G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); +gplugin_gjs_plugin_set_property(GObject *obj, guint param_id, + const GValue *value, GParamSpec *pspec) + GPluginGjsPlugin *plugin = GPLUGIN_GJS_PLUGIN(obj); + gplugin_gjs_plugin_set_context(plugin, (GjsContext*)g_value_get_object(value)); + G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); +gplugin_gjs_plugin_init(G_GNUC_UNUSED GPluginGjsPlugin *plugin) { +gplugin_gjs_plugin_finalize(GObject *obj) { + GPluginGjsPluginPrivate *priv = GPLUGIN_GJS_PLUGIN_GET_PRIVATE(obj); + g_clear_object(&priv->context); + G_OBJECT_CLASS(gplugin_gjs_plugin_parent_class)->finalize(obj); +gplugin_gjs_plugin_class_init(GPluginGjsPluginClass *klass) { + GObjectClass *obj_class = G_OBJECT_CLASS(klass); + obj_class->get_property = gplugin_gjs_plugin_get_property; + obj_class->set_property = gplugin_gjs_plugin_set_property; + obj_class->finalize = gplugin_gjs_plugin_finalize; + properties[PROP_CONTEXT] = g_param_spec_object( + "The Gjs Context for this plugin", + (GParamFlags)(G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS) + g_object_class_install_properties(obj_class, N_PROPERTIES, properties); +gplugin_gjs_plugin_class_finalize(G_GNUC_UNUSED GPluginGjsPluginClass *klass) { +/****************************************************************************** + *****************************************************************************/ +gplugin_gjs_plugin_register(GPluginNativePlugin *plugin) { + gplugin_gjs_plugin_register_type(G_TYPE_MODULE(plugin)); +gplugin_gjs_plugin_get_context(const GPluginGjsPlugin *plugin) { + GPluginGjsPluginPrivate *priv = NULL; + g_return_val_if_fail(GPLUGIN_IS_GJS_PLUGIN(plugin), NULL); + priv = GPLUGIN_GJS_PLUGIN_GET_PRIVATE(plugin); --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gjs/gplugin-gjs-plugin.h Sat Feb 15 01:33:13 2020 -0600
@@ -0,0 +1,54 @@
+ * Copyright (C) 2011-2019 Gary Kramlich <grim@reaperworld.com> + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see <http://www.gnu.org/licenses/>. +#ifndef GPLUGIN_GJS_PLUGIN_H +#define GPLUGIN_GJS_PLUGIN_H +#define GPLUGIN_TYPE_GJS_PLUGIN (gplugin_gjs_plugin_get_type()) +#define GPLUGIN_GJS_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GPLUGIN_TYPE_GJS_PLUGIN, GPluginGjsPlugin)) +#define GPLUGIN_GJS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((obj), GPLUGIN_TYPE_GJS_PLUGIN, GPluginGjsPluginClass)) +#define GPLUGIN_IS_GJS_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GPLUGIN_TYPE_GJS_PLUGIN)) +#define GPLUGIN_IS_GJS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((obj), GPLUGIN_TYPE_GJS_PLUGIN)) +#define GPLUGIN_GJS_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GPLUGIN_TYPE_GJS_PLUGIN, GPluginGjsPluginClass)) +typedef struct _GPluginGjsPlugin GPluginGjsPlugin; +typedef struct _GPluginGjsPluginClass GPluginGjsPluginClass; +#include <gplugin-native.h> +struct _GPluginGjsPlugin { +struct _GPluginGjsPluginClass { +void gplugin_gjs_plugin_register(GPluginNativePlugin *plugin); +GType gplugin_gjs_plugin_get_type(void); +GjsContext *gplugin_gjs_plugin_get_context(const GPluginGjsPlugin *plugin); +#endif /* GPLUGIN_GJS_PLUGIN_H */ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gjs/meson.build Sat Feb 15 01:33:13 2020 -0600
@@ -0,0 +1,39 @@
+ if not get_option('gobject-introspection') + error('gnome-javascript plugin requires GObject Introspection.') + GPLUGIN_GJS_SOURCES = [ + 'gplugin-gjs-loader.cc', + 'gplugin-gjs-plugin.cc', + GPLUGIN_GJS_HEADERS = [ + 'gplugin-gjs-loader.h', + 'gplugin-gjs-plugin.h', + GJS = dependency('gjs-1.0', version: '>=1.32.0') + # tell meson we need cpp since we have gjs +# '-DPREFIX="@0@"'.format(get_option('prefix')), +# '-DLIBDIR="@0@"'.format(get_option('libdir')), + '-DGPLUGIN_WEBSITE="http://bitbucket.org/gplugin/main"', + shared_library('gplugin-gjs', + dependencies : [GIO, GJS, gplugin_dep], + install_dir : join_paths(get_option('libdir'), 'gplugin'), --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gjs/tests/meson.build Sat Feb 15 01:33:13 2020 -0600
@@ -0,0 +1,13 @@
+e = executable('test-gjs-loader', 'test-gjs-loader.c', + include_directories : include_directories('.'), + '-DGJS_LOADER_DIR="@0@/gjs"'.format(meson.build_root()), + '-DGJS_PLUGIN_DIR="@0@/plugins"'.format(meson.current_source_dir()), + link_with : gplugin_loader_tests, + dependencies : [GLIB, GOBJECT, GJS, gplugin_dep]) +test('GNOME JavaScript loader', e) --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gjs/tests/plugins/basic.js Sat Feb 15 01:33:13 2020 -0600
@@ -0,0 +1,41 @@
+ * Copyright (C) 2011-2014 Gary Kramlich <grim@reaperworld.com> + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see <http://www.gnu.org/licenses/>. +const GPlugin = imports.gi.GPlugin; +function gplugin_query() { + return new GPlugin.PluginInfo({ + id: "gplugin/gjs-basic-plugin", + abi_version: 0x01020304, + description: 'description' +function gplugin_load(plugin) { +function gplugin_unload(plugin) { --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gjs/tests/plugins/dependent.js Sat Feb 15 01:33:13 2020 -0600
@@ -0,0 +1,33 @@
+ * Copyright (C) 2011-2014 Gary Kramlich <grim@reaperworld.com> + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see <http://www.gnu.org/licenses/>. +const GPlugin = imports.gi.GPlugin; +function gplugin_query() { + return new GPlugin.PluginInfo({ + id: "gplugin/gjs-dependent-plugin", + dependencies: ["dependency1", "dependency2"], +function gplugin_load(plugin) { +function gplugin_unload(plugin) { --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gjs/tests/plugins/load-exception.js Sat Feb 15 01:33:13 2020 -0600
@@ -0,0 +1,32 @@
+ * Copyright (C) 2011-2014 Gary Kramlich <grim@reaperworld.com> + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see <http://www.gnu.org/licenses/>. +const GPlugin = imports.gi.GPlugin; +function gplugin_query() { + return new GPlugin.PluginInfo({ + id: "gplugin/gjs-load-exception" +function gplugin_load(plugin) { +function gplugin_unload(plugin) { --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gjs/tests/plugins/load-failed.js Sat Feb 15 01:33:13 2020 -0600
@@ -0,0 +1,32 @@
+ * Copyright (C) 2011-2014 Gary Kramlich <grim@reaperworld.com> + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see <http://www.gnu.org/licenses/>. +const GPlugin = imports.gi.GPlugin; +var gplugin_query = function() { + return new GPlugin.PluginInfo({ + id: "gplugin/gjs-load-failed" +var gplugin_load = function(plugin) { +var gplugin_unload = function(plugin) { --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gjs/tests/plugins/unload-failed.js Sat Feb 15 01:33:13 2020 -0600
@@ -0,0 +1,32 @@
+ * Copyright (C) 2011-2014 Gary Kramlich <grim@reaperworld.com> + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see <http://www.gnu.org/licenses/>. +const GPlugin = imports.gi.GPlugin; +function gplugin_query() { + return new GPlugin.PluginInfo({ + id: "gplugin/gjs-unload-failed" +function gplugin_load(plugin) { +function gplugin_unload(plugin) { --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gjs/tests/test-gjs-loader.c Sat Feb 15 01:33:13 2020 -0600
@@ -0,0 +1,31 @@
+ * Copyright (C) 2011-2017 Gary Kramlich <grim@reaperworld.com> + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see <http://www.gnu.org/licenses/>. +#include <gplugin/gplugin-loader-tests.h> +main(gint argc, gchar **argv) { + g_test_init(&argc, &argv, NULL); + gplugin_loader_tests_main(GJS_LOADER_DIR, GJS_PLUGIN_DIR, "gjs"); --- a/meson.build Tue Aug 03 03:42:48 2021 -0500
+++ b/meson.build Sat Feb 15 01:33:13 2020 -0600
@@ -5,7 +5,7 @@
license : 'LGPL-2.0-or-later',
meson_version : '>=0.56.0',
- default_options : ['c_std=c99'])
+ default_options : ['c_std=c99', 'cpp_std=c++11']) parts = meson.project_version().split('-')
@@ -36,6 +36,7 @@
GLIB = dependency('glib-2.0', version : '>=2.40.0')
GOBJECT = dependency('gobject-2.0')
+GIO = dependency('gio-2.0') # we separate gmodule out so our test aren't linked to it
GMODULE = dependency('gmodule-2.0')
@@ -90,6 +91,7 @@
--- a/meson_options.txt Tue Aug 03 03:42:48 2021 -0500
+++ b/meson_options.txt Sat Feb 15 01:33:13 2020 -0600
@@ -17,6 +17,12 @@
+ type : 'boolean', value : true, + description : 'Whether or not to build the GNOME JavaScript plugin loader' type : 'boolean', value : true,
description : 'Whether or not to build man pages from --help output'