meson.build 7.26 KB
Newer Older
1
project('gnome-shell', 'c',
2
  version: '3.33.1',
3
  meson_version: '>= 0.47.0',
4 5 6 7 8
  license: 'GPLv2+'
)

# We depend on a specific version of the libmutter API. The mutter variants of
# the Cogl and Clutter libraries also use this API version.
9
mutter_api_version = '4'
10 11 12 13 14 15 16

clutter_pc = 'mutter-clutter-' + mutter_api_version
cogl_pc = 'mutter-cogl-' + mutter_api_version
cogl_pango_pc = 'mutter-cogl-pango-' + mutter_api_version
libmutter_pc = 'libmutter-' + mutter_api_version

croco_req = '>= 0.6.8'
17
ecal_req = '>= 3.33.1'
18 19 20
eds_req = '>= 3.17.2'
gcr_req = '>= 3.7.5'
gdesktop_req = '>= 3.7.90'
21
gio_req = '>= 2.56.0'
22
gi_req = '>= 1.49.1'
23
gjs_req = '>= 1.54.0'
24 25
gtk_req = '>= 3.15.0'
json_glib_req = '>= 0.13.2'
26
mutter_req = '>= 3.33.1'
27
polkit_req = '>= 0.100'
28
schemas_req = '>= 3.27.90'
29
startup_req = '>= 0.11'
30
ibus_req = '>= 1.5.2'
31 32 33

bt_req = '>= 3.9.0'
gst_req = '>= 0.11.92'
34
nm_req = '>= 1.10.4'
35 36 37 38 39 40 41 42 43 44 45 46
secret_req = '>= 0.18'

gnome = import('gnome')
i18n  = import('i18n')

prefix = get_option('prefix')

bindir = join_paths(prefix, get_option('bindir'))
datadir = join_paths(prefix, get_option('datadir'))
libdir = join_paths(prefix, get_option('libdir'))
libexecdir = join_paths(prefix, get_option('libexecdir'))
mandir = join_paths(prefix, get_option('mandir'))
47
sysconfdir = join_paths(prefix, get_option('sysconfdir'))
48 49 50 51

pkgdatadir = join_paths(datadir, meson.project_name())
pkglibdir = join_paths(libdir, meson.project_name())

52
autostartdir = join_paths(sysconfdir, 'xdg', 'autostart')
53 54 55 56
convertdir = join_paths(datadir, 'GConf', 'gsettings')
desktopdir = join_paths(datadir, 'applications')
ifacedir = join_paths(datadir, 'dbus-1', 'interfaces')
localedir = join_paths(datadir, 'locale')
57
portaldir = join_paths(datadir, 'xdg-desktop-portal', 'portals')
58 59 60
schemadir = join_paths(datadir, 'glib-2.0', 'schemas')
servicedir = join_paths(datadir, 'dbus-1', 'services')

Iain Lane's avatar
Iain Lane committed
61 62 63 64 65
# XXX: Once https://github.com/systemd/systemd/issues/9595 is fixed and we can
# depend on this version, replace with something like:
# systemduserunitdir = systemd_dep.get_pkgconfig_variable('systemduserunitdir',
#                                                         define_variable: ['prefix', prefix])
# and uncomment systemd_dep below
66
systemduserunitdir = join_paths(prefix, 'lib', 'systemd', 'user')
Iain Lane's avatar
Iain Lane committed
67

68 69 70 71 72 73 74 75
keybindings_dep = dependency('gnome-keybindings', required: false)
if keybindings_dep.found()
  keysdir = keybindings_dep.get_pkgconfig_variable('keysdir')
else
  keysdir = join_paths(datadir, 'gnome-control-center', 'keybindings')
endif

atk_bridge_dep = dependency('atk-bridge-2.0')
76
ecal_dep = dependency('libecal-2.0', version: ecal_req)
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
eds_dep = dependency('libedataserver-1.2', version: eds_req)
gcr_dep = dependency('gcr-base-3', version: gcr_req)
gdk_x11_dep = dependency('gdk-x11-3.0')
gdk_pixbuf_dep = dependency('gdk-pixbuf-2.0')
gi_dep = dependency('gobject-introspection-1.0', version: gi_req)
gio_dep = dependency('gio-2.0', version: gio_req)
gio_unix_dep = dependency('gio-unix-2.0', version: gio_req)
gjs_dep = dependency('gjs-1.0', version: gjs_req)
gtk_dep = dependency('gtk+-3.0', version: gtk_req)
libxml_dep = dependency('libxml-2.0')
croco_dep = dependency('libcroco-0.6', version: croco_req)
clutter_dep = dependency(clutter_pc, version: mutter_req)
cogl_dep = dependency(cogl_pc, version: mutter_req)
cogl_pango_dep = dependency(cogl_pango_pc, version: mutter_req)
mutter_dep = dependency(libmutter_pc, version: mutter_req)
polkit_dep = dependency('polkit-agent-1', version: polkit_req)
startup_dep = dependency('libstartup-notification-1.0', version: startup_req)
94
ibus_dep = dependency('ibus-1.0', version: ibus_req)
95 96 97 98 99 100 101 102 103 104 105 106 107 108
x11_dep = dependency('x11')
schemas_dep = dependency('gsettings-desktop-schemas', version: schemas_req)

