[dia: 44/105] #19: Python plugin: explicitly check for pygtk module.



commit 8f9f2afd2721709983f066a82ad25255ee6c6bdd
Author: Eduard Nicodei <eddnicodei gmail com>
Date:   Tue Jan 1 18:34:19 2019 +0000

    #19: Python plugin: explicitly check for pygtk module.

 plug-ins/python/meson.build | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/plug-ins/python/meson.build b/plug-ins/python/meson.build
index f59f0fbb..25b4477a 100644
--- a/plug-ins/python/meson.build
+++ b/plug-ins/python/meson.build
@@ -1,8 +1,5 @@
-# TODO: should we use pymod.find_installation() ?
-#       this seems to work fine.
-# TODO: is just the only dependency we need?
-# Ensure that this does not require pygtk-2.0 as per
-# Makefile.am.
+# TODO: should we use pymod even though it requires more recent
+#       version of meson?
 py_dep = dependency('python2', version: '>= 2.3', required: false)
 
 sources = files(
@@ -38,7 +35,6 @@ python_scripts = [
     'diasvg_import.py',
     'dot.py',
     'doxrev.py',
-    'gtkcons.py',  # TODO: this requires python module pygtk.
     'imgmap.py',
     'otypes.py',
     'pydiadoc.py',
@@ -59,6 +55,13 @@ if py_dep.found()
         install_dir: dialibdir
     )
 
+    # Check for pygtk module.
+    # TODO: we should use meson python module for this.
+    python = find_program('python2')
+    if run_command(python, '-c', 'import pygtk').returncode() == 0
+        python_scripts += 'gtkcons.py'
+    endif
+
     install_data(python_scripts, install_dir: join_paths(pkgdatadir, 'python'))
     install_data('python-startup.py', install_dir: pkgdatadir)
 endif


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