-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
211 lines (203 loc) · 5.85 KB
/
meson.build
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
project(
'builder_plugins',
'vala',
'c',
version: '0.1.0',
meson_version: '>= 0.60.0',
)
c = run_command('whoami', check: true)
assert(c.returncode() == 0, 'whoami failed????')
user_name = c.stdout().strip()
if user_name == 'root'
warning('Don\'t run as root!')
install_dir = '/root/.local/share/gnome-builder/plugins'
else
install_dir = '/home' / user_name / '.local/share/gnome-builder/plugins'
endif
vapi_dir = meson.current_source_dir() / 'vapi'
if get_option('flatpak')
add_project_arguments(['-D', 'FLATPAK'], language: 'vala')
endif
add_project_arguments(['--vapidir', vapi_dir], language: 'vala')
add_project_arguments(['-g3'], language: 'c')
inc = include_directories(
'include/libide/code',
'include/libide/core',
'include/libide/debugger',
'include/libide/editor',
'include/libide/foundry',
'include/libide/greeter',
'include/libide/gtk',
'include/libide/gui',
'include/libide/io',
'include/libide/lsp',
'include/libide/plugins',
'include/libide/projects',
'include/libide/search',
'include/libide/sourceview',
'include/libide/terminal',
'include/libide/threading',
'include/libide/tree',
'include/libide/tweaks',
'include/libide/vcs',
'include/libide/webkit',
'include/libdex-1',
'include/libide',
'include/libpanel-1',
'include/libpeas',
'include/template-glib-1.0',
'include/vte-2.91',
'include/webkitgtk-6.0',
)
vala_compiler = meson.get_compiler('vala')
dependencies = [
dependency('gee-0.8'),
dependency('gio-2.0'),
dependency('glib-2.0'),
dependency('gobject-2.0'),
dependency('gtk4'),
dependency('gtksourceview-5'),
dependency('json-glib-1.0'),
dependency('jsonrpc-glib-1.0'),
dependency('libadwaita-1', version: '>=1.2.0'),
dependency('libsoup-3.0'),
vala_compiler.find_library('ide', dirs: vapi_dir),
vala_compiler.find_library('libdex', dirs: vapi_dir),
vala_compiler.find_library('linux'),
vala_compiler.find_library('panel-1', dirs: vapi_dir),
vala_compiler.find_library('peas', dirs: vapi_dir),
vala_compiler.find_library('template-glib-1.0', dirs: vapi_dir),
vala_compiler.find_library('vte-3.91', dirs: vapi_dir),
]
gnome = import('gnome', required: false)
plugins = []
tgts = []
enabled_plugins = []
if get_option('smart').enabled()
enabled_plugins += 'icon_installer'
enabled_plugins += 'gitgui'
enabled_plugins += 'hierarchies'
enabled_plugins += 'scriptdir'
progs = [
'clangd',
'gtkcsslanguageserver',
'pyright',
'shfmt',
'texlab',
]
foreach prog : progs
p = find_program(prog, required: false)
if p.found()
enabled_plugins += prog
endif
endforeach
spec_progs = {
'swift': 'swift-templates',
'proxy-ls': 'proxyls',
}
foreach prog, plugin : spec_progs
p = find_program(prog, required: false)
if p.found()
enabled_plugins += plugin
endif
endforeach
foreach x : enabled_plugins
subdir(x)
plugins += (x + '.plugin')
endforeach
else
if get_option('plugin_hierarchies').enabled()
subdir('hierarchies')
plugins += 'hierarchies.plugin'
endif
if get_option('plugin_clangd').enabled()
subdir('clangd')
plugins += 'clangd.plugin'
endif
if get_option('plugin_gitgui').enabled()
subdir('gitgui')
plugins += 'gitgui.plugin'
endif
if get_option('plugin_gtkcsslanguageserver').enabled()
subdir('gtkcsslanguageserver')
plugins += 'gtkcsslanguageserver.plugin'
endif
if get_option('plugin_icon_installer').enabled()
subdir('icon_installer')
plugins += 'icon_installer.plugin'
endif
if get_option('plugin_proxyls').enabled()
subdir('proxyls')
plugins += 'proxyls.plugin'
endif
if get_option('plugin_pyright').enabled()
subdir('pyright')
plugins += 'pyright.plugin'
endif
if get_option('plugin_scriptdir').enabled()
subdir('scriptdir')
plugins += 'scriptdir.plugin'
endif
if get_option('plugin_shfmt').enabled()
subdir('shfmt')
plugins += 'shfmt.plugin'
endif
if get_option('plugin_swift_templates').enabled()
subdir('swift-templates')
plugins += 'swift-templates.plugin'
endif
if get_option('plugin_texlab').enabled()
subdir('texlab')
plugins += 'texlab.plugin'
endif
endif
if plugins.length() == 0
error('No plugins enabled!')
endif
subdir('data')
copied_tgts = []
cp = find_program('cp')
compress = find_program('eu-elfcompress', required: false)
if compress.found() and get_option('compress').enabled()
foreach tgt : tgts
name = tgt.full_path().split('/')[-1]
copied_tgts += custom_target(
'compress_' + name,
output: name,
input: tgt,
command: [compress, '@INPUT@', '-o', '@OUTPUT@', '-q'],
install: false,
)
endforeach
else
foreach tgt : tgts
name = tgt.full_path().split('/')[-1]
copied_tgts += custom_target(
'copy_' + name,
output: name,
input: tgt,
command: [cp, '@INPUT@', '@OUTPUT@'],
install: false,
)
endforeach
endif
foreach p : plugins
# TODO: Source item ... cannot be converted to File object, because it is a generated file
plugin_file = meson.current_build_dir() + '/data/' + p
copied_tgts += custom_target(
'copy_' + p,
output: p,
input: plugin_file,
command: [cp, '@INPUT@', '@OUTPUT@'],
install: false,
)
endforeach
zip = find_program('zip')
custom_target(
'make_dist',
output: 'dist.zip',
input: copied_tgts,
command: [zip, '--quiet', '@OUTPUT@', '@INPUT@'],
install: false,
build_by_default: true,
)