mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-21 14:53:44 +03:00
meson: Fix Python module build
This commit is contained in:
committed by
Nick Wellnhofer
parent
c2e2d76211
commit
064a02114a
@@ -3,20 +3,57 @@ pymod = import('python')
|
|||||||
py = pymod.find_installation('python3', required: false)
|
py = pymod.find_installation('python3', required: false)
|
||||||
|
|
||||||
if py.found() == true
|
if py.found() == true
|
||||||
r = run_command(py, 'generator.py', meson.current_source_dir(), check: true)
|
message('Installing python modules to', py.get_install_dir())
|
||||||
|
|
||||||
libxml2mod_src = ['libxml.c', 'libxml2-py.c', 'types.c']
|
pygenerated = custom_target(
|
||||||
|
'Python generated files',
|
||||||
|
input: files('generator.py'),
|
||||||
|
depend_files: files(
|
||||||
|
'..' / 'doc' / 'libxml2-api.xml',
|
||||||
|
'libxml2-python-api.xml',
|
||||||
|
),
|
||||||
|
output: [
|
||||||
|
'libxml2-py.h',
|
||||||
|
'libxml2-export.c',
|
||||||
|
'libxml2-py.c',
|
||||||
|
'libxml2class.py',
|
||||||
|
'libxml2class.txt',
|
||||||
|
],
|
||||||
|
command: [py, '@INPUT@', meson.current_build_dir()],
|
||||||
|
)
|
||||||
|
pygenerated_dep = declare_dependency(
|
||||||
|
sources : [pygenerated[0]],
|
||||||
|
)
|
||||||
|
|
||||||
message(py.get_install_dir())
|
libxml2_py = custom_target(
|
||||||
|
'libxml2.py',
|
||||||
|
input: [files('libxml.py'), pygenerated[3]],
|
||||||
|
output: 'libxml2.py',
|
||||||
|
command: [find_program('cat'), '@INPUT@'],
|
||||||
|
capture: true,
|
||||||
|
install: true,
|
||||||
|
install_dir: py.get_install_dir(),
|
||||||
|
)
|
||||||
|
|
||||||
|
libxml2mod_src = [
|
||||||
|
files('libxml.c', 'types.c'),
|
||||||
|
pygenerated[2],
|
||||||
|
]
|
||||||
|
|
||||||
py.extension_module(
|
py.extension_module(
|
||||||
'libxml2mod',
|
'libxml2mod',
|
||||||
files(libxml2mod_src),
|
libxml2mod_src,
|
||||||
dependencies: [py.dependency(), xml_dep],
|
dependencies: [
|
||||||
include_directories: [config_dir],
|
py.dependency(),
|
||||||
|
xml_dep,
|
||||||
|
pygenerated_dep,
|
||||||
|
],
|
||||||
|
include_directories: [config_dir, '.'],
|
||||||
install: true,
|
install: true,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
py.install_sources(files('drv_libxml2.py'))
|
||||||
|
|
||||||
setup_py = configuration_data()
|
setup_py = configuration_data()
|
||||||
setup_py.set('prefix', get_option('prefix'))
|
setup_py.set('prefix', get_option('prefix'))
|
||||||
setup_py.set('LIBXML_VERSION', meson.project_version())
|
setup_py.set('LIBXML_VERSION', meson.project_version())
|
||||||
|
Reference in New Issue
Block a user