diff --git a/meson.build b/meson.build index cbfc1d3..36321a1 100644 --- a/meson.build +++ b/meson.build @@ -20,9 +20,14 @@ e_module_arch = dep_e.get_pkgconfig_variable('module_arch') #### Python3 #### py3 = import('python').find_installation('python3', modules: ['efl', 'dbus']) dep_py3 = py3.dependency(embed: true) + +## bytecompile command to be used by gadgets py3_bytecompile = [py3, meson.source_root() / 'meson_bytecompile.py', '@INPUT@', '@OUTPUT@'] +## find the installed libpython soname, will be dlopened at runtime +py_instsoname = py3.get_variable('INSTSONAME') + #### Install dirs #### mod_install_dir = join_paths(e_modules_dir, meson.project_name()) @@ -33,6 +38,7 @@ gadgets_install_dir = join_paths(e_lib_dir, 'enlightenment', 'edgar_gadgets') #### Config.h #### config_h = configuration_data() config_h.set_quoted('PACKAGE', meson.project_name()) +config_h.set_quoted('PYINSTSONAME', py_instsoname) config_dir = include_directories('.') diff --git a/src/e_mod_edgar.c b/src/e_mod_edgar.c index 09aa3fe..b0f4fc7 100644 --- a/src/e_mod_edgar.c +++ b/src/e_mod_edgar.c @@ -20,6 +20,7 @@ #include #include +#include "edgar_config.h" #include "e_mod_main.h" #include "e_mod_edgar.h" #include "efl.eo_api.h" @@ -151,10 +152,10 @@ edgar_init() // Make cpython visible to gadgets and to gadgets imported modules // NOTE: This is needed because e load modules using RTLD_LOCAL - py3_lib_handle = dlopen("libpython3.so", (RTLD_LAZY | RTLD_GLOBAL)); + // NOTE: PYINSTSONAME is gathered at build time from the sysconfig module + py3_lib_handle = dlopen(PYINSTSONAME, (RTLD_LAZY | RTLD_GLOBAL)); if (!py3_lib_handle) { - DBG("EDGAR: Cannot find libpython3.so"); e_util_dialog_internal("Edgar Error", "Cannot find Python3 lib.
" "Your python gadgets will not work.

"