summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2020-04-26 09:01:17 +0200
committerDave Andreoli <dave@gurumeditation.it>2020-04-26 09:01:17 +0200
commit26a99ee82e8a271e1ae37b3eb863d53eb241ab0d (patch)
treee454f7172aad05ab37bd8f0f84a1ac162991f57c
parent443bf2efbf8409e8716258ae8578b7b8ccb8bc06 (diff)
A much better way to find the libpython soname
This should work 100% of the time, since py 3.2, and without any fuzzy searching
-rw-r--r--meson.build6
-rw-r--r--src/e_mod_edgar.c5
2 files changed, 9 insertions, 2 deletions
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')
20#### Python3 #### 20#### Python3 ####
21py3 = import('python').find_installation('python3', modules: ['efl', 'dbus']) 21py3 = import('python').find_installation('python3', modules: ['efl', 'dbus'])
22dep_py3 = py3.dependency(embed: true) 22dep_py3 = py3.dependency(embed: true)
23
24## bytecompile command to be used by gadgets
23py3_bytecompile = [py3, meson.source_root() / 'meson_bytecompile.py', 25py3_bytecompile = [py3, meson.source_root() / 'meson_bytecompile.py',
24 '@INPUT@', '@OUTPUT@'] 26 '@INPUT@', '@OUTPUT@']
25 27
28## find the installed libpython soname, will be dlopened at runtime
29py_instsoname = py3.get_variable('INSTSONAME')
30
26 31
27#### Install dirs #### 32#### Install dirs ####
28mod_install_dir = join_paths(e_modules_dir, meson.project_name()) 33mod_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')
33#### Config.h #### 38#### Config.h ####
34config_h = configuration_data() 39config_h = configuration_data()
35config_h.set_quoted('PACKAGE', meson.project_name()) 40config_h.set_quoted('PACKAGE', meson.project_name())
41config_h.set_quoted('PYINSTSONAME', py_instsoname)
36config_dir = include_directories('.') 42config_dir = include_directories('.')
37 43
38 44
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 @@
20#include <e.h> 20#include <e.h>
21#include <Efl_Ui.h> 21#include <Efl_Ui.h>
22 22
23#include "edgar_config.h"
23#include "e_mod_main.h" 24#include "e_mod_main.h"
24#include "e_mod_edgar.h" 25#include "e_mod_edgar.h"
25#include "efl.eo_api.h" 26#include "efl.eo_api.h"
@@ -151,10 +152,10 @@ edgar_init()
151 152
152 // Make cpython visible to gadgets and to gadgets imported modules 153 // Make cpython visible to gadgets and to gadgets imported modules
153 // NOTE: This is needed because e load modules using RTLD_LOCAL 154 // NOTE: This is needed because e load modules using RTLD_LOCAL
154 py3_lib_handle = dlopen("libpython3.so", (RTLD_LAZY | RTLD_GLOBAL)); 155 // NOTE: PYINSTSONAME is gathered at build time from the sysconfig module
156 py3_lib_handle = dlopen(PYINSTSONAME, (RTLD_LAZY | RTLD_GLOBAL));
155 if (!py3_lib_handle) 157 if (!py3_lib_handle)
156 { 158 {
157 DBG("EDGAR: Cannot find libpython3.so");
158 e_util_dialog_internal("Edgar Error", 159 e_util_dialog_internal("Edgar Error",
159 "<font align=left><b>Cannot find Python3 lib.</b><br>" 160 "<font align=left><b>Cannot find Python3 lib.</b><br>"
160 "Your python gadgets will not work.<br><br>" 161 "Your python gadgets will not work.<br><br>"