forked from linuxmint/nemo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
219 lines (180 loc) · 7.19 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
211
212
213
214
215
216
217
218
219
# Meson build file
# https://github.com/linuxmint/nemo
project('nemo', 'c', version : '6.2.6', meson_version : '>=0.56.0')
# 1. If the library code has changed at all since last release, then increment revision.
# 2. If any interfaces have been added, then increment current and set revision to 0.
# Interface break is not allowed.
nemo_extension_current = 5
nemo_extension_revision = 0
# We need to decrement current by one in the calculation of the age because
# the library was started with version "1:0:0" instead of "0:0:0"
NEMO_EXTENSION_VERSION_INFO = '@0@:@1@:@2@'.format(
nemo_extension_current, nemo_extension_revision, nemo_extension_current - 1
)
################################################################################
conf = configuration_data()
gnome = import('gnome')
pkgconfig = import('pkgconfig')
cc = meson.get_compiler('c')
prefix = get_option('prefix')
buildtype = get_option('buildtype')
# Surround the version in quotes to make it a C string
conf.set_quoted('VERSION', meson.project_version())
check_headers = [
'malloc.h',
'sys/mount.h',
'sys/param.h',
'sys/vfs.h',
'X11/XF86keysym.h',
]
foreach h : check_headers
conf.set10('HAVE_' + h.underscorify().to_upper(), cc.has_header(h))
endforeach
conf.set10('HAVE_MALLOPT', cc.has_function('mallopt', prefix: '#include <malloc.h>'))
if not get_option('deprecated_warnings')
add_global_arguments([
'-Wno-deprecated-declarations',
'-Wno-deprecated',
'-Wno-declaration-after-statement',
'-DGLIB_DISABLE_DEPRECATION_WARNINGS',
],
language: 'c',
)
endif
if buildtype in ['debug', 'debugoptimized']
conf.set('ENABLE_DEBUG', true)
endif
if buildtype == 'debug'
add_global_arguments('-fno-omit-frame-pointer', language: 'c')
endif
################################################################################
# Find dependencies
glib_version = '>=2.45.7'
math = cc.find_library('m', required: true)
gtk = dependency('gtk+-3.0', version: '>=3.10.0')
gio = dependency('gio-2.0', version: glib_version)
gio_unix= dependency('gio-unix-2.0', version: glib_version)
glib = dependency('glib-2.0', version: glib_version)
gmodule = dependency('gmodule-no-export-2.0', version: glib_version)
gobject = dependency('gobject-2.0', version: '>=2.0')
go_intr = dependency('gobject-introspection-1.0', version: '>=1.0')
json = dependency('json-glib-1.0', version: '>=1.6')
cinnamon= dependency('cinnamon-desktop', version: '>=4.8.0')
gail = dependency('gail-3.0')
libxml = dependency('libxml-2.0', version: '>=2.7.8')
x11 = dependency('x11')
xapp = dependency('xapp', version: '>=2.0.0')
# Facultative dependencies
trackerChoice = get_option('tracker')
tracker_enabled = false
if trackerChoice != 'false'
trackerRequired = (trackerChoice == 'true')
# Check all the possible versions
tracker_sparql = dependency('tracker-sparql-3.0', required: false)
if not tracker_sparql.found()
tracker_sparql = dependency('tracker-sparql-2.0', required: false)
endif
if not tracker_sparql.found()
tracker_sparql = dependency('tracker-sparql-1.0', required: false)
endif
if not tracker_sparql.found()
tracker_sparql = dependency('tracker-sparql-0.18', required: false)
endif
if not tracker_sparql.found()
tracker_sparql = dependency('tracker-sparql-0.16', required: trackerRequired)
endif
tracker_enabled = trackerRequired or tracker_sparql.found()
endif
conf.set('ENABLE_TRACKER', tracker_enabled)
gtkdoc_enabled = get_option('gtk_doc')
if gtkdoc_enabled
find_program('gtkdoc-scan', required: true)
endif
libexif_enabled = get_option('exif')
if libexif_enabled
libexif = dependency('libexif', version: '>=0.6.20')
endif
conf.set('HAVE_EXIF', libexif_enabled)
exempi_enabled = get_option('xmp')
if exempi_enabled
exempi = dependency('exempi-2.0', version: '>=2.2.0')
endif
conf.set('HAVE_EXEMPI', exempi_enabled)
libselinux_enabled = get_option('selinux')
if libselinux_enabled
libselinux = dependency('libselinux', version: '>=2.0')
endif
conf.set('HAVE_SELINUX', libselinux_enabled)
gtk_layer_shell_enabled = get_option('gtk_layer_shell')
if gtk_layer_shell_enabled
gtk_layer_shell = dependency('gtk-layer-shell-0', version: '>=0.8', required: false)
conf.set('HAVE_GTK_LAYER_SHELL', gtk_layer_shell.found())
endif
# make sure pango development files are installed
pango = dependency('pango', version: '>=1.40.0')
# check for newer pango for necessary workarounds
new_pango = dependency('pango', version: '>=1.44.0', required: false)
if new_pango.found()
conf.set('HAVE_PANGO_144', true)
else
message('................using pango @0@ instead'.format(new_pango.version()))
endif
enableEmptyView = get_option('empty_view')
conf.set10('ENABLE_EMPTY_VIEW', enableEmptyView)
conf.set_quoted('GETTEXT_PACKAGE', 'nemo')
conf.set_quoted('LOCALE_DIR', join_paths(get_option('prefix'), get_option('localedir')))
conf.set_quoted('LOCALEDIR', join_paths(get_option('prefix'), get_option('localedir')))
conf.set('ENABLE_NLS', cc.has_header('libintl.h'))
conf.set('HAVE_GETTEXT', true)
conf.set('HAVE_LOCALE_H', cc.has_header('locale.h'))
configure_file(
input : 'config.h.meson.in',
output: 'config.h',
configuration: conf
)
################################################################################
rootInclude = include_directories('.')
nemoDataPath = join_paths(get_option('prefix'), get_option('datadir'), 'nemo')
libExecPath = join_paths(get_option('prefix'), get_option('libexecdir'))
# Keep this constant, in case some extensions are behind in being updated...
nemoExtensionPath = join_paths(get_option('prefix'), get_option('libdir'), 'nemo', 'extensions-3.0')
nemo_definitions = [
'-DNEMO_DATADIR="@0@"'.format(nemoDataPath),
'-DNEMO_EXTENSIONDIR="@0@"'.format(nemoExtensionPath),
'-DLIBEXECDIR="@0@"'.format(libExecPath),
'-DG_LOG_DOMAIN="Nemo"'
]
po_subdir = join_paths(meson.project_source_root(), 'po')
subdir('install-scripts')
subdir('cut-n-paste-code/libegg')
subdir('data')
subdir('eel')
subdir('files')
subdir('gresources')
subdir('libnemo-extension')
subdir('libnemo-private')
# subdir('po')
subdir('src')
subdir('search-helpers')
subdir('test')
subdir('docs')
subdir('action-layout-editor')
message('\n'.join(['',
' @0@-@1@'.format(meson.project_name(), meson.project_version()),
'',
' prefix: @0@'.format(prefix),
' source code location: @0@'.format(meson.project_source_root()),
' compiler: @0@'.format(cc.get_id()),
' libexif support: @0@'.format(libexif_enabled),
' exempi support: @0@'.format(exempi_enabled),
' Tracker support: @0@'.format(tracker_enabled),
' Wayland support: @0@'.format(cc.has_header('gdk/gdkwayland.h', dependencies: gtk)),
' gtk-layer-shell-0: @0@'.format(gtk_layer_shell_enabled and gtk_layer_shell.found()),
'',
' nemo-extension documentation: @0@'.format(gtkdoc_enabled),
' nemo-extension introspection: @0@'.format(true),
'',
' debugging support: @0@'.format(buildtype),
' perf profiling support: @0@'.format(buildtype == 'debug'),
'',
]))