From 3c0c2f62d9162df934959a9f4e5a8a0f270e93f7 Mon Sep 17 00:00:00 2001 From: Max Audron Date: Sun, 14 Feb 2021 12:59:12 +0100 Subject: [PATCH] add optional compile of pylash and liblash to meson --- lash_compat/liblash/meson.build | 21 +++++++++++++++++++++ lash_compat/pylash/meson.build | 9 +++++++++ meson.build | 10 ++++++++++ meson_options.txt | 2 ++ 4 files changed, 42 insertions(+) create mode 100644 lash_compat/liblash/meson.build create mode 100644 lash_compat/pylash/meson.build create mode 100644 meson_options.txt diff --git a/lash_compat/liblash/meson.build b/lash_compat/liblash/meson.build new file mode 100644 index 00000000..7a1831e6 --- /dev/null +++ b/lash_compat/liblash/meson.build @@ -0,0 +1,21 @@ +install_headers([ + 'lash/client_interface.h', + 'lash/config.h', + 'lash/event.h', + 'lash/lash.h', + 'lash/protocol.h', + 'lash/types.h', +], subdir : 'lash-1.0/lash') + +liblash = library('lash', 'lash.c', + include_directories : [lash_inc, inc], + dependencies : [dbus_dep], + link_with : [cdbuslib, commonlib], + install : true) + +pkg_mod.generate(libraries : liblash, + version : '1.1.1', + name : 'liblash', + requires : dbus_dep, + description : 'lash compatibility library to ladish', + filebase : 'liblash') diff --git a/lash_compat/pylash/meson.build b/lash_compat/pylash/meson.build new file mode 100644 index 00000000..6ca684ea --- /dev/null +++ b/lash_compat/pylash/meson.build @@ -0,0 +1,9 @@ +py = import('python') +py = py.find_installation('python2') + +libpylash = py.extension_module('pylash', ['lash.c', 'lash_wrap.c'], + include_directories : [lash_inc, inc], + dependencies : [py.dependency()], + install : true) + +py.install_sources('lash.py') diff --git a/meson.build b/meson.build index 81f333e3..dd7e56bf 100644 --- a/meson.build +++ b/meson.build @@ -47,6 +47,8 @@ deps = [ dependency('expat') ] +pkg_mod = import('pkgconfig') + subdir('common') subdir('proxies') subdir('cdbus') @@ -55,6 +57,14 @@ subdir('alsapid') # ladishd subdir('daemon') +if get_option('liblash').enabled() + subdir('lash_compat/liblash') +endif + +if get_option('pylash').enabled() + subdir('lash_compat/pylash') +endif + install_data(['AUTHORS', 'README', 'NEWS'], install_dir : data_dir) install_data('ladish_control', diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 00000000..40e1bd08 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,2 @@ +option('liblash', type : 'feature') +option('pylash', type : 'feature')