2017-09-08 09:37:54 +03:00
|
|
|
project('gala',
|
2020-07-20 23:06:57 +03:00
|
|
|
'c', 'vala',
|
2023-11-10 00:37:11 +03:00
|
|
|
version: '7.1.3',
|
2024-07-15 03:33:36 +03:00
|
|
|
meson_version: '>= 0.59.0',
|
2020-07-20 23:06:57 +03:00
|
|
|
license: 'GPL3',
|
2017-09-08 09:37:54 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
is_release = false
|
|
|
|
|
|
|
|
gnome = import('gnome')
|
|
|
|
i18n = import('i18n')
|
2020-03-06 18:47:25 +03:00
|
|
|
pkg = import('pkgconfig')
|
2017-09-08 09:37:54 +03:00
|
|
|
cc = meson.get_compiler('c')
|
|
|
|
|
|
|
|
gala_version = meson.project_version()
|
|
|
|
|
2023-02-21 22:05:43 +03:00
|
|
|
vala_version_required = '0.46.0'
|
2017-09-08 09:37:54 +03:00
|
|
|
vala = meson.get_compiler('vala')
|
|
|
|
if not vala.version().version_compare('>= @0@'.format(vala_version_required))
|
2020-07-20 23:06:57 +03:00
|
|
|
error('Valac >= @0@ required!'.format(vala_version_required))
|
2017-09-08 09:37:54 +03:00
|
|
|
endif
|
|
|
|
|
2020-03-06 18:47:25 +03:00
|
|
|
vapi_dir = meson.current_source_dir() / 'vapi'
|
2017-09-08 09:37:54 +03:00
|
|
|
|
2021-08-12 16:32:39 +03:00
|
|
|
locale_dir = join_paths(get_option('prefix'), get_option('localedir'))
|
2017-09-08 09:37:54 +03: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 16:32:39 +03:00
|
|
|
conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
|
|
|
|
conf.set_quoted('LOCALEDIR', locale_dir)
|
2017-09-08 09:37:54 +03:00
|
|
|
conf.set_quoted('DATADIR', data_dir)
|
|
|
|
conf.set_quoted('PKGDATADIR', pkgdata_dir)
|
2020-03-06 18:47:25 +03:00
|
|
|
conf.set_quoted('PLUGINDIR', plugins_dir)
|
|
|
|
conf.set_quoted('RESOURCEPATH', '/org/pantheon/desktop/gala')
|
2017-09-08 09:37:54 +03:00
|
|
|
conf.set_quoted('VERSION', gala_version)
|
2020-03-06 18:47:25 +03:00
|
|
|
conf.set_quoted('SCHEMA', 'org.pantheon.desktop.gala')
|
|
|
|
config_h = configure_file(
|
2020-07-20 23:06:57 +03:00
|
|
|
output: 'config.h',
|
|
|
|
configuration: conf
|
2020-03-06 18:47:25 +03:00
|
|
|
)
|
2017-09-08 09:37:54 +03:00
|
|
|
|
2020-03-06 18:47:25 +03:00
|
|
|
config_dep = declare_dependency(
|
2020-07-20 23:06:57 +03:00
|
|
|
dependencies: vala.find_library('config', dirs: vapi_dir),
|
|
|
|
sources: config_h
|
2020-03-06 18:47:25 +03:00
|
|
|
)
|
2017-09-08 09:37:54 +03:00
|
|
|
|
2020-03-06 18:47:25 +03:00
|
|
|
config_inc_dir = include_directories('.')
|
2017-09-08 09:37:54 +03:00
|
|
|
|
2020-03-06 18:47:25 +03:00
|
|
|
customconf = configuration_data()
|
|
|
|
customconf.set('GETTEXT_PACKAGE', meson.project_name())
|
2017-09-08 09:37:54 +03:00
|
|
|
|
|
|
|
add_project_arguments([
|
2020-07-20 23:06:57 +03:00
|
|
|
'--target-glib=2.44',
|
|
|
|
'--hide-internal',
|
|
|
|
'--enable-deprecated',
|
|
|
|
'--vapidir=' + vapi_dir,
|
|
|
|
],
|
|
|
|
language: 'vala',
|
2017-09-08 09:37:54 +03:00
|
|
|
)
|
|
|
|
add_project_arguments([
|
2020-07-20 23:06:57 +03: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',
|
|
|
|
|
2024-07-18 17:16:17 +03:00
|
|
|
'-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_74',
|
|
|
|
'-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_74',
|
2020-07-20 23:06:57 +03:00
|
|
|
],
|
|
|
|
language: 'c',
|
2017-09-08 09:37:54 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
# Dependencies
|
2024-07-18 17:16:17 +03:00
|
|
|
glib_version_required = '2.74.0'
|
2017-09-08 09:37:54 +03:00
|
|
|
gtk_version_required = '3.10.0'
|
|
|
|
|
2021-06-30 08:47:46 +03:00
|
|
|
canberra_dep = dependency('libcanberra')
|
2020-03-06 18:47:25 +03: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 03:47:37 +03:00
|
|
|
gio_unix_dep = dependency('gio-unix-2.0', version: '>= @0@'.format(glib_version_required))
|
2020-03-06 18:47:25 +03:00
|
|
|
gmodule_dep = dependency('gmodule-2.0')
|
2017-09-08 09:37:54 +03:00
|
|
|
gtk_dep = [dependency('gtk+-3.0', version: '>= @0@'.format(gtk_version_required)), dependency('gdk-x11-3.0')]
|
2024-07-05 21:14:35 +03:00
|
|
|
gtk4_dep = dependency('gtk4')
|
2017-09-08 09:37:54 +03:00
|
|
|
gee_dep = dependency('gee-0.8')
|
2024-07-05 21:14:35 +03:00
|
|
|
granite_dep = dependency('granite-7')
|
2017-09-08 09:37:54 +03:00
|
|
|
gnome_desktop_dep = dependency('gnome-desktop-3.0')
|
|
|
|
m_dep = cc.find_library('m', required: false)
|
2021-08-26 15:43:43 +03:00
|
|
|
posix_dep = vala.find_library('posix', required: false)
|
2023-11-15 22:54:03 +03:00
|
|
|
sqlite3_dep = dependency('sqlite3')
|
2021-09-29 21:51:50 +03:00
|
|
|
if get_option('systemd')
|
2021-10-04 04:47:04 +03:00
|
|
|
systemd_dep = dependency('libsystemd')
|
2021-09-29 21:51:50 +03:00
|
|
|
endif
|
2017-09-08 09:37:54 +03:00
|
|
|
|
|
|
|
mutter_dep = []
|
|
|
|
libmutter_dep = []
|
|
|
|
|
2018-01-11 19:57:21 +03:00
|
|
|
vala_flags = []
|
|
|
|
|
2022-03-09 11:44:55 +03:00
|
|
|
mutter42_dep = dependency('libmutter-10', version: ['>= 42', '< 43'], required: false)
|
2022-01-18 15:33:50 +03:00
|
|
|
if mutter42_dep.found()
|
2022-03-09 11:44:55 +03:00
|
|
|
libmutter_dep = dependency('libmutter-10', version: '>= 42')
|
2022-01-18 15:33:50 +03:00
|
|
|
mutter_dep = [
|
|
|
|
libmutter_dep,
|
|
|
|
dependency('mutter-cogl-10'), dependency('mutter-cogl-pango-10'),
|
|
|
|
dependency('mutter-clutter-10')
|
|
|
|
]
|
2023-02-21 07:29:21 +03:00
|
|
|
vala_flags = []
|
2022-01-18 15:33:50 +03:00
|
|
|
endif
|
|
|
|
|
2022-08-08 23:46:04 +03: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')
|
|
|
|
]
|
2023-02-21 07:29:21 +03:00
|
|
|
vala_flags = ['--define', 'HAS_MUTTER43']
|
2022-08-08 23:46:04 +03:00
|
|
|
endif
|
|
|
|
|
2023-04-20 16:24:37 +03:00
|
|
|
mutter44_dep = dependency('libmutter-12', version: ['>= 44', '< 45'], required: false)
|
|
|
|
if mutter44_dep.found()
|
|
|
|
libmutter_dep = dependency('libmutter-12', version: '>= 44')
|
|
|
|
mutter_dep = [
|
|
|
|
libmutter_dep,
|
|
|
|
dependency('mutter-cogl-12'), dependency('mutter-cogl-pango-12'),
|
|
|
|
dependency('mutter-clutter-12')
|
|
|
|
]
|
|
|
|
vala_flags = ['--define', 'HAS_MUTTER43', '--define', 'HAS_MUTTER44']
|
|
|
|
endif
|
|
|
|
|
2023-08-29 13:37:34 +03:00
|
|
|
mutter45_dep = dependency('libmutter-13', version: ['>= 45', '< 46'], required: false)
|
|
|
|
if mutter45_dep.found()
|
|
|
|
libmutter_dep = dependency('libmutter-13', version: '>= 45')
|
|
|
|
mutter_dep = [
|
|
|
|
libmutter_dep,
|
|
|
|
dependency('mutter-mtk-13'), dependency('mutter-cogl-13'),
|
|
|
|
dependency('mutter-cogl-pango-13'), dependency('mutter-clutter-13')
|
|
|
|
]
|
|
|
|
vala_flags = ['--define', 'HAS_MUTTER43', '--define', 'HAS_MUTTER44', '--define', 'HAS_MUTTER45']
|
|
|
|
endif
|
|
|
|
|
2024-01-13 03:03:36 +03:00
|
|
|
mutter46_dep = dependency('libmutter-14', version: ['>= 46', '< 47'], required: false)
|
|
|
|
if mutter46_dep.found()
|
|
|
|
libmutter_dep = dependency('libmutter-14', version: '>= 46')
|
|
|
|
mutter_dep = [
|
|
|
|
libmutter_dep,
|
|
|
|
dependency('mutter-mtk-14'), dependency('mutter-cogl-14'),
|
|
|
|
dependency('mutter-cogl-pango-14'), dependency('mutter-clutter-14')
|
|
|
|
]
|
|
|
|
vala_flags = ['--define', 'HAS_MUTTER43', '--define', 'HAS_MUTTER44', '--define', 'HAS_MUTTER45', '--define', 'HAS_MUTTER46']
|
|
|
|
endif
|
|
|
|
|
2017-09-08 09:37:54 +03:00
|
|
|
if mutter_dep.length() == 0
|
2020-07-20 23:06:57 +03:00
|
|
|
error ('No supported mutter library found!')
|
2017-09-08 09:37:54 +03:00
|
|
|
endif
|
|
|
|
|
2023-02-21 22:05:43 +03:00
|
|
|
mutter_typelib_dir = libmutter_dep.get_variable('typelibdir')
|
2018-01-11 19:57:21 +03:00
|
|
|
|
2021-10-04 04:47:04 +03:00
|
|
|
if get_option('systemd')
|
|
|
|
vala_flags += ['--define', 'WITH_SYSTEMD']
|
|
|
|
endif
|
|
|
|
|
2018-01-11 19:57:21 +03:00
|
|
|
add_project_arguments(vala_flags, language: 'vala')
|
2018-03-14 10:46:38 +03:00
|
|
|
add_project_link_arguments(['-Wl,-rpath,@0@'.format(mutter_typelib_dir)], language: 'c')
|
2017-09-08 09:37:54 +03:00
|
|
|
|
2024-03-26 20:05:32 +03:00
|
|
|
gala_base_dep = [canberra_dep, glib_dep, gobject_dep, gio_dep, gio_unix_dep, gmodule_dep, gee_dep, gtk_dep, mutter_dep, gnome_desktop_dep, m_dep, posix_dep, sqlite3_dep, config_dep]
|
2017-09-08 09:37:54 +03:00
|
|
|
|
2021-09-29 21:51:50 +03:00
|
|
|
if get_option('systemd')
|
|
|
|
gala_base_dep += systemd_dep
|
|
|
|
endif
|
|
|
|
|
2017-09-08 09:37:54 +03:00
|
|
|
subdir('data')
|
2024-05-24 14:03:08 +03:00
|
|
|
subdir('protocol')
|
2017-09-08 09:37:54 +03:00
|
|
|
subdir('lib')
|
|
|
|
subdir('src')
|
2018-09-11 01:16:52 +03:00
|
|
|
subdir('daemon')
|
2024-07-05 21:14:35 +03:00
|
|
|
subdir('daemon-gtk3')
|
2017-09-08 09:37:54 +03:00
|
|
|
subdir('plugins/pip')
|
|
|
|
subdir('plugins/template')
|
2018-01-25 01:12:11 +03:00
|
|
|
if get_option('documentation')
|
2020-07-20 23:06:57 +03:00
|
|
|
subdir('docs')
|
2018-01-25 01:12:11 +03:00
|
|
|
endif
|
2017-09-08 09:37:54 +03:00
|
|
|
subdir('po')
|
|
|
|
|
2020-03-12 14:27:47 +03:00
|
|
|
vapigen = find_program('vapigen', required: false)
|
|
|
|
if vapigen.found()
|
2020-07-20 23:06:57 +03:00
|
|
|
subdir('vapi')
|
2020-03-12 14:27:47 +03:00
|
|
|
endif
|
|
|
|
|
2024-07-15 03:33:36 +03:00
|
|
|
gnome.post_install(
|
|
|
|
glib_compile_schemas: true,
|
|
|
|
update_desktop_database: true
|
|
|
|
)
|