src: add meson

This commit is contained in:
0xMRTT 2023-05-02 00:29:08 +02:00
parent 2f00cbfd1d
commit 245688918c
Signed by: 0xMRTT
GPG Key ID: 19C1449A774028BD

45
src/meson.build Normal file
View File

@ -0,0 +1,45 @@
pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name())
moduledir = join_paths(pkgdatadir, 'imaginer')
gnome = import('gnome')
blueprints = custom_target('blueprints',
input: files(
'window.blp',
'gtk/help-overlay.blp',
),
output: '.',
command: [find_program('blueprint-compiler'), 'batch-compile', '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'],
)
gnome.compile_resources('imaginer',
'imaginer.gresource.xml',
gresource_bundle: true,
install: true,
install_dir: pkgdatadir,
dependencies: blueprints,
)
python = import('python')
conf = configuration_data()
conf.set('PYTHON', python.find_installation('python3').path())
conf.set('VERSION', meson.project_version())
conf.set('localedir', join_paths(get_option('prefix'), get_option('localedir')))
conf.set('pkgdatadir', pkgdatadir)
configure_file(
input: 'imaginer.in',
output: 'imaginer',
configuration: conf,
install: true,
install_dir: get_option('bindir'),
install_mode: 'r-xr--r--'
)
imaginer_sources = [
'__init__.py',
'main.py',
'window.py',
]
install_data(imaginer_sources, install_dir: moduledir)