2017-05-25 00:16:27 +00:00
|
|
|
project('gnome-shell', 'c',
|
2020-03-07 21:47:10 +00:00
|
|
|
version: '3.36.0',
|
2018-08-06 12:21:02 +00:00
|
|
|
meson_version: '>= 0.47.0',
|
2017-05-25 00:16:27 +00:00
|
|
|
license: 'GPLv2+'
|
|
|
|
)
|
|
|
|
|
2019-07-23 20:34:58 +00:00
|
|
|
split_version = meson.project_version().split('.')
|
|
|
|
|
2017-05-25 00:16:27 +00:00
|
|
|
# We depend on a specific version of the libmutter API. The mutter variants of
|
|
|
|
# the Cogl and Clutter libraries also use this API version.
|
2019-07-23 20:34:58 +00:00
|
|
|
# The API version is increased automatically each development cycle,
|
|
|
|
# starting with 0 in 3.23.x
|
|
|
|
api_version = (split_version[1].to_int() - 23) / 2
|
|
|
|
mutter_api_version = '@0@'.format(api_version)
|
2017-05-25 00:16:27 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2019-04-18 14:21:43 +00:00
|
|
|
ecal_req = '>= 3.33.1'
|
2017-05-25 00:16:27 +00:00
|
|
|
eds_req = '>= 3.17.2'
|
|
|
|
gcr_req = '>= 3.7.5'
|
2018-03-19 20:44:41 +00:00
|
|
|
gio_req = '>= 2.56.0'
|
2017-05-25 00:16:27 +00:00
|
|
|
gi_req = '>= 1.49.1'
|
2019-10-28 17:44:24 +00:00
|
|
|
gjs_req = '>= 1.63.2'
|
2017-05-25 00:16:27 +00:00
|
|
|
gtk_req = '>= 3.15.0'
|
2020-03-07 21:47:10 +00:00
|
|
|
mutter_req = '>= 3.36.0'
|
2017-05-25 00:16:27 +00:00
|
|
|
polkit_req = '>= 0.100'
|
2019-07-20 16:25:29 +00:00
|
|
|
schemas_req = '>= 3.33.1'
|
2017-05-25 00:16:27 +00:00
|
|
|
startup_req = '>= 0.11'
|
2018-01-17 16:01:24 +00:00
|
|
|
ibus_req = '>= 1.5.2'
|
2020-03-07 21:47:10 +00:00
|
|
|
gnome_desktop_req = '>= 3.35.90'
|
2017-05-25 00:16:27 +00:00
|
|
|
|
|
|
|
bt_req = '>= 3.9.0'
|
|
|
|
gst_req = '>= 0.11.92'
|
2018-01-11 09:50:45 +00:00
|
|
|
nm_req = '>= 1.10.4'
|
2017-05-25 00:16:27 +00:00
|
|
|
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'))
|
2018-07-18 17:27:29 +00:00
|
|
|
sysconfdir = join_paths(prefix, get_option('sysconfdir'))
|
2017-05-25 00:16:27 +00:00
|
|
|
|
|
|
|
pkgdatadir = join_paths(datadir, meson.project_name())
|
|
|
|
pkglibdir = join_paths(libdir, meson.project_name())
|
|
|
|
|
2018-07-18 17:27:29 +00:00
|
|
|
autostartdir = join_paths(sysconfdir, 'xdg', 'autostart')
|
2017-05-25 00:16:27 +00:00
|
|
|
convertdir = join_paths(datadir, 'GConf', 'gsettings')
|
|
|
|
desktopdir = join_paths(datadir, 'applications')
|
2020-01-24 17:09:34 +00:00
|
|
|
icondir = join_paths(datadir, 'icons')
|
2017-05-25 00:16:27 +00:00
|
|
|
ifacedir = join_paths(datadir, 'dbus-1', 'interfaces')
|
|
|
|
localedir = join_paths(datadir, 'locale')
|
2020-03-12 19:27:32 +00:00
|
|
|
metainfodir = join_paths(datadir, 'metainfo')
|
2017-07-19 23:43:38 +00:00
|
|
|
portaldir = join_paths(datadir, 'xdg-desktop-portal', 'portals')
|
2017-05-25 00:16:27 +00:00
|
|
|
schemadir = join_paths(datadir, 'glib-2.0', 'schemas')
|
|
|
|
servicedir = join_paths(datadir, 'dbus-1', 'services')
|
|
|
|
|
2018-01-17 15:56:17 +00:00
|
|
|
# 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
|
2018-07-18 21:03:30 +00:00
|
|
|
systemduserunitdir = join_paths(prefix, 'lib', 'systemd', 'user')
|
2018-01-17 15:56:17 +00:00
|
|
|
|
2017-05-25 00:16:27 +00:00
|
|
|
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')
|
2019-04-18 14:21:43 +00:00
|
|
|
ecal_dep = dependency('libecal-2.0', version: ecal_req)
|
2017-05-25 00:16:27 +00:00
|
|
|
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')
|
|
|
|
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)
|
2018-01-17 16:01:24 +00:00
|
|
|
ibus_dep = dependency('ibus-1.0', version: ibus_req)
|
2017-05-25 00:16:27 +00:00
|
|
|
x11_dep = dependency('x11')
|
|
|
|
schemas_dep = dependency('gsettings-desktop-schemas', version: schemas_req)
|
2019-11-26 18:45:29 +00:00
|
|
|
gnome_desktop_dep = dependency('gnome-desktop-3.0', version: gnome_desktop_req)
|
2017-05-25 00:16:27 +00:00
|
|
|
|
|
|
|
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 = []
|
2017-11-25 06:15:39 +00:00
|
|
|
if get_option('networkmanager')
|
2017-10-31 10:38:20 +00:00
|
|
|
nm_deps += dependency('libnm', version: nm_req)
|
2017-11-25 06:15:39 +00:00
|
|
|
nm_deps += dependency('libsecret-1', version: secret_req)
|
2017-05-25 00:16:27 +00:00
|
|
|
|
|
|
|
have_networkmanager = true
|
|
|
|
else
|
2018-01-21 20:04:37 +00:00
|
|
|
have_networkmanager = false
|
2017-12-11 17:37:45 +00:00
|
|
|
endif
|
|
|
|
|
2017-11-25 06:15:39 +00:00
|
|
|
if get_option('systemd')
|
2018-01-17 15:56:17 +00:00
|
|
|
libsystemd_dep = dependency('libsystemd')
|
|
|
|
# XXX: see systemduserunitdir
|
|
|
|
# systemd_dep = dependency('systemd')
|
|
|
|
have_systemd = true
|
2017-05-25 00:16:27 +00:00
|
|
|
else
|
2018-01-17 15:56:17 +00:00
|
|
|
libsystemd_dep = []
|
2017-05-25 00:16:27 +00:00
|
|
|
have_systemd = false
|
|
|
|
endif
|
|
|
|
|
2017-11-25 06:10:26 +00:00
|
|
|
if get_option('man')
|
2017-05-25 00:16:27 +00:00
|
|
|
xsltproc = find_program('xsltproc')
|
|
|
|
|
|
|
|
subdir('man')
|
|
|
|
endif
|
|
|
|
|
|
|
|
mutter_typelibdir = mutter_dep.get_pkgconfig_variable('typelibdir')
|
|
|
|
python = find_program('python3')
|
2018-02-20 09:24:24 +00:00
|
|
|
sassc = find_program('sassc')
|
2020-03-04 02:06:57 +00:00
|
|
|
gjs = find_program('gjs')
|
2020-03-12 19:27:32 +00:00
|
|
|
appstream_util = find_program('appstream-util', required: false)
|
2017-05-25 00:16:27 +00:00
|
|
|
|
|
|
|
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)
|
|
|
|
|
shell-app: remove child_setup from app launching
When the amount of free memory on the system is somewhat low, gnome-shell
will sometimes fail to launch apps, reporting the error:
fork(): Cannot allocate memory
fork() is failing here because while cloning the process virtual address
space, Linux worries that the thread being forked may end up COWing the
entire address space of the parent process (gnome-shell, which is
memory-hungry), and there is not enough free memory to permit that to
happen. This check is somewhat irrelevant because we are only forking
to immediately exec(), which will discard the whole virtual address
space anyway.
This issue can be avoided by using a new optimized gspawn codepath in
the latest glib development version, which uses posix_spawn() internally.
For the optimized codepath to be used, we must not pass a child_setup
function, so the the file descriptor management is reimplemented here
using new glib API to pass fds to the child process. The old API will
continue to be used on older glib versions.
We must also change the spawn flags for this code path to be hit.
I checked that gnome-shell's open file descriptors are all CLOEXEC
so using G_SPAWN_LEAVE_DESCRIPTORS_OPEN should be safe.
This will result in more resilient app launching when memory is low,
since the optimized spawn path avoids cloning the virtual address
space of the parent process (gnome-shell) and avoids the irrelevant
memory overcommit check.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/132
2018-06-06 13:07:17 +00:00
|
|
|
# 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)
|
|
|
|
)
|
2017-05-25 00:16:27 +00:00
|
|
|
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')
|
|
|
|
)
|
|
|
|
|
2018-07-27 16:30:22 +00:00
|
|
|
cdata.set('HAVE_FDWALK',
|
|
|
|
cc.has_function('fdwalk')
|
|
|
|
)
|
|
|
|
|
2019-04-29 10:59:56 +00:00
|
|
|
buildtype = get_option('buildtype')
|
|
|
|
if buildtype != 'plain'
|
|
|
|
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')
|
|
|
|
endif
|
2019-03-05 22:46:47 +00:00
|
|
|
|
2019-03-17 13:38:39 +00:00
|
|
|
if get_option('debug')
|
|
|
|
debug_c_args = [
|
|
|
|
'-DG_ENABLE_DEBUG',
|
|
|
|
'-fno-omit-frame-pointer'
|
|
|
|
]
|
|
|
|
supported_debug_c_args = cc.get_supported_arguments(debug_c_args)
|
|
|
|
add_project_arguments(supported_debug_c_args, language: 'c')
|
|
|
|
endif
|
|
|
|
|
2017-05-25 00:16:27 +00:00
|
|
|
config_h = configure_file(
|
|
|
|
input: 'config.h.meson',
|
|
|
|
output: 'config.h',
|
|
|
|
configuration: cdata
|
|
|
|
)
|
|
|
|
|
|
|
|
conf_inc = include_directories('.')
|
|
|
|
|
|
|
|
libgvc = subproject('gvc',
|
|
|
|
default_options: [
|
2018-01-30 12:37:38 +00:00
|
|
|
'package_name=' + meson.project_name(),
|
|
|
|
'package_version=' + meson.project_version(),
|
2017-05-25 00:16:27 +00:00
|
|
|
'pkgdatadir=' + pkgdatadir,
|
|
|
|
'pkglibdir=' + pkglibdir,
|
|
|
|
'static=false',
|
2018-01-30 12:37:38 +00:00
|
|
|
'introspection=true',
|
2018-01-26 10:24:03 +00:00
|
|
|
'alsa=false'
|
2017-05-25 00:16:27 +00:00
|
|
|
]
|
|
|
|
)
|
|
|
|
libgvc_gir = libgvc.get_variable('libgvc_gir')
|
|
|
|
|
2019-12-02 23:07:01 +00:00
|
|
|
if get_option('extensions_tool')
|
2020-03-08 00:57:34 +00:00
|
|
|
extension_tool = subproject('extensions-tool',
|
2019-12-02 23:07:01 +00:00
|
|
|
default_options: [
|
|
|
|
'package_name=@0@'.format(meson.project_name()),
|
|
|
|
]
|
|
|
|
)
|
2020-03-08 00:57:34 +00:00
|
|
|
|
|
|
|
extension_tool_version = extension_tool.get_variable('package_version')
|
|
|
|
assert(extension_tool_version == meson.project_version(),
|
|
|
|
'extension-tool version does not match project version'
|
|
|
|
)
|
2019-12-02 23:07:01 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
2019-04-26 10:33:58 +00:00
|
|
|
po_dir = join_paths(meson.current_source_dir(), 'po')
|
|
|
|
|
2017-05-25 00:16:27 +00:00
|
|
|
subdir('js')
|
|
|
|
subdir('src')
|
|
|
|
subdir('po')
|
|
|
|
subdir('data')
|
|
|
|
subdir('tests')
|
2018-07-18 17:27:29 +00:00
|
|
|
subdir('tools')
|
2017-05-25 00:16:27 +00:00
|
|
|
|
2017-11-25 06:10:26 +00:00
|
|
|
if get_option('gtk_doc')
|
2017-05-25 00:16:27 +00:00
|
|
|
subdir('docs/reference')
|
|
|
|
endif
|
2018-03-18 21:07:32 +00:00
|
|
|
|
2019-12-03 22:45:41 +00:00
|
|
|
meson.add_install_script('meson/postinstall.py')
|
2020-03-05 11:44:35 +00:00
|
|
|
|
|
|
|
summary_options = {
|
|
|
|
'networkmanager': get_option('networkmanager'),
|
|
|
|
'systemd': get_option('systemd'),
|
|
|
|
'extensions_tool': get_option('extensions_tool'),
|
|
|
|
'man': get_option('man'),
|
|
|
|
'gtk_doc': get_option('gtk_doc'),
|
|
|
|
}
|
|
|
|
|
|
|
|
summary_build = {
|
|
|
|
'buildtype': get_option('buildtype'),
|
|
|
|
'debug': get_option('debug'),
|
|
|
|
}
|
|
|
|
|
|
|
|
summary_dirs = {
|
|
|
|
'prefix': get_option('prefix'),
|
|
|
|
'bindir': get_option('bindir'),
|
|
|
|
'libdir': get_option('libdir'),
|
|
|
|
'libexecdir': get_option('libexecdir'),
|
|
|
|
'datadir': get_option('datadir'),
|
|
|
|
'sysconfdir': get_option('sysconfdir'),
|
|
|
|
}
|
|
|
|
|
|
|
|
if get_option('man')
|
|
|
|
summary_dirs += { 'mandir': get_option('mandir') }
|
|
|
|
endif
|
|
|
|
|
|
|
|
if meson.version().version_compare('>= 0.53.0')
|
|
|
|
summary(summary_dirs, section: 'Directories')
|
|
|
|
summary(summary_build, section: 'Build Configuration')
|
|
|
|
summary(summary_options, section: 'Build Options')
|
|
|
|
endif
|