Initial meson support

This commit is contained in:
Rico Tzschichholz 2017-09-08 08:37:54 +02:00
parent b7b74f4400
commit ded8fd9345
18 changed files with 456 additions and 0 deletions

View File

@ -0,0 +1,19 @@
#!/usr/bin/env python3
import os
import subprocess
prefix = os.environ.get('MESON_INSTALL_PREFIX', '/usr/local')
datadir = os.path.join(prefix, 'share')
# Packaging tools define DESTDIR and this isn't needed for them
if 'DESTDIR' not in os.environ:
print('Compiling gsettings schemas...')
subprocess.call(['glib-compile-schemas', os.path.join(datadir, 'glib-2.0', 'schemas')])
print('Updating icon cache...')
subprocess.call(['gtk-update-icon-cache', '-qtf', os.path.join(datadir, 'icons', 'hicolor')])
print('Updating desktop database...')
subprocess.call(['update-desktop-database', '-q', os.path.join(datadir, 'applications')])

41
config.h.meson Normal file
View File

@ -0,0 +1,41 @@
/* Name of package */
#mesondefine PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#mesondefine PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#mesondefine PACKAGE_NAME
/* Define to the full name and version of this package. */
#mesondefine PACKAGE_STRING
/* Define to the suffix of this package */
#mesondefine PACKAGE_SUFFIX
/* Define to the one symbol short name of this package. */
#mesondefine PACKAGE_TARNAME
/* Define to the home page for this package. */
#mesondefine PACKAGE_URL
/* Define to the version of this package. */
#mesondefine PACKAGE_VERSION
/* Codename of this release */
#mesondefine RELEASE_NAME
/* Define to the data directory. */
#mesondefine DATADIR
/* Define to the data directory of this package. */
#mesondefine PKGDATADIR
/* Define to the docklets directory of this package. */
#mesondefine DOCKLETSDIR
/* Version number of package */
#mesondefine VERSION
/* Version info of package */
#mesondefine VERSION_INFO

34
data/meson.build Normal file
View File

@ -0,0 +1,34 @@
gala_gschema = configure_file(
input: 'org.pantheon.desktop.gala.gschema.xml.in',
output: 'org.pantheon.desktop.gala.gschema.xml',
configuration: customconf,
install: true,
install_dir: join_paths(data_dir, 'glib-2.0', 'schemas')
)
gala_gschema_compile = gnome.compile_schemas()
i18n.merge_file(
input: 'gala-multitaskingview.desktop.in',
output: 'gala-multitaskingview.desktop',
po_dir: '../po',
type: 'desktop',
install: true,
install_dir: join_paths(data_dir, 'applications')
)
i18n.merge_file(
input: 'gala-other.desktop.in',
output: 'gala-other.desktop',
po_dir: '../po',
type: 'desktop',
install: true,
install_dir: join_paths(data_dir, 'applications')
)
install_data(['gala.desktop', 'gala-wayland.desktop'], install_dir: join_paths(data_dir, 'applications'))
icons_dir = join_paths(get_option('datadir'), 'icons', 'hicolor')
install_data('icons/32x32/multitasking-view.svg', install_dir: join_paths(icons_dir, '32x32', 'apps'))
install_data('icons/48x48/multitasking-view.svg', install_dir: join_paths(icons_dir, '48x48', 'apps'))
install_data('icons/64x64/multitasking-view.svg', install_dir: join_paths(icons_dir, '64x64', 'apps'))
install_data(['gala.css', 'texture.png'], install_dir: pkgdata_dir)

40
lib/meson.build Normal file
View File

@ -0,0 +1,40 @@
gala_lib_sources = files(
'ActivatableComponent.vala',
'Plugin.vala',
'Utils.vala',
'WindowIcon.vala',
'WindowManager.vala',
)
gala_resources = gnome.compile_resources(
'gala-resources',
join_paths(meson.source_root(), 'data', 'gala.gresource.xml'),
source_dir: join_paths(meson.source_root(), 'data'),
c_name: 'gala',
)
gala_lib = shared_library(
'gala',
gala_lib_sources,
gala_resources,
dependencies: [gala_base_dep],
include_directories: config_inc_dir,
install: true,
install_dir: [true, join_paths(get_option('includedir'), 'gala'), true],
version : '0.0.0',
vala_args: [
'--pkg', 'config',
'--pkg', 'compat',
],
)
install_data('gala.deps', install_dir: join_paths(get_option('datadir'), 'vala', 'vapi'))
gala_dep = declare_dependency(link_with: [gala_lib], include_directories: include_directories('.'))
configure_file(
input: 'gala.pc.in',
output: 'gala.pc',
configuration: pkgconf,
install_dir: join_paths(get_option('libdir'), 'pkgconfig'),
)

