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
|
project('mate-polkit', 'c',
license : 'GPL2+',
version : '1.28.0',
meson_version : '>=0.43'
)
glib_version = '>=2.50'
gtk_version = '>=3.22'
agent_version = '>=0.97'
gobject_version = '>=0.97'
gnome = import('gnome')
i18n = import('i18n')
gettext_package = meson.project_name()
prefix = get_option('prefix')
datadir = join_paths(prefix, get_option('datadir'))
sysconfdir = join_paths(prefix, get_option('sysconfdir'))
libexecdir = join_paths(prefix, get_option('libexecdir'))
# Dependencies
glib_dep = dependency('glib-2.0', version : glib_version)
gthread_dep = dependency('gthread-2.0')
gtk_dep = dependency('gtk+-3.0', version : gtk_version)
agent_dep = dependency('polkit-agent-1', version : agent_version)
gobject_dep = dependency('polkit-gobject-1', version : gobject_version)
# Optional dependencies
if get_option('accountsservice')
accountsservice_dep = dependency('accountsservice', required : false)
build_accountsservice = accountsservice_dep.found()
else
build_accountsservice = false
endif
appindicator_ayatana_dep = dependency('ayatana-appindicator3-0.1', required : false)
ubuntu_ayatana_dep = dependency('appindicator3-0.1', required : false)
appindicator_ayatana = appindicator_ayatana_dep.found()
ubuntu_ayatana = ubuntu_ayatana_dep.found()
if get_option('appindicator') == 'yes'
if appindicator_ayatana
appindicator_dep = dependency('ayatana-appindicator3-0.1')
elif ubuntu_ayatana
appindicator_dep = dependency('appindicator3-0.1')
else
error ('Neither Ayatana AppIndicator nor Ubuntu AppIndicator library is present, but you enabled AppIndicator support.')
endif
elif get_option('appindicator') == 'auto'
if appindicator_ayatana
appindicator_dep = dependency('ayatana-appindicator3-0.1')
elif ubuntu_ayatana
appindicator_dep = dependency('appindicator3-0.1')
else
appindicator_dep = []
endif
else
appindicator_dep = []
endif
# config.h
config_data = configuration_data()
config_data.set_quoted('GETTEXT_PACKAGE', gettext_package)
config_data.set_quoted('MATELOCALEDIR', join_paths(prefix, get_option('localedir')))
config_data.set_quoted('PACKAGE_NAME', meson.project_name())
config_data.set_quoted('PACKAGE_VERSION', meson.project_version())
config_data.set_quoted('VERSION', meson.project_version())
config_data.set_quoted('PKG_DATA_DIR', join_paths(prefix, get_option('datadir'), meson.project_name()))
config_data.set_quoted('ENGRAMPA_RESOURCE_UI_PATH', '/org/mate/Engrampa/ui')
config_data.set_quoted('PACKAGE_URL', 'https://mate-desktop.org')
if build_accountsservice
config_data.set('HAVE_ACCOUNTSSERVICE', 1)
endif
if appindicator_ayatana and get_option('appindicator') != 'no'
config_data.set('HAVE_AYATANA_APPINDICATOR', 1)
elif ubuntu_ayatana and get_option('appindicator') != 'no'
config_data.set('HAVE_UBUNTU_APPINDICATOR', 1)
endif
config_file = configure_file(output : 'config.h', configuration : config_data)
config_inc = include_directories('.')
# C args
c_args = [
'-Wall',
'-Wcast-align',
'-Wtype-limits',
'-Wclobbered',
'-Wempty-body',
'-Wignored-qualifiers',
'-Wmissing-prototypes',
'-Wnested-externs',
'-Wpointer-arith',
'-Wno-sign-compare',
'-Wformat-security',
'-Wno-deprecated-declarations'
]
# Subdirectories
subdir('po')
subdir('src')
# Summary
summary = [
'configuration summary:',
'',
' project: @0@ @1@'.format(meson.project_name(), meson.project_version()),
' prefix: @0@'.format(prefix),
' sysconfdir: @0@'.format(sysconfdir),
' Accountsservice: @0@'.format(build_accountsservice),
' AppIndicator: @0@'.format(get_option('appindicator')),
'Ayatana AppIndicator (preferred): @0@'.format(appindicator_ayatana),
'Ubuntu AppIndicator (legacy): @0@'.format(ubuntu_ayatana),
''
]
message('\n'.join(summary))
|