mirror of
https://github.com/elementary/gala.git
synced 2024-08-16 18:40:27 +03:00
meson: Make the build system more compact and resilient (#739)
This commit is contained in:
parent
4b8b707bc8
commit
2d319439ee
@ -1,41 +0,0 @@
|
||||
/* 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
|
@ -1,12 +1,17 @@
|
||||
valadoc = find_program('valadoc')
|
||||
|
||||
mutter_packages_command = []
|
||||
foreach dep : mutter_dep
|
||||
mutter_packages_command += [ '--pkg', dep.name() ]
|
||||
endforeach
|
||||
|
||||
basic_command = [
|
||||
valadoc,
|
||||
'--force',
|
||||
'--verbose',
|
||||
'--package-name','gala',
|
||||
'--package-version', '0.0.0',
|
||||
'--driver', meson.get_compiler('vala').version(),
|
||||
'--driver', vala.version(),
|
||||
mutter_packages_command,
|
||||
'--pkg', 'libbamf3',
|
||||
'--pkg', 'plank',
|
||||
|
@ -1,13 +0,0 @@
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
datarootdir=@datarootdir@
|
||||
pkgdatadir=@datadir@/gala
|
||||
|
||||
Name: Gala
|
||||
Description: Library to develop plugins for Gala
|
||||
Version: @PACKAGE_VERSION@
|
||||
Requires: gdk-pixbuf-2.0 glib-2.0 gobject-2.0 @MUTTER_PKGS@
|
||||
Libs: -L${libdir} -lgala
|
||||
Cflags: -I${includedir}/gala @MUTTER_CFLAGS@
|
@ -23,20 +23,22 @@ gala_lib = shared_library(
|
||||
install: true,
|
||||
install_dir: [true, join_paths(get_option('includedir'), 'gala'), true],
|
||||
install_rpath: mutter_typelib_dir,
|
||||
version : '0.0.0',
|
||||
vala_args: [
|
||||
'--pkg', 'config',
|
||||
'--pkg', 'compat',
|
||||
],
|
||||
version : '0.0.0'
|
||||
)
|
||||
|
||||
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'),
|
||||
pkg.generate(
|
||||
gala_lib,
|
||||
filebase: 'gala',
|
||||
name: 'Gala',
|
||||
description: 'Library to develop plugins for Gala',
|
||||
subdirs: 'gala',
|
||||
requires: [glib_dep, gobject_dep, libmutter_dep],
|
||||
variables: [
|
||||
'datarootdir=${prefix}/@0@'.format(get_option('datadir')),
|
||||
'pkgdatadir=${datarootdir}/gala'
|
||||
]
|
||||
)
|
||||
|
106
meson.build
106
meson.build
@ -1,7 +1,7 @@
|
||||
project('gala',
|
||||
'c', 'vala',
|
||||
version: '3.2.0',
|
||||
meson_version: '>= 0.46.0',
|
||||
meson_version: '>= 0.48.0',
|
||||
license: 'GPL3',
|
||||
)
|
||||
|
||||
@ -9,6 +9,7 @@ is_release = false
|
||||
|
||||
gnome = import('gnome')
|
||||
i18n = import('i18n')
|
||||
pkg = import('pkgconfig')
|
||||
cc = meson.get_compiler('c')
|
||||
|
||||
gala_version = meson.project_version()
|
||||
@ -19,55 +20,40 @@ if not vala.version().version_compare('>= @0@'.format(vala_version_required))
|
||||
error('Valac >= @0@ required!'.format(vala_version_required))
|
||||
endif
|
||||
|
||||
vapi_dir = meson.current_source_dir() / 'vapi'
|
||||
|
||||
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('PLUGINDIR', plugins_dir)
|
||||
conf.set_quoted('RESOURCEPATH', '/org/pantheon/desktop/gala')
|
||||
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)
|
||||
conf.set_quoted('SCHEMA', 'org.pantheon.desktop.gala')
|
||||
config_h = configure_file(
|
||||
output: 'config.h',
|
||||
configuration: conf
|
||||
)
|
||||
|
||||
config_dep = declare_dependency(
|
||||
dependencies: vala.find_library('config', dirs: vapi_dir),
|
||||
sources: config_h
|
||||
)
|
||||
|
||||
config_inc_dir = include_directories('.')
|
||||
|
||||
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',
|
||||
'--vapidir=' + vapi_dir,
|
||||
],
|
||||
language: 'vala',
|
||||
)
|
||||
@ -80,13 +66,6 @@ add_project_arguments([
|
||||
'-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',
|
||||
@ -102,7 +81,10 @@ 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')]
|
||||
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))
|
||||
gmodule_dep = 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')
|
||||
@ -111,6 +93,8 @@ granite_dep = dependency('granite', version: '>= 5.3.0')
|
||||
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)
|
||||
cogl_fixes_dep = vala.find_library('cogl-fixes', dirs: vapi_dir)
|
||||
compat_dep = vala.find_library('compat', dirs: vapi_dir)
|
||||
|
||||
mutter_dep = []
|
||||
libmutter_dep = []
|
||||
@ -119,15 +103,7 @@ vala_flags = []
|
||||
|
||||
mutter328_dep = dependency('libmutter-2', version: ['>= 3.27', '< 3.29'], required: false)
|
||||
if mutter328_dep.found()
|
||||
mutter_packages_command = [
|
||||
'--pkg', 'libmutter-2',
|
||||
'--pkg', 'mutter-cogl-2',
|
||||
'--pkg', 'mutter-cogl-pango-2',
|
||||
'--pkg', 'mutter-cogl-path-2',
|
||||
'--pkg', 'mutter-clutter-2'
|
||||
]
|
||||
libmutter_dep = dependency('libmutter-2', version: '>= 3.27.92')
|
||||
pkgconf.set('MUTTER_PKGS', 'libmutter-2 >= 3.27.92')
|
||||
mutter_dep = [
|
||||
libmutter_dep,
|
||||
dependency('mutter-cogl-2'), dependency('mutter-cogl-pango-2'),
|
||||
@ -140,15 +116,7 @@ endif
|
||||
|
||||
mutter330_dep = dependency('libmutter-3', version: ['>= 3.29.4', '< 3.31'], required: false)
|
||||
if mutter330_dep.found()
|
||||
mutter_packages_command = [
|
||||
'--pkg', 'libmutter-3',
|
||||
'--pkg', 'mutter-cogl-3',
|
||||
'--pkg', 'mutter-cogl-pango-3',
|
||||
'--pkg', 'mutter-cogl-path-3',
|
||||
'--pkg', 'mutter-clutter-3'
|
||||
]
|
||||
libmutter_dep = dependency('libmutter-3', version: '>= 3.29.4')
|
||||
pkgconf.set('MUTTER_PKGS', 'libmutter-3 >= 3.29.4')
|
||||
mutter_dep = [
|
||||
libmutter_dep,
|
||||
dependency('mutter-cogl-3'), dependency('mutter-cogl-pango-3'),
|
||||
@ -161,15 +129,7 @@ endif
|
||||
|
||||
mutter332_dep = dependency('libmutter-4', version: ['>= 3.31.2', '< 3.34'], required: false)
|
||||
if mutter332_dep.found()
|
||||
mutter_packages_command = [
|
||||
'--pkg', 'libmutter-4',
|
||||
'--pkg', 'mutter-cogl-4',
|
||||
'--pkg', 'mutter-cogl-pango-4',
|
||||
'--pkg', 'mutter-cogl-path-4',
|
||||
'--pkg', 'mutter-clutter-4'
|
||||
]
|
||||
libmutter_dep = dependency('libmutter-4', version: '>= 3.31.2')
|
||||
pkgconf.set('MUTTER_PKGS', 'libmutter-4 >= 3.31.2')
|
||||
mutter_dep = [
|
||||
libmutter_dep,
|
||||
dependency('mutter-cogl-4'), dependency('mutter-cogl-pango-4'),
|
||||
@ -182,15 +142,7 @@ endif
|
||||
|
||||
mutter334_dep = dependency('libmutter-5', version: ['>= 3.34', '< 3.35.1'], required: false)
|
||||
if mutter334_dep.found()
|
||||
mutter_packages_command = [
|
||||
'--pkg', 'libmutter-5',
|
||||
'--pkg', 'mutter-cogl-5',
|
||||
'--pkg', 'mutter-cogl-pango-5',
|
||||
'--pkg', 'mutter-cogl-path-5',
|
||||
'--pkg', 'mutter-clutter-5'
|
||||
]
|
||||
libmutter_dep = dependency('libmutter-5', version: '>= 3.34')
|
||||
pkgconf.set('MUTTER_PKGS', 'libmutter-5 >= 3.34')
|
||||
mutter_dep = [
|
||||
libmutter_dep,
|
||||
dependency('mutter-cogl-5'), dependency('mutter-cogl-pango-5'),
|
||||
@ -203,15 +155,7 @@ endif
|
||||
|
||||
mutter336_dep = dependency('libmutter-6', version: ['>= 3.35.1', '< 3.38'], required: false)
|
||||
if mutter336_dep.found()
|
||||
mutter_packages_command = [
|
||||
'--pkg', 'libmutter-6',
|
||||
'--pkg', 'mutter-cogl-6',
|
||||
'--pkg', 'mutter-cogl-pango-6',
|
||||
'--pkg', 'mutter-cogl-path-6',
|
||||
'--pkg', 'mutter-clutter-6'
|
||||
]
|
||||
libmutter_dep = dependency('libmutter-6', version: '>= 3.35.1')
|
||||
pkgconf.set('MUTTER_PKGS', 'libmutter-6 >= 3.35.1')
|
||||
mutter_dep = [
|
||||
libmutter_dep,
|
||||
dependency('mutter-cogl-6'), dependency('mutter-cogl-pango-6'),
|
||||
@ -231,7 +175,7 @@ mutter_typelib_dir = libmutter_dep.get_pkgconfig_variable('typelibdir')
|
||||
add_project_arguments(vala_flags, language: 'vala')
|
||||
add_project_link_arguments(['-Wl,-rpath,@0@'.format(mutter_typelib_dir)], language: 'c')
|
||||
|
||||
gala_base_dep = [glib_dep, gee_dep, gtk_dep, plank_dep, bamf_dep, mutter_dep, granite_dep, gnome_desktop_dep, m_dep]
|
||||
gala_base_dep = [glib_dep, gobject_dep, gio_dep, gmodule_dep, gee_dep, gtk_dep, plank_dep, bamf_dep, mutter_dep, granite_dep, gnome_desktop_dep, m_dep, config_dep, cogl_fixes_dep, compat_dep]
|
||||
|
||||
subdir('data')
|
||||
subdir('lib')
|
||||
|
@ -20,9 +20,7 @@ namespace Config
|
||||
{
|
||||
public const string DATADIR;
|
||||
public const string PKGDATADIR;
|
||||
public const string RELEASE_NAME;
|
||||
public const string VERSION;
|
||||
public const string VERSION_INFO;
|
||||
public const string PLUGINDIR;
|
||||
public const string SCHEMA;
|
||||
public const string RESOURCEPATH;
|
||||
|
Loading…
Reference in New Issue
Block a user