Debian Codegraph @

data/meson.build

raw
1 # Icons #
2 subdir('icons')
3
4 # Desktop file
5 conf = configuration_data()
6 conf.set('APP_ID', app_id)
7 conf.set('PKGNAME', meson.project_name())
8 conf.set('NAME', name)
9 desktop_file = i18n.merge_file(
10 input: configure_file(
11 input: '@[email protected]'.format(base_id),
12 output: '@[email protected]'.format(app_id),
13 configuration: conf
14 ),
15 output: '@[email protected]'.format(app_id),
16 type: 'desktop',
17 po_dir: '../po',
18 install: true,
19 install_dir: join_paths(datadir, 'applications')
20 )
21
22 # Validate desktop file
23 desktop_utils = find_program('desktop-file-validate', required: false)
24 if desktop_utils.found()
25 test('Validate desktop file', desktop_utils,
26 args: [desktop_file]
27 )
28 endif
29
30 # Appdata
31 conf = configuration_data()
32 conf.set('APP_ID', app_id)
33 conf.set('PKGNAME', meson.project_name())
34 conf.set('NAME', name)
35 appdata_file = i18n.merge_file(
36 input: configure_file(
37 input: '@[email protected]'.format(base_id),
38 output: '@[email protected]'.format(app_id),
39 configuration: conf
40 ),
41 output: '@[email protected]'.format(app_id),
42 po_dir: '../po',
43 install: true,
44 install_dir: join_paths(datadir, 'metainfo')
45 )
46
47 # Validate Appdata
48 appstreamcli = find_program('appstreamcli', required: false)
49 if appstreamcli.found()
50 test(
51 'Validate appdata', appstreamcli,
52 args: [
53 'validate', '--no-net', '--explain', appdata_file.full_path()
54 ]
55 )
56 endif
57
58 # GSchema
59 conf = configuration_data()
60 conf.set('APP_ID', app_id)
61 conf.set('PATH_ID', path_id)
62 conf.set('PKGNAME', meson.project_name())
63 configure_file(
64 input: '@[email protected]'.format(base_id),
65 output: '@[email protected]'.format(app_id),
66 configuration: conf,
67 install: true,
68 install_dir: datadir / 'glib-2.0' / 'schemas'
69 )
70
71 # Validate GSchema
72 glib_compile_schemas = find_program('glib-compile-schemas', required: false)
73 if glib_compile_schemas.found()
74 test(
75 'Validate gschema', glib_compile_schemas,
76 args: [
77 '--strict', '--dry-run', meson.current_build_dir()
78 ]
79 )
80 endif
81
82 # DBus service
83 conf = configuration_data()
84 conf.set('APP_ID', app_id)
85 conf.set('PKGNAME', meson.project_name())
86 conf.set('BINDIR', bindir)
87 configure_file(
88 input: '@[email protected]'.format(base_id),
89 output: '@[email protected]'.format(app_id),
90 configuration: conf,
91 install_dir: join_paths(datadir,'dbus-1', 'services')
92 )
93
94 # Resources
95 conf = configuration_data()
96 conf.set('PATH_ID', path_id)
97 conf.set('APP_ID', app_id)
98 configure_file(
99 input: '@[email protected]'.format(base_id),
100 output: '@[email protected]'.format(app_id),
101 configuration: conf,
102 )
103 gnome.compile_resources(
104 app_id,
105 join_paths(meson.project_build_root(), 'data', '@[email protected]'.format(app_id)),
106 gresource_bundle: true,
107 source_dir: join_paths(meson.project_build_root(), 'data'),
108 install: true,
109 install_dir: join_paths(datadir, meson.project_name()),
110 dependencies: appdata_file,
111 )
112
113 # Run required post-install steps
114 gnome.post_install(
115 gtk_update_icon_cache: true,
116 glib_compile_schemas: true,
117 update_desktop_database: true,
118 )