-
-
Notifications
You must be signed in to change notification settings - Fork 333
Expand file tree
/
Copy pathmeson.build
More file actions
165 lines (141 loc) · 4.73 KB
/
Copy pathmeson.build
File metadata and controls
165 lines (141 loc) · 4.73 KB
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
project(
'io.github.alainm23.planify',
'vala', 'c',
version: '4.19.5'
)
###########
# Profile #
###########
profile = get_option('profile')
if profile == 'development'
find_program('git')
rev_txt = run_command('git','rev-parse','--short','HEAD').stdout().strip()
rev = '-@0@'.format(rev_txt)
application_id = 'io.github.alainm23.planify.Devel'
application_path = '/io/github/alainm23/planify/Devel'
add_project_arguments(['--define=DEVELOPMENT'], language: 'vala')
else
rev = ''
application_id = 'io.github.alainm23.planify'
application_path = '/io/github/alainm23/planify'
endif
################
# Dependencies #
################
cc = meson.get_compiler('c')
gnome = import('gnome')
i18n = import('i18n')
pkgconfig = import('pkgconfig')
add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format (application_id), language:'c')
add_project_arguments('-DLIBICAL_GLIB_UNSTABLE_API=1', language: 'c')
gio_dep = dependency('gio-2.0')
glib_dep = dependency('glib-2.0')
gee_dep = dependency('gee-0.8')
gtk_dep = dependency('gtk4')
libsoup_dep = dependency('libsoup-3.0')
sqlite3_dep = dependency('sqlite3')
libadwaita_dep = dependency('libadwaita-1', version: '>= 1.7.0')
json_dep = dependency('json-glib-1.0')
libical_dep = dependency('libical-glib')
libgxml_dep = dependency('gxml-0.20')
libsecret_dep = dependency('libsecret-1')
libspelling = dependency('libspelling-1', required: get_option('spelling'))
gtksourceview_dep = dependency('gtksourceview-5')
m_dep = meson.get_compiler('c').find_library('m', required : false)
icu_uc_dep = dependency('icu-uc')
# is libical version 4 or higher?
is_libical4 = libical_dep.version().version_compare('>= 4.0.0')
if is_libical4
add_project_arguments('-D', 'IS_LIBICAL4', language: 'vala')
endif
if icu_uc_dep.found ()
add_project_arguments(['--vapidir=' + meson.project_source_root() / 'vapi'], language: 'vala')
endif
if libspelling.found ()
add_project_arguments(['--define=WITH_LIBSPELLING'], language: 'vala')
endif
if get_option('portal')
libportal_dep = dependency('libportal', required: true)
libportal_gtk4_dep = dependency('libportal-gtk4', required: true)
add_project_arguments('-D', 'WITH_LIBPORTAL', language: 'vala')
if not libportal_dep.found()
error('libportal requested but not found')
endif
if not libportal_gtk4_dep.found()
error('libportal-gtk4 requested but not found')
endif
endif
if get_option('evolution')
libecal_dep = dependency('libecal-2.0', version: '>= 3.45.1')
libedataserver_dep = dependency('libedataserver-1.2', version: '>= 3.45.1')
add_project_arguments('-D', 'WITH_EVOLUTION', language: 'vala')
if not libecal_dep.found()
error('libecal-2.0 requested but not found')
endif
if not libedataserver_dep.found()
error('libedataserver-1.2 requested but not found')
endif
endif
############
# Resources #
############
asresources = gnome.compile_resources (
'as-resources', 'data/io.github.alainm23.planify.gresource.xml',
source_dir: 'data',
c_name: 'as'
)
############
# Config #
############
prefix = get_option('prefix')
bindir = prefix / get_option('bindir')
datadir = prefix / get_option('datadir')
localedir = prefix / get_option ('localedir')
libexecdir = prefix / get_option('libexecdir')
grep = find_program('grep')
total_strings_res = run_command(grep, '-c', 'msgid', meson.project_source_root() + '/po/io.github.alainm23.planify.pot', check : true)
total_strings = total_strings_res.stdout().strip().to_int() - 1
# _NL_TIME_FIRST_WEEKDAY is a glibc-ism
nl_time_first_weekday_src = '''
#include <langinfo.h>
int main() {
nl_langinfo(_NL_TIME_FIRST_WEEKDAY);
};
'''
if cc.compiles(nl_time_first_weekday_src)
add_project_arguments('-D', 'HAVE__NL_TIME_FIRST_WEEKDAY', language: 'vala')
endif
conf_data = configuration_data()
conf_data.set('TOTAL_STRINGS', total_strings)
conf_data.set_quoted('APPLICATION_ID', application_id)
conf_data.set_quoted('GETTEXT_PACKAGE', application_id)
conf_data.set_quoted('GNOMELOCALEDIR', localedir)
conf_data.set_quoted('VERSION', meson.project_version())
conf_data.set_quoted('LOCALEDIR', localedir)
conf_data.set_quoted('PACKAGE_VERSION', meson.project_version())
conf_data.set_quoted('PREFIX', prefix)
conf_data.set_quoted('DATADIR', datadir)
conf_data.set_quoted('PROFILE', profile)
config_file = configure_file(
configuration : conf_data,
input : 'config.vala.in',
output : 'config.vala'
)
subdir('core')
subdir('src')
subdir('quick-add')
subdir('cli')
subdir('data')
subdir('search-provider')
subdir('po')
# Testing
subdir('test')
summary({
'Tracing': get_option('tracing'),
'Profile': get_option('profile'),
}, section: 'Development')
gnome.post_install(
glib_compile_schemas: true,
gtk_update_icon_cache: true,
update_desktop_database: true,
)