| 1 |
namespace = 'LcbDBus' |
| 2 |
|
| 3 |
generated_dbus_sources = [] |
| 4 |
|
| 5 |
dbus_interfaces = ['org.freedesktop.cbd.xml'] |
| 6 |
|
| 7 |
generated_dbus_sources += gnome.gdbus_codegen( |
| 8 |
'lcb-dbus', |
| 9 |
sources: 'org.freedesktop.cbd.xml', |
| 10 |
docbook: 'libcellbroadcast', |
| 11 |
interface_prefix: 'org.freedesktop', |
| 12 |
install_header: true, |
| 13 |
install_dir: get_option('includedir') / libname, |
| 14 |
namespace: namespace, |
| 15 |
) |
| 16 |
|
| 17 |
|
| 18 |
dbus_header_dir = meson.current_build_dir() |
| 19 |
dbus_inc = include_directories('.') |
| 20 |
install_data(dbus_interfaces, install_dir: ifacedir) |
| 21 |
|
| 22 |
|
| 23 |
if get_option('daemon') |
| 24 |
service_data = configuration_data() |
| 25 |
service_data.set('libexecdir', libexecdir) |
| 26 |
service_data.set('app_id', app_id) |
| 27 |
dbus_service_file = f'@[email protected]' |
| 28 |
systemd_service_file = 'cellbroadcastd.service' |
| 29 |
|
| 30 |
configure_file( |
| 31 |
input: systemd_service_file + '.in', |
| 32 |
output: systemd_service_file, |
| 33 |
configuration: service_data, |
| 34 |
install: true, |
| 35 |
install_dir: systemd_user_unit_dir, |
| 36 |
) |
| 37 |
configure_file( |
| 38 |
input: dbus_service_file + '.in', |
| 39 |
output: dbus_service_file, |
| 40 |
configuration: service_data, |
| 41 |
install: true, |
| 42 |
install_dir: servicedir, |
| 43 |
) |
| 44 |
|
| 45 |
desktopconf = configuration_data() |
| 46 |
desktopconf.set('libexecdir', libexecdir) |
| 47 |
desktop_file = f'@[email protected]' |
| 48 |
merged = i18n.merge_file( |
| 49 |
input: configure_file( |
| 50 |
input: desktop_file + '.in.in', |
| 51 |
output: desktop_file + '.in', |
| 52 |
configuration: desktopconf, |
| 53 |
), |
| 54 |
output: desktop_file, |
| 55 |
po_dir: '../po', |
| 56 |
install: true, |
| 57 |
install_dir: desktopdir, |
| 58 |
type: 'desktop', |
| 59 |
) |
| 60 |
|
| 61 |
desktop_utils = find_program('desktop-file-validate', required: false) |
| 62 |
if desktop_utils.found() |
| 63 |
test('Validate desktop file', desktop_utils, args: [merged]) |
| 64 |
endif |
| 65 |
endif # daemon |
| 66 |
|
| 67 |
schemas = ['org.freedesktop.cbd.gschema.xml'] |
| 68 |
|
| 69 |
#generate XML enum definitions for GSettings schema |
| 70 |
schema_enum_headers = files('../libcellbroadcast/lcb-enums.h') |
| 71 |
generate_enums_schema = gnome.mkenums( |
| 72 |
'org.freedesktop.cbd.enums.xml', |
| 73 |
sources: schema_enum_headers, |
| 74 |
comments: '<!-- @comment@ -->', |
| 75 |
fhead: '<schemalist>', |
| 76 |
vhead: ' <@type@ id="org.freedesktop.cbd.@EnumName@">', |
| 77 |
vprod: ' <value nick="@valuenick@" value="@valuenum@"/>', |
| 78 |
vtail: ' </@type@>', |
| 79 |
ftail: '</schemalist>', |
| 80 |
install_header: true, |
| 81 |
install_dir: 'share/glib-2.0/schemas', |
| 82 |
) |
| 83 |
|
| 84 |
#workaround due to https://github.com/mesonbuild/meson/issues/1687 |
| 85 |
copy_schema = custom_target( |
| 86 |
'copy-gschema-to-builddir', |
| 87 |
input: 'org.freedesktop.cbd.gschema.xml', |
| 88 |
output: 'org.freedesktop.cbd.gschema.xml', |
| 89 |
command: ['cp', '@INPUT@', '@OUTPUT@'], |
| 90 |
) |
| 91 |
schemas = ['org.freedesktop.cbd.gschema.xml'] |
| 92 |
compile_schemas = custom_target( |
| 93 |
'glib-compile-schemas', |
| 94 |
build_by_default: true, |
| 95 |
output: 'gschemas.compiled', |
| 96 |
install: false, |
| 97 |
command: [find_program('glib-compile-schemas'), meson.current_build_dir()], |
| 98 |
depends: [generate_enums_schema, copy_schema], |
| 99 |
) |
| 100 |
install_data(schemas, install_dir: 'share/glib-2.0/schemas') |
| 101 |
|
| 102 |
glib_compile_schemas = find_program('glib-compile-schemas', required: false) |
| 103 |
if glib_compile_schemas.found() |
| 104 |
test( |
| 105 |
'Validate schema file', |
| 106 |
glib_compile_schemas, |
| 107 |
args: ['--strict', '--dry-run', meson.current_build_dir()], |
| 108 |
) |
| 109 |
endif |