build: Allow making a library-only build for flatpak packaging.
It's not worth bundling libgnomekbd into a flatpak either so drop
the layout controller also, which isn't really useful outside of
Cinnamon desktop components anyhow.
Michael Webster
3 years ago
5 | 5 | libdeps += dependency('gtk+-3.0', version: '>=3.3.16', required: true) |
6 | 6 | libdeps += dependency('gdk-pixbuf-2.0', version: '>=2.22.0', required: true) |
7 | 7 | libdeps += dependency('cairo', required: true) |
8 | libdeps += dependency('libgnomekbdui', required: true) | |
9 | 8 | libdeps += dependency('x11', required: true) |
10 | 9 | |
11 | 10 | xapp_headers = [ |
12 | 11 | 'xapp-gtk-window.h', |
13 | 12 | 'xapp-icon-chooser-button.h', |
14 | 13 | 'xapp-icon-chooser-dialog.h', |
15 | 'xapp-kbd-layout-controller.h', | |
16 | 14 | 'xapp-monitor-blanker.h', |
17 | 15 | 'xapp-preferences-window.h', |
18 | 16 | 'xapp-stack-sidebar.h', |
26 | 24 | 'xapp-gtk-window.c', |
27 | 25 | 'xapp-icon-chooser-button.c', |
28 | 26 | 'xapp-icon-chooser-dialog.c', |
29 | 'xapp-kbd-layout-controller.c', | |
30 | 27 | 'xapp-monitor-blanker.c', |
31 | 28 | 'xapp-preferences-window.c', |
32 | 29 | 'xapp-stack-sidebar.c', |
34 | 31 | 'xapp-status-icon-monitor.c', |
35 | 32 | 'xapp-util.c' |
36 | 33 | ] |
34 | ||
35 | if not app_lib_only | |
36 | libdeps += dependency('libgnomekbdui', required: true) | |
37 | xapp_headers += 'xapp-kbd-layout-controller.h' | |
38 | xapp_sources += 'xapp-kbd-layout-controller.c' | |
39 | endif | |
37 | 40 | |
38 | 41 | dbus_headers = [] |
39 | 42 |
9 | 9 | dbus_services_dir = dependency('dbus-1').get_pkgconfig_variable('session_bus_services_dir', |
10 | 10 | define_variable: ['prefix', get_option('prefix')]) |
11 | 11 | libexec_path = join_paths(get_option('prefix'), get_option('libexecdir'), 'xapps', 'sn-watcher') |
12 | ||
13 | ||
14 | 12 | |
15 | 13 | cdata = configuration_data() |
16 | 14 | cdata.set_quoted('GETTEXT_PACKAGE', 'xapp') |
33 | 31 | ) |
34 | 32 | endif |
35 | 33 | |
34 | app_lib_only = get_option('app-lib-only') | |
35 | ||
36 | 36 | c = configure_file(output : 'config.h', |
37 | 37 | configuration : cdata |
38 | 38 | ) |
40 | 40 | top_inc = include_directories('.') |
41 | 41 | codegen = find_program(join_paths(meson.source_root(), 'meson-scripts', 'g-codegen.py')) |
42 | 42 | |
43 | subdir('icons') | |
44 | 43 | subdir('libxapp') |
45 | 44 | subdir('po') |
45 | subdir('schemas') | |
46 | 46 | subdir('pygobject') |
47 | subdir('schemas') | |
48 | subdir('status-applets') | |
49 | subdir('scripts') | |
50 | 47 | |
51 | if get_option('status-notifier') | |
48 | if not app_lib_only | |
49 | subdir('icons') | |
50 | subdir('status-applets') | |
51 | subdir('scripts') | |
52 | endif | |
53 | ||
54 | if get_option('status-notifier') and not app_lib_only | |
52 | 55 | subdir('xapp-sn-watcher') |
53 | 56 | endif |
54 | 57 |
16 | 16 | type: 'boolean', |
17 | 17 | value: true, |
18 | 18 | description: 'Build the XApp StatusNotifier service.' |
19 | )⏎ | |
19 | ) | |
20 | option('app-lib-only', | |
21 | type: 'boolean', | |
22 | value: false, | |
23 | description: 'Limit build to core library only and without the keyboard layout controller. This is to allow flatpak bundlings.' | |
24 | ) | |
25 |
405 | 405 | cairo_status_t status = CAIRO_STATUS_SUCCESS; |
406 | 406 | status = cairo_surface_write_to_png (surface, save_filename); |
407 | 407 | |
408 | g_debug ("Saving tmp image file for '%s' to '%s'", item->sortable_name, save_filename); | |
409 | ||
408 | 410 | if (status != CAIRO_STATUS_SUCCESS) |
409 | 411 | { |
410 | 412 | g_warning ("Failed to save png of status icon"); |