Debian Codegraph @

data/meson.build

raw
1
2 service = ['com.github.FontManager.FontManager',
3 'com.github.FontManager.FontViewer']
4
5 appdata_dir = join_paths(datadir, 'metainfo')
6 dbus_service_dir = join_paths(datadir, 'dbus-1', 'services')
7 desktop_dir = join_paths(datadir, 'applications')
8 schema_dir = join_paths(datadir, 'glib-2.0', 'schemas')
9 search_provider_dir = join_paths(datadir, 'gnome-shell', 'search-providers')
10
11 configure_file(
12 command: [
13 'glib-compile-schemas',
14 '--targetdir=' + meson.current_build_dir(),
15 meson.current_source_dir()
16 ],
17 output: 'gschema.compiled'
18 )
19
20 foreach path: service
21 if (path == 'com.github.FontManager.FontManager' and not get_option('manager'))
22 continue
23 endif
24 if (path == 'com.github.FontManager.FontViewer' and not get_option('viewer'))
25 continue
26 endif
27 install_data('@[email protected]'.format(path), install_dir: schema_dir)
28
29 icons = [ 'com.github.FontManager.FontManager.svg' ]
30 foreach icon: icons
31 icon_dir = join_paths(datadir, 'icons', 'hicolor', 'scalable', 'apps')
32 install_data(icon, install_dir: icon_dir, rename: '@[email protected]'.format(path))
33 endforeach
34
35 i18n.merge_file(
36 input: configure_file(
37 input: '@[email protected]'.format(path),
38 output: '@[email protected]'.format(path),
39 configuration: config
40 ),
41 output: '@[email protected]'.format(path),
42 type: 'desktop',
43 po_dir: '../po',
44 install: true,
45 install_dir: desktop_dir
46 )
47 i18n.merge_file(
48 input: configure_file(
49 input: '@[email protected]'.format(path),
50 output: '@[email protected]'.format(path),
51 configuration: config
52 ),
53 output: '@[email protected]'.format(path),
54 po_dir: '../po',
55 install: true,
56 install_dir: appdata_dir
57 )
58 endforeach
59
60 python_write = '''
61 with open('@OUTPUT@', 'w') as output:
62 output.write(@0@)
63 '''
64
65 dbus_service = '''"""[D-BUS Service]
66 Name=@0@
67 Exec=@1@/@2@ --gapplication-service
68 """
69 '''
70
71 if get_option('manager')
72
73 custom_target(
74 '@[email protected]'.format(service[0]),
75 output: '@[email protected]'.format(service[0]),
76 command: [
77 python,
78 '-c',
79 python_write.format(
80 dbus_service.format(
81 service[0],
82 join_paths(prefix, get_option('bindir')),
83 meson.project_name()
84 )
85 )
86 ],
87 install: true,
88 install_dir: dbus_service_dir
89 )
90
91 if get_option('search-provider')
92 install_data('com.github.FontManager.FontManager.SearchProvider.ini',
93 install_dir: search_provider_dir)
94 endif
95
96 if get_option('app-armor')
97 aa_config_dir = join_paths(get_option('sysconfdir'), 'apparmor.d')
98 aa_profile = join_paths(meson.current_build_dir(), 'font-manager.aap')
99 configure_file(input: 'font-manager.aap.in', output: 'font-manager.aap', configuration: config)
100 install_data(aa_profile, install_dir: aa_config_dir, rename: 'font-manager')
101 endif
102
103 endif
104
105 if get_option('viewer')
106
107 custom_target(
108 '@[email protected]'.format(service[1]),
109 output: '@[email protected]'.format(service[1]),
110 command: [
111 python,
112 '-c',
113 python_write.format(
114 dbus_service.format(
115 service[1],
116 pkglibexec_dir,
117 'font-viewer'
118 )
119 )
120 ],
121 install: true,
122 install_dir: dbus_service_dir
123 )
124
125 endif