diff --git a/.gitmodules b/.gitmodules index 640494894764b3b0cf57797592f89ab9cbff31ff..4f832302d16cf5fdb54b9940d9562f43b3b892a7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -126,7 +126,11 @@ path = libdap-chain-common url = https://gitlab.demlabs.net/cellframe/libdap-chain-common branch = master +[submodule "libdap-chain-plugins-python"] + path = libdap-chain-plugins-python + url = https://gitlab.demlabs.net/cellframe/libdap-chain-plugins-python.git [submodule "libdap-chain-cli"] path = libdap-chain-cli url = https://gitlab.demlabs.net/cellframe/libdap-chain-cli.git branch = master + diff --git a/CMakeLists.txt b/CMakeLists.txt index ee5babd0a7361ffe2b54398e9e67e34c960922e8..a21b53f00ebe1b15e16bb4d60c26e88d88c01a2f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -362,6 +362,16 @@ if(UNIX) dap_core ) + if (SUPPORT_PYTHON_PLUGINS) + add_subdirectory(libdap-chain-plugins-python) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DDAP_SUPPORT_PYTHON_PLUGINS") + message("Build with support python plugins") + set(Python_ADDITIONAL_VERSION 3.7 3.6 3.5 3.4) + find_package(PythonLibs REQUIRED) + set(NODE_LIBRARIES ${NODE_LIBRARIES} ${PYTHON_LIBRARIES} dap_chain_plugins_python) + include_directories(${PYTHON_INCLUDE_DIR} include/) + endif() + if(ANDROID ) set(ALL_LIBRARIES ${NODE_LIBRARIES} ${NODE_CLI_LIBRARIES} ${NODE_TOOL_LIBRARIES} log) diff --git a/libdap b/libdap index 214f324f5faa30ca6b00bfedae1104b09a0c1e30..ceb3ae7f57c6647876f71cd41f238dfe38254116 160000 --- a/libdap +++ b/libdap @@ -1 +1 @@ -Subproject commit 214f324f5faa30ca6b00bfedae1104b09a0c1e30 +Subproject commit ceb3ae7f57c6647876f71cd41f238dfe38254116 diff --git a/libdap-chain-net-srv b/libdap-chain-net-srv index 05cd2947d6e3547e3e111b53befeff4b043cb16a..f00357d0a187058e13b366198cb12140c9a919d7 160000 --- a/libdap-chain-net-srv +++ b/libdap-chain-net-srv @@ -1 +1 @@ -Subproject commit 05cd2947d6e3547e3e111b53befeff4b043cb16a +Subproject commit f00357d0a187058e13b366198cb12140c9a919d7 diff --git a/libdap-chain-plugins-python b/libdap-chain-plugins-python new file mode 160000 index 0000000000000000000000000000000000000000..44891e078ee5fe046e873d91635b4bd6221bb46d --- /dev/null +++ b/libdap-chain-plugins-python @@ -0,0 +1 @@ +Subproject commit 44891e078ee5fe046e873d91635b4bd6221bb46d diff --git a/sources/main.c b/sources/main.c index e5474d4ec299f426e11fb291937d49df516589fc..0f13d4e9ee76881a0cdef073c838f0898b13e259 100755 --- a/sources/main.c +++ b/sources/main.c @@ -110,6 +110,10 @@ #include "dap_defines.h" #include "dap_file_utils.h" +#ifdef DAP_SUPPORT_PYTHON_PLUGINSv + #include "dap_chain_plugins.h" +#endif + #define ENC_HTTP_URL "/enc_init" #define STREAM_CTL_URL "/stream_ctl" @@ -440,6 +444,12 @@ int main( int argc, const char **argv ) #endif #endif + //Init python plugins + #ifdef DAP_SUPPORT_PYTHON_PLUGINS + log_it(L_NOTICE, "Loading python plugins"); + dap_chain_plugins_init(g_config); + #endif + // Endless loop for server's requests processing rc = dap_server_loop(l_server); // After loop exit actions @@ -449,6 +459,9 @@ int main( int argc, const char **argv ) failure: + #ifdef DAP_SUPPORT_PYTHON_PLUGINS + dap_chain_plugins_deinit(); + #endif dap_stream_deinit(); dap_stream_ctl_deinit(); dap_http_folder_deinit();