-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
94 lines (79 loc) · 2.66 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
project('com.github.gffranco.OpenXboxClient', 'vala', 'c', version: '0.1.0')
# Compilers
c_compiler = meson.get_compiler('c')
vala_compiler = meson.get_compiler('vala')
add_project_arguments([
'-DGETTEXT_PACKAGE=\"@0@\"'.format(meson.project_name()),
],
language: 'c',
)
i18n = import('i18n')
# load meson from subdir
subdir('data')
# Set our translation domain
add_global_arguments('-DGETTEXT_PACKAGE=\"@0@\"'.format (meson.project_name()), language:'c')
# Subprojects
libXboxWebApi_proj = subproject('libXboxWebApi')
libXboxWebApi_dep = libXboxWebApi_proj.get_variable('libXboxWebApi_dep')
# Adding deps
dependencies = [
dependency('glib-2.0', version: '>=2.38'),
dependency('gio-unix-2.0', version: '>=2.20'),
dependency('granite'),
dependency('webkit2gtk-4.0'),
dependency('libsoup-2.4'),
dependency('json-glib-1.0'),
libXboxWebApi_dep,
]
# Adds subfolders specific build system
icon_sizes = ['128', '256']
foreach i : icon_sizes
install_data(
join_paths('data/icons', i, meson.project_name() + '.svg'),
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', i + 'x' + i, 'apps')
)
install_data(
join_paths('data/icons', i, meson.project_name() + '.svg'),
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', i + 'x' + i + '@2', 'apps')
)
endforeach
config_data = configuration_data()
config_data.set('EXEC_NAME', meson.project_name())
conf_data = configuration_data()
conf_data.set_quoted('PROJECT_NAME', meson.project_name())
conf_data.set_quoted('GETTEXT_PACKAGE', meson.project_name())
conf_data.set_quoted('VERSION', meson.project_version())
conf_data.set_quoted('PREFIX', get_option('prefix'))
desktop_in_file = configure_file(
input: join_paths('data', meson.project_name() + '.desktop.in.in'),
output: '@BASENAME@',
configuration: config_data
)
desktop_file = i18n.merge_file(
input: desktop_in_file,
output: meson.project_name() + '.desktop',
po_dir: join_paths(meson.source_root(), 'po'),
type: 'desktop',
install: true,
install_dir: join_paths(get_option('datadir'), 'applications')
)
appstream_file = i18n.merge_file(
input: join_paths (meson.source_root(), 'data', meson.project_name() + '.appdata.xml.in'),
output: '@BASENAME@',
po_dir: join_paths(meson.source_root(), 'po'),
install: true,
install_dir: join_paths(get_option('datadir'), 'metainfo')
)
code_files = files(
'src/Application.vala',
'src/MainWindow.vala',
'src/LoginWindow.vala',
)
code_files += resources_src
executable(
meson.project_name(),
code_files,
resources_src,
dependencies: dependencies,
install: true
)