namespace = 'LcbDBus' generated_dbus_sources = [] dbus_interfaces = ['org.freedesktop.cbd.xml'] generated_dbus_sources += gnome.gdbus_codegen( 'lcb-dbus', sources: 'org.freedesktop.cbd.xml', docbook: 'libcellbroadcast', interface_prefix: 'org.freedesktop', install_header: true, install_dir: get_option('includedir') / libname, namespace: namespace, ) dbus_header_dir = meson.current_build_dir() dbus_inc = include_directories('.') install_data(dbus_interfaces, install_dir: ifacedir) if get_option('daemon') service_data = configuration_data() service_data.set('libexecdir', libexecdir) service_data.set('app_id', app_id) dbus_service_file = f'@app_id@.service' systemd_service_file = 'cellbroadcastd.service' configure_file( input: systemd_service_file + '.in', output: systemd_service_file, configuration: service_data, install: true, install_dir: systemd_user_unit_dir, ) configure_file( input: dbus_service_file + '.in', output: dbus_service_file, configuration: service_data, install: true, install_dir: servicedir, ) desktopconf = configuration_data() desktopconf.set('libexecdir', libexecdir) desktop_file = f'@app_id@.desktop' merged = i18n.merge_file( input: configure_file( input: desktop_file + '.in.in', output: desktop_file + '.in', configuration: desktopconf, ), output: desktop_file, po_dir: '../po', install: true, install_dir: desktopdir, type: 'desktop', ) desktop_utils = find_program('desktop-file-validate', required: false) if desktop_utils.found() test('Validate desktop file', desktop_utils, args: [merged]) endif endif # daemon schemas = ['org.freedesktop.cbd.gschema.xml'] #generate XML enum definitions for GSettings schema schema_enum_headers = files('../libcellbroadcast/lcb-enums.h') generate_enums_schema = gnome.mkenums( 'org.freedesktop.cbd.enums.xml', sources: schema_enum_headers, comments: '', fhead: '', vhead: ' <@type@ id="org.freedesktop.cbd.@EnumName@">', vprod: ' ', vtail: ' ', ftail: '', install_header: true, install_dir: 'share/glib-2.0/schemas', ) #workaround due to https://github.com/mesonbuild/meson/issues/1687 copy_schema = custom_target( 'copy-gschema-to-builddir', input: 'org.freedesktop.cbd.gschema.xml', output: 'org.freedesktop.cbd.gschema.xml', command: ['cp', '@INPUT@', '@OUTPUT@'], ) schemas = ['org.freedesktop.cbd.gschema.xml'] compile_schemas = custom_target( 'glib-compile-schemas', build_by_default: true, output: 'gschemas.compiled', install: false, command: [find_program('glib-compile-schemas'), meson.current_build_dir()], depends: [generate_enums_schema, copy_schema], ) install_data(schemas, install_dir: 'share/glib-2.0/schemas') glib_compile_schemas = find_program('glib-compile-schemas', required: false) if glib_compile_schemas.found() test( 'Validate schema file', glib_compile_schemas, args: ['--strict', '--dry-run', meson.current_build_dir()], ) endif