[dia: 43/105] #19: Port python_plugin.



commit c1d7ddb7a6005655305777cb6520600674917dc8
Author: Eduard Nicodei <eddnicodei gmail com>
Date:   Tue Jan 1 18:09:54 2019 +0000

    #19: Port python_plugin.

 plug-ins/meson.build        |  2 +-
 plug-ins/python/meson.build | 64 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 65 insertions(+), 1 deletion(-)
---
diff --git a/plug-ins/meson.build b/plug-ins/meson.build
index 57130f99..59cbff67 100644
--- a/plug-ins/meson.build
+++ b/plug-ins/meson.build
@@ -22,7 +22,7 @@ subdir('pdf')
 subdir('pgf')
 subdir('postscript')
 subdir('pstricks')
-#subdir('python')
+subdir('python') # Non-standard: shared_module
 #subdir('stress')
 
 subdir('svg')
diff --git a/plug-ins/python/meson.build b/plug-ins/python/meson.build
new file mode 100644
index 00000000..f59f0fbb
--- /dev/null
+++ b/plug-ins/python/meson.build
@@ -0,0 +1,64 @@
+# 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.
+py_dep = dependency('python2', version: '>= 2.3', required: false)
+
+sources = files(
+    'pydia-color.c',
+    'pydia-cpoint.c',
+    'pydia-diagram.c',
+    'pydia-diagramdata.c',
+    'pydia-display.c',
+    'pydia-error.c',
+    'pydia-export.c',
+    'pydia-font.c',
+    'pydia-geometry.c',
+    'pydia-handle.c',
+    'pydia-image.c',
+    'pydia-layer.c',
+    'pydia-menuitem.c',
+    'pydia-object.c',
+    'pydia-paperinfo.c',
+    'pydia-properties.c',
+    'pydia-property.c',
+    'pydia-render.c',
+    'pydia-sheet.c',
+    'pydia-text.c',
+    'diamodule.c',
+    'python.c',
+)
+
+python_scripts = [
+    'aobjects.py',
+    'allprops.py',
+    'codegen.py',
+    'diasvg.py',
+    'diasvg_import.py',
+    'dot.py',
+    'doxrev.py',
+    'gtkcons.py',  # TODO: this requires python module pygtk.
+    'imgmap.py',
+    'otypes.py',
+    'pydiadoc.py',
+    'scascale.py',
+    'select_by.py',
+    'select_empty.py',
+]
+
+if py_dep.found()
+    # Same as layout plugin.
+    shared_module(
+        'python_plugin',
+        sources,
+        dependencies: [libxml_dep, libgtk_dep, py_dep],
+        include_directories: [libdia_inc, configuration_inc, diaapp_inc],
+        link_with: [libdia],
+        install: true,
+        install_dir: dialibdir
+    )
+
+    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]