forked from small-tech/comet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
95 lines (84 loc) · 2.73 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
project(
'org.small_tech.comet',
'vala',
'c',
version: '1.1.2'
)
i18n = import('i18n')
gnome = import('gnome')
add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()), language: 'c')
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('LOCALEDIR', join_paths(get_option('prefix'), get_option('localedir')))
conf_data.set_quoted('VERSION', meson.project_version())
config_header = configure_file(
input : 'src' / 'Constants' / 'Config.vala.in',
output : 'Config.vala',
configuration : conf_data
)
# Custom resource support.
# Place custom icons, etc. in the data/ directory
# and add them to data/gresource.xml.
gresource = gnome.compile_resources(
'gresource',
'data' / 'gresource.xml',
source_dir: 'data'
)
executable(
meson.project_name(),
gresource,
'src' / 'Application.vala',
'src' / 'BaseWindow.vala',
'src' / 'MainWindow.vala',
'src' / 'Model.vala',
'src' / 'Widgets' / 'HeaderBar.vala',
'src' / 'WelcomeWindow.vala',
'src' / 'Constants' / 'Colours.vala',
'src' / 'Constants' / 'Names.vala',
config_header,
dependencies: [
dependency('granite', version: '>=5.2.4'),
dependency('gtk+-3.0'),
dependency('libhandy-1', version: '>=0.90.0'),
dependency('gspell-1', version: '>=1.8.0'),
meson.get_compiler('vala').find_library('posix')
],
install: true
)
# Translate and install our .desktop file.
i18n.merge_file(
input: 'data' / 'comet.desktop.in',
output: meson.project_name() + '.desktop',
po_dir: meson.source_root() / 'po',
type: 'desktop',
install: true,
install_dir: get_option('datadir') / 'applications'
)
# Translate and install our .appdata file.
i18n.merge_file(
input: 'data' / 'comet.appdata.xml.in',
output: meson.project_name() + '.appdata.xml',
po_dir: meson.source_root() / 'po',
install: true,
install_dir: get_option('datadir') / 'metainfo'
)
icon_sizes = ['16', '24', '32', '48', '64', '128']
foreach i : icon_sizes
install_data(
'data' / 'comet-' + i + '.svg',
install_dir: get_option('datadir') / 'icons' / 'hicolor' / i + 'x' + i / 'apps',
rename: meson.project_name() + '.svg'
)
install_data(
'data' / 'comet-' + i + '.svg',
install_dir: get_option('datadir') / 'icons' / 'hicolor' / i + 'x' + i + '@2' / 'apps',
rename: meson.project_name() + '.svg'
)
endforeach
# Also execute the build files from the translation
# and data subdirectories.
subdir('po')
subdir('data')
# Execute post install script to compile gsettings schemas.
meson.add_install_script('meson/post_install.py')