2017-09-08 08:37:54 +02:00
|
|
|
project('gala',
|
2020-07-20 22:06:57 +02:00
|
|
|
'c', 'vala',
|
2023-01-05 21:51:48 +01:00
|
|
|
version: '7.0.0',
|
2021-09-29 20:51:50 +02:00
|
|
|
meson_version: '>= 0.50.0',
|
2020-07-20 22:06:57 +02:00
|
|
|
license: 'GPL3',
|
2017-09-08 08:37:54 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
is_release = false
|
|
|
|
|
|
|
|
gnome = import('gnome')
|
|
|
|
i18n = import('i18n')
|
2020-03-06 16:47:25 +01:00
|
|
|
pkg = import('pkgconfig')
|
2017-09-08 08:37:54 +02:00
|
|
|
cc = meson.get_compiler('c')
|
|
|
|
|
|
|
|
gala_version = meson.project_version()
|
|
|
|
|
|
|
|
vala_version_required = '0.28.0'
|
|
|
|
vala = meson.get_compiler('vala')
|
|
|
|
if not vala.version().version_compare('>= @0@'.format(vala_version_required))
|
2020-07-20 22:06:57 +02:00
|
|
|
error('Valac >= @0@ required!'.format(vala_version_required))
|
2017-09-08 08:37:54 +02:00
|
|
|
endif
|
|
|
|
|
2020-03-06 16:47:25 +01:00
|
|
|
vapi_dir = meson.current_source_dir() / 'vapi'
|
2017-09-08 08:37:54 +02:00
|
|
|
|
2021-08-12 15:32:39 +02:00
|
|
|
locale_dir = join_paths(get_option('prefix'), get_option('localedir'))
|
2017-09-08 08:37:54 +02:00
|
|
|
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()
|
2021-08-12 15:32:39 +02:00
|
|
|
conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
|
|
|
|
conf.set_quoted('LOCALEDIR', locale_dir)
|
2017-09-08 08:37:54 +02:00
|
|
|
conf.set_quoted('DATADIR', data_dir)
|
|
|
|
conf.set_quoted('PKGDATADIR', pkgdata_dir)
|
2020-03-06 16:47:25 +01:00
|
|
|
conf.set_quoted('PLUGINDIR', plugins_dir)
|
|
|
|
conf.set_quoted('RESOURCEPATH', '/org/pantheon/desktop/gala')
|
2017-09-08 08:37:54 +02:00
|
|
|
conf.set_quoted('VERSION', gala_version)
|
2020-03-06 16:47:25 +01:00
|
|
|
conf.set_quoted('SCHEMA', 'org.pantheon.desktop.gala')
|
|
|
|
config_h = configure_file(
|
2020-07-20 22:06:57 +02:00
|
|
|
output: 'config.h',
|
|
|
|
configuration: conf
|
2020-03-06 16:47:25 +01:00
|
|
|
)
|
2017-09-08 08:37:54 +02:00
|
|
|
|
2020-03-06 16:47:25 +01:00
|
|
|
config_dep = declare_dependency(
|
2020-07-20 22:06:57 +02:00
|
|
|
dependencies: vala.find_library('config', dirs: vapi_dir),
|
|
|
|
sources: config_h
|
2020-03-06 16:47:25 +01:00
|
|
|
)
|
2017-09-08 08:37:54 +02:00
|
|
|
|
2020-03-06 16:47:25 +01:00
|
|
|
config_inc_dir = include_directories('.')
|
2017-09-08 08:37:54 +02:00
|
|
|
|
2020-03-06 16:47:25 +01:00
|
|
|
customconf = configuration_data()
|
|
|
|
customconf.set('GETTEXT_PACKAGE', meson.project_name())
|
2017-09-08 08:37:54 +02:00
|
|
|
|
|
|
|
add_project_arguments([
|
2020-07-20 22:06:57 +02:00
|
|
|
'--target-glib=2.44',
|
|
|
|
'--hide-internal',
|
|
|
|
'--enable-deprecated',
|
|
|
|
'--vapidir=' + vapi_dir,
|
|
|
|
],
|
|
|
|
language: 'vala',
|
2017-09-08 08:37:54 +02:00
|
|
|
)
|
|
|
|
add_project_arguments([
|
2020-07-20 22:06:57 +02:00
|
|
|
'-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',
|
2017-09-08 08:37:54 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
# Dependencies
|
|
|
|
glib_version_required = '2.44.0'
|
|
|
|
gtk_version_required = '3.10.0'
|
|
|
|
gsd_version_required = '3.15.2'
|
|
|
|
|
2021-06-30 07:47:46 +02:00
|
|
|
canberra_dep = dependency('libcanberra')
|
2020-03-06 16:47:25 +01:00
|
|
|
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))
|
2022-10-11 02:47:37 +02:00
|
|
|
gio_unix_dep = dependency('gio-unix-2.0', version: '>= @0@'.format(glib_version_required))
|
2020-03-06 16:47:25 +01:00
|
|
|
gmodule_dep = dependency('gmodule-2.0')
|
2017-09-08 08:37:54 +02:00
|
|
|
gtk_dep = [dependency('gtk+-3.0', version: '>= @0@'.format(gtk_version_required)), dependency('gdk-x11-3.0')]
|
|
|
|
gee_dep = dependency('gee-0.8')
|
2020-08-05 22:02:45 +02:00
|
|
|
granite_dep = dependency('granite', version: '>= 5.4.0')
|
2017-09-08 08:37:54 +02:00
|
|
|
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)
|
2021-08-26 14:43:43 +02:00
|
|
|
posix_dep = vala.find_library('posix', required: false)
|
2021-04-30 00:36:59 +02:00
|
|
|
gexiv2_dep = dependency('gexiv2')
|
2021-09-29 20:51:50 +02:00
|
|
|
if get_option('systemd')
|
2021-10-04 03:47:04 +02:00
|
|
|
systemd_dep = dependency('libsystemd')
|
2021-09-29 20:51:50 +02:00
|
|
|
endif
|
2017-09-08 08:37:54 +02:00
|
|
|
|
|
|
|
mutter_dep = []
|
|
|
|
libmutter_dep = []
|
|
|
|
|
2018-01-11 17:57:21 +01:00
|
|
|
vala_flags = []
|
|
|
|
|
2020-11-17 12:11:52 +01:00
|
|
|
mutter336_dep = dependency('libmutter-6', version: ['>= 3.35.1', '< 3.37'], required: false)
|
2019-10-31 22:22:38 +01:00
|
|
|
if mutter336_dep.found()
|
2020-07-20 22:06:57 +02:00
|
|
|
libmutter_dep = dependency('libmutter-6', version: '>= 3.35.1')
|
|
|
|
mutter_dep = [
|
|
|
|
libmutter_dep,
|
|
|
|
dependency('mutter-cogl-6'), dependency('mutter-cogl-pango-6'),
|
|
|
|
dependency('mutter-cogl-path-6'), dependency('mutter-clutter-6')
|
|
|
|
]
|
2021-01-03 21:14:17 +01:00
|
|
|
vala_flags = []
|
2020-07-20 22:06:57 +02:00
|
|
|
add_project_arguments(['-DCLUTTER_ENABLE_COMPOSITOR_API', '-DCLUTTER_ENABLE_EXPERIMENTAL_API',
|
|
|
|
'-DCOGL_ENABLE_EXPERIMENTAL_API', '-DCOGL_ENABLE_EXPERIMENTAL_2_0_API'], language: 'c')
|
2019-10-31 22:22:38 +01:00
|
|
|
endif
|
|
|
|
|
2020-11-17 12:11:52 +01:00
|
|
|
mutter338_dep = dependency('libmutter-7', version: ['>= 3.37', '< 3.39'], required: false)
|
|
|
|
if mutter338_dep.found()
|
|
|
|
libmutter_dep = dependency('libmutter-7', version: '>= 3.37')
|
|
|
|
mutter_dep = [
|
|
|
|
libmutter_dep,
|
|
|
|
dependency('mutter-cogl-7'), dependency('mutter-cogl-pango-7'),
|
|
|
|
dependency('mutter-clutter-7')
|
|
|
|
]
|
2021-01-03 21:14:17 +01:00
|
|
|
vala_flags = ['--define', 'HAS_MUTTER338']
|
2020-11-17 12:11:52 +01:00
|
|
|
add_project_arguments(['-DCLUTTER_ENABLE_COMPOSITOR_API', '-DCLUTTER_ENABLE_EXPERIMENTAL_API',
|
2021-08-17 00:23:46 +02:00
|
|
|
'-DCOGL_ENABLE_EXPERIMENTAL_API', '-DCOGL_ENABLE_EXPERIMENTAL_2_0_API'], language: 'c')
|
|
|
|
endif
|
|
|
|
|
|
|
|
mutter40_dep = dependency('libmutter-8', version: ['>= 40', '< 41'], required: false)
|
|
|
|
if mutter40_dep.found()
|
|
|
|
libmutter_dep = dependency('libmutter-8', version: '>= 40')
|
|
|
|
mutter_dep = [
|
|
|
|
libmutter_dep,
|
|
|
|
dependency('mutter-cogl-8'), dependency('mutter-cogl-pango-8'),
|
|
|
|
dependency('mutter-clutter-8')
|
|
|
|
]
|
2021-08-26 14:43:43 +02:00
|
|
|
vala_flags = ['--define', 'HAS_MUTTER338', '--define', 'HAS_MUTTER40']
|
2021-08-17 00:23:46 +02:00
|
|
|
add_project_arguments(['-DCLUTTER_ENABLE_COMPOSITOR_API', '-DCLUTTER_ENABLE_EXPERIMENTAL_API',
|
2020-11-17 12:11:52 +01:00
|
|
|
'-DCOGL_ENABLE_EXPERIMENTAL_API', '-DCOGL_ENABLE_EXPERIMENTAL_2_0_API'], language: 'c')
|
|
|
|
endif
|
|
|
|
|
2021-08-26 14:43:43 +02:00
|
|
|
mutter41_dep = dependency('libmutter-9', version: ['>= 41', '< 42'], required: false)
|
|
|
|
if mutter41_dep.found()
|
|
|
|
libmutter_dep = dependency('libmutter-9', version: '>= 41')
|
|
|
|
mutter_dep = [
|
|
|
|
libmutter_dep,
|
|
|
|
dependency('mutter-cogl-9'), dependency('mutter-cogl-pango-9'),
|
|
|
|
dependency('mutter-clutter-9')
|
|
|
|
]
|
|
|
|
vala_flags = ['--define', 'HAS_MUTTER338', '--define', 'HAS_MUTTER40', '--define', 'HAS_MUTTER41']
|
|
|
|
endif
|
|
|
|
|
2022-03-09 09:44:55 +01:00
|
|
|
mutter42_dep = dependency('libmutter-10', version: ['>= 42', '< 43'], required: false)
|
2022-01-18 13:33:50 +01:00
|
|
|
if mutter42_dep.found()
|
2022-03-09 09:44:55 +01:00
|
|
|
libmutter_dep = dependency('libmutter-10', version: '>= 42')
|
2022-01-18 13:33:50 +01:00
|
|
|
mutter_dep = [
|
|
|
|
libmutter_dep,
|
|
|
|
dependency('mutter-cogl-10'), dependency('mutter-cogl-pango-10'),
|
|
|
|
dependency('mutter-clutter-10')
|
|
|
|
]
|
|
|
|
vala_flags = ['--define', 'HAS_MUTTER338', '--define', 'HAS_MUTTER40', '--define', 'HAS_MUTTER41', '--define', 'HAS_MUTTER42']
|
|
|
|
endif
|
|
|
|
|
2022-08-08 22:46:04 +02:00
|
|
|
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_MUTTER338', '--define', 'HAS_MUTTER40', '--define', 'HAS_MUTTER41', '--define', 'HAS_MUTTER42', '--define', 'HAS_MUTTER43']
|
|
|
|
endif
|
|
|
|
|
2017-09-08 08:37:54 +02:00
|
|
|
if mutter_dep.length() == 0
|
2020-07-20 22:06:57 +02:00
|
|
|
error ('No supported mutter library found!')
|
2017-09-08 08:37:54 +02:00
|
|
|
endif
|
|
|
|
|
2018-03-14 08:46:38 +01:00
|
|
|
mutter_typelib_dir = libmutter_dep.get_pkgconfig_variable('typelibdir')
|
2018-01-11 17:57:21 +01:00
|
|
|
|
2021-10-04 03:47:04 +02:00
|
|
|
if get_option('systemd')
|
|
|
|
vala_flags += ['--define', 'WITH_SYSTEMD']
|
|
|
|
endif
|
|
|
|
|
2018-01-11 17:57:21 +01:00
|
|
|
add_project_arguments(vala_flags, language: 'vala')
|
2018-03-14 08:46:38 +01:00
|
|
|
add_project_link_arguments(['-Wl,-rpath,@0@'.format(mutter_typelib_dir)], language: 'c')
|
2017-09-08 08:37:54 +02:00
|
|
|
|
2022-10-11 02:47:37 +02:00
|
|
|
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]
|
2017-09-08 08:37:54 +02:00
|
|
|
|
2021-09-29 20:51:50 +02:00
|
|
|
if get_option('systemd')
|
|
|
|
gala_base_dep += systemd_dep
|
|
|
|
endif
|
|
|
|
|
2017-09-08 08:37:54 +02:00
|
|
|
subdir('data')
|
|
|
|
subdir('lib')
|
|
|
|
subdir('src')
|
2018-09-11 00:16:52 +02:00
|
|
|
subdir('daemon')
|
2017-09-08 08:37:54 +02:00
|
|
|
subdir('plugins/maskcorners')
|
|
|
|
subdir('plugins/pip')
|
|
|
|
subdir('plugins/template')
|
2018-01-24 23:12:11 +01:00
|
|
|
if get_option('documentation')
|
2020-07-20 22:06:57 +02:00
|
|
|
subdir('docs')
|
2018-01-24 23:12:11 +01:00
|
|
|
endif
|
2017-09-08 08:37:54 +02:00
|
|
|
subdir('po')
|
|
|
|
|
2020-03-12 12:27:47 +01:00
|
|
|
vapigen = find_program('vapigen', required: false)
|
|
|
|
if vapigen.found()
|
2020-07-20 22:06:57 +02:00
|
|
|
subdir('vapi')
|
2020-03-12 12:27:47 +01:00
|
|
|
endif
|
|
|
|
|
2017-09-08 08:37:54 +02:00
|
|
|
meson.add_install_script('build-aux/meson/post_install.py')
|