195
meson.build Normal file
View File

@ -0,0 +1,195 @@
project('gala',
'c', 'vala',
version: '0.3.0',
meson_version: '>= 0.42.0',
license: 'GPL3',
)
is_release = false
gnome = import('gnome')
i18n = import('i18n')
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))
error('Valac >= @0@ required!'.format(vala_version_required))
endif
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())
config_inc_dir = include_directories('.')
conf = configuration_data()
conf.set_quoted('PACKAGE', meson.project_name())
conf.set_quoted('PACKAGE_BUGREPORT', 'https://github.com/elementary/gala/issues')
conf.set_quoted('PACKAGE_NAME', meson.project_name())
conf.set_quoted('PACKAGE_STRING', 'Gala')
conf.set_quoted('PACKAGE_TARNAME', meson.project_name())
conf.set_quoted('PACKAGE_URL', 'https://github.com/elementary/gala')
conf.set_quoted('PACKAGE_VERSION', gala_version)
conf.set_quoted('DATADIR', data_dir)
conf.set_quoted('PKGDATADIR', pkgdata_dir)
conf.set_quoted('PKGLIBDIR', pkglib_dir)
conf.set_quoted('PLUGINSDIR', plugins_dir)
conf.set_quoted('RELEASE_NAME', 'Window Manager.')
conf.set_quoted('VERSION', gala_version)
conf.set_quoted('VERSION_INFO', (is_release ? 'Release' : 'Development'))
conf.set_quoted('BUILD_VERSION', gala_version)
configure_file(input: 'config.h.meson', output: 'config.h', configuration: conf)
customconf = configuration_data()
customconf.set('GETTEXT_PACKAGE', meson.project_name())
pkgconf = configuration_data()
pkgconf.set('PACKAGE_VERSION', gala_version)
pkgconf.set('MUTTER_CFLAGS', '')
pkgconf.set('prefix', get_option('prefix'))
pkgconf.set('exec_prefix', '${prefix}')
pkgconf.set('libdir', '${prefix}/@0@'.format(get_option('libdir')))
pkgconf.set('bindir', '${exec_prefix}/@0@'.format(get_option('bindir')))
pkgconf.set('datarootdir', '${prefix}/@0@'.format(get_option('datadir')))
pkgconf.set('datadir', '${datarootdir}')
pkgconf.set('includedir', '${prefix}/@0@'.format(get_option('includedir')))
add_project_arguments([
'--target-glib=2.44',
'--hide-internal',
'--enable-deprecated',
'--vapidir=' + join_paths(meson.source_root(), 'vapi'),
'--pkg', 'config',
'--pkg', 'cogl-fixes',
'--pkg', 'compat',
],
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',
'-DDATADIR="@0@"'.format(data_dir),
'-DPKGDATADIR="@0@"'.format(pkgdata_dir),
'-DPKGLIBDIR="@0@"'.format(pkglib_dir),
'-DPLUGINDIR="@0@"'.format(plugins_dir),
'-DSCHEMA="org.pantheon.desktop.gala"',
'-DRESOURCEPATH="/org/pantheon/desktop/gala"',
'-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'
plank_version_required = '0.11.0'
gsd_version_required = '3.15.2'
glib_dep = [dependency('gio-2.0', version: '>= @0@'.format(glib_version_required)), dependency('gio-unix-2.0'), 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')
bamf_dep = dependency('libbamf3')
plank_dep = dependency('plank', version: '>= @0@'.format(plank_version_required))
granite_dep = dependency('granite')
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)
mutter_dep = []
libmutter_dep = []
mutter318_dep = dependency('libmutter', version: ['>= 3.18.3', '< 3.19'], required: false)
if mutter318_dep.found()
libmutter_dep = dependency('libmutter')
pkgconf.set('MUTTER_PKGS', 'libmutter >= 3.18.3')
mutter_dep = [libmutter_dep, dependency('cogl-1.0'), dependency('clutter-1.0')]
endif
mutter320_dep = dependency('libmutter', version: ['>= 3.19', '< 3.21'], required: false)
if mutter320_dep.found()
libmutter_dep = dependency('libmutter', version: '>= 3.20.3')
pkgconf.set('MUTTER_PKGS', 'libmutter >= 3.20.3')
mutter_dep = [libmutter_dep, dependency('cogl-1.0'), dependency('clutter-1.0')]
add_project_arguments(['--define', 'HAS_MUTTER320'], language: 'vala')
endif
mutter322_dep = dependency('libmutter', version: ['>= 3.21', '< 3.23'], required: false)
if mutter322_dep.found()
libmutter_dep = dependency('libmutter', version: '>= 3.22.0')
pkgconf.set('MUTTER_PKGS', 'libmutter >= 3.22.0')
mutter_dep = [
libmutter_dep,
dependency('mutter-cogl-1.0'), dependency('mutter-cogl-pango-1.0'),
dependency('mutter-cogl-path-1.0'), dependency('mutter-clutter-1.0')
]
add_project_arguments(['--define', 'HAS_MUTTER320', '--define', 'HAS_MUTTER322'], language: 'vala')
add_project_arguments(['-DCLUTTER_ENABLE_COMPOSITOR_API', '-DCLUTTER_ENABLE_EXPERIMENTAL_API',
'-DCOGL_ENABLE_EXPERIMENTAL_API', '-DCOGL_ENABLE_EXPERIMENTAL_2_0_API'], language: 'c')
endif
mutter324_dep = dependency('libmutter-0', version: ['>= 3.23', '< 3.25'], required: false)
if mutter324_dep.found()
libmutter_dep = dependency('libmutter-0', version: '>= 3.24.0')
pkgconf.set('MUTTER_PKGS', 'libmutter-0 >= 3.24.0')
mutter_dep = [
libmutter_dep,
dependency('mutter-cogl-0'), dependency('mutter-cogl-pango-0'),
dependency('mutter-cogl-path-0'), dependency('mutter-clutter-0')
]
add_project_arguments(['--define', 'HAS_MUTTER320', '--define', 'HAS_MUTTER322',
'--define', 'HAS_MUTTER324'], language: 'vala')
add_project_arguments(['-DCLUTTER_ENABLE_COMPOSITOR_API', '-DCLUTTER_ENABLE_EXPERIMENTAL_API',
'-DCOGL_ENABLE_EXPERIMENTAL_API', '-DCOGL_ENABLE_EXPERIMENTAL_2_0_API'], language: 'c')
endif
mutter326_dep = dependency('libmutter-1', version: ['>= 3.25', '< 3.27'], required: false)
if mutter326_dep.found()
libmutter_dep = dependency('libmutter-1', version: '>= 3.26.0')
pkgconf.set('MUTTER_PKGS', 'libmutter-1 >= 3.26.0')
mutter_dep = [
libmutter_dep,
dependency('mutter-cogl-1'), dependency('mutter-cogl-pango-1'),
dependency('mutter-cogl-path-1'), dependency('mutter-clutter-1')
]
add_project_arguments(['--define', 'HAS_MUTTER320', '--define', 'HAS_MUTTER322',
'--define', 'HAS_MUTTER324', '--define', 'HAS_MUTTER326'], language: 'vala')
add_project_arguments(['-DCLUTTER_ENABLE_COMPOSITOR_API', '-DCLUTTER_ENABLE_EXPERIMENTAL_API',
'-DCOGL_ENABLE_EXPERIMENTAL_API', '-DCOGL_ENABLE_EXPERIMENTAL_2_0_API'], language: 'c')
endif
if mutter_dep.length() == 0
error ('No supported mutter library found!')
endif
add_project_link_arguments(['-Wl,-rpath,@0@'.format(libmutter_dep.get_pkgconfig_variable('typelibdir'))], language: 'c')
gala_base_dep = [glib_dep, gee_dep, gtk_dep, plank_dep, bamf_dep, mutter_dep, granite_dep, gnome_desktop_dep, m_dep]
subdir('data')
subdir('lib')
subdir('src')
subdir('plugins/maskcorners')
subdir('plugins/notify')
subdir('plugins/pip')
subdir('plugins/template')
subdir('plugins/zoom')
subdir('po')
meson.add_install_script('build-aux/meson/post_install.py')

View File

@ -0,0 +1,13 @@
gala_maskcorners_sources = [
'Main.vala',
'Settings.vala',
]
gala_maskcorners_lib = shared_library(
'gala-maskcorners',
gala_maskcorners_sources,
dependencies: [gala_dep, gala_base_dep],
include_directories: config_inc_dir,
install: true,
install_dir: plugins_dir,
)

View File

@ -0,0 +1,25 @@
gala_notify_sources = [
'Main.vala',
'ConfirmationNotification.vala',
'NormalNotification.vala',
'Notification.vala',
'NotificationStack.vala',
'NotifyServer.vala',
'NotifySettings.vala',
]
canberra_dep = [dependency('libcanberra'), dependency('libcanberra-gtk3')]
gala_notify_lib = shared_library(
'gala-notify',
gala_notify_sources,
dependencies: [gala_dep, gala_base_dep, canberra_dep],
include_directories: config_inc_dir,
install: true,
install_dir: plugins_dir,
)
install_data(
'data/image-mask.svg',
install_dir: pkgdata_dir,
)

16
plugins/pip/meson.build Normal file
View File

@ -0,0 +1,16 @@
gala_pip_sources = [
'Main.vala',
'MoveAction.vala',
'PopupWindow.vala',
'SelectionArea.vala',
'ShadowEffect.vala',
]
gala_pip_lib = shared_library(
'gala-pip',
gala_pip_sources,
dependencies: [gala_dep, gala_base_dep],
include_directories: config_inc_dir,
install: true,
install_dir: plugins_dir,
)

View File

@ -0,0 +1,12 @@
gala_template_sources = [
'Main.vala',
]
gala_template_lib = shared_library(
'gala-template',
gala_template_sources,
dependencies: [gala_dep, gala_base_dep],
include_directories: config_inc_dir,
install: false,
install_dir: plugins_dir,
)

12
plugins/zoom/meson.build Normal file
View File

@ -0,0 +1,12 @@
gala_zoom_sources = [
'Main.vala',
]
gala_zoom_lib = shared_library(
'gala-zoom',
gala_zoom_sources,
dependencies: [gala_dep, gala_base_dep],
include_directories: config_inc_dir,
install: true,
install_dir: plugins_dir,
)

1
po/meson.build Normal file
View File

@ -0,0 +1 @@
i18n.gettext(meson.project_name(), preset: 'glib')

48
src/meson.build Normal file
View File

@ -0,0 +1,48 @@
gala_bin_sources = files(
'DBus.vala',
'DBusAccelerator.vala',
'DockThemeManager.vala',
'DragDropAction.vala',
'InternalUtils.vala',
'KeyboardManager.vala',
'Main.vala',
'MediaFeedback.vala',
'PluginManager.vala',
'ScreenSaver.vala',
'ScreenshotManager.vala',
'Settings.vala',
'ShadowEffect.vala',
'TextShadowEffect.vala',
'WindowListener.vala',
'WindowManager.vala',
'WorkspaceManager.vala',
'Background/Animation.vala',
'Background/Background.vala',
'Background/BackgroundCache.vala',
'Background/BackgroundContainer.vala',
'Background/BackgroundManager.vala',
'Background/BackgroundSource.vala',
'Background/SystemBackground.vala',
'Widgets/IconGroup.vala',
'Widgets/IconGroupContainer.vala',
'Widgets/MonitorClone.vala',
'Widgets/MultitaskingView.vala',
'Widgets/SafeWindowClone.vala',
'Widgets/SelectionArea.vala',
'Widgets/WindowClone.vala',
'Widgets/WindowCloneContainer.vala',
'Widgets/WindowIconActor.vala',
'Widgets/WindowMenu.vala',
'Widgets/WindowOverview.vala',
'Widgets/WindowSwitcher.vala',
'Widgets/WorkspaceClone.vala',
'Widgets/WorkspaceInsertThumb.vala',
)
gala_bin = executable(
'gala',
gala_bin_sources,
dependencies: [gala_dep, gala_base_dep],
include_directories: config_inc_dir,
install: true,
)

View File

View File

View File

View File

View File

View File