2016-12-14 00:12:03 +03:00
|
|
|
python_opt = get_option('with-python')
|
|
|
|
if python_opt.startswith('python3')
|
2020-03-11 21:07:56 +03:00
|
|
|
# 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)
|
2020-03-11 21:13:25 +03:00
|
|
|
if not python_dep.found()
|
|
|
|
python_dep = dependency(python_opt, version: '>= 3.3')
|
|
|
|
endif
|
|
|
|
else
|
2020-03-11 21:07:56 +03:00
|
|
|
python_dep = dependency(python_opt, version: '>= 3.3')
|
|
|
|
endif
|
2016-12-14 00:12:03 +03:00
|
|
|
else
|
|
|
|
python_dep = dependency(python_opt, version: '>= 2.7')
|
|
|
|
endif
|
|
|
|
|
2017-09-03 00:52:25 +03:00
|
|
|
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],
|
2016-12-14 00:12:03 +03:00
|
|
|
install: true,
|
|
|
|
install_dir: plugindir,
|
|
|
|
name_prefix: '',
|
|
|
|
)
|