Update the ruby stuff for meson and add all the stub plugins
--- a/meson.build Sat Jun 03 02:47:28 2017 -0500
+++ b/meson.build Sat Jun 03 03:07:52 2017 -0500
@@ -110,6 +110,7 @@
###############################################################################
--- a/meson_options.txt Sat Jun 03 02:47:28 2017 -0500
+++ b/meson_options.txt Sat Jun 03 03:07:52 2017 -0500
@@ -56,6 +56,12 @@
+ type : 'boolean', value : true, + description : 'Whether or not to build the Ruby plugin loader.' type : 'boolean', value : false,
description : 'Whether or not to build the TCC plugin loader'
--- a/ruby/CMakeLists.txt Sat Jun 03 02:47:28 2017 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
- "Whether or not to build the Ruby plugin loader"
- message(FATAL_ERROR "Ruby plugin requires GObject Introspection.")
- set(GPLUGIN_RUBY_SOURCES
- set(GPLUGIN_RUBY_HEADERS
- pkg_check_modules(RUBY REQUIRED ruby-2.1)
- ${CMAKE_CURRENT_SOURCE_DIR}
- # Now add our libraries
- add_library(gplugin-ruby MODULE
- ${GPLUGIN_RUBY_SOURCES}
- ${GPLUGIN_RUBY_HEADERS}
- add_library(gplugin-ruby-static STATIC
- ${GPLUGIN_RUBY_SOURCES}
- ${GPLUGIN_RUBY_HEADERS}
- set_target_properties(gplugin-ruby PROPERTIES PREFIX "")
- target_link_libraries(gplugin-ruby
- target_link_libraries(gplugin-ruby-static
- install(TARGETS gplugin-ruby DESTINATION lib/gplugin)
- add_subdirectory(tests)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ruby/meson.build Sat Jun 03 03:07:52 2017 -0500
@@ -0,0 +1,45 @@
+ if not get_option('gobject-introspection') + error('Ruby plugin requires GObject Introspection.') + GPLUGIN_RUBY_SOURCES = [ + 'gplugin-ruby-loader.c', + 'gplugin-ruby-plugin.c', + GPLUGIN_RUBY_HEADERS = [ + 'gplugin-ruby-loader.h', + 'gplugin-ruby-plugin.h', + _RUBYS = [['ruby-2.3', '>=2.3.0'], + ['ruby-2.2', '>=2.2.0'], + ['ruby-2.1', '>=2.1.0']] + RUBY = dependency(_RUBY[0], version : _RUBY[1], required : false) + RUBY_FOUND = RUBY.found() + error('No usable Ruby library was found') + shared_library('gplugin-ruby', + dependencies : [RUBY, gplugin_dep], + install_dir : join_paths(get_option('libdir'), 'gplugin') +if get_option('testing') --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ruby/tests/meson.build Sat Jun 03 03:07:52 2017 -0500
@@ -0,0 +1,12 @@
+e = executable('test-ruby-loader', 'test-ruby-loader.c', + '-DRUBY_LOADER_DIR="@0@/ruby"'.format(meson.build_root()), + '-DRUBY_PLUGIN_DIR="@0@/plugins"'.format(meson.current_source_dir()), + link_with : gplugin_loader_tests, + dependencies : [GLIB, GOBJECT, RUBY, gplugin_dep]) --- a/ruby/tests/plugins/basic.rb Sat Jun 03 02:47:28 2017 -0500
+++ b/ruby/tests/plugins/basic.rb Sat Jun 03 03:07:52 2017 -0500
@@ -5,22 +5,14 @@
return GPlugin::PluginInfo.new({
:id => 'ruby/ruby-basic-plugin',
- :abi_version => 0x01020304,
- :name => 'basic plugin',
def gplugin_unload(plugin)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ruby/tests/plugins/dependent.rb Sat Jun 03 03:07:52 2017 -0500
@@ -0,0 +1,18 @@
+ return GPlugin::PluginInfo.new({ + :id => 'ruby/ruby-dependent', + :dependencies => ["dependency1", "dependency2"], +def gplugin_load(plugin) +def gplugin_unload(plugin) --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ruby/tests/plugins/load-exception.rb Sat Jun 03 03:07:52 2017 -0500
@@ -0,0 +1,17 @@
+ return GPlugin::PluginInfo.new({ + :id => 'ruby/ruby-load-exception', +def gplugin_load(plugin) +def gplugin_unload(plugin) --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ruby/tests/plugins/load-failed.rb Sat Jun 03 03:07:52 2017 -0500
@@ -0,0 +1,17 @@
+ return GPlugin::PluginInfo.new({ + :id => 'ruby/ruby-load-failed', +def gplugin_load(plugin) +def gplugin_unload(plugin) --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ruby/tests/plugins/unload-failed.rb Sat Jun 03 03:07:52 2017 -0500
@@ -0,0 +1,17 @@
+ return GPlugin::PluginInfo.new({ + :id => 'ruby/ruby-unload-failed', +def gplugin_load(plugin) +def gplugin_unload(plugin) --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ruby/tests/test-ruby-loader.c Sat Jun 03 03:07:52 2017 -0500
@@ -0,0 +1,31 @@
+ * 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/gplugin-loader-tests.h> +main(gint argc, gchar **argv) { + g_test_init(&argc, &argv, NULL); + gplugin_loader_tests_main(RUBY_LOADER_DIR, RUBY_PLUGIN_DIR, "ruby");