bt_dep = dependency('gnome-bluetooth-1.0', version: bt_req, required: false)
gst_dep = dependency('gstreamer-1.0', version: gst_req, required: false)
gst_base_dep = dependency('gstreamer-base-1.0', required: false)

recorder_deps = []
enable_recorder = gst_dep.found() and gst_base_dep.found()
if enable_recorder
  recorder_deps += [gst_dep, gst_base_dep, gtk_dep, x11_dep]
endif

nm_deps = []
109
if get_option('networkmanager')
Lubomir Rintel's avatar
Lubomir Rintel committed
110
  nm_deps += dependency('libnm', version: nm_req)
111
  nm_deps += dependency('libsecret-1', version: secret_req)
112

113 114
  vpndir = nm_deps[0].get_pkgconfig_variable('vpnservicedir')

115 116
  have_networkmanager = true
else
117
  vpndir = prefix
118

119
  have_networkmanager = false
120 121
endif

122
if get_option('systemd')
Iain Lane's avatar
Iain Lane committed
123 124 125 126
  libsystemd_dep = dependency('libsystemd')
  # XXX: see systemduserunitdir
  # systemd_dep = dependency('systemd')
  have_systemd = true
127
else
Iain Lane's avatar
Iain Lane committed
128
  libsystemd_dep = []
129 130 131
  have_systemd = false
endif

132
if get_option('man')
133 134 135 136 137 138 139
  xsltproc = find_program('xsltproc')

  subdir('man')
endif

mutter_typelibdir = mutter_dep.get_pkgconfig_variable('typelibdir')
python = find_program('python3')
Florian Müllner's avatar
Florian Müllner committed
140
sassc = find_program('sassc')
141 142 143 144 145 146 147 148 149 150 151 152 153

cc = meson.get_compiler('c')

m_dep = cc.find_library('m', required: false)

cdata = configuration_data()
cdata.set_quoted('GETTEXT_PACKAGE', meson.project_name())
cdata.set_quoted('VERSION', meson.project_version())
cdata.set_quoted('PACKAGE_VERSION', meson.project_version())

cdata.set('HAVE_NETWORKMANAGER', have_networkmanager)
cdata.set('HAVE_SYSTEMD', have_systemd)

154 155 156 157 158
# New API added in glib-2.57.2
cdata.set('HAVE_GIO_DESKTOP_LAUNCH_URIS_WITH_FDS',
          cc.has_function('g_desktop_app_info_launch_uris_as_manager_with_fds',
                          dependencies : gio_dep)
)
159 160 161 162 163 164 165
cdata.set('HAVE_FDWALK', cc.has_function('fdwalk'))
cdata.set('HAVE_MALLINFO', cc.has_function('mallinfo'))
cdata.set('HAVE_SYS_RESOURCE_H', cc.has_header('sys/resource.h'))
cdata.set('HAVE__NL_TIME_FIRST_WEEKDAY',
  cc.has_header_symbol('langinfo.h', '_NL_TIME_FIRST_WEEKDAY')
)

166 167 168 169
cdata.set('HAVE_FDWALK',
          cc.has_function('fdwalk')
)

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
all_warnings = [
  '-fno-strict-aliasing',
  '-Wpointer-arith',
  '-Wmissing-declarations',
  '-Wimplicit-function-declaration',
  '-Wformat=2',
  '-Wformat-nonliteral',
  '-Wformat-security',
  '-Wstrict-prototypes',
  '-Wmissing-prototypes',
  '-Wnested-externs',
  '-Wold-style-definition',
  '-Wundef',
  '-Wunused',
  '-Wcast-align',
  '-Wmissing-noreturn',
  '-Wmissing-format-attribute',
  '-Wmissing-include-dirs',
  '-Wlogical-op',
  '-Wignored-qualifiers',
  '-Werror=redundant-decls',
  '-Werror=implicit',
  '-Werror=nonnull',
  '-Werror=init-self',
  '-Werror=main',
  '-Werror=missing-braces',
  '-Werror=sequence-point',
  '-Werror=return-type',
  '-Werror=trigraphs',
  '-Werror=array-bounds',
  '-Werror=write-strings',
  '-Werror=address',
  '-Werror=int-to-pointer-cast',
  '-Werror=pointer-to-int-cast',
  '-Werror=empty-body',
  '-Werror=write-strings',
]

supported_warnings = cc.get_supported_arguments(all_warnings)

add_project_arguments(supported_warnings, language: 'c')

212 213 214 215 216 217 218 219 220 221
config_h = configure_file(
  input: 'config.h.meson',
  output: 'config.h',
  configuration: cdata
)

conf_inc = include_directories('.')

libgvc = subproject('gvc',
  default_options: [
222 223
    'package_name=' + meson.project_name(),
    'package_version=' + meson.project_version(),
224 225 226
    'pkgdatadir=' + pkgdatadir,
    'pkglibdir=' + pkglibdir,
    'static=false',
227
    'introspection=true',
228
    'alsa=false'
229 230 231 232 233 234 235 236 237
  ]
)
libgvc_gir = libgvc.get_variable('libgvc_gir')

subdir('js')
subdir('src')
subdir('po')
subdir('data')
subdir('tests')
238
subdir('tools')
239

240
if get_option('gtk_doc')
241 242
  subdir('docs/reference')
endif
243 244

meson.add_install_script('meson/meson-postinstall.sh')