Merged in feature/vala (pull request #21)
Vala Testing and vapi generation
Approved-by: Elliott Sales de Andrade
--- a/INSTALL Fri Jul 19 21:17:45 2019 +0000
+++ b/INSTALL Mon Jul 22 07:01:06 2019 +0000
@@ -12,7 +12,7 @@
python3-dev, python-gi-dev, python3-gi
All of these packages and their development headers need to be installed
prior to building GPlugin.
--- a/gplugin/meson.build Fri Jul 19 21:17:45 2019 +0000
+++ b/gplugin/meson.build Mon Jul 22 07:01:06 2019 +0000
@@ -228,6 +228,7 @@
GPLUGIN_PUBLIC_BUILT_SOURCES +
GPLUGIN_PUBLIC_BUILT_HEADERS,
includes : ['GModule-2.0', 'GObject-2.0'],
symbol_prefix : 'gplugin',
nsversion : '@0@.0'.format(GPLUGIN_MAJOR_VERSION),
--- a/meson.build Fri Jul 19 21:17:45 2019 +0000
+++ b/meson.build Mon Jul 22 07:01:06 2019 +0000
@@ -104,6 +104,7 @@
###############################################################################
--- a/meson_options.txt Fri Jul 19 21:17:45 2019 +0000
+++ b/meson_options.txt Mon Jul 22 07:01:06 2019 +0000
@@ -60,3 +60,9 @@
type : 'boolean', value : false,
description : 'Whether or not to build the TCC plugin loader'
+ type : 'boolean', value : true, + description : 'Whether or not to build vapi files for gplugin' --- a/packaging/debian/control Fri Jul 19 21:17:45 2019 +0000
+++ b/packaging/debian/control Mon Jul 22 07:01:06 2019 +0000
@@ -7,7 +7,8 @@
gobject-introspection, libgirepository1.0-dev,
liblua5.1-0-dev, lua-lgi,
- python3-dev, python-gi-dev, python3-gi
+ python3-dev, python-gi-dev, python3-gi, Homepage: https://bitbucket.org/gplugin/gplugin
Vcs-Browser: https://bitbucket.org/gplugin/gplugin/src
Vcs-Hg: https://bitbucket.org/gplugin/gplugin
--- a/packaging/debian/libgplugin-dev.install Fri Jul 19 21:17:45 2019 +0000
+++ b/packaging/debian/libgplugin-dev.install Mon Jul 22 07:01:06 2019 +0000
@@ -3,3 +3,6 @@
debian/tmp/usr/include/gplugin-1.0/gplugin-native.h
debian/tmp/usr/lib/*/libgplugin.so
debian/tmp/usr/lib/*/pkgconfig/gplugin.pc
+debian/tmp/usr/share/vala/vapi/gplugin.deps +debian/tmp/usr/share/vala/vapi/gplugin.vapi --- a/packaging/debian/libgplugin-gtk-dev.install Fri Jul 19 21:17:45 2019 +0000
+++ b/packaging/debian/libgplugin-gtk-dev.install Mon Jul 22 07:01:06 2019 +0000
@@ -2,3 +2,5 @@
usr/include/gplugin-1.0/gplugin-gtk.h
debian/tmp/usr/lib/*/libgplugin-gtk.so
debian/tmp/usr/lib/*/pkgconfig/gplugin-gtk.pc
+debian/tmp/usr/share/vala/vapi/gplugin-gtk.deps +debian/tmp/usr/share/vala/vapi/gplugin-gtk.vapi --- a/packaging/gplugin.spec.in Fri Jul 19 21:17:45 2019 +0000
+++ b/packaging/gplugin.spec.in Mon Jul 22 07:01:06 2019 +0000
@@ -22,6 +22,7 @@
BuildRequires: python3-devel
BuildRequires: python3-gobject
BuildRequires: /usr/lib64/pkgconfig/pygobject-3.0.pc
@@ -43,6 +44,12 @@
Requires: %{name}-gtk3%{?_isa} = %{version}-%{release}
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
+Summary: A GObject based library that implements a reusable plugin system +Group: Development/Libraries +Requires: %{name}-gtk3%{?_isa} = %{version}-%{release} +Requires: %{name}-devel%{?_isa} = %{version}-%{release} Summary: A GObject based library that implements a reusable plugin system
Group: Development/Libraries
@@ -51,6 +58,10 @@
Summary: A GObject based library that implements a reusable plugin system
Group: Development/Libraries
+Summary: A GObject based library that implements a reusable plugin system +Group: Development/Libraries +Requires: %{name}-devel%{?_isa} = %{version}-%{release} GPlugin is a GObject based library that implements a reusable plugin system
@@ -110,6 +121,19 @@
This package contains all necessary include files and libraries needed
to develop GTK3 applications that require these.
+GPlugin is a GObject based library that implements a reusable plugin system +that supports loading plugins in other languages via loaders. GPlugin also +implements dependencies among the plugins. +It was started due to the infamous "Plugin Problem" for Guifications 3, which +was that I needed plugins that could depend on each other, be able to be +written in other languages, have plugins that are loaded before the main load +phase, and allow plugins to register types into the GObject type system. +This package contains the vapi bindings allowing GPluginGtk to be used from GPlugin is a GObject based library that implements a reusable plugin system
that supports loading plugins in other languages via loaders. GPlugin also
@@ -134,6 +158,17 @@
This package contains Python 3 loader for %{name} library.
+GPlugin is a GObject based library that implements a reusable plugin system +that supports loading plugins in other languages via loaders. GPlugin also +implements dependencies among the plugins. +It was started due to the infamous "Plugin Problem" for Guifications 3, which +was that I needed plugins that could depend on each other, be able to be +written in other languages, have plugins that are loaded before the main load +phase, and allow plugins to register types into the GObject type system. +This package contains the vapi bindings allowing GPlugin to be used from vala. @@ -219,6 +254,19 @@
%{_libdir}/gplugin/gplugin-python.so
+${_datadir}/vala/vapi/gplugin.vapi +${_datadir}/vala/vapi/gplugin.deps +${_datadir}/vala/vapi/gplugin-gtk.vapi +${_datadir}/vala/vapi/gplugin-gtk.deps * Sun May 15 2016 Gary Kramlich <grim@reaperworld.com>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vala/meson.build Mon Jul 22 07:01:06 2019 +0000
@@ -0,0 +1,24 @@
+ if not get_option('gobject-introspection') + error('Vala generation requires GObject Introspection.') + gplugin_vapi = gnome.generate_vapi('gplugin', + sources : gplugin_gir[0], + gir_dirs : join_paths(meson.build_root(), 'gplugin'), + gplugin_gtk_vapi = gnome.generate_vapi('gplugin-gtk', + sources : gplugin_gtk_gir[0], + packages : [ 'gtk+-3.0' ], + gir_dirs : join_paths(meson.build_root(), 'gplugin'), --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vala/tests/meson.build Mon Jul 22 07:01:06 2019 +0000
@@ -0,0 +1,14 @@
+e = executable('test-vala-loading', 'test-vala-loading.c', + include_directories : include_directories('.'), + '-DVALA_PLUGIN_DIR="@0@/plugins"'.format(meson.current_build_dir()), + link_with : gplugin_loader_tests, + dependencies : [GLIB, GOBJECT, gplugin_dep]) --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vala/tests/plugins/basic.vala Mon Jul 22 07:01:06 2019 +0000
@@ -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/>. +public class BasicPluginInfo : GPlugin.PluginInfo { + public BasicPluginInfo() { + string[] authors = {"author1"}; + id: "gplugin/vala-basic-plugin", + abi_version: 0x01020304, + description: "description" +public GPlugin.PluginInfo gplugin_query(out Error error) { + return new BasicPluginInfo(); +public bool gplugin_load(GPlugin.Plugin plugin, out Error error) { +public bool gplugin_unload(GPlugin.Plugin plugin, out Error error) { --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vala/tests/plugins/dependent.vala Mon Jul 22 07:01:06 2019 +0000
@@ -0,0 +1,46 @@
+ * 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/>. +public class DependentPluginInfo : GPlugin.PluginInfo { + public DependentPluginInfo() { + string[] dependencies = {"dependency1", "dependency2"}; + id: "gplugin/vala-dependent-plugin", + dependencies: dependencies +public GPlugin.PluginInfo gplugin_query(out Error error) { + return new DependentPluginInfo(); +public bool gplugin_load(GPlugin.Plugin plugin, out Error error) { +public bool gplugin_unload(GPlugin.Plugin plugin, out Error error) { --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vala/tests/plugins/load-exception.vala Mon Jul 22 07:01:06 2019 +0000
@@ -0,0 +1,43 @@
+ * 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/>. +public class LoadExceptionPluginInfo : GPlugin.PluginInfo { + public LoadExceptionPluginInfo() { + id: "gplugin/vala-load-exception" +public GPlugin.PluginInfo gplugin_query(out Error error) { + return new LoadExceptionPluginInfo(); +public bool gplugin_load(GPlugin.Plugin plugin, out Error error) { + error = new Error(Quark.from_string("gplugin"), 0, "explode"); +public bool gplugin_unload(GPlugin.Plugin plugin, out Error error) { --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vala/tests/plugins/load-failed.vala Mon Jul 22 07:01:06 2019 +0000
@@ -0,0 +1,43 @@
+ * 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/>. +public class LoadFailedPluginInfo : GPlugin.PluginInfo { + public LoadFailedPluginInfo() { + id: "gplugin/vala-load-failed" +public GPlugin.PluginInfo gplugin_query(out Error error) { + return new LoadFailedPluginInfo(); +public bool gplugin_load(GPlugin.Plugin plugin, out Error error) { +public bool gplugin_unload(GPlugin.Plugin plugin, out Error error) { --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vala/tests/plugins/meson.build Mon Jul 22 07:01:06 2019 +0000
@@ -0,0 +1,17 @@
+ shared_library('vala-basic-plugin', 'basic.vala', + dependencies : [gplugin_dep, gplugin_vapi]) + shared_library('vala-dependent-plugin', 'dependent.vala', + dependencies : [gplugin_dep, gplugin_vapi]) + shared_library('vala-load-exception', 'load-exception.vala', + dependencies : [gplugin_dep, gplugin_vapi]) + shared_library('vala-load-failed', 'load-failed.vala', + dependencies : [gplugin_dep, gplugin_vapi]) + shared_library('vala-unload-failed', 'unload-failed.vala', + dependencies : [gplugin_dep, gplugin_vapi]) --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vala/tests/plugins/unload-failed.vala Mon Jul 22 07:01:06 2019 +0000
@@ -0,0 +1,43 @@
+ * 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/>. +public class UnloadFailedPluginInfo : GPlugin.PluginInfo { + public UnloadFailedPluginInfo() { + id: "gplugin/vala-unload-failed" +public GPlugin.PluginInfo gplugin_query(out Error error) { + return new UnloadFailedPluginInfo(); +public bool gplugin_load(GPlugin.Plugin plugin, out Error error) { +public bool gplugin_unload(GPlugin.Plugin plugin, out Error error) { --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vala/tests/test-vala-loading.c Mon Jul 22 07:01:06 2019 +0000
@@ -0,0 +1,34 @@
+ * 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/gplugin-loader-tests.h> +/****************************************************************************** + *****************************************************************************/ +main(gint argc, gchar **argv) { + g_test_init(&argc, &argv, NULL); + gplugin_loader_tests_main(NULL, VALA_PLUGIN_DIR, "vala");