1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
libfilebrowser_public_h = files(
'gedit-file-bookmarks-store.h',
'gedit-file-browser-error.h',
'gedit-file-browser-store.h',
'gedit-file-browser-view.h',
'gedit-file-browser-widget.h',
'gedit-file-browser-utils.h',
'gedit-file-browser-plugin.h',
'gedit-file-browser-messages.h',
)
libfilebrowser_sources = files(
'gedit-file-bookmarks-store.c',
'gedit-file-browser-messages.c',
'gedit-file-browser-plugin.c',
'gedit-file-browser-store.c',
'gedit-file-browser-utils.c',
'gedit-file-browser-view.c',
'gedit-file-browser-widget.c',
)
libfilebrowser_deps = [
libgedit_dep,
]
subdir('messages')
libfilebrowser_register_enums = gnome.mkenums(
'gedit-file-browser-enum-register',
sources: libfilebrowser_public_h,
c_template: 'gedit-file-browser-enum-register.c.template',
)
libfilebrowser_type_enums = gnome.mkenums(
'gedit-file-browser-enum-types',
depends : [libfilebrowser_register_enums],
sources: libfilebrowser_public_h,
h_template: 'gedit-file-browser-enum-types.h.template',
c_template: 'gedit-file-browser-enum-types-stage1.c.template',
)
# cat won't work on Windows so this
# will need to be reimplemented as a script
cat = find_program('cat')
# Combine the 2 C mkenums templates together before compiling
libfilebrowser_enums_c = custom_target('libfilebrowser_enums_c',
input: [libfilebrowser_type_enums.get(0),
libfilebrowser_register_enums],
output: 'gedit-file-browser-enum-types.c',
command: [cat, '@INPUT0@', '@INPUT1@'],
# redirects the command output since we can't use >> here
capture: true,
)
libfilebrowser_sources += [
libfilebrowser_enums_c,
libfilebrowser_type_enums.get(1),
]
subdir('resources')
libfilebrowser_sha = shared_module(
'filebrowser',
sources: libfilebrowser_sources,
include_directories: root_include_dir,
dependencies: libfilebrowser_deps,
install: true,
install_dir: join_paths(
pkglibdir,
'plugins',
),
name_suffix: module_suffix,
)
# FIXME: https://github.com/mesonbuild/meson/issues/1687
custom_target(
'org.gnome.gedit.plugins.filebrowser.enums.xml',
input : libfilebrowser_sources + libfilebrowser_public_h,
output: 'org.gnome.gedit.plugins.filebrowser.enums.xml',
capture: true,
command: [
'glib-mkenums',
'--comments', '<!-- @comment@ -->',
'--fhead', '<schemalist>',
'--vhead', ' <@type@ id="org.gnome.gedit.plugins.filebrowser.@EnumName@">',
'--vprod', ' <value nick="@valuenick@" value="@valuenum@"/>',
'--vtail', ' </@type@>',
'--ftail', '</schemalist>',
'@INPUT@'
],
install: true,
install_dir: join_paths(
glibdir,
'schemas',
)
)
filebrowser_gschema_file = files('org.gnome.gedit.plugins.filebrowser.gschema.xml')
install_data(
filebrowser_gschema_file,
install_dir: join_paths(get_option('prefix'), get_option('datadir'), 'glib-2.0/schemas')
)
if xmllint.found()
test(
'validate-filebrowser-gschema',
xmllint,
args: [
'--noout',
'--dtdvalid', gschema_dtd,
filebrowser_gschema_file,
]
)
endif
custom_target(
'filebrowser.plugin',
input: 'filebrowser.plugin.desktop.in',
output: 'filebrowser.plugin',
command: msgfmt_plugin_cmd,
install: true,
install_dir: join_paths(
pkglibdir,
'plugins',
)
)
|