flow: Promoted 'trunk' (0dcd20dd5e76) to 'feature/gjs-cc'.
--- a/.hgignore Tue Sep 29 22:45:21 2015 -0500
+++ b/.hgignore Tue Aug 23 12:08:22 2016 -0500
@@ -14,4 +14,4 @@
^packaging\/debian\/files$
--- a/CMakeLists.txt Tue Sep 29 22:45:21 2015 -0500
+++ b/CMakeLists.txt Tue Aug 23 12:08:22 2016 -0500
@@ -17,6 +17,9 @@
# don't force target names to match a pattern
cmake_policy(SET CMP0037 OLD)
+ cmake_policy(SET CMP0042 NEW) endif(${CMAKE_VERSION} VERSION_GREATER "3.0.0")
###############################################################################
@@ -25,8 +28,8 @@
set(GPLUGIN_MAJOR_VERSION 0)
-set(GPLUGIN_MINOR_VERSION 0)
-set(GPLUGIN_MICRO_VERSION 23)
+set(GPLUGIN_MINOR_VERSION 28) +set(GPLUGIN_MICRO_VERSION 0) set(GPLUGIN_EXTRA_VERSION dev)
set(GPLUGIN_VERSION ${GPLUGIN_MAJOR_VERSION}.${GPLUGIN_MINOR_VERSION}.${GPLUGIN_MICRO_VERSION}${GPLUGIN_EXTRA_VERSION})
@@ -55,6 +58,12 @@
+ "Whether or not to build man pages from --help output" ###############################################################################
###############################################################################
@@ -95,29 +104,18 @@
include(PkgConfigVariable)
-set(REQ_GLIB_VER 2.20.0)
-pkg_check_modules(GLIB REQUIRED
- glib-2.0>=${REQ_GLIB_VER}
- gobject-2.0>=${REQ_GLIB_VER}
+pkg_check_modules(GLIB REQUIRED glib-2.0>=2.34.0 gobject-2.0) # we separate gmodule out so our test aren't linked to it
-pkg_check_modules(GMODULE REQUIRED
- gmodule-2.0>=${REQ_GLIB_VER}
+pkg_check_modules(GMODULE REQUIRED gmodule-2.0) pkg_config_variable(glib-2.0 glib_genmarshal GLIB_GENMARSHAL)
-if(${GLIB_gobject-2.0_VERSION} LESS 2.32.0)
- set(GLIB_MKENUMS ${CMAKE_SOURCE_DIR}/tools/glib-mkenums
- CACHE FILEPATH "glib-mkenums executable"
-else(${GLIB_gobject-2.0_VERSION} LESS 2.32.0)
- pkg_config_variable(glib-2.0 glib_mkenums GLIB_MKENUMS)
-endif(${GLIB_gobject-2.0_VERSION} LESS 2.32.0)
+pkg_config_variable(glib-2.0 glib_mkenums GLIB_MKENUMS) @@ -150,6 +148,7 @@
-DPREFIX="${CMAKE_INSTALL_PREFIX}"
-DLIBDIR="${CMAKE_INSTALL_LIBDIR}"
-DGPLUGIN_WEBSITE="http://bitbucket.org/gplugin/main"
@@ -160,16 +159,16 @@
# check if we're using gcc
-if(CMAKE_COMPILER_IS_GNUCC)
+if(CMAKE_COMPILER_IS_GNUCC OR APPLE) -DGPLUGIN_UNUSED=__attribute__\(\(unused\)\)
-else(CMAKE_COMPILER_IS_GNUCC)
+else(CMAKE_COMPILER_IS_GNUCC OR APPLE)
-endif(CMAKE_COMPILER_IS_GNUCC)
+endif(CMAKE_COMPILER_IS_GNUCC OR APPLE) @@ -189,6 +188,7 @@
###############################################################################
add_subdirectory(gplugin)
add_subdirectory(gplugin-gtk)
+add_subdirectory(packaging) add_subdirectory(plugins)
@@ -196,6 +196,7 @@
###############################################################################
--- a/ChangeLog Tue Sep 29 22:45:21 2015 -0500
+++ b/ChangeLog Tue Aug 23 12:08:22 2016 -0500
@@ -1,4 +1,32 @@
+ * Fixed building on OSX with homebrew + * Added an RPM spec file + * Bumped the glib requirement to 2.34.0 + * Fix some error reporting with the native loader + * Added a load-failed signal which is emitted when a plugin fails to load + * Removed pre glib 2.32.0 code + * Fix a regression where the GIR file did not have a predictable name. + * Fix the glib requirement. It was set at 2.20, but we require 2.32. + * Fixed the version numbering finally + * Updated the version in CMakeLists.txt + * Really fixed the debian package this time + * Made help2man optional + * Don't try to build the pot files if NLS is disabled + * Made the moonscript tests option work + * Added Debian.md to explain how to use the Debian repository + * Install man pages in the correct directory on BSD * Made the moonscripts tests not interfer with the lua tests unless they're
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/HACKING.OSX Tue Aug 23 12:08:22 2016 -0500
@@ -0,0 +1,28 @@
+There are a few notes about building on OSX. +First off, building has *ONLY* been tested against homebrew. If you want to +support fink or macports, please let me know and I will merge your pull +For the Lua loader to work, you need to install lgi from luarocks either +systemwide or to a virtual environment created by LuaDist, vert, or something +When you're building lgi against homebrew you'll have to set the +PKG_CONFIG_PATH environment variable since homebrew does not install libffi +systemwide. This is easily done via: + export PKG_CONFIG_PATH=$(brew --prefix libffi)/lib/pkgconfig +and then running "luarocks install lgi" +If you're using homebrew, you need to install pygobject3 with + brew install pygobject3 --with-python3 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cmake/Modules/FindLibTcc.cmake Tue Aug 23 12:08:22 2016 -0500
@@ -0,0 +1,51 @@
+find_path(libtcc_INCLUDE_DIR +# find home brew and stash the prefix of tcc if there is one + find_program(BREW brew) + COMMAND ${BREW} --prefix tcc + OUTPUT_VARIABLE BREW_TCC_PREFIX + OUTPUT_STRIP_TRAILING_WHITESPACE + set(BREW_TCC_LIB_DIR ${BREW_TCC_PREFIX}/lib) + set(BREW_TCC_INCLUDE_DIR ${BREW_TCC_PREFIX}/include) +find_path(LIBTCC_INCLUDE_DIR + ${BREW_TCC_INCLUDE_DIR} +find_library(LIBTCC_LIBRARIES + /usr/lib/x86_64-linux-gnu + /usr/lib/x86_32-linux-gnu +include(CMakeParseArguments) +find_package_handle_standard_args(libtcc REQUIRED_VARS LIBTCC_LIBRARIES LIBTCC_INCLUDE_DIR) +set(TCC_FOUND ${LIBTCC_FOUND}) + set(TCC_INCLUDE_DIRS ${LIBTCC_INCLUDE_DIR}) + set(TCC_LIBRARIES ${LIBTCC_LIBRARY}) --- a/cmake/Modules/help2man.cmake Tue Sep 29 22:45:21 2015 -0500
+++ b/cmake/Modules/help2man.cmake Tue Aug 23 12:08:22 2016 -0500
@@ -63,7 +63,12 @@
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_HELP2MAN_OUTPUT} DESTINATION share/man/man${_HELP2MAN_SECTION})
+ set(_HELP2MAN_DIR share/man/) + if(CMAKE_SYSTEM_NAME MATCHES .*BSD.*) + set(_HELP2MAN_DIR man/) + endif(CMAKE_SYSTEM_NAME MATCHES .*BSD.*) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_HELP2MAN_OUTPUT} DESTINATION ${_HELP2MAN_DIR}man${_HELP2MAN_SECTION}) --- a/gplugin-gtk/CMakeLists.txt Tue Sep 29 22:45:21 2015 -0500
+++ b/gplugin-gtk/CMakeLists.txt Tue Aug 23 12:08:22 2016 -0500
@@ -130,13 +130,15 @@
- TARGET gplugin-gtk-viewer
- OUTPUT gplugin-gtk-viewer.1
- NAME "View installed plugins"
+ TARGET gplugin-gtk-viewer + OUTPUT gplugin-gtk-viewer.1 + NAME "View installed plugins" install(TARGETS gplugin-gtk-viewer RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
--- a/gplugin/CMakeLists.txt Tue Sep 29 22:45:21 2015 -0500
+++ b/gplugin/CMakeLists.txt Tue Aug 23 12:08:22 2016 -0500
@@ -182,13 +182,15 @@
- SOURCES ${GPLUGIN_SOURCES} ${GPLUGIN_NATIVE_SOURCES} gplugin-query.c
- BUILT_SOURCES ${GPLUGIN_PUBLIC_BUILT_SOURCES}
+ SOURCES ${GPLUGIN_SOURCES} ${GPLUGIN_NATIVE_SOURCES} gplugin-query.c + BUILT_SOURCES ${GPLUGIN_PUBLIC_BUILT_SOURCES} ###############################################################################
# gplugin-query executable
@@ -196,13 +198,15 @@
add_executable(gplugin-query gplugin-query.c)
target_link_libraries(gplugin-query ${GLIB_LIBRARIES} gplugin)
- NAME "Query installed plugins"
+ NAME "Query installed plugins" ###############################################################################
# loader-tests static library
@@ -218,30 +222,25 @@
###############################################################################
- message("The GObject Introspection build always fails on OS X, "
- include(GObjectIntrospection)
+ include(GObjectIntrospection) - set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${CMAKE_BINARY_DIR}")
+ set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${CMAKE_BINARY_DIR}")
- FILENAME GPlugin-${GPLUGIN_MAJOR_VERSION}.${GPLUGIN_MINOR_VERSION}.gir
- PACKAGES glib-2.0 gmodule-2.0 gobject-2.0
- SCANNER_ARGS --add-include-path=${CMAKE_CURRENT_SOURCE_DIR}
- --include=GModule-2.0 --include=GObject-2.0
- COMPILER_ARGS --includedir=${CMAKE_CURRENT_SOURCE_DIR}
- SYMBOL_PREFIXES gplugin
- SOURCES ${GPLUGIN_SOURCES} ${GPLUGIN_HEADERS}
- BUILT_SOURCES ${GPLUGIN_PUBLIC_BUILT_SOURCES}
- ${GPLUGIN_PUBLIC_BUILT_HEADERS}
- # For loader plugin tests dependencies
- set(GPLUGIN_GIR_TARGETS ${GPLUGIN_GIR_TARGETS} PARENT_SCOPE)
+ FILENAME GPlugin-${GPLUGIN_MAJOR_VERSION}.${GPLUGIN_MINOR_VERSION}.gir + PACKAGES glib-2.0 gmodule-2.0 gobject-2.0 + SCANNER_ARGS --add-include-path=${CMAKE_CURRENT_SOURCE_DIR} + --include=GModule-2.0 --include=GObject-2.0 + COMPILER_ARGS --includedir=${CMAKE_CURRENT_SOURCE_DIR} + SYMBOL_PREFIXES gplugin + SOURCES ${GPLUGIN_SOURCES} ${GPLUGIN_HEADERS} + BUILT_SOURCES ${GPLUGIN_PUBLIC_BUILT_SOURCES} + ${GPLUGIN_PUBLIC_BUILT_HEADERS} + # For loader plugin tests dependencies + set(GPLUGIN_GIR_TARGETS ${GPLUGIN_GIR_TARGETS} PARENT_SCOPE) ###############################################################################
--- a/gplugin/gplugin-manager.c Tue Sep 29 22:45:21 2015 -0500
+++ b/gplugin/gplugin-manager.c Tue Aug 23 12:08:22 2016 -0500
@@ -37,6 +37,7 @@
@@ -89,6 +90,7 @@
void (*loaded_plugin)(GObject *manager,
+ void (*load_failed)(GObject *manager, GPluginPlugin *plugin); gboolean (*unloading_plugin)(GObject *manager,
@@ -149,7 +151,7 @@
*****************************************************************************/
gplugin_manager_real_append_path(GPluginManager *manager,
@@ -165,7 +167,7 @@
gplugin_manager_real_prepend_path(GPluginManager *manager,
@@ -181,7 +183,7 @@
gplugin_manager_real_remove_path(GPluginManager *manager,
GList *l = NULL, *link = NULL;
@@ -209,7 +211,7 @@
gplugin_manager_real_register_loader(GPluginManager *manager,
GPluginLoader *loader = NULL;
GPluginLoaderClass *lo_class = NULL;
@@ -273,7 +275,7 @@
gplugin_manager_real_unregister_loader(GPluginManager *manager,
GPluginLoaderClass *klass = NULL;
@@ -550,7 +552,7 @@
gplugin_manager_real_find_plugins(GPluginManager *manager,
GSList *plugins_list = NULL, *l;
@@ -767,15 +769,18 @@
gplugin_plugin_set_state(plugin, (ret) ? GPLUGIN_PLUGIN_STATE_LOADED :
GPLUGIN_PLUGIN_STATE_LOAD_FAILED);
- g_signal_emit(manager, signals[SIG_LOADED], 0, plugin);
+ g_signal_emit(manager, signals[SIG_LOADED], 0, plugin); + g_signal_emit(manager, signals[SIG_LOAD_FAILED], 0, plugin); gplugin_manager_real_unload_plugin(GPluginManager *manager,
GPluginLoader *loader = NULL;
@@ -832,16 +837,7 @@
gplugin_manager_finalize(GObject *obj) {
GPluginManager *manager = GPLUGIN_MANAGER(obj);
-#if GLIB_CHECK_VERSION(2,32,0)
g_queue_free_full(manager->paths, g_free);
- for(iter = manager->paths->head; iter; iter = iter->next)
- g_queue_free(manager->paths);
-#endif /* GLIB_CHECK_VERSION(2,32,0) */
/* free all the data in the plugins hash table and destroy it */
g_hash_table_foreach_remove(manager->plugins,
@@ -937,10 +933,28 @@
+ * GPluginManager::load-failed: + * @manager: The #GPluginPluginManager instance. + * @plugin: The #GPluginPlugin that failed to load. + * emitted after a plugin fails to load. + signals[SIG_LOAD_FAILED] = + g_signal_new("load-failed", + G_OBJECT_CLASS_TYPE(manager_class), + G_STRUCT_OFFSET(GPluginManagerClass, load_failed), + gplugin_marshal_VOID__OBJECT, * GPluginManager::unloading-plugin:
- * @manager: the #gpluginpluginmanager instance. treat as a #gobject.
- * @plugin: the #gpluginplugin that's about to be loaded.
- * @error: return address for a #gerror.
+ * @manager: the #GPluginPluginManager instance. treat as a #GObject. + * @plugin: the #GPluginPlugin that's about to be loaded. * emitted before a plugin is unloaded.
--- a/gplugin/gplugin-native-loader.c Tue Sep 29 22:45:21 2015 -0500
+++ b/gplugin/gplugin-native-loader.c Tue Aug 23 12:08:22 2016 -0500
@@ -132,7 +132,7 @@
*error = g_error_new(GPLUGIN_DOMAIN, 0,
_("the query function did not return a "
"GPluginPluginInfo instance"));
@@ -151,7 +151,7 @@
if(!GPLUGIN_IS_PLUGIN_INFO(info)) {
*error = g_error_new(GPLUGIN_DOMAIN, 0,
_("the query function did not return a "
"GPluginPluginInfo instance"));
--- a/gplugin/tests/CMakeLists.txt Tue Sep 29 22:45:21 2015 -0500
+++ b/gplugin/tests/CMakeLists.txt Tue Aug 23 12:08:22 2016 -0500
@@ -3,7 +3,15 @@
###############################################################################
macro(add_test_plugin plugin)
add_library(${plugin} MODULE ${plugin}.c)
- set_target_properties(${plugin} PROPERTIES PREFIX "")
+ if(CMAKE_C_COMPILER_ID MATCHES "Clang") + set(LINK_FLAGS "-undefined dynamic_lookup") + endif(CMAKE_C_COMPILER_ID MATCHES "Clang") + set_target_properties(${plugin} PROPERTIES + LINK_FLAGS "${LINK_FLAGS}" target_link_libraries(${plugin} ${GLIB_LIBRARIES} gplugin)
endmacro(add_test_plugin)
@@ -31,6 +39,7 @@
add_subdirectory(load-on-query-fail)
add_subdirectory(versioned-dependencies)
add_subdirectory(bind-local)
+add_subdirectory(unresolved-symbol) ###############################################################################
@@ -116,6 +125,15 @@
add_dependencies(test-bind-local bind-local)
add_definitions(-DTEST_BIND_LOCAL_DIR="${CMAKE_CURRENT_BINARY_DIR}/bind-local/")
+####################################### +####################################### +add_gtest(test-unresolved-symbol) +add_dependencies(test-unresolved-symbol unresolved-symbol) + -DPLUGIN_DIR="${CMAKE_CURRENT_BINARY_DIR}/unresolved-symbol" ###############################################################################
###############################################################################
--- a/gplugin/tests/test-signals.c Tue Sep 29 22:45:21 2015 -0500
+++ b/gplugin/tests/test-signals.c Tue Aug 23 12:08:22 2016 -0500
@@ -24,6 +24,7 @@
} TestGPluginManagerSignalsData;
/******************************************************************************
@@ -105,6 +106,16 @@
+test_gplugin_manager_signals_load_failed(GPLUGIN_UNUSED GObject *manager, + GPLUGIN_UNUSED GPluginPlugin *plugin, + TestGPluginManagerSignalsData *data = (TestGPluginManagerSignalsData *)d; + data->load_failed = TRUE; /******************************************************************************
*****************************************************************************/
@@ -113,7 +124,7 @@
GPluginPlugin *plugin = NULL;
GObject *manager = gplugin_manager_get_instance();
- TestGPluginManagerSignalsData data = { FALSE, FALSE, FALSE, FALSE };
+ TestGPluginManagerSignalsData data = { FALSE, FALSE, FALSE, FALSE, FALSE }; gulong signals[] = { 0, 0, 0, 0};
@@ -158,7 +169,7 @@
GPluginPlugin *plugin = NULL;
GObject *manager = gplugin_manager_get_instance();
- TestGPluginManagerSignalsData data = { FALSE, FALSE, FALSE, FALSE };
+ TestGPluginManagerSignalsData data = { FALSE, FALSE, FALSE, FALSE, FALSE }; gulong signals[] = { 0, 0, 0, 0};
@@ -200,7 +211,7 @@
GPluginPlugin *plugin = NULL;
GObject *manager = gplugin_manager_get_instance();
- TestGPluginManagerSignalsData data = { FALSE, FALSE, FALSE, FALSE };
+ TestGPluginManagerSignalsData data = { FALSE, FALSE, FALSE, FALSE, FALSE }; gulong signals[] = { 0, 0, 0, 0};
@@ -240,6 +251,36 @@
g_signal_handler_disconnect(manager, signals[3]);
+test_gplugin_manager_signals_load_failure(void) { + GPluginPlugin *plugin = NULL; + GObject *manager = gplugin_manager_get_instance(); + TestGPluginManagerSignalsData data = { FALSE, FALSE, FALSE, FALSE, FALSE }; + gulong signals[] = { 0, 0, 0, 0, 0}; + g_signal_connect(manager, "loading-plugin", + G_CALLBACK(test_gplugin_manager_signals_normal_loading), + g_signal_connect(manager, "load-failed", + G_CALLBACK(test_gplugin_manager_signals_load_failed), + gplugin_manager_append_path(TEST_DIR); + gplugin_manager_refresh(); + plugin = gplugin_manager_find_plugin("gplugin/native-load-failed"); + gplugin_manager_load_plugin(plugin, &error); + g_assert_error(error, GPLUGIN_DOMAIN, 0); + g_assert(data.loading); + g_assert(data.load_failed); + g_signal_handler_disconnect(manager, signals[0]); + g_signal_handler_disconnect(manager, signals[1]); /******************************************************************************
*****************************************************************************/
@@ -256,6 +297,8 @@
test_gplugin_manager_signals_loading_stopped);
g_test_add_func("/manager/signals/unloading-stopped",
test_gplugin_manager_signals_unloading_stopped);
+ g_test_add_func("/manager/signals/load-failed", + test_gplugin_manager_signals_load_failure); --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin/tests/test-unresolved-symbol.c Tue Aug 23 12:08:22 2016 -0500
@@ -0,0 +1,60 @@
+ * Copyright (C) 2011-2016 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> +/****************************************************************************** + *****************************************************************************/ +test_unresolved_symbol(void) { + "*some_unresolved_symbol*" + gplugin_manager_remove_paths(); + gplugin_manager_append_path(PLUGIN_DIR); + gplugin_manager_refresh(); + g_test_assert_expected_messages(); +/****************************************************************************** + *****************************************************************************/ +main(gint argc, gchar **argv) { + g_test_init(&argc, &argv, NULL); + /* test the load on query flag */ + g_test_add_func("/loaders/native/unresolved-symbol", + test_unresolved_symbol); --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin/tests/unresolved-symbol/CMakeLists.txt Tue Aug 23 12:08:22 2016 -0500
@@ -0,0 +1,1 @@
+add_test_plugin(unresolved-symbol) --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin/tests/unresolved-symbol/unresolved-symbol.c Tue Aug 23 12:08:22 2016 -0500
@@ -0,0 +1,41 @@
+ * Copyright (C) 2011-2016 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> +G_MODULE_EXPORT GPluginPluginInfo * +gplugin_query(GPLUGIN_UNUSED GError **error) { + some_unresolved_symbol(); +G_MODULE_EXPORT gboolean +gplugin_load(GPLUGIN_UNUSED GPluginNativePlugin *plugin, + GPLUGIN_UNUSED GError **error) +G_MODULE_EXPORT gboolean +gplugin_unload(GPLUGIN_UNUSED GPluginNativePlugin *plugin, + GPLUGIN_UNUSED GError **error) --- a/lua/CMakeLists.txt Tue Sep 29 22:45:21 2015 -0500
+++ b/lua/CMakeLists.txt Tue Aug 23 12:08:22 2016 -0500
@@ -20,7 +20,7 @@
- set(_LUAS "luajit>=2.0.0;lua>=5.1.0;lua5.2>=5.2.0;lua5.1>=5.1.0")
+ set(_LUAS "lua>=5.1.0;lua5.1>=5.1.0;luajit>=2.0.0;lua5.2>=5.2.0") pkg_check_modules(LUA ${_LUA})
@@ -33,6 +33,8 @@
include_directories(${LUA_INCLUDE_DIRS})
+ link_directories(${LUA_LIBRARY_DIRS}) message(STATUS "checking for lua module 'lgi'")
# compile our lua-lgi test program
@@ -42,6 +44,7 @@
-DINCLUDE_DIRECTORIES:STRING=${LUA_INCLUDE_DIRS}
-DLINK_LIBRARIES:STRING=${LUA_LIBRARIES}
+ -DLINK_DIRECTORIES:STRING=${LUA_LIBRARY_DIRS} COPY_FILE ${CMAKE_CURRENT_BINARY_DIR}/gplugin-lua-test-lgi
--- a/lua/gplugin-lua-test-lgi.c Tue Sep 29 22:45:21 2015 -0500
+++ b/lua/gplugin-lua-test-lgi.c Tue Aug 23 12:08:22 2016 -0500
@@ -16,18 +16,46 @@
+_add_require_path(lua_State *L, const char *path) { + const char *pkg_path = NULL; + lua_getglobal(L, "package"); + lua_getfield(L, -1, "path"); // get field "path" from table at top of stack (-1) + pkg_path = lua_tostring(L, -1); // grab path string from top of stack + memset(buff, 0, sizeof(buff)); + snprintf(buff, sizeof(buff), "%s;%s", pkg_path, path); + lua_pop(L, 1); // pop off the path field + lua_pushstring(L, buff); // push the new one + lua_setfield(L, -2, "path"); // set the field "path" in table at -2 with value at top of stack + lua_pop( L, 1 ); // get rid of package table from top of stack main(int argc, char *argv[]) {
- lua_State *L = luaL_newstate();
+ /* add some additional paths to package.path */ + //_add_require_path(L, "/usr/local/lib/luarocks/rocks"); + /* now try to do the require */ lua_getglobal(L, "require");
lua_pushstring(L, "lgi");
--- a/lua/tests/CMakeLists.txt Tue Sep 29 22:45:21 2015 -0500
+++ b/lua/tests/CMakeLists.txt Tue Aug 23 12:08:22 2016 -0500
@@ -24,10 +24,10 @@
add_lua_gtest(test-lua-loader)
target_link_libraries(test-lua-loader gplugin-loader-tests)
add_lua_gtest(test-lua-moon-loader)
target_link_libraries(test-lua-moon-loader gplugin-loader-tests)
-endif(${MOONSCRIPT_TESTS})
set(GTESTER_LUA_TESTS "${LUA_TESTS}")
set(GTESTER_LUA_LOG "test-gplugin-lua.xml")
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/packaging/CMakeLists.txt Tue Aug 23 12:08:22 2016 -0500
@@ -0,0 +1,1 @@
+configure_file(gplugin.spec.in gplugin.spec @ONLY) --- a/packaging/debian/changelog Tue Sep 29 22:45:21 2015 -0500
+++ b/packaging/debian/changelog Tue Aug 23 12:08:22 2016 -0500
@@ -1,3 +1,39 @@
+gplugin (0.27) unstable; urgency=medium + * New upstream release, see official changelog + -- Gary Kramlich <grim@reaperworld.com> Mon, 18 Apr 2016 22:31:45 -0500 +gplugin (0.26) unstable; urgency=medium + * New upstream release, see official changelog + -- Gary Kramlich <grim@reaperworld.com> Mon, 18 Apr 2016 22:31:30 -0500 +gplugin (0.25) unstable; urgency=medium + * New upstream release, see official changelog + -- Gary Kramlich <grim@reaperworld.com> Sat, 06 Feb 2016 20:28:53 -0600 +gplugin (0.24.1) unstable; urgency=medium + * New upstream release, see official changelog + -- Gary Kramlich <grim@reaperworld.com> Sat, 06 Feb 2016 20:28:47 -0600 +gplugin (0.0.24) unstable; urgency=medium + * New upstream release, see official changelog + -- Gary Kramlich <grim@reaperworld.com> Thu, 28 Jan 2016 22:38:05 -0600 +gplugin (0.0.23) unstable; urgency=medium + * New release, see official changelog + -- Gary Kramlich <grim@reaperworld.com> Wed, 06 Jan 2016 23:05:37 -0600 gplugin (0.0.21) unstable; urgency=medium
* New release, see official changelog
--- a/packaging/debian/control Tue Sep 29 22:45:21 2015 -0500
+++ b/packaging/debian/control Tue Aug 23 12:08:22 2016 -0500
@@ -2,7 +2,8 @@
Maintainer: Gary Kramlich <grim@reaperworld.com>
-Build-Depends: debhelper (>=9), cmake, libglib2.0-dev, libgtk-3-dev,
+Build-Depends: debhelper (>=9), dh-exec, + cmake, libglib2.0-dev, libgtk-3-dev, xsltproc, gettext, help2man,
gobject-introspection, libgirepository1.0-dev,
liblua5.1-0-dev, lua-lgi,
@@ -23,18 +24,6 @@
This package contains the main library.
-Package: libgplugin0-dbg
-Depends: ${misc:Depends}, libgplugin0 (= ${binary:Version})
-Description: debugging symbols for libgplugin0
- GPlugin is a GObject based library that implements a reusable plugin system
- which supports loading plugins in other languages via loaders. It relies
- heavily on GObjectIntrospection to expose its API to the other languages.
- This package contains the debugging symbols for libgplugin0.
@@ -68,18 +57,6 @@
This library provides some default GTK+-3 widgets for GPlugin.
-Package: libgplugin-gtk0-dbg
-Depends: ${misc:Depends}, libgplugin-gtk0 (= ${binary:Version})
-Description: debugging symbols for libgplugin-gtk0
- GPlugin is a GObject based library that implements a reusable plugin system
- which supports loading plugins in other languages via loaders. It relies
- heavily on GObjectIntrospection to expose its API to the other languages.
- This library provides the debugging symbols for libgplugin-gtk0
Package: libgplugin-gtk-dev
@@ -116,7 +93,7 @@
-Depends: ${misc:Depends}, ${shlibs:Depends}, libluajit-5.1,
+Depends: ${misc:Depends}, ${shlibs:Depends}, liblua5.1-0, libgplugin0, gir1.2-gplugin-0.0
Description: GPlugin Lua Loader
GPlugin is a GObject based library that implements a reusable plugin system
--- a/packaging/debian/copyright Tue Sep 29 22:45:21 2015 -0500
+++ b/packaging/debian/copyright Tue Aug 23 12:08:22 2016 -0500
@@ -23,4 +23,3 @@
On Debian systems, the complete text of the GNU Lesser General Public LIcense
can be found in /usr/share/common-licenses/LGPL-3.
--- a/packaging/debian/gir1.2-gplugin-0.0.install Tue Sep 29 22:45:21 2015 -0500
+++ b/packaging/debian/gir1.2-gplugin-0.0.install Tue Aug 23 12:08:22 2016 -0500
@@ -1,3 +1,3 @@
-usr/lib/*/girepository-1.0/
+usr/lib/${DEB_HOST_MULTIARCH}/girepository-1.0/
--- a/packaging/debian/libgplugin-dev.install Tue Sep 29 22:45:21 2015 -0500
+++ b/packaging/debian/libgplugin-dev.install Tue Aug 23 12:08:22 2016 -0500
@@ -1,6 +1,6 @@
usr/include/gplugin-1.0/gplugin
usr/include/gplugin-1.0/gplugin.h
usr/include/gplugin-1.0/gplugin-native.h
-usr/lib/*/pkgconfig/gplugin.pc
+usr/lib/${DEB_HOST_MULTIARCH}/libgplugin.so +usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig/gplugin.pc --- a/packaging/debian/libgplugin-gtk-bin.install Tue Sep 29 22:45:21 2015 -0500
+++ b/packaging/debian/libgplugin-gtk-bin.install Tue Aug 23 12:08:22 2016 -0500
@@ -1,3 +1,2 @@
usr/bin/gplugin-gtk-viewer
usr/share/man/man1/gplugin-gtk-viewer.1
--- a/packaging/debian/libgplugin-gtk-dev.install Tue Sep 29 22:45:21 2015 -0500
+++ b/packaging/debian/libgplugin-gtk-dev.install Tue Aug 23 12:08:22 2016 -0500
@@ -1,5 +1,5 @@
usr/include/gplugin-1.0/gplugin-gtk
usr/include/gplugin-1.0/gplugin-gtk.h
-usr/lib/*/libgplugin-gtk.so
-usr/lib/*/pkgconfig/gplugin-gtk.pc
+usr/lib/${DEB_HOST_MULTIARCH}/libgplugin-gtk.so +usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig/gplugin-gtk.pc --- a/packaging/debian/libgplugin-gtk0.install Tue Sep 29 22:45:21 2015 -0500
+++ b/packaging/debian/libgplugin-gtk0.install Tue Aug 23 12:08:22 2016 -0500
@@ -1,2 +1,2 @@
-usr/lib/*/libgplugin-gtk.so.*
+usr/lib/${DEB_HOST_MULTIARCH}/libgplugin-gtk.so.* --- a/packaging/debian/libgplugin-gtk0.postinst Tue Sep 29 22:45:21 2015 -0500
+++ b/packaging/debian/libgplugin-gtk0.postinst Tue Aug 23 12:08:22 2016 -0500
@@ -9,4 +9,3 @@
--- a/packaging/debian/libgplugin-gtk0.postrm Tue Sep 29 22:45:21 2015 -0500
+++ b/packaging/debian/libgplugin-gtk0.postrm Tue Aug 23 12:08:22 2016 -0500
@@ -9,4 +9,3 @@
--- a/packaging/debian/libgplugin-gtk0.symbols Tue Sep 29 22:45:21 2015 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-libgplugin-gtk.so.0 libgplugin-gtk0 #MINVER#
- gplugin_gtk_get_store_column_types@Base 0.0.17
- gplugin_gtk_plugin_info_get_plugin@Base 0.0.17
- gplugin_gtk_plugin_info_get_type@Base 0.0.17
- gplugin_gtk_plugin_info_new@Base 0.0.17
- gplugin_gtk_plugin_info_set_plugin@Base 0.0.17
- gplugin_gtk_store_get_type@Base 0.0.17
- gplugin_gtk_store_new@Base 0.0.17
- gplugin_gtk_view_get_show_internal@Base 0.0.17
- gplugin_gtk_view_get_type@Base 0.0.17
- gplugin_gtk_view_new@Base 0.0.17
- gplugin_gtk_view_set_show_internal@Base 0.0.17
--- a/packaging/debian/libgplugin-lua.install Tue Sep 29 22:45:21 2015 -0500
+++ b/packaging/debian/libgplugin-lua.install Tue Aug 23 12:08:22 2016 -0500
@@ -1,2 +1,2 @@
-usr/lib/*/gplugin/gplugin-lua.so usr/lib/*/gplugin
+usr/lib/${DEB_HOST_MULTIARCH}/gplugin/gplugin-lua.so --- a/packaging/debian/libgplugin-python.install Tue Sep 29 22:45:21 2015 -0500
+++ b/packaging/debian/libgplugin-python.install Tue Aug 23 12:08:22 2016 -0500
@@ -1,2 +1,2 @@
-usr/lib/*/gplugin/gplugin-python.so usr/lib/*/gplugin
+usr/lib/${DEB_HOST_MULTIARCH}/gplugin/gplugin-python.so --- a/packaging/debian/libgplugin0.install Tue Sep 29 22:45:21 2015 -0500
+++ b/packaging/debian/libgplugin0.install Tue Aug 23 12:08:22 2016 -0500
@@ -1,4 +1,4 @@
-usr/lib/*/libgplugin.so.*
+usr/lib/${DEB_HOST_MULTIARCH}/libgplugin.so.* usr/share/man/man1/gplugin-query.1
--- a/packaging/debian/libgplugin0.postinst Tue Sep 29 22:45:21 2015 -0500
+++ b/packaging/debian/libgplugin0.postinst Tue Aug 23 12:08:22 2016 -0500
@@ -5,4 +5,3 @@
--- a/packaging/debian/libgplugin0.postrm Tue Sep 29 22:45:21 2015 -0500
+++ b/packaging/debian/libgplugin0.postrm Tue Aug 23 12:08:22 2016 -0500
@@ -5,4 +5,3 @@
--- a/packaging/debian/libgplugin0.symbols Tue Sep 29 22:45:21 2015 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-libgplugin.so.0 libgplugin0 #MINVER#
- dependency_pattern@Base 0.0.17
- dependency_regex@Base 0.0.17
- gplugin_boolean_accumulator@Base 0.0.17
- gplugin_file_tree_entry_free@Base 0.0.17
- gplugin_file_tree_entry_new@Base 0.0.17
- gplugin_file_tree_free@Base 0.0.17
- gplugin_file_tree_new@Base 0.0.17
- gplugin_get_option_group@Base 0.0.17
- gplugin_init@Base 0.0.17
- gplugin_loader_class_get_supported_extensions@Base 0.0.17
- gplugin_loader_get_type@Base 0.0.17
- gplugin_loader_load_plugin@Base 0.0.17
- gplugin_loader_query_plugin@Base 0.0.17
- gplugin_loader_unload_plugin@Base 0.0.17
- gplugin_manager_add_app_paths@Base 0.0.17
- gplugin_manager_add_default_paths@Base 0.0.17
- gplugin_manager_append_path@Base 0.0.17
- gplugin_manager_find_plugin@Base 0.0.17
- gplugin_manager_find_plugins@Base 0.0.17
- gplugin_manager_free_plugin_list@Base 0.0.17
- gplugin_manager_get_instance@Base 0.0.17
- gplugin_manager_get_paths@Base 0.0.17
- gplugin_manager_get_type@Base 0.0.17
- gplugin_manager_list_plugins@Base 0.0.17
- gplugin_manager_load_plugin@Base 0.0.17
- gplugin_manager_prepend_path@Base 0.0.17
- gplugin_manager_private_init@Base 0.0.17
- gplugin_manager_private_uninit@Base 0.0.17
- gplugin_manager_refresh@Base 0.0.17
- gplugin_manager_register_loader@Base 0.0.17
- gplugin_manager_remove_path@Base 0.0.17
- gplugin_manager_remove_paths@Base 0.0.17
- gplugin_manager_unload_plugin@Base 0.0.17
- gplugin_manager_unregister_loader@Base 0.0.17
- gplugin_marshal_BOOLEAN__OBJECT_POINTER@Base 0.0.17
- gplugin_marshal_VOID__ENUM_ENUM@Base 0.0.17
- gplugin_marshal_VOID__INT_INT@Base 0.0.17
- gplugin_native_loader_get_type@Base 0.0.17
- gplugin_native_plugin_add_interface@Base 0.0.17
- gplugin_native_plugin_get_module@Base 0.0.17
- gplugin_native_plugin_get_type@Base 0.0.17
- gplugin_native_plugin_register_enum@Base 0.0.17
- gplugin_native_plugin_register_flags@Base 0.0.17
- gplugin_native_plugin_register_type@Base 0.0.17
- gplugin_native_plugin_unuse@Base 0.0.17
- gplugin_native_plugin_use@Base 0.0.17
- gplugin_plugin_get_filename@Base 0.0.17
- gplugin_plugin_get_info@Base 0.0.17
- gplugin_plugin_get_internal_filename@Base 0.0.17
- gplugin_plugin_get_loader@Base 0.0.17
- gplugin_plugin_get_state@Base 0.0.17
- gplugin_plugin_get_type@Base 0.0.17
- gplugin_plugin_info_get_abi_version@Base 0.0.17
- gplugin_plugin_info_get_authors@Base 0.0.17
- gplugin_plugin_info_get_bind_local@Base 0.0.17
- gplugin_plugin_info_get_category@Base 0.0.17
- gplugin_plugin_info_get_dependencies@Base 0.0.17
- gplugin_plugin_info_get_description@Base 0.0.17
- gplugin_plugin_info_get_help@Base 0.0.17
- gplugin_plugin_info_get_icon@Base 0.0.17
- gplugin_plugin_info_get_id@Base 0.0.17
- gplugin_plugin_info_get_internal@Base 0.0.17
- gplugin_plugin_info_get_license_id@Base 0.0.17
- gplugin_plugin_info_get_license_text@Base 0.0.17
- gplugin_plugin_info_get_license_url@Base 0.0.17
- gplugin_plugin_info_get_load_on_query@Base 0.0.17
- gplugin_plugin_info_get_name@Base 0.0.17
- gplugin_plugin_info_get_summary@Base 0.0.17
- gplugin_plugin_info_get_type@Base 0.0.17
- gplugin_plugin_info_get_version@Base 0.0.17
- gplugin_plugin_info_get_version_func@Base 0.0.17
- gplugin_plugin_info_get_website@Base 0.0.17
- gplugin_plugin_set_state@Base 0.0.17
- gplugin_plugin_state_get_type@Base 0.0.17
- gplugin_uninit@Base 0.0.17
- gplugin_version_compare@Base 0.0.17
--- a/packaging/debian/rules Tue Sep 29 22:45:21 2015 -0500
+++ b/packaging/debian/rules Tue Aug 23 12:08:22 2016 -0500
@@ -3,12 +3,3 @@
- dh_makeshlibs -plibgplugin0
- dh_makeshlibs -plibgplugin-gtk0
- dh_strip -plibgplugin0 --dbg-package=libgplugin0-dbg
- dh_strip -plibgplugin-gtk0 --dbg-package=libgplugin-gtk0-dbg
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/packaging/gplugin.spec.in Tue Aug 23 12:08:22 2016 -0500
@@ -0,0 +1,245 @@
+Version: @GPLUGIN_VERSION@ +Release: %{?build_number}%{?!build_number:1} +Summary: A GObject based library that implements a reusable plugin system +Url: https://bitbucket.org/rw_grim/gplugin/overview +Group: Development/Libraries +BuildRequires: cmake >= 2.8 +BuildRequires: glib2-devel >= 2.20.0 +BuildRequires: gobject-introspection-devel +BuildRequires: gtk3-devel +BuildRequires: lua-devel +BuildRequires: python3-devel +BuildRequires: python3-gobject +BuildRequires: /usr/lib64/pkgconfig/pygobject-3.0.pc +%if 0%{?suse_version} > 0 +# avoid "directories not owned by a package" error +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}%{?_isa} = %{version}-%{release} +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}-gtk3%{?_isa} = %{version}-%{release} +Requires: %{name}-devel%{?_isa} = %{version}-%{release} +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 +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. +%description -n libgplugin0 +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. +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 all necessary include files and libraries needed +to develop 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 additional GTK3 dependencies 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 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 Lua 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 Python 3 loader for %{name} library. +CFLAGS="%{optflags}" cmake \ + -DCMAKE_INSTALL_PREFIX=%{_prefix} \ +make install DESTDIR=%{buildroot} +rm -rf %{buildroot}%{_datadir}/doc/gplugin/ +%if %{notownedhack} == 1 +rm -rf %{buildroot}%{_datadir}/gplugin/ +%post -n libgplugin0 -p /sbin/ldconfig +%postun -n libgplugin0 -p /sbin/ldconfig +%post -n gplugin-gtk3 -p /sbin/ldconfig +%postun -n gplugin-gtk3 -p /sbin/ldconfig +%if %{notownedhack} == 0 +%{_bindir}/gplugin-query +%{_mandir}/man1/gplugin-query.1* +%{_libdir}/libgplugin.so.0.1.0 +%if %{notownedhack} == 0 +%{_includedir}/gplugin-1.0/ +%{_libdir}/libgplugin.so +%{_libdir}/libgplugin.so.0 +%{_libdir}/pkgconfig/gplugin.pc +%{_libdir}/pkgconfig/gplugin-gtk.pc +%{_libdir}/girepository-1.0/GPlugin-0.0.typelib +%{_datadir}/gir-1.0/GPlugin-0.0.gir +%if %{notownedhack} == 0 +%{_bindir}/gplugin-gtk-viewer +%{_libdir}/libgplugin-gtk.so.0.1.0 +%if %{notownedhack} == 0 +%{_datadir}/gplugin/gplugin-gtk/ +%{_mandir}/man1/gplugin-gtk-viewer.1* +%if %{notownedhack} == 0 +%{_libdir}/libgplugin-gtk.so +%{_libdir}/libgplugin-gtk.so.0 +%{_libdir}/gplugin/gplugin-lua.so +%if %{notownedhack} == 0 +%{_libdir}/gplugin/gplugin-python.so +* Sun May 15 2016 Gary Kramlich <grim@reaperworld.com> +- Updates and pulled upstream +* Mon May 4 2015 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.0.18-1 +- Initial package release --- a/python/CMakeLists.txt Tue Sep 29 22:45:21 2015 -0500
+++ b/python/CMakeLists.txt Tue Aug 23 12:08:22 2016 -0500
@@ -32,6 +32,8 @@
${PYGOBJECT_INCLUDE_DIRS}
+ link_directories(${PYTHON3_LIBRARY_DIRS}) message(STATUS "checking if pygobject works with python3")
set(GPLUGIN_PYTHON_TEST_PYGOBJECT_INCLUDES)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tcc/CMakeLists.txt Tue Aug 23 12:08:22 2016 -0500
@@ -0,0 +1,39 @@
+ "Whether or not to build the TCC plugin loader" + set(GPLUGIN_TCC_SOURCES + set(GPLUGIN_TCC_HEADERS + find_package(LibTcc REQUIRED) + include_directories(${LIBTCC_INCLUDE_DIR}) + #pkg_check_modules(TCC REQUIRED libtcc) + add_library(gplugin-tcc MODULE + set_target_properties(gplugin-tcc PROPERTIES PREFIX "") + target_link_libraries(gplugin-tcc + install(TARGETS gplugin-tcc DESTINATION lib/gplugin) --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tcc/gplugin-tcc-core.c Tue Aug 23 12:08:22 2016 -0500
@@ -0,0 +1,67 @@
+ * Copyright (C) 2011-2013 Gary Kramlich <grim@reaperworld.com> + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program 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 General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. +#include <gplugin-native.h> +#include "gplugin-tcc-loader.h" +#include "gplugin-tcc-plugin.h" +G_MODULE_EXPORT GPluginPluginInfo * +gplugin_query(GPLUGIN_UNUSED GError **error) { + const gchar * const authors[] = { + "Eion Robb <eion@robbmob.com>", + return gplugin_plugin_info_new( + GPLUGIN_NATIVE_PLUGIN_ABI_VERSION, + "name", "C source plugin loader", + "version", GPLUGIN_VERSION, + "summary", "A plugin that can load C source plugins", + "description", "This plugin allows the loading of plugins written in C.", + "website", GPLUGIN_WEBSITE, +G_MODULE_EXPORT gboolean +gplugin_load(GPluginNativePlugin *plugin, + GPLUGIN_UNUSED GError **error) + gplugin_tcc_loader_register(plugin); + gplugin_tcc_plugin_register(plugin); + gplugin_manager_register_loader(gplugin_tcc_loader_get_type()); +G_MODULE_EXPORT gboolean +gplugin_unload(GPLUGIN_UNUSED GPluginNativePlugin *plugin, + GPLUGIN_UNUSED GError **error) --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tcc/gplugin-tcc-loader.c Tue Aug 23 12:08:22 2016 -0500
@@ -0,0 +1,203 @@
+ * Copyright (C) 2011-2013 Gary Kramlich <grim@reaperworld.com> + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program 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 General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. +#include "gplugin-tcc-loader.h" +#include "gplugin-tcc-plugin.h" +/****************************************************************************** + *****************************************************************************/ +static GObjectClass *parent_class = NULL; +static GType type_real = 0; +/****************************************************************************** + * GPluginLoaderInterface API + *****************************************************************************/ +gplugin_tcc_loader_class_supported_extensions(GPLUGIN_UNUSED const GPluginLoaderClass *klass) { + exts = g_slist_append(exts, "c"); +gplugin_tcc_loader_query(GPluginLoader *loader, const gchar *filename, + GPluginPlugin *plugin = NULL; + GPluginPluginInfo *info = NULL; + gpointer memneeded = NULL; + GPluginTccPluginQueryFunc gplugin_query = NULL; + tcc_set_output_type(s, TCC_OUTPUT_MEMORY); + if(tcc_add_file(s, filename) == -1) { + *error = g_error_new(GPLUGIN_DOMAIN, 0, "couldn't load file %s", filename); + /* copy code into memory */ + if((memsize = tcc_relocate(s, NULL)) < 0) { + *error = g_error_new(GPLUGIN_DOMAIN, 0, "couldn't work out how much memory is needed"); + memneeded = g_malloc0(memsize); + if(tcc_relocate(s, memneeded) < 0) { + *error = g_error_new(GPLUGIN_DOMAIN, 0, "could not relocate plugin into memory"); + gplugin_query = (GPluginTccPluginQueryFunc) tcc_get_symbol(s, "gplugin_query"); + if (gplugin_query == NULL) { + *error = g_error_new(GPLUGIN_DOMAIN, 0, "no gplugin_query function found"); + info = gplugin_query(error); + plugin = g_object_new(GPLUGIN_TYPE_TCC_PLUGIN, +gplugin_tcc_loader_load(GPLUGIN_UNUSED GPluginLoader *loader, + GPluginTccPluginLoadFunc gplugin_load = NULL; + TCCState *s = gplugin_tcc_plugin_get_state(GPLUGIN_TCC_PLUGIN(plugin)); + gplugin_load = (GPluginTccPluginLoadFunc) tcc_get_symbol(s, "gplugin_load"); + if (gplugin_load == NULL) { + *error = g_error_new(GPLUGIN_DOMAIN, 0, "no gplugin_load function found"); + return gplugin_load(GPLUGIN_NATIVE_PLUGIN(plugin), error); +gplugin_tcc_loader_unload(GPLUGIN_UNUSED GPluginLoader *loader, + GPluginTccPluginLoadFunc gplugin_unload = NULL; + TCCState *s = gplugin_tcc_plugin_get_state(GPLUGIN_TCC_PLUGIN(plugin)); + gplugin_unload = (GPluginTccPluginUnloadFunc) tcc_get_symbol(s, "gplugin_unload"); + if (gplugin_unload == NULL) { + *error = g_error_new(GPLUGIN_DOMAIN, 0, "no gplugin_unload function found"); + return gplugin_unload(GPLUGIN_NATIVE_PLUGIN(plugin), error); +/****************************************************************************** + *****************************************************************************/ +gplugin_tcc_loader_class_init(GPluginTccLoaderClass *klass) { + GPluginLoaderClass *loader_class = GPLUGIN_LOADER_CLASS(klass); + parent_class = g_type_class_peek_parent(klass); + loader_class->supported_extensions = + gplugin_tcc_loader_class_supported_extensions; + loader_class->query = gplugin_tcc_loader_query; + loader_class->load = gplugin_tcc_loader_load; + loader_class->unload = gplugin_tcc_loader_unload; +/****************************************************************************** + *****************************************************************************/ +gplugin_tcc_loader_register(GPluginNativePlugin *plugin) { + if(g_once_init_enter(&type_real)) { + static const GTypeInfo info = { + .class_size = sizeof(GPluginTccLoaderClass), + .class_init = (GClassInitFunc)gplugin_tcc_loader_class_init, + .instance_size = sizeof(GPluginTccLoader), + type = gplugin_native_plugin_register_type(plugin, + g_once_init_leave(&type_real, type); +gplugin_tcc_loader_get_type(void) { + if(G_UNLIKELY(type_real == 0)) { + g_warning("gplugin_tcc_loader_get_type was called before " + "the type was registered!\n"); --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tcc/gplugin-tcc-loader.h Tue Aug 23 12:08:22 2016 -0500
@@ -0,0 +1,59 @@
+ * Copyright (C) 2011-2013 Gary Kramlich <grim@reaperworld.com> + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program 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 General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. +#ifndef GPLUGIN_TCC_LOADER_H +#define GPLUGIN_TCC_LOADER_H +#define GPLUGIN_TYPE_TCC_LOADER (gplugin_tcc_loader_get_type()) +#define GPLUGIN_TCC_LOADER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GPLUGIN_TYPE_TCC_LOADER, GPluginTccLoader)) +#define GPLUGIN_TCC_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((obj), GPLUGIN_TYPE_TCC_LOADER, GPluginTccLoaderClass)) +#define GPLUGIN_IS_TCC_LOADER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GPLUGIN_TYPE_TCC_LOADER)) +#define GPLUGIN_IS_TCC_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((obj), GPLUGIN_TYPE_TCC_LOADER)) +#define GPLUGIN_TCC_LOADER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GPLUGIN_TYPE_TCC_LOADER, GPluginTccLoaderClass)) +typedef struct _GPluginTccLoader GPluginTccLoader; +typedef struct _GPluginTccLoaderClass GPluginTccLoaderClass; +#include <gplugin-native.h> +struct _GPluginTccLoader { + void (*_gplugin_reserved_1)(void); + void (*_gplugin_reserved_2)(void); + void (*_gplugin_reserved_3)(void); + void (*_gplugin_reserved_4)(void); +struct _GPluginTccLoaderClass { + GPluginLoaderClass parent; + void (*_gplugin_reserved_1)(void); + void (*_gplugin_reserved_2)(void); + void (*_gplugin_reserved_3)(void); + void (*_gplugin_reserved_4)(void); +void gplugin_tcc_loader_register(GPluginNativePlugin *plugin); +GType gplugin_tcc_loader_get_type(void); +#endif /* GPLUGIN_TCC_LOADER_H */ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tcc/gplugin-tcc-plugin.c Tue Aug 23 12:08:22 2016 -0500
@@ -0,0 +1,183 @@
+ * Copyright (C) 2011-2013 Gary Kramlich <grim@reaperworld.com> + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program 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 General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. +#include "gplugin-tcc-plugin.h" +#define GPLUGIN_TCC_PLUGIN_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE((obj), GPLUGIN_TYPE_TCC_PLUGIN, GPluginTccPluginPrivate)) +/****************************************************************************** + *****************************************************************************/ +} GPluginTccPluginPrivate; +/****************************************************************************** + *****************************************************************************/ +/****************************************************************************** + *****************************************************************************/ +static GObjectClass *parent_class = NULL; +static GType type_real = 0; +/****************************************************************************** + *****************************************************************************/ +gplugin_tcc_plugin_set_state(GPluginTccPlugin *plugin, TCCState *s) { + GPluginTccPluginPrivate *priv = GPLUGIN_TCC_PLUGIN_GET_PRIVATE(plugin); +gplugin_tcc_plugin_set_memory(GPluginTccPlugin *plugin, gpointer mem) { + GPluginTccPluginPrivate *priv = GPLUGIN_TCC_PLUGIN_GET_PRIVATE(plugin); +/****************************************************************************** + *****************************************************************************/ +gplugin_tcc_plugin_get_property(GObject *obj, guint param_id, GValue *value, + GPluginTccPlugin *plugin = GPLUGIN_TCC_PLUGIN(obj); + g_value_set_pointer(value, + gplugin_tcc_plugin_get_state(plugin)); + G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); +gplugin_tcc_plugin_set_property(GObject *obj, guint param_id, + const GValue *value, GParamSpec *pspec) + GPluginTccPlugin *plugin = GPLUGIN_TCC_PLUGIN(obj); + gplugin_tcc_plugin_set_state(plugin, + g_value_get_pointer(value)); + gplugin_tcc_plugin_set_memory(plugin, + g_value_get_pointer(value)); + G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); +gplugin_tcc_plugin_finalize(GObject *obj) { + GPluginTccPluginPrivate *priv = GPLUGIN_TCC_PLUGIN_GET_PRIVATE(obj); + G_OBJECT_CLASS(parent_class)->finalize(obj); +gplugin_tcc_plugin_class_init(GPluginTccPluginClass *klass) { + GObjectClass *obj_class = G_OBJECT_CLASS(klass); + parent_class = g_type_class_peek_parent(klass); + g_type_class_add_private(klass, sizeof(GPluginTccPluginPrivate)); + obj_class->get_property = gplugin_tcc_plugin_get_property; + obj_class->set_property = gplugin_tcc_plugin_set_property; + obj_class->finalize = gplugin_tcc_plugin_finalize; + g_object_class_install_property(obj_class, PROP_STATE, + g_param_spec_pointer("state", "state", + "The TCC compilation context for the plugin", + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property(obj_class, PROP_MEM, + g_param_spec_pointer("memory", "memory", + "The memory allocated for the symbol table for the plugin", + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); +/****************************************************************************** + *****************************************************************************/ +gplugin_tcc_plugin_register(GPluginNativePlugin *plugin) { + if(g_once_init_enter(&type_real)) { + static const GTypeInfo info = { + .class_size = sizeof(GPluginTccPluginClass), + .class_init = (GClassInitFunc)gplugin_tcc_plugin_class_init, + .instance_size = sizeof(GPluginTccPlugin), + type = gplugin_native_plugin_register_type(plugin, + g_once_init_leave(&type_real, type); +gplugin_tcc_plugin_get_type(void) { + if(G_UNLIKELY(type_real == 0)) { + g_warning("gplugin_tcc_plugin_get_type was called before " + "the type was registered!\n"); +gplugin_tcc_plugin_get_state(const GPluginTccPlugin *plugin) { + GPluginTccPluginPrivate *priv = GPLUGIN_TCC_PLUGIN_GET_PRIVATE(plugin); --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tcc/gplugin-tcc-plugin.h Tue Aug 23 12:08:22 2016 -0500
@@ -0,0 +1,62 @@
+ * Copyright (C) 2011-2013 Gary Kramlich <grim@reaperworld.com> + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program 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 General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. +#ifndef GPLUGIN_TCC_PLUGIN_H +#define GPLUGIN_TCC_PLUGIN_H +#define GPLUGIN_TYPE_TCC_PLUGIN (gplugin_tcc_plugin_get_type()) +#define GPLUGIN_TCC_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GPLUGIN_TYPE_TCC_PLUGIN, GPluginTccPlugin)) +#define GPLUGIN_TCC_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((obj), GPLUGIN_TYPE_TCC_PLUGIN, GPluginTccPluginClass)) +#define GPLUGIN_IS_TCC_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GPLUGIN_TYPE_TCC_PLUGIN)) +#define GPLUGIN_IS_TCC_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((obj), GPLUGIN_TYPE_TCC_PLUGIN)) +#define GPLUGIN_TCC_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GPLUGIN_TYPE_TCC_PLUGIN, GPluginTccPluginClass)) +typedef struct _GPluginTccPlugin GPluginTccPlugin; +typedef struct _GPluginTccPluginClass GPluginTccPluginClass; +#include <gplugin-native.h> +struct _GPluginTccPlugin { +struct _GPluginTccPluginClass { + GPluginPluginClass parent; + void (*_gplugin_reserved_1)(void); + void (*_gplugin_reserved_2)(void); + void (*_gplugin_reserved_3)(void); + void (*_gplugin_reserved_4)(void); +void gplugin_tcc_plugin_register(GPluginNativePlugin *plugin); +GType gplugin_tcc_plugin_get_type(void); +TCCState *gplugin_tcc_plugin_get_state(const GPluginTccPlugin *plugin); +typedef GPluginPluginInfo *(*GPluginTccPluginQueryFunc)(GError **error); +typedef gboolean (*GPluginTccPluginLoadFunc)(GPluginNativePlugin *plugin, GError **error); +typedef gboolean (*GPluginTccPluginUnloadFunc)(GPluginNativePlugin *plugin, GError **error); +#endif /* GPLUGIN_TCC_PLUGIN_H */ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tcc/tests/CMakeLists.txt Tue Aug 23 12:08:22 2016 -0500
@@ -0,0 +1,52 @@
+macro(add_tcc_gtest target) + add_executable(${target} ${target}.c) + target_link_libraries(${target} + ${GLIB_LIBRARIES} ${TCC_LIBRARIES} gplugin + add_dependencies(${target} gplugin-tcc) + get_target_property(_output_name ${target} RUNTIME_OUTPUT_NAME) + if(NOT ${_output_name}) + get_target_property(_output_name ${target} LOCATION) + endif(NOT ${_output_name}) + list(APPEND TCC_TESTS ${_output_name}) + -DTCC_LOADER_DIR="${CMAKE_BINARY_DIR}/tcc" + -DTCC_PLUGIN_DIR="${CMAKE_CURRENT_SOURCE_DIR}/plugins" +add_tcc_gtest(test-tcc-loader) +target_link_libraries(test-tcc-loader gplugin-loader-tests) +set(GTESTER_TCC_TESTS "${TCC_TESTS}") +set(GTESTER_TCC_LOG "test-gplugin-tcc.xml") +set(GTESTER_TCC_JUNIT "test-gplugin-tcc-junit.xml") + COMMAND ${GTESTER} -k --verbose -o ${GTESTER_TCC_LOG} ${TCC_TESTS} + OUTPUT ${GTESTER_TCC_LOG} + DEPENDS gplugin ${GPLUGIN_GIR_TARGETS} gplugin-tcc + ${TCC_TESTS} ${CMAKE_CURRENT_SOURCE_DIR}/plugins + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND ${XSLTPROC} -o ${GTESTER_TCC_JUNIT} --nonet + ${CMAKE_SOURCE_DIR}/xsl/gtester-junit.xsl + OUTPUT ${GTESTER_TCC_JUNIT} + DEPENDS ${GTESTER_TCC_LOG} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} +add_custom_target(tcc-tests ALL + DEPENDS ${GTESTER_TCC_LOG} ${GTESTER_TCC_JUNIT} ${TCC_TESTS} --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tcc/tests/plugins/basic-plugin.c Tue Aug 23 12:08:22 2016 -0500
@@ -0,0 +1,55 @@
+ * Copyright (C) 2011-2013 Gary Kramlich <grim@reaperworld.com> + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program 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 General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. +#include <gplugin-native.h> +G_MODULE_EXPORT GPluginPluginInfo * +gplugin_query(GPLUGIN_UNUSED GError **error) { + const gchar * const authors[] = { + return gplugin_plugin_info_new( + "gplugin/native-basic-plugin", + "name", "basic plugin", + "license-id", "license", + "description", "description", +G_MODULE_EXPORT gboolean +gplugin_load(GPLUGIN_UNUSED GPluginNativePlugin *plugin, + GPLUGIN_UNUSED GError **error) +G_MODULE_EXPORT gboolean +gplugin_unload(GPLUGIN_UNUSED GPluginNativePlugin *plugin, + GPLUGIN_UNUSED GError **error) --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tcc/tests/plugins/dependent.c Tue Aug 23 12:08:22 2016 -0500
@@ -0,0 +1,49 @@
+ * Copyright (C) 2011-2013 Gary Kramlich <grim@reaperworld.com> + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program 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 General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. +#include <gplugin-native.h> +G_MODULE_EXPORT GPluginPluginInfo * +gplugin_query(GPLUGIN_UNUSED GError **error) { + const gchar * const dependencies[] = { + return gplugin_plugin_info_new( + "gplugin/native-dependent-plugin", + GPLUGIN_NATIVE_PLUGIN_ABI_VERSION, + "dependencies", dependencies, +G_MODULE_EXPORT gboolean +gplugin_load(GPLUGIN_UNUSED GPluginNativePlugin *plugin, + GPLUGIN_UNUSED GError **error) +G_MODULE_EXPORT gboolean +gplugin_unload(GPLUGIN_UNUSED GPluginNativePlugin *plugin, + GPLUGIN_UNUSED GError **error) --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tcc/tests/plugins/load-exception.c Tue Aug 23 12:08:22 2016 -0500
@@ -0,0 +1,42 @@
+ * Copyright (C) 2011-2013 Gary Kramlich <grim@reaperworld.com> + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program 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 General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. +#include <gplugin-native.h> +G_MODULE_EXPORT GPluginPluginInfo * +gplugin_query(GPLUGIN_UNUSED GError **error) { + return gplugin_plugin_info_new( + "gplugin/native-load-exception", + GPLUGIN_NATIVE_PLUGIN_ABI_VERSION, +G_MODULE_EXPORT gboolean +gplugin_load(GPLUGIN_UNUSED GPluginNativePlugin *plugin, + GPLUGIN_UNUSED GError **error) +G_MODULE_EXPORT gboolean +gplugin_unload(GPLUGIN_UNUSED GPluginNativePlugin *plugin, + GPLUGIN_UNUSED GError **error) --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tcc/tests/plugins/load-failed.c Tue Aug 23 12:08:22 2016 -0500
@@ -0,0 +1,43 @@
+ * Copyright (C) 2011-2013 Gary Kramlich <grim@reaperworld.com> + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program 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 General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. +#include <gplugin-native.h> +G_MODULE_EXPORT GPluginPluginInfo * +gplugin_query(GPLUGIN_UNUSED GError **error) { + return gplugin_plugin_info_new( + "gplugin/native-load-failed", + GPLUGIN_NATIVE_PLUGIN_ABI_VERSION, +G_MODULE_EXPORT gboolean +gplugin_load(GPLUGIN_UNUSED GPluginNativePlugin *plugin, GError **error) { + *error = g_error_new(GPLUGIN_DOMAIN, 0, "expected error"); +G_MODULE_EXPORT gboolean +gplugin_unload(GPLUGIN_UNUSED GPluginNativePlugin *plugin, + GPLUGIN_UNUSED GError **error) --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tcc/tests/plugins/unload-failed.c Tue Aug 23 12:08:22 2016 -0500
@@ -0,0 +1,43 @@
+ * Copyright (C) 2011-2013 Gary Kramlich <grim@reaperworld.com> + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program 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 General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. +#include <gplugin-native.h> +G_MODULE_EXPORT GPluginPluginInfo * +gplugin_query(GPLUGIN_UNUSED GError **error) { + return gplugin_plugin_info_new( + "gplugin/native-unload-failed", + GPLUGIN_NATIVE_PLUGIN_ABI_VERSION, +G_MODULE_EXPORT gboolean +gplugin_load(GPLUGIN_UNUSED GPluginNativePlugin *plugin, + GPLUGIN_UNUSED GError **error) +G_MODULE_EXPORT gboolean +gplugin_unload(GPLUGIN_UNUSED GPluginNativePlugin *plugin, GError **error) { + *error = g_error_new(GPLUGIN_DOMAIN, 0, "expected error"); --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tcc/tests/test-tcc-loader.c Tue Aug 23 12:08:22 2016 -0500
@@ -0,0 +1,31 @@
+ * Copyright (C) 2011-2013 Gary Kramlich <grim@reaperworld.com> + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program 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 General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. 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(TCC_LOADER_DIR, TCC_PLUGIN_DIR, "c"); --- a/tools/glib-mkenums Tue Sep 29 22:45:21 2015 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,565 +0,0 @@
-# Information about the current enumeration
-my $flags; # Is enumeration a bitmask?
-my $option_underscore_name; # Overriden underscore variant of the enum name
- # for example to fix the cases we don't get the
- # mixed-case -> underscorized transform right.
-my $option_lowercase_name; # DEPRECATED. A lower case name to use as part
- # of the *_get_type() function, instead of the
- # one that we guess. For instance, when an enum
- # uses abnormal capitalization and we can not
- # guess where to put the underscores.
-my $seenbitshift; # Have we seen bitshift operators?
-my $enum_prefix; # Prefix for this enumeration
-my $enumname; # Name for this enumeration
-my $enumshort; # $enumname without prefix
-my $enumname_prefix; # prefix of $enumname
-my $enumindex = 0; # Global enum counter
-my $firstenum = 1; # Is this the first enumeration per file?
-my @entries; # [ $name, $val ] for each entry
-my $sandbox = Safe->new; # sandbox for safe evaluation of expressions
- for $opt (split /\s*,\s*/, $opts) {
- my ($key,$val) = $opt =~ /(\w+)(?:=(.+))?/;
- defined $val or $val = 1;
- push @opts, $key, $val;
- my $looking_for_name = 0;
- # read lines until we have no open comments
- while (m@/\*([^*]|\*(?!/))*$@) {
- defined ($new = <$file>) || die "Unmatched comment in $ARGV";
- # strip comments w/o options
- if ($looking_for_name) {
- if (/^\#include\s*<([^>]*)>/ ) {
- open NEWFILE, $file or die "Cannot open include file $file: $!\n";
- if (parse_entries (\*NEWFILE, $NEWFILE)) {
- if (/^\s*\}\s*(\w+)/) {
- \s*\w+\s*\(.*\)\s* # macro with multiple args
- (?:[^,/]|/(?!\*))* # anything but a comma or comment
- my ($name, $value, $options) = ($1,$2,$3);
- if (!defined $flags && defined $value && $value =~ /<</) {
- if (defined $options) {
- my %options = parse_trigraph($options);
- if (!defined $options{skip}) {
- push @entries, [ $name, $value, $options{nick} ];
- push @entries, [ $name, $value ];
- # ignore preprocessor directives
- print STDERR "$0: $file_name:$.: Failed to parse `$_'\n";
- print "glib-mkenums version glib-2.36.3\n";
- print "glib-mkenums comes with ABSOLUTELY NO WARRANTY.\n";
- print "You may redistribute copies of glib-mkenums under the terms of\n";
- print "the GNU General Public License which can be found in the\n";
- print "GLib source package. Sources, examples and contact\n";
- print "information are available at http://www.gtk.org\n";
- print " glib-mkenums [OPTION...] [FILES...]\n\n";
- print "Help Options:\n";
- print " -h, --help Show this help message\n\n";
- print "Utility Options:\n";
- print " --identifier-prefix <text> Identifier prefix\n";
- print " --symbol-prefix <text> Symbol prefix\n";
- print " --fhead <text> Output file header\n";
- print " --fprod <text> Per input file production\n";
- print " --ftail <text> Output file trailer\n";
- print " --eprod <text> Per enum text (produced prior to value itarations)\n";
- print " --vhead <text> Value header, produced before iterating over enum values\n";
- print " --vprod <text> Value text, produced for each enum value\n";
- print " --vtail <text> Value tail, produced after iterating over enum values\n";
- print " --comments <text> Comment structure\n";
- print " --template file Template file\n";
- print " -v, --version Print version informations\n\n";
- print "Production text substitutions:\n";
- print " \@EnumName\@ PrefixTheXEnum\n";
- print " \@enum_name\@ prefix_the_xenum\n";
- print " \@ENUMNAME\@ PREFIX_THE_XENUM\n";
- print " \@ENUMSHORT\@ THE_XENUM\n";
- print " \@ENUMPREFIX\@ PREFIX\n";
- print " \@VALUENAME\@ PREFIX_THE_XVALUE\n";
- print " \@valuenick\@ the-xvalue\n";
- print " \@valuenum\@ the integer value (limited support, Since: 2.26)\n";
- print " \@type\@ either enum or flags\n";
- print " \@Type\@ either Enum or Flags\n";
- print " \@TYPE\@ either ENUM or FLAGS\n";
- print " \@filename\@ name of current input file\n";
- print " \@basename\@ base name of the current input file (Since: 2.22)\n";
-my $idprefix = ""; # "G", "Gtk", etc
-my $symprefix = ""; # "g", "gtk", etc, if not just lc($idprefix)
-my $fhead = ""; # output file header
-my $fprod = ""; # per input file production
-my $ftail = ""; # output file trailer
-my $eprod = ""; # per enum text (produced prior to value itarations)
-my $vhead = ""; # value header, produced before iterating over enum values
-my $vprod = ""; # value text, produced for each enum value
-my $vtail = ""; # value tail, produced after iterating over enum values
-my $comment_tmpl = ""; # comment template
-sub read_template_file {
- my %tmpl = ('file-header', $fhead,
- 'file-production', $fprod,
- 'enumeration-production', $eprod,
- 'value-header', $vhead,
- 'value-production', $vprod,
- 'comment', $comment_tmpl);
- open (FILE, $file) || die "Can't open $file: $!\n";
- if (/^\/\*\*\*\s+(BEGIN|END)\s+([\w-]+)\s+\*\*\*\//) {
- if (($in eq 'junk') && ($1 eq 'BEGIN') && (exists($tmpl{$2}))) {
- elsif (($in eq $2) && ($1 eq 'END') && (exists($tmpl{$2}))) {
- die "Malformed template file $file\n";
- if (!($in eq 'junk')) {
- if (!($in eq 'junk')) {
- die "Malformed template file $file\n";
- $fhead = $tmpl{'file-header'};
- $fprod = $tmpl{'file-production'};
- $ftail = $tmpl{'file-tail'};
- $eprod = $tmpl{'enumeration-production'};
- $vhead = $tmpl{'value-header'};
- $vprod = $tmpl{'value-production'};
- $vtail = $tmpl{'value-tail'};
- $comment_tmpl = $tmpl{'comment'};
- # default to C-style comments
- $comment_tmpl = "/* \@comment\@ */" if $comment_tmpl eq "";
-if (!defined $ARGV[0]) {
-while ($_=$ARGV[0],/^-/) {
- if (/^--template$/) { read_template_file (shift); }
- elsif (/^--identifier-prefix$/) { $idprefix = shift }
- elsif (/^--symbol-prefix$/) { $symprefix = shift }
- elsif (/^--fhead$/) { $fhead = $fhead . shift }
- elsif (/^--fprod$/) { $fprod = $fprod . shift }
- elsif (/^--ftail$/) { $ftail = $ftail . shift }
- elsif (/^--eprod$/) { $eprod = $eprod . shift }
- elsif (/^--vhead$/) { $vhead = $vhead . shift }
- elsif (/^--vprod$/) { $vprod = $vprod . shift }
- elsif (/^--vtail$/) { $vtail = $vtail . shift }
- elsif (/^--comments$/) { $comment_tmpl = shift }
- elsif (/^--help$/ || /^-h$/ || /^-\?$/) { usage; }
- elsif (/^--version$/ || /^-v$/) { version; }
- last if not defined($ARGV[0]);
-# put auto-generation comment
- my $comment = $comment_tmpl;
- $comment =~ s/\@comment\@/Generated data (by glib-mkenums)/;
- print "\n" . $comment . "\n\n";
- my $base = basename ($ARGV[0]);
- $prod =~ s/\@filename\@/$ARGV[0]/g;
- $prod =~ s/\@basename\@/$base/g;
- $prod =~ s/\\a/\a/g; $prod =~ s/\\b/\b/g; $prod =~ s/\\t/\t/g; $prod =~ s/\\n/\n/g;
- $prod =~ s/\\f/\f/g; $prod =~ s/\\r/\r/g;
- close (ARGV); # reset line numbering
- $firstenum = 1; # Flag to print filename at next enum
- # read lines until we have no open comments
- while (m@/\*([^*]|\*(?!/))*$@) {
- defined ($new = <>) || die "Unmatched comment in $ARGV";
- # strip comments w/o options
- # ignore forward declarations
- next if /^\s*typedef\s+enum.*;/;
- if (m@^\s*typedef\s+enum\s*
- my %options = parse_trigraph ($2);
- next if defined $options{skip};
- $enum_prefix = $options{prefix};
- $flags = $options{flags};
- $option_lowercase_name = $options{lowercase_name};
- $option_underscore_name = $options{underscore_name};
- $option_lowercase_name = undef;
- $option_underscore_name = undef;
- if (defined $option_lowercase_name) {
- if (defined $option_underscore_name) {
- print STDERR "$0: $ARGV:$.: lowercase_name overriden with underscore_name\n";
- $option_lowercase_name = undef;
- print STDERR "$0: $ARGV:$.: lowercase_name is deprecated, use underscore_name\n";
- # Didn't have trailing '{' look on next lines
- if (!defined $1 && !defined $4) {
- die "Hit end of file while parsing enum in $ARGV";
- # Now parse the entries
- parse_entries (\*ARGV, $ARGV);
- # figure out if this was a flags or enums enumeration
- $flags = $seenbitshift;
- # Autogenerate a prefix
- if (!defined $enum_prefix) {
- if (defined $enum_prefix) {
- my $tmp = ~ ($name ^ $enum_prefix);
- ($tmp) = $tmp =~ /(^\xff*)/;
- $enum_prefix = $enum_prefix & $tmp;
- if (!defined $enum_prefix) {
- # Trim so that it ends in an underscore
- $enum_prefix =~ s/_[^_]*$/_/;
- # canonicalize user defined prefixes
- $enum_prefix = uc($enum_prefix);
- $enum_prefix =~ s/-/_/g;
- $enum_prefix =~ s/(.*)([^_])$/$1$2_/;
- for $entry (@entries) {
- my ($name,$num,$nick) = @{$entry};
- ($nick = $name) =~ s/^$enum_prefix//;
- @{$entry} = ($name, $num, $nick);
- if (defined $option_underscore_name) {
- $enumlong = uc $option_underscore_name;
- $enumsym = lc $option_underscore_name;
- $enumshort = $enumlong;
- $enumshort =~ s/^[A-Z][A-Z0-9]*_//;
- $enumname_prefix = $enumlong;
- $enumname_prefix =~ s/_$enumshort$//;
- } elsif (!$symprefix && !$idprefix) {
- # enumname is e.g. GMatchType
- $enspace =~ s/^([A-Z][a-z]*).*$/$1/;
- $enumshort = $enumname;
- $enumshort =~ s/^[A-Z][a-z]*//;
- $enumshort =~ s/([^A-Z])([A-Z])/$1_$2/g;
- $enumshort =~ s/([A-Z][A-Z])([A-Z][0-9a-z])/$1_$2/g;
- $enumshort = uc($enumshort);
- $enumname_prefix = $enumname;
- $enumname_prefix =~ s/^([A-Z][a-z]*).*$/$1/;
- $enumname_prefix = uc($enumname_prefix);
- $enumlong = uc($enspace) . "_" . $enumshort;
- $enumsym = lc($enspace) . "_" . lc($enumshort);
- if (defined($option_lowercase_name)) {
- $enumsym = $option_lowercase_name;
- $enumshort = $enumname;
- $enumshort =~ s/^${idprefix}//;
- $enumshort =~ s/^[A-Z][a-z]*//;
- $enumshort =~ s/([^A-Z])([A-Z])/$1_$2/g;
- $enumshort =~ s/([A-Z][A-Z])([A-Z][0-9a-z])/$1_$2/g;
- $enumshort = uc($enumshort);
- $enumname_prefix = $symprefix && uc($symprefix) || uc($idprefix);
- $enumlong = $enumname_prefix . "_" . $enumshort;
- $enumsym = lc($enumlong);
- my $base = basename ($ARGV);
- $prod =~ s/\@filename\@/$ARGV/g;
- $prod =~ s/\@basename\@/$base/g;
- $prod =~ s/\\a/\a/g; $prod =~ s/\\b/\b/g; $prod =~ s/\\t/\t/g; $prod =~ s/\\n/\n/g;
- $prod =~ s/\\f/\f/g; $prod =~ s/\\r/\r/g;
- $prod =~ s/\@enum_name\@/$enumsym/g;
- $prod =~ s/\@EnumName\@/$enumname/g;
- $prod =~ s/\@ENUMSHORT\@/$enumshort/g;
- $prod =~ s/\@ENUMNAME\@/$enumlong/g;
- $prod =~ s/\@ENUMPREFIX\@/$enumname_prefix/g;
- if ($flags) { $prod =~ s/\@type\@/flags/g; } else { $prod =~ s/\@type\@/enum/g; }
- if ($flags) { $prod =~ s/\@Type\@/Flags/g; } else { $prod =~ s/\@Type\@/Enum/g; }
- if ($flags) { $prod =~ s/\@TYPE\@/FLAGS/g; } else { $prod =~ s/\@TYPE\@/ENUM/g; }
- $prod =~ s/\\a/\a/g; $prod =~ s/\\b/\b/g; $prod =~ s/\\t/\t/g; $prod =~ s/\\n/\n/g;
- $prod =~ s/\\f/\f/g; $prod =~ s/\\r/\r/g;
- $prod =~ s/\@enum_name\@/$enumsym/g;
- $prod =~ s/\@EnumName\@/$enumname/g;
- $prod =~ s/\@ENUMSHORT\@/$enumshort/g;
- $prod =~ s/\@ENUMNAME\@/$enumlong/g;
- $prod =~ s/\@ENUMPREFIX\@/$enumname_prefix/g;
- if ($flags) { $prod =~ s/\@type\@/flags/g; } else { $prod =~ s/\@type\@/enum/g; }
- if ($flags) { $prod =~ s/\@Type\@/Flags/g; } else { $prod =~ s/\@Type\@/Enum/g; }
- if ($flags) { $prod =~ s/\@TYPE\@/FLAGS/g; } else { $prod =~ s/\@TYPE\@/ENUM/g; }
- $prod =~ s/\\a/\a/g; $prod =~ s/\\b/\b/g; $prod =~ s/\\t/\t/g; $prod =~ s/\\n/\n/g;
- $prod =~ s/\\f/\f/g; $prod =~ s/\\r/\r/g;
- $prod =~ s/\\a/\a/g; $prod =~ s/\\b/\b/g; $prod =~ s/\\t/\t/g; $prod =~ s/\\n/\n/g;
- $prod =~ s/\\f/\f/g; $prod =~ s/\\r/\r/g;
- my ($name,$num,$nick) = @{$_};
- if ($prod =~ /\@valuenum\@/) {
- # only attempt to eval the value if it is requested
- # this prevents us from throwing errors otherwise
- # use sandboxed perl evaluation as a reasonable
- # approximation to C constant folding
- $num = $sandbox->reval ($num);
- # make sure it parsed to an integer
- if (!defined $num or $num !~ /^-?\d+$/) {
- die "Unable to parse enum value '$num'";
- $tmp_prod =~ s/\@valuenum\@/$num/g;
- $tmp_prod =~ s/\@VALUENAME\@/$name/g;
- $tmp_prod =~ s/\@valuenick\@/$nick/g;
- if ($flags) { $tmp_prod =~ s/\@type\@/flags/g; } else { $tmp_prod =~ s/\@type\@/enum/g; }
- if ($flags) { $tmp_prod =~ s/\@Type\@/Flags/g; } else { $tmp_prod =~ s/\@Type\@/Enum/g; }
- if ($flags) { $tmp_prod =~ s/\@TYPE\@/FLAGS/g; } else { $tmp_prod =~ s/\@TYPE\@/ENUM/g; }
- $prod =~ s/\@enum_name\@/$enumsym/g;
- $prod =~ s/\@EnumName\@/$enumname/g;
- $prod =~ s/\@ENUMSHORT\@/$enumshort/g;
- $prod =~ s/\@ENUMNAME\@/$enumlong/g;
- $prod =~ s/\@ENUMPREFIX\@/$enumname_prefix/g;
- if ($flags) { $prod =~ s/\@type\@/flags/g; } else { $prod =~ s/\@type\@/enum/g; }
- if ($flags) { $prod =~ s/\@Type\@/Flags/g; } else { $prod =~ s/\@Type\@/Enum/g; }
- if ($flags) { $prod =~ s/\@TYPE\@/FLAGS/g; } else { $prod =~ s/\@TYPE\@/ENUM/g; }
- $prod =~ s/\\a/\a/g; $prod =~ s/\\b/\b/g; $prod =~ s/\\t/\t/g; $prod =~ s/\\n/\n/g;
- $prod =~ s/\\f/\f/g; $prod =~ s/\\r/\r/g;
- my $base = basename ($ARGV);
- $prod =~ s/\@filename\@/$ARGV/g;
- $prod =~ s/\@basename\@/$base/g;
- $prod =~ s/\\a/\a/g; $prod =~ s/\\b/\b/g; $prod =~ s/\\t/\t/g; $prod =~ s/\\n/\n/g;
- $prod =~ s/\\f/\f/g; $prod =~ s/\\r/\r/g;
-# put auto-generation comment
- my $comment = $comment_tmpl;
- $comment =~ s/\@comment\@/Generated data ends here/;
- print "\n" . $comment . "\n\n";