forked from elementary/gala
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
167 lines (138 loc) · 5.11 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
project('gala',
'c', 'vala',
version: '7.0.1',
meson_version: '>= 0.58.0',
license: 'GPL3',
)
is_release = false
gnome = import('gnome')
i18n = import('i18n')
pkg = import('pkgconfig')
cc = meson.get_compiler('c')
gala_version = meson.project_version()
vala_version_required = '0.46.0'
vala = meson.get_compiler('vala')
if not vala.version().version_compare('>= @0@'.format(vala_version_required))
error('Valac >= @0@ required!'.format(vala_version_required))
endif
vapi_dir = meson.current_source_dir() / 'vapi'
locale_dir = join_paths(get_option('prefix'), get_option('localedir'))
data_dir = join_paths(get_option('prefix'), get_option('datadir'))
plugins_dir = join_paths(get_option('prefix'), get_option('libdir'), meson.project_name(), 'plugins')
pkgdata_dir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name())
pkglib_dir = join_paths(get_option('prefix'), get_option('libdir'), meson.project_name())
conf = configuration_data()
conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
conf.set_quoted('LOCALEDIR', locale_dir)
conf.set_quoted('DATADIR', data_dir)
conf.set_quoted('PKGDATADIR', pkgdata_dir)
conf.set_quoted('PLUGINDIR', plugins_dir)
conf.set_quoted('RESOURCEPATH', '/org/pantheon/desktop/gala')
conf.set_quoted('VERSION', gala_version)
conf.set_quoted('SCHEMA', 'org.pantheon.desktop.gala')
config_h = configure_file(
output: 'config.h',
configuration: conf
)
config_dep = declare_dependency(
dependencies: vala.find_library('config', dirs: vapi_dir),
sources: config_h
)
config_inc_dir = include_directories('.')
customconf = configuration_data()
customconf.set('GETTEXT_PACKAGE', meson.project_name())
add_project_arguments([
'--target-glib=2.44',
'--hide-internal',
'--enable-deprecated',
'--vapidir=' + vapi_dir,
],
language: 'vala',
)
add_project_arguments([
'-Wno-discarded-qualifiers',
'-Wno-incompatible-pointer-types',
'-Wno-unused',
'-Wl,--enable-new-dtags',
'-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()),
'-DGNOME_DESKTOP_USE_UNSTABLE_API',
'-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_44',
'-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_44',
'-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_10',
'-DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_10',
],
language: 'c',
)
# Dependencies
glib_version_required = '2.44.0'
gtk_version_required = '3.10.0'
gsd_version_required = '3.15.2'
canberra_dep = dependency('libcanberra')
glib_dep = dependency('glib-2.0', version: '>= @0@'.format(glib_version_required))
gobject_dep = dependency('gobject-2.0', version: '>= @0@'.format(glib_version_required))
gio_dep = dependency('gio-2.0', version: '>= @0@'.format(glib_version_required))
gio_unix_dep = dependency('gio-unix-2.0', version: '>= @0@'.format(glib_version_required))
gmodule_dep = dependency('gmodule-2.0')
gtk_dep = [dependency('gtk+-3.0', version: '>= @0@'.format(gtk_version_required)), dependency('gdk-x11-3.0')]
gee_dep = dependency('gee-0.8')
granite_dep = dependency('granite', version: '>= 5.4.0')
gnome_desktop_dep = dependency('gnome-desktop-3.0')
gsd_dep = dependency('gnome-settings-daemon', version: '>= @0@'.format(gsd_version_required))
m_dep = cc.find_library('m', required: false)
posix_dep = vala.find_library('posix', required: false)
gexiv2_dep = dependency('gexiv2')
if get_option('systemd')
systemd_dep = dependency('libsystemd')
endif
mutter_dep = []
libmutter_dep = []
vala_flags = []
mutter42_dep = dependency('libmutter-10', version: ['>= 42', '< 43'], required: false)
if mutter42_dep.found()
libmutter_dep = dependency('libmutter-10', version: '>= 42')
mutter_dep = [
libmutter_dep,
dependency('mutter-cogl-10'), dependency('mutter-cogl-pango-10'),
dependency('mutter-clutter-10')
]
vala_flags = []
endif
mutter43_dep = dependency('libmutter-11', version: ['>= 43', '< 44'], required: false)
if mutter43_dep.found()
libmutter_dep = dependency('libmutter-11', version: '>= 43')
mutter_dep = [
libmutter_dep,
dependency('mutter-cogl-11'), dependency('mutter-cogl-pango-11'),
dependency('mutter-clutter-11')
]
vala_flags = ['--define', 'HAS_MUTTER43']
endif
if mutter_dep.length() == 0
error ('No supported mutter library found!')
endif
mutter_typelib_dir = libmutter_dep.get_variable('typelibdir')
if get_option('systemd')
vala_flags += ['--define', 'WITH_SYSTEMD']
endif
add_project_arguments(vala_flags, language: 'vala')
add_project_link_arguments(['-Wl,-rpath,@0@'.format(mutter_typelib_dir)], language: 'c')
gala_base_dep = [canberra_dep, glib_dep, gobject_dep, gio_dep, gio_unix_dep, gmodule_dep, gee_dep, gtk_dep, mutter_dep, granite_dep, gnome_desktop_dep, m_dep, posix_dep, gexiv2_dep, config_dep]
if get_option('systemd')
gala_base_dep += systemd_dep
endif
subdir('data')
subdir('lib')
subdir('src')
subdir('daemon')
subdir('plugins/maskcorners')
subdir('plugins/pip')
subdir('plugins/template')
if get_option('documentation')
subdir('docs')
endif
subdir('po')
vapigen = find_program('vapigen', required: false)
if vapigen.found()
subdir('vapi')
endif
meson.add_install_script('build-aux/meson/post_install.py')