[nautilus-python/wip/jtojnar/meson: 1/2] build: Move libpython path definition to makefile




commit 5ceff15347fa16b08fe9fc24376a65ff6ed6ef29
Author: Jan Tojnar <jtojnar gmail com>
Date:   Wed Aug 10 15:10:50 2022 +0200

    build: Move libpython path definition to makefile
    
    This will make it easier to port to Meson.

 src/Makefile.am       | 4 +---
 src/nautilus-python.c | 4 ++--
 2 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 4011ca5..409eb1f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -6,9 +6,7 @@ AM_CPPFLAGS =                        \
     -I$(top_builddir)                \
     $(DISABLE_DEPRECATED_CFLAGS)            \
     $(NAUTILUS_PYTHON_CFLAGS)            \
-    -DPYTHON_VERSION=\"$(PYTHON_VERSION)\"        \
-    -DPY_LIB_LOC="\"$(PYTHON_LIB_LOC)\""        \
-    -DPY_LIB_NAME="\"$(PYTHON_LIB_NAME)\""        \
+    -DPYTHON_LIBPATH="\"$(PYTHON_LIB_LOC)/lib$(PYTHON_LIB_NAME).so.1.0\"" \
     $(PYTHON_INCLUDES)
 
 nautilus_extensiondir=$(NAUTILUS_EXTENSION_DIR)
diff --git a/src/nautilus-python.c b/src/nautilus-python.c
index 843e3c6..0db7234 100644
--- a/src/nautilus-python.c
+++ b/src/nautilus-python.c
@@ -153,8 +153,8 @@ nautilus_python_init_python (void) {
     if (Py_IsInitialized())
         return TRUE;
 
-    debug("g_module_open " PY_LIB_LOC "/lib" PY_LIB_NAME "." G_MODULE_SUFFIX ".1.0");  
-    libpython = g_module_open (PY_LIB_LOC "/lib" PY_LIB_NAME "." G_MODULE_SUFFIX ".1.0", 0);
+    debug("g_module_open " PYTHON_LIBPATH);
+    libpython = g_module_open (PYTHON_LIBPATH, 0);
     if (!libpython)
         g_warning("g_module_open libpython failed: %s", g_module_error());
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]