summary refs log tree commit diff stats
path: root/plugins/python/meson.build
diff options
context:
space:
mode:
authorSoniEx2 <endermoneymod@gmail.com>2021-05-27 20:39:07 -0300
committerSoniEx2 <endermoneymod@gmail.com>2021-05-27 20:39:07 -0300
commit5571d277b93b62c73568b78c652c85b2e8e95183 (patch)
tree0d97d65058e31ccdeab4006384442a8e378d5f06 /plugins/python/meson.build
parentf58165fd33919951e2ca594c6f19a785420fc4f9 (diff)
parent7f8b0a19cff46f7d27451fb9942eea5018f0c5b5 (diff)
Merge upstream changes
Diffstat (limited to 'plugins/python/meson.build')
-rw-r--r--plugins/python/meson.build24
1 files changed, 21 insertions, 3 deletions
diff --git a/plugins/python/meson.build b/plugins/python/meson.build
index e24f0c6f..5fd7ec2f 100644
--- a/plugins/python/meson.build
+++ b/plugins/python/meson.build
@@ -1,12 +1,30 @@
 python_opt = get_option('with-python')
 if python_opt.startswith('python3')
-  python_dep = dependency(python_opt, version: '>= 3.3')
+  # Python 3.8 introduced a new -embed variant
+  if not python_opt.endswith('-embed')
+    python_dep = dependency(python_opt + '-embed', version: '>= 3.3', required: false)
+    if not python_dep.found()
+      python_dep = dependency(python_opt, version: '>= 3.3')
+    endif
+  else
+    python_dep = dependency(python_opt, version: '>= 3.3')
+  endif
 else
   python_dep = dependency(python_opt, version: '>= 2.7')
 endif
 
-shared_module('python', 'python.c',
-  dependencies: [libgio_dep, hexchat_plugin_dep, python_dep],
+python3_source = custom_target('python-bindings',
+  input: ['../../src/common/hexchat-plugin.h', 'python.py'],
+  output: 'python.c',
+  command: [find_program('generate_plugin.py'), '@INPUT@', '@OUTPUT@']
+)
+
+install_data(['_hexchat.py', 'hexchat.py', 'xchat.py'],
+  install_dir: join_paths(get_option('libdir'), 'hexchat/python')
+)
+
+shared_module('python', python3_source,
+  dependencies: [hexchat_plugin_dep, python_dep],
   install: true,
   install_dir: plugindir,
   name_prefix: '',