[gnome-todo] project: Improved meson build port.
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-todo] project: Improved meson build port.
- Date: Fri, 23 Jun 2017 06:53:31 +0000 (UTC)
commit 407e7293fc191642788f8812488505b80850c6ff
Author: Iñigo Martínez <inigomartinez gmail com>
Date: Wed Jun 21 22:36:45 2017 +0200
project: Improved meson build port.
- Added ToDo website for PACKAGE_URL define.
- Added generation of the enums schema.
- Added a post install script for generating icon theme cache and
compile different schemas.
- Fixed documentation generation by using GTK prefixes.
- Added mkdb_args, which will be available in the future meson
releases.
- Removed unused meson build options.
- Fixed plugins to be created as shared modules.
- Removed listed headers.
- Use i18n module instead of using custom targets.
- Changed application data information install directory to the
new proposed 'metainfo' directory.
- Use pkgconfig module's generate function to generate pc file.
- Raised meson required version to 0.41.0.
https://bugzilla.gnome.org/show_bug.cgi?id=783589
configure_meson | 2 -
data/appdata/meson.build | 14 +-
data/icons/meson.build | 16 +--
data/icons/meson_post_install.py | 10 --
data/meson.build | 63 +++------
data/meson_post_install.py | 10 --
doc/reference/meson.build | 20 ++--
doc/reference/xml/gtkdocentities.ent.in | 1 -
doc/reference/xml/meson.build | 8 +-
meson.build | 175 ++++++++++-----------
meson_options.txt | 1 -
meson_post_install.py | 15 ++
plugins/background/meson.build | 23 ++--
plugins/dark-theme/meson.build | 21 ++--
plugins/eds/meson.build | 31 ++--
plugins/meson.build | 8 +-
plugins/scheduled-panel/meson.build | 24 ++--
plugins/score/meson.build | 14 +-
plugins/today-panel/meson.build | 24 ++--
plugins/todo-txt/meson.build | 29 ++--
plugins/todoist/meson.build | 31 ++--
plugins/unscheduled-panel/meson.build | 14 +-
src/meson.build | 258 ++++++++++++-------------------
23 files changed, 355 insertions(+), 457 deletions(-)
---
diff --git a/configure_meson b/configure_meson
index acd02aa..724fac9 100755
--- a/configure_meson
+++ b/configure_meson
@@ -82,7 +82,6 @@ sanitycheck MESONTEST 'mesontest'
sanitycheck NINJA 'ninja' 'ninja-build'
declare -A default_options=(
- ['nls']=true
['gtk-doc']=false
['dark-theme-plugin']=true
['background-plugin']=true
@@ -166,7 +165,6 @@ echo "
prefix: ${prefix}
compiler: ${CC}
global flags: ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
- nls: $(echooption nls)
documentation: $(echooption gtk-doc)
Plugins:
diff --git a/data/appdata/meson.build b/data/appdata/meson.build
index 1cebb8b..2c3900c 100644
--- a/data/appdata/meson.build
+++ b/data/appdata/meson.build
@@ -1,10 +1,10 @@
-appdata = 'org.gnome.Todo.appdata.xml'
+info = 'org.gnome.Todo.metainfo.xml'
-custom_target(
- appdata,
- input: '@0@.in'.format(appdata),
- output: appdata,
- command: [msgfmt, '--xml', '--template', '@INPUT@', '-d', po_dir, '-o', '@OUTPUT@'],
+i18n.merge_file(
+ info,
+ input: 'org.gnome.Todo.appdata.xml.in',
+ output: info,
+ po_dir: po_dir,
install: true,
- install_dir: join_paths(gnome_todo_datadir, 'appdata')
+ install_dir: join_paths(gnome_todo_datadir, 'metainfo')
)
diff --git a/data/icons/meson.build b/data/icons/meson.build
index 0175733..81b7b03 100644
--- a/data/icons/meson.build
+++ b/data/icons/meson.build
@@ -4,19 +4,13 @@ icon_sizes = [
'32x32',
'48x48',
'256x256',
- '512x512'
+ '512x512',
+ 'symbolic'
]
foreach icon_size: icon_sizes
- install_data(
- join_paths('hicolor', icon_size, 'apps', 'org.gnome.Todo.png'),
- install_dir: join_paths(gnome_todo_datadir, 'icons', 'hicolor', icon_size, 'apps')
+ install_subdir(
+ 'hicolor/' + icon_size,
+ install_dir: join_paths(gnome_todo_datadir, 'icons', 'hicolor')
)
endforeach
-
-install_data(
- join_paths('hicolor', 'symbolic', 'apps', 'org.gnome.Todo-symbolic.svg'),
- install_dir: join_paths(gnome_todo_datadir, 'icons', 'hicolor', 'symbolic', 'apps')
-)
-
-meson.add_install_script('meson_post_install.py')
diff --git a/data/meson.build b/data/meson.build
index 3b85504..994daa8 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -1,41 +1,23 @@
-# gnome.pc.in options
-pc_conf = configuration_data()
-pc_conf.set('prefix', gnome_todo_prefix)
-pc_conf.set('includedir', gnome_todo_includedir)
-pc_conf.set('VERSION', gnome_todo_version)
-
-pc = 'gnome-todo.pc'
-
-configure_file(
- input: '@0@.in'.format(pc),
- output: pc,
- install: true,
- install_dir: join_paths(gnome_todo_libdir, 'pkgconfig'),
- configuration: pc_conf
-)
-
-msgfmt = find_program('msgfmt')
-
-po_dir = join_paths(meson.source_root(), 'po')
-
desktop = 'org.gnome.Todo.desktop'
-custom_target(
+i18n.merge_file(
desktop,
- input: '@0@.in'.format(desktop),
+ type: 'desktop',
+ input: desktop + '.in',
output: desktop,
- command: [msgfmt, '--desktop', '--template', '@INPUT@', '-d', po_dir, '-o', '@OUTPUT@'],
+ po_dir: po_dir,
install: true,
install_dir: join_paths(gnome_todo_datadir, 'applications')
)
autostart = 'org.gnome.Todo.Autostart.desktop'
-custom_target(
+i18n.merge_file(
autostart,
- input: '@0@.in'.format(autostart),
+ type: 'desktop',
+ input: autostart + '.in',
output: autostart,
- command: [msgfmt, '--desktop', '--template', '@INPUT@', '-d', po_dir, '-o', '@OUTPUT@'],
+ po_dir: po_dir,
install: true,
install_dir: gnome_todo_pkgdatadir
)
@@ -46,29 +28,23 @@ service_conf.set('bindir', gnome_todo_bindir)
service = 'org.gnome.Todo.service'
configure_file(
- input: '@0@.in'.format(service),
+ input: service + '.in',
output: service,
install: true,
install_dir: join_paths(gnome_todo_datadir, 'dbus-1', 'services'),
configuration: service_conf
)
-enums = 'org.gnome.todo.enums.xml'
-
-custom_target(
- enums,
- input: join_paths(meson.source_root(), 'src', 'gtd-enums.h'),
- output: enums,
- command: [find_program('glib-mkenums'),
- '--comments', '<!-- @comment@ -->',
- '--fhead', '<schemalist>',
- '--vhead', ' <@type@ id="org.gnome.todo.@EnumName@">',
- '--vprod', ' <value nick="@valuenick@" value="@valuenum@"/>',
- '--vtail', ' </@type@>',
- '--ftail', '</schemalist>',
- '--output', '@OUTPUT@',
- '@INPUT@'],
- install: true,
+gnome.mkenums(
+ 'org.gnome.todo.enums.xml',
+ sources: enum_headers,
+ comments: '<!-- @comment@ -->',
+ fhead: '<schemalist>',
+ vhead: ' <@type@ id="org.gnome.todo.@EnumName@">',
+ vprod: ' <value nick="@valuenick@" value="@valuenum@"/>',
+ vtail: ' </@type@>',
+ ftail: '</schemalist>',
+ install_header: true,
install_dir: gnome_todo_schemadir
)
@@ -76,7 +52,6 @@ install_data(
'org.gnome.todo.gschema.xml',
install_dir: gnome_todo_schemadir
)
-meson.add_install_script('meson_post_install.py')
subdir('appdata')
subdir('icons')
diff --git a/doc/reference/meson.build b/doc/reference/meson.build
index 2293ccd..dc4b13e 100644
--- a/doc/reference/meson.build
+++ b/doc/reference/meson.build
@@ -30,31 +30,31 @@ private_headers = [
]
html_images = [
- join_paths('images', 'notification.png')
+ 'images/notification.png'
]
version_conf = configuration_data()
version_conf.set('VERSION', gnome_todo_version)
-version = 'version.xml'
+version_xml = 'version.xml'
-version_xml = configure_file(
- input: '@0@.in'.format(version),
- output: version,
+configure_file(
+ input: version_xml + '.in',
+ output: version_xml,
configuration: version_conf
)
-gtk_prefix = gtk_dep.get_pkgconfig_variable('prefix')
-gtk_doc_path = join_paths(gtk_prefix, 'share', 'gtk-doc', 'html')
-
glib_prefix = glib_dep.get_pkgconfig_variable('prefix')
glib_doc_path = join_paths(glib_prefix, 'share', 'gtk-doc', 'html')
+gtk_prefix = gtk_dep.get_pkgconfig_variable('prefix')
+gtk_doc_path = join_paths(gtk_prefix, 'share', 'gtk-doc', 'html')
+
doc_path = join_paths(gnome_todo_datadir, 'gtk-doc', 'html', meson.project_name())
gnome.gtkdoc(
meson.project_name(),
- main_sgml: '@0 -docs sgml'.format(meson.project_name()),
+ main_sgml: meson.project_name() + '-docs.sgml',
src_dir: [
join_paths(meson.source_root(), 'src'),
join_paths(meson.build_root(), 'src')
@@ -68,7 +68,7 @@ gnome.gtkdoc(
'--sgml-mode',
'--output-format=xml'
],
- gobject_typesfile: '@0@.types'.format(meson.project_name()),
+ gobject_typesfile: meson.project_name() + '.types',
fixxref_args: [
'--extra-dir=@0@'.format(join_paths(glib_doc_path, 'glib')),
'--extra-dir=@0@'.format(join_paths(glib_doc_path, 'gmodule')),
diff --git a/doc/reference/xml/gtkdocentities.ent.in b/doc/reference/xml/gtkdocentities.ent.in
index abc7730..d2a068a 100644
--- a/doc/reference/xml/gtkdocentities.ent.in
+++ b/doc/reference/xml/gtkdocentities.ent.in
@@ -5,4 +5,3 @@
<!ENTITY package_tarname @PACKAGE_TARNAME@>
<!ENTITY package_url @PACKAGE_URL@>
<!ENTITY package_version @PACKAGE_VERSION@>
-<!ENTITY package_api_version @PACKAGE_API_VERSION@>
diff --git a/doc/reference/xml/meson.build b/doc/reference/xml/meson.build
index a7ed06b..ee0004d 100644
--- a/doc/reference/xml/meson.build
+++ b/doc/reference/xml/meson.build
@@ -1,7 +1,7 @@
-entities = 'gtkdocentities.ent'
+ent = 'gtkdocentities.ent'
configure_file(
- input: '@0@.in'.format(entities),
- output: entities,
- configuration: conf
+ input: ent + '.in',
+ output: ent,
+ configuration: config_h
)
diff --git a/meson.build b/meson.build
index 90b47db..9355f40 100644
--- a/meson.build
+++ b/meson.build
@@ -1,13 +1,13 @@
project(
'gnome-todo', 'c',
- version: '3.25.1',
+ version: '3.25.3',
license: 'GPL3+',
default_options: [
'buildtype=debugoptimized',
'c_std=gnu99',
'warning_level=1'
],
- meson_version: '>= 0.38.1'
+ meson_version: '>= 0.41.0'
)
gnome_todo_version = meson.project_version()
@@ -16,7 +16,7 @@ gnome_todo_major_version = version_array[0].to_int()
gnome_todo_minor_version = version_array[1].to_int()
gnome_todo_micro_version = version_array[2].to_int()
-gnome_todo_gir_ns = 'Gtd'
+gnome_todo_gir_namespace = 'Gtd'
gnome_todo_gir_version = '1.0'
gnome_todo_prefix = get_option('prefix')
@@ -30,104 +30,95 @@ gnome_todo_pkglibdir = join_paths(gnome_todo_libdir, meson.project_name())
gnome_todo_pkgdatadir = join_paths(gnome_todo_datadir, meson.project_name())
gnome_todo_pkgincludedir = join_paths(gnome_todo_includedir, meson.project_name())
+gnome_todo_pluginsdir = join_paths(gnome_todo_pkglibdir, 'plugins')
gnome_todo_schemadir = join_paths(gnome_todo_datadir, 'glib-2.0', 'schemas')
+soversion = 0
+current = 0
+revision = 0
+libversion = '@0@.@1@.@2@'.format(soversion, current, revision)
+
cc = meson.get_compiler('c')
-conf = configuration_data()
+config_h = configuration_data()
-conf.set('ENABLE_NLS', get_option('enable-nls'))
-conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
+config_h.set_quoted('GETTEXT_PACKAGE', meson.project_name())
# debug options
-conf.set('GNOME_TODO_ENABLE_DEBUG', get_option('buildtype') != 'release')
-conf.set('NDEBUG', get_option('buildtype') == 'release')
+config_h.set('GNOME_TODO_ENABLE_DEBUG', get_option('buildtype') != 'release')
+config_h.set('NDEBUG', get_option('buildtype') == 'release')
# package
-conf.set_quoted('PACKAGE', meson.project_name())
-conf.set_quoted('PACKAGE_BUGREPORT', 'https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-todo')
-conf.set_quoted('PACKAGE_NAME', meson.project_name())
-conf.set_quoted('PACKAGE_STRING', '@0@-@1@'.format(meson.project_name(), gnome_todo_version))
-conf.set_quoted('PACKAGE_TARNAME', gnome_todo_version)
-conf.set_quoted('PACKAGE_URL', '')
-conf.set_quoted('PACKAGE_VERSION', gnome_todo_version)
-conf.set_quoted('PACKAGE_API_VERSION', gnome_todo_version)
-conf.set_quoted('VERSION', gnome_todo_version)
+config_h.set_quoted('PACKAGE', meson.project_name())
+config_h.set_quoted('PACKAGE_BUGREPORT', 'https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-todo')
+config_h.set_quoted('PACKAGE_NAME', meson.project_name())
+config_h.set_quoted('PACKAGE_STRING', '@0@ @1@'.format(meson.project_name(), gnome_todo_version))
+config_h.set_quoted('PACKAGE_TARNAME', gnome_todo_version)
+config_h.set_quoted('PACKAGE_URL', 'https://wiki.gnome.org/Apps/Todo')
+config_h.set_quoted('PACKAGE_VERSION', gnome_todo_version)
+config_h.set_quoted('VERSION', gnome_todo_version)
# headers
-conf.set('HAVE_DLFCN_H', cc.has_header('dlfcn.h'))
-conf.set('HAVE_INTTYPES_H', cc.has_header('inttypes.h'))
-conf.set('HAVE_MATH_H', cc.has_header('math.h'))
-conf.set('HAVE_MEMORY_H', cc.has_header('memory.h'))
-conf.set('HAVE_STDINT_H', cc.has_header('stdint.h'))
-conf.set('HAVE_STDLIB_H', cc.has_header('stdlib.h'))
-conf.set('HAVE_STRINGS_H', cc.has_header('strings.h'))
-conf.set('HAVE_STRING_H', cc.has_header('string.h'))
-conf.set('HAVE_SYS_STAT_H', cc.has_header('sys/stat.h'))
-conf.set('HAVE_SYS_TYPES_H', cc.has_header('sys/types.h'))
-conf.set('HAVE_UNISTD_H', cc.has_header('unistd.h'))
+config_h.set('HAVE_DLFCN_H', cc.has_header('dlfcn.h'))
+config_h.set('HAVE_INTTYPES_H', cc.has_header('inttypes.h'))
+config_h.set('HAVE_MATH_H', cc.has_header('math.h'))
+config_h.set('HAVE_MEMORY_H', cc.has_header('memory.h'))
+config_h.set('HAVE_STDINT_H', cc.has_header('stdint.h'))
+config_h.set('HAVE_STDLIB_H', cc.has_header('stdlib.h'))
+config_h.set('HAVE_STRINGS_H', cc.has_header('strings.h'))
+config_h.set('HAVE_STRING_H', cc.has_header('string.h'))
+config_h.set('HAVE_SYS_STAT_H', cc.has_header('sys/stat.h'))
+config_h.set('HAVE_SYS_TYPES_H', cc.has_header('sys/types.h'))
+config_h.set('HAVE_UNISTD_H', cc.has_header('unistd.h'))
# functions
-conf.set('HAVE_DCGETTEXT', cc.has_function('dcgettext'))
-conf.set('HAVE_GETTEXT', cc.has_function('gettext'))
-conf.set('HAVE_ICONV', cc.has_function('iconv'))
-
-# Compiler flags
-test_cflags = [
- '-fno-strict-aliasing',
- '-Wall',
- '-Warray-bounds',
- '-Wcast-align',
- '-Wdeclaration-after-statement',
- '-Wextra',
- '-Wformat-nonliteral',
- '-Wformat-security',
- '-Wformat=2',
- '-Wimplicit-function-declaration',
- '-Winit-self',
- '-Winline',
- '-Wmissing-declarations',
- '-Wmissing-format-attribute',
- '-Wmissing-include-dirs',
- '-Wmissing-noreturn',
- '-Wmissing-prototypes',
- '-Wnested-externs',
- '-Wno-error=missing-field-initializers',
- '-Wno-error=unused-parameter',
- '-Wno-missing-field-initializers',
- '-Wno-unused-parameter',
- '-Wold-style-definition',
- '-Wpacked',
- '-Wpointer-arith',
- '-Wredundant-decls',
- '-Wreturn-type',
- '-Wshadow',
- '-Wsign-compare',
- '-Wstrict-aliasing',
- '-Wstrict-prototypes',
- '-Wswitch-default',
- '-Wswitch-enum',
- '-Wundef',
- '-Wunused-but-set-variable',
- '-Wwrite-strings'
-]
-
-common_flags = [
- '-DHAVE_CONFIG_H'
-]
-
-foreach cflag: test_cflags
- if cc.has_argument(cflag)
- common_flags += [cflag]
- endif
-endforeach
-
-add_global_arguments(common_flags, language: 'c')
+config_h.set('HAVE_DCGETTEXT', cc.has_function('dcgettext'))
+config_h.set('HAVE_GETTEXT', cc.has_function('gettext'))
+config_h.set('HAVE_ICONV', cc.has_function('iconv'))
+
+# compiler flags
+common_flags = ['-DHAVE_CONFIG_H']
+
+buildtype = get_option('buildtype')
+if buildtype == 'debug' or buildtype == 'debugoptimized'
+ test_cflags = [
+ '-ffast-math',
+ '-fstrict-aliasing',
+ '-Wcast-align',
+ '-Werror=implicit',
+ '-Werror=init-self',
+ '-Werror=main',
+ '-Werror=missing-braces',
+ '-Werror=return-type',
+ '-Werror=array-bounds',
+ '-Werror=write-strings',
+ '-Wformat=2',
+ '-Wlogical-op',
+ '-Wmissing-declarations',
+ '-Wmissing-format-attribute',
+ '-Wmissing-noreturn',
+ '-Wmissing-prototypes',
+ '-Wnested-externs',
+ '-Wno-unused-local-typedefs',
+ '-Wold-style-definition',
+ '-Wredundant-decls',
+ '-Wshadow',
+ '-Wstrict-prototypes'
+ ]
+
+ foreach cflag: test_cflags
+ if cc.has_argument(cflag)
+ common_flags += [cflag]
+ endif
+ endforeach
+
+ add_project_arguments(common_flags, language: 'c')
+endif
-glib_dep = dependency('glib-2.0', version: '>= 2.43.4')
+glib_dep = dependency('glib-2.0', version: '>= 2.43.4')
gtk_dep = dependency('gtk+-3.0', version: '>= 3.22.0')
-gnome_todo_dep = [
+gnome_todo_deps = [
dependency('gmodule-export-2.0'),
dependency('gio-2.0', version: '>= 2.43.4'),
glib_dep,
@@ -142,26 +133,26 @@ gnome_todo_dep = [
]
configure_file(
- output : 'config.h',
- configuration : conf
+ output: 'config.h',
+ configuration: config_h
)
gnome = import('gnome')
+i18n = import('i18n')
pkg = import('pkgconfig')
top_inc = include_directories('.')
src_inc = include_directories('src')
+po_dir = join_paths(meson.source_root(), 'po')
+
subdir('plugins')
subdir('src')
subdir('data')
+subdir('po')
if get_option('enable-gtk-doc')
subdir('doc')
endif
-if get_option('enable-nls')
- i18n = import('i18n')
-
- subdir('po')
-endif
+meson.add_install_script('meson_post_install.py')
diff --git a/meson_options.txt b/meson_options.txt
index 98856f9..927daa2 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,4 +1,3 @@
-option('enable-nls', type: 'boolean', value: false, description: 'use Native Language Support')
option('enable-eds-plugin', type: 'boolean', value: true, description: 'enable Evolution-Data-Server plugin')
option('enable-background-plugin', type: 'boolean', value: true, description: 'enable Run In Background
plugin')
option('enable-dark-theme-plugin', type: 'boolean', value: true, description: 'enable Dark theme plugin')
diff --git a/meson_post_install.py b/meson_post_install.py
new file mode 100644
index 0000000..bf320a9
--- /dev/null
+++ b/meson_post_install.py
@@ -0,0 +1,15 @@
+#!/usr/bin/env python3
+
+import os
+import subprocess
+
+install_prefix = os.environ['MESON_INSTALL_PREFIX']
+icondir = os.path.join(install_prefix, 'share', 'icons', 'hicolor')
+schemadir = os.path.join(install_prefix, 'share', 'glib-2.0', 'schemas')
+
+if not os.environ.get('DESTDIR'):
+ print('Update icon cache...')
+ subprocess.call(['gtk-update-icon-cache', '-f', '-t', icondir])
+
+ print('Compiling gsettings schemas...')
+ subprocess.call(['glib-compile-schemas', schemadir])
diff --git a/plugins/background/meson.build b/plugins/background/meson.build
index 27d754a..69f4621 100644
--- a/plugins/background/meson.build
+++ b/plugins/background/meson.build
@@ -1,27 +1,26 @@
plugin_name = 'background'
-sources = [
- 'gtd-plugin-background.c',
- 'gtd-plugin-background.h'
-]
+plugins_ldflags += ['-Wl,--undefined=gtd_plugin_background_register_types']
-libbackground_lib = static_library(
+plugins_libs += static_library(
plugin_name,
- sources: sources,
- include_directories: plugins_inc,
- dependencies: gnome_todo_dep,
+ sources: 'gtd-plugin-' + plugin_name + '.c',
+ include_directories: plugins_incs,
+ dependencies: gnome_todo_deps,
c_args: common_flags + [
'-DPACKAGE_DATA_DIR="@0@"'.format(gnome_todo_pkgdatadir)
]
)
install_data(
- 'org.gnome.todo.background.gschema.xml',
+ 'org.gnome.todo.' + plugin_name + '.gschema.xml',
install_dir: gnome_todo_schemadir
)
-plugins_files += configure_file(
- input: '@0 plugin in'.format(plugin_name),
- output: '@0@.plugin'.format(plugin_name),
+plugin_data = plugin_name + '.plugin'
+
+plugins_confs += configure_file(
+ input: plugin_data + '.in',
+ output: plugin_data,
configuration: plugins_conf
)
diff --git a/plugins/dark-theme/meson.build b/plugins/dark-theme/meson.build
index 9fbbc08..9883ef3 100644
--- a/plugins/dark-theme/meson.build
+++ b/plugins/dark-theme/meson.build
@@ -1,19 +1,18 @@
plugin_name = 'dark-theme'
-sources = [
- 'gtd-plugin-dark-theme.c',
- 'gtd-plugin-dark-theme.h'
-]
+plugins_ldflags += ['-Wl,--undefined=gtd_plugin_dark_theme_register_types']
-libdarktheme_lib = static_library(
+plugins_libs += static_library(
'darktheme',
- sources: sources,
- include_directories: plugins_inc,
- dependencies: gnome_todo_dep,
+ sources: 'gtd-plugin-' + plugin_name + '.c',
+ include_directories: plugins_incs,
+ dependencies: gnome_todo_deps
)
-plugins_files += configure_file(
- input: '@0 plugin in'.format(plugin_name),
- output: '@0@.plugin'.format(plugin_name),
+plugin_data = plugin_name + '.plugin'
+
+plugins_confs += configure_file(
+ input: plugin_data + '.in',
+ output: plugin_data,
configuration: plugins_conf
)
diff --git a/plugins/eds/meson.build b/plugins/eds/meson.build
index 0428f3a..6f4cb0d 100644
--- a/plugins/eds/meson.build
+++ b/plugins/eds/meson.build
@@ -1,27 +1,26 @@
plugin_name = 'eds'
-sources = [
- 'gtd-plugin-eds.c',
- 'gtd-plugin-eds.h',
- 'gtd-provider-eds.c',
- 'gtd-provider-eds.h',
+plugins_ldflags += ['-Wl,--undefined=gtd_plugin_eds_register_types']
+
+sources = files(
+ 'gtd-plugin-' + plugin_name + '.c',
+ 'gtd-provider-' + plugin_name + '.c',
'gtd-provider-goa.c',
- 'gtd-provider-goa.h',
'gtd-provider-local.c',
- 'gtd-provider-local.h',
- 'gtd-task-list-eds.c',
- 'gtd-task-list-eds.h'
-]
+ 'gtd-task-list-' + plugin_name + '.c'
+)
-libeds_lib = static_library(
+plugins_libs += static_library(
plugin_name,
sources: sources,
- include_directories: plugins_inc,
- dependencies: gnome_todo_dep,
+ include_directories: plugins_incs,
+ dependencies: gnome_todo_deps
)
-plugins_files += configure_file(
- input: '@0 plugin in'.format(plugin_name),
- output: '@0@.plugin'.format(plugin_name),
+plugin_data = plugin_name + '.plugin'
+
+plugins_confs += configure_file(
+ input: plugin_data + '.in',
+ output: plugin_data,
configuration: plugins_conf
)
diff --git a/plugins/meson.build b/plugins/meson.build
index 9302fd4..3c45f8f 100644
--- a/plugins/meson.build
+++ b/plugins/meson.build
@@ -1,6 +1,8 @@
-plugins_install_dir = join_paths(gnome_todo_pkglibdir, 'plugins')
-plugins_inc = [top_inc, src_inc]
-plugins_files = []
+plugins_incs = [top_inc, src_inc]
+
+plugins_ldflags = []
+plugins_libs = []
+plugins_confs = []
plugins_conf = configuration_data()
plugins_conf.set('VERSION', gnome_todo_version)
diff --git a/plugins/scheduled-panel/meson.build b/plugins/scheduled-panel/meson.build
index 7fb8463..7c322b0 100644
--- a/plugins/scheduled-panel/meson.build
+++ b/plugins/scheduled-panel/meson.build
@@ -1,21 +1,23 @@
plugin_name = 'scheduled-panel'
-sources = [
+plugins_ldflags += ['-Wl,--undefined=gtd_plugin_scheduled_panel_register_types']
+
+sources = files(
'gtd-panel-scheduled.c',
- 'gtd-panel-scheduled.h',
- 'gtd-plugin-scheduled-panel.c',
- 'gtd-plugin-scheduled-panel.h'
-]
+ 'gtd-plugin-' + plugin_name + '.c'
+)
-libscheduledpanel_lib = static_library(
+plugins_libs += static_library(
'scheduledpanel',
sources: sources,
- include_directories: plugins_inc,
- dependencies: gnome_todo_dep,
+ include_directories: plugins_incs,
+ dependencies: gnome_todo_deps,
)
-plugins_files += configure_file(
- input: '@0 plugin in'.format(plugin_name),
- output: '@0@.plugin'.format(plugin_name),
+plugin_data = plugin_name + '.plugin'
+
+plugins_confs += configure_file(
+ input: plugin_data + '.in',
+ output: plugin_data,
configuration: plugins_conf
)
diff --git a/plugins/score/meson.build b/plugins/score/meson.build
index d1f4420..92d9b74 100644
--- a/plugins/score/meson.build
+++ b/plugins/score/meson.build
@@ -1,16 +1,18 @@
plugin_name = 'score'
-install_dir = join_paths(plugins_install_dir, plugin_name)
+plugin_dir = join_paths(gnome_todo_pluginsdir, plugin_name)
install_data(
join_paths(plugin_name, '__init__.py'),
- install_dir: join_paths(install_dir, plugin_name)
+ install_dir: join_paths(plugin_dir, plugin_name)
)
-configure_file(
- input: '@0 plugin in'.format(plugin_name),
- output: '@0@.plugin'.format(plugin_name),
+plugin_data = plugin_name + '.plugin'
+
+plugins_confs += configure_file(
+ input: plugin_data + '.in',
+ output: plugin_data,
install: true,
- install_dir: install_dir,
+ install_dir: plugin_dir,
configuration: plugins_conf
)
diff --git a/plugins/today-panel/meson.build b/plugins/today-panel/meson.build
index eac8de9..c504bd9 100644
--- a/plugins/today-panel/meson.build
+++ b/plugins/today-panel/meson.build
@@ -1,21 +1,23 @@
plugin_name = 'today-panel'
-sources = [
+plugins_ldflags += ['-Wl,--undefined=gtd_plugin_today_panel_register_types']
+
+sources = files(
'gtd-panel-today.c',
- 'gtd-panel-today.h',
- 'gtd-plugin-today-panel.c',
- 'gtd-plugin-today-panel.h'
-]
+ 'gtd-plugin-' + plugin_name + '.c'
+)
-libtodaypanel_lib = static_library(
+plugins_libs += static_library(
'todaypanel',
sources: sources,
- include_directories: plugins_inc,
- dependencies: gnome_todo_dep,
+ include_directories: plugins_incs,
+ dependencies: gnome_todo_deps,
)
-plugins_files += configure_file(
- input: '@0 plugin in'.format(plugin_name),
- output: '@0@.plugin'.format(plugin_name),
+plugin_data = plugin_name + '.plugin'
+
+plugins_confs += configure_file(
+ input: plugin_data + '.in',
+ output: plugin_data,
configuration: plugins_conf
)
diff --git a/plugins/todo-txt/meson.build b/plugins/todo-txt/meson.build
index 407ea26..de91b79 100644
--- a/plugins/todo-txt/meson.build
+++ b/plugins/todo-txt/meson.build
@@ -1,19 +1,18 @@
plugin_name = 'todo-txt'
-sources = [
- 'gtd-plugin-todo-txt.c',
- 'gtd-plugin-todo-txt.h',
- 'gtd-provider-todo-txt.c',
- 'gtd-provider-todo-txt.h',
- 'gtd-todo-txt-parser.c',
- 'gtd-todo-txt-parser.h'
-]
+plugins_ldflags += ['-Wl,--undefined=gtd_plugin_todo_txt_register_types']
-libtodotxt_lib = static_library(
+sources = files(
+ 'gtd-plugin-' + plugin_name + '.c',
+ 'gtd-provider-' + plugin_name + '.c',
+ 'gtd-' + plugin_name + '-parser.c'
+)
+
+plugins_libs += static_library(
'todotxt',
sources: sources,
- include_directories: plugins_inc,
- dependencies: gnome_todo_dep,
+ include_directories: plugins_incs,
+ dependencies: gnome_todo_deps,
c_args: common_flags + [
'-DPACKAGE_DATA_DIR="@0@"'.format(gnome_todo_pkgdatadir)
]
@@ -24,8 +23,10 @@ install_data(
install_dir: gnome_todo_schemadir
)
-plugins_files += configure_file(
- input: '@0 plugin in'.format(plugin_name),
- output: '@0@.plugin'.format(plugin_name),
+plugin_data = plugin_name + '.plugin'
+
+plugins_confs += configure_file(
+ input: plugin_data + '.in',
+ output: plugin_data,
configuration: plugins_conf
)
diff --git a/plugins/todoist/meson.build b/plugins/todoist/meson.build
index e7dde5d..e5ad336 100644
--- a/plugins/todoist/meson.build
+++ b/plugins/todoist/meson.build
@@ -1,26 +1,27 @@
plugin_name = 'todoist'
-sources = [
- 'gtd-plugin-todoist.c',
- 'gtd-plugin-todoist.h',
- 'gtd-provider-todoist.c',
- 'gtd-provider-todoist.h',
- 'gtd-todoist-preferences-panel.c',
- 'gtd-todoist-preferences-panel.h'
-]
+plugins_ldflags += ['-Wl,--undefined=gtd_plugin_todoist_register_types']
-libtodoist_lib = static_library(
- 'todoist',
+sources = files(
+ 'gtd-plugin-' + plugin_name + '.c',
+ 'gtd-provider-' + plugin_name + '.c',
+ 'gtd-' + plugin_name + '-preferences-panel.c'
+)
+
+plugins_libs += static_library(
+ plugin_name,
sources: sources,
- include_directories: plugins_inc,
- dependencies: gnome_todo_dep,
+ include_directories: plugins_incs,
+ dependencies: gnome_todo_deps,
c_args: common_flags + [
'-DPACKAGE_DATA_DIR="@0@"'.format(gnome_todo_pkgdatadir)
]
)
-plugins_files += configure_file(
- input: '@0 plugin in'.format(plugin_name),
- output: '@0@.plugin'.format(plugin_name),
+plugin_data = plugin_name + '.plugin'
+
+plugins_confs += configure_file(
+ input: plugin_data + '.in',
+ output: plugin_data,
configuration: plugins_conf
)
diff --git a/plugins/unscheduled-panel/meson.build b/plugins/unscheduled-panel/meson.build
index 9cc500e..1d4c4be 100644
--- a/plugins/unscheduled-panel/meson.build
+++ b/plugins/unscheduled-panel/meson.build
@@ -1,16 +1,18 @@
plugin_name = 'unscheduled-panel'
-install_dir = join_paths(plugins_install_dir, plugin_name)
+plugin_dir = join_paths(gnome_todo_pluginsdir, plugin_name)
install_data(
join_paths(plugin_name, '__init__.py'),
- install_dir: join_paths(install_dir, plugin_name)
+ install_dir: join_paths(plugin_dir, plugin_name)
)
-configure_file(
- input: '@0 plugin in'.format(plugin_name),
- output: '@0@.plugin'.format(plugin_name),
+plugin_data = plugin_name + '.plugin'
+
+plugins_confs += configure_file(
+ input: plugin_data + '.in',
+ output: plugin_data,
install: true,
- install_dir: install_dir,
+ install_dir: plugin_dir,
configuration: plugins_conf
)
diff --git a/src/meson.build b/src/meson.build
index b5bfc68..093d50d 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,34 +1,25 @@
-engine_headers = [
- join_paths('engine', 'gtd-manager.h')
-]
-
install_headers(
- engine_headers,
+ 'engine/gtd-manager.h',
subdir: join_paths(gnome_todo_pkgincludedir, 'engine')
)
-interfaces_headers = [
- join_paths('interfaces', 'gtd-activatable.h'),
- join_paths('interfaces', 'gtd-panel.h'),
- join_paths('interfaces', 'gtd-provider.h')
-]
+interfaces_headers = files(
+ 'interfaces/gtd-activatable.h',
+ 'interfaces/gtd-panel.h',
+ 'interfaces/gtd-provider.h'
+)
install_headers(
interfaces_headers,
subdir: join_paths(gnome_todo_pkgincludedir, 'interfaces')
)
-notification_headers = [
- join_paths('notification', 'gtd-notification.h')
-]
-
install_headers(
- notification_headers,
+ 'notification/gtd-notification.h',
subdir: join_paths(gnome_todo_pkgincludedir, 'notification')
)
-headers = [
- 'gtd-enums.h',
+headers = files(
'gtd-object.h',
'gtd-task.h',
'gtd-task-list.h',
@@ -37,58 +28,35 @@ headers = [
'gtd-types.h',
'gtd-window.h',
'gnome-todo.h'
-]
+)
+
+enum_headers = files(
+ 'gtd-enums.h'
+)
install_headers(
- headers,
+ headers + enum_headers,
subdir: gnome_todo_pkgincludedir
)
-private_headers = [
- join_paths('engine', 'gtd-manager-protected.h'),
- join_paths('engine', 'gtd-plugin-manager.h'),
- join_paths('notification', 'gtd-notification-widget.h'),
- join_paths('provider', 'gtd-provider-popover.h'),
- join_paths('provider', 'gtd-provider-row.h'),
- join_paths('provider', 'gtd-provider-selector.h'),
- join_paths('views', 'gtd-list-selector.h'),
- join_paths('views', 'gtd-list-selector-grid.h'),
- join_paths('views', 'gtd-list-selector-grid-item.h'),
- join_paths('views', 'gtd-list-selector-item.h'),
- join_paths('views', 'gtd-list-selector-list.h'),
- join_paths('views', 'gtd-list-selector-list-item.h'),
- join_paths('views', 'gtd-list-selector-panel.h'),
- 'gtd-application.h',
- 'gtd-arrow-frame.h',
- 'gtd-dnd-row.h',
- 'gtd-edit-pane.h',
- 'gtd-empty-list-widget.h',
- 'gtd-initial-setup-window.h',
- 'gtd-new-task-row.h',
- 'gtd-plugin-dialog.h',
- 'gtd-plugin-dialog-row.h',
- 'gtd-task-row.h',
- 'main.c'
-]
-
-sources = [
- join_paths('engine', 'gtd-manager.c'),
- join_paths('engine', 'gtd-plugin-manager.c'),
- join_paths('interfaces', 'gtd-activatable.c'),
- join_paths('interfaces', 'gtd-panel.c'),
- join_paths('interfaces', 'gtd-provider.c'),
- join_paths('notification', 'gtd-notification.c'),
- join_paths('notification', 'gtd-notification-widget.c'),
- join_paths('provider', 'gtd-provider-popover.c'),
- join_paths('provider', 'gtd-provider-row.c'),
- join_paths('provider', 'gtd-provider-selector.c'),
- join_paths('views', 'gtd-list-selector.c'),
- join_paths('views', 'gtd-list-selector-grid.c'),
- join_paths('views', 'gtd-list-selector-grid-item.c'),
- join_paths('views', 'gtd-list-selector-item.c'),
- join_paths('views', 'gtd-list-selector-list.c'),
- join_paths('views', 'gtd-list-selector-list-item.c'),
- join_paths('views', 'gtd-list-selector-panel.c'),
+sources = files(
+ 'engine/gtd-manager.c',
+ 'engine/gtd-plugin-manager.c',
+ 'interfaces/gtd-activatable.c',
+ 'interfaces/gtd-panel.c',
+ 'interfaces/gtd-provider.c',
+ 'notification/gtd-notification.c',
+ 'notification/gtd-notification-widget.c',
+ 'provider/gtd-provider-popover.c',
+ 'provider/gtd-provider-row.c',
+ 'provider/gtd-provider-selector.c',
+ 'views/gtd-list-selector.c',
+ 'views/gtd-list-selector-grid.c',
+ 'views/gtd-list-selector-grid-item.c',
+ 'views/gtd-list-selector-item.c',
+ 'views/gtd-list-selector-list.c',
+ 'views/gtd-list-selector-list-item.c',
+ 'views/gtd-list-selector-panel.c',
'gtd-application.c',
'gtd-arrow-frame.c',
'gtd-dnd-row.c',
@@ -106,14 +74,14 @@ sources = [
'gtd-timer.c',
'gtd-window.c',
'main.c'
-]
+)
data_dir = join_paths(meson.source_root(), 'data')
sources += gnome.compile_resources(
'gtd-resources',
join_paths(data_dir, 'todo.gresource.xml'),
- dependencies: plugins_files,
+ dependencies: plugins_confs,
export: true,
source_dir: [
data_dir,
@@ -126,122 +94,92 @@ enum = 'gtd-enum-types'
sources += gnome.mkenums(
enum,
- sources: 'gtd-enums.h',
- c_template: '@0@.c.template'.format(enum),
- h_template: '@0@.h.template'.format(enum),
+ sources: enum_headers,
+ c_template: enum + '.c.template',
+ h_template: enum + '.h.template',
)
-ldflags = [
- '-Wl,--export-dynamic',
- '-Wl,--undefined=gtd_plugin_eds_register_types'
+gnome_todo_incs = [
+ top_inc,
+ include_directories(
+ 'engine',
+ 'provider',
+ 'notification',
+ 'interfaces',
+ 'views'
+ )
]
-gnome_todo_libs = [
- libeds_lib
+gnome_todo_cflags = common_flags + [
+ '-DPACKAGE_LOCALE_DIR="@0@"'.format(gnome_todo_localedir),
+ '-DPACKAGE_DATA_DIR="@0@"'.format(gnome_todo_pkgdatadir),
+ '-DPACKAGE_LIB_DIR="@0@"'.format(gnome_todo_pkglibdir),
+ '-DUI_DATA_DIR="@0@"'.format(join_paths(gnome_todo_pkgdatadir, 'style'))
]
-if get_option('enable-background-plugin')
- ldflags += ['-Wl,--undefined=gtd_plugin_background_register_types']
- gnome_todo_libs += [libbackground_lib]
-endif
-
-if get_option('enable-dark-theme-plugin')
- ldflags += ['-Wl,--undefined=gtd_plugin_dark_theme_register_types']
- gnome_todo_libs += [libdarktheme_lib]
-endif
-
-if get_option('enable-scheduled-panel-plugin')
- ldflags += ['-Wl,--undefined=gtd_plugin_scheduled_panel_register_types']
- gnome_todo_libs += [libscheduledpanel_lib]
-endif
-
-if get_option('enable-today-panel-plugin')
- ldflags += ['-Wl,--undefined=gtd_plugin_today_panel_register_types']
- gnome_todo_libs += [libtodaypanel_lib]
-endif
-
-if get_option('enable-todo-txt-plugin')
- ldflags += ['-Wl,--undefined=gtd_plugin_todo_txt_register_types']
- gnome_todo_libs += [libtodotxt_lib]
-endif
-
-if get_option('enable-todoist-plugin')
- ldflags += ['-Wl,--undefined=gtd_plugin_todoist_register_types']
- gnome_todo_libs += [libtodoist_lib]
-endif
-
gnome_todo_ldflags = []
if host_machine.system().contains('linux')
- foreach ldflag: ldflags
+ foreach ldflag: plugins_ldflags
if cc.has_argument(ldflag)
gnome_todo_ldflags += ldflag
endif
endforeach
endif
-gnome_todo_cflags = common_flags + [
- '-DPACKAGE_LOCALE_DIR="@0@"'.format(gnome_todo_localedir),
- '-DPACKAGE_DATA_DIR="@0@"'.format(gnome_todo_pkgdatadir),
- '-DPACKAGE_LIB_DIR="@0@"'.format(gnome_todo_pkglibdir),
- '-DUI_DATA_DIR="@0@"'.format(join_paths(gnome_todo_pkgdatadir, 'style'))
-]
-
-gnome_todo_inc = [
- top_inc,
- include_directories(
- 'engine',
- 'provider',
- 'notification',
- 'interfaces',
- 'views'
- )
-]
-
gnome_todo = executable(
- 'gnome-todo',
- sources + headers + private_headers,
- include_directories: gnome_todo_inc,
- dependencies: gnome_todo_dep,
+ meson.project_name(),
+ sources,
+ include_directories: gnome_todo_incs,
+ dependencies: gnome_todo_deps,
c_args: gnome_todo_cflags,
- link_with: gnome_todo_libs,
+ link_with: plugins_libs,
link_args: gnome_todo_ldflags,
install: true,
install_dir: gnome_todo_bindir
)
-gtd_ldflags = [
- '-Wl,--export-dynamic'
-]
-
-libgtd_lib = shared_library(
+libgtd = shared_library(
'gtd',
- sources: sources + headers + private_headers,
- include_directories: gnome_todo_inc,
- dependencies: gnome_todo_dep,
- c_args: gnome_todo_cflags,
- link_args: gtd_ldflags
+ sources: sources,
+ version: libversion,
+ soversion: soversion,
+ include_directories: gnome_todo_incs,
+ dependencies: gnome_todo_deps,
+ c_args: gnome_todo_cflags
)
-libgtd_inc = include_directories('.')
libgtd_dep = declare_dependency(
- link_with: libgtd_lib,
- include_directories: libgtd_inc,
- dependencies: gnome_todo_dep
+ link_with: libgtd,
+ include_directories: include_directories('.'),
+ dependencies: gnome_todo_deps
+)
+
+pkg.generate(
+ libraries: libgtd,
+ version: gnome_todo_version,
+ name: 'Gnome To Do',
+ description: 'Header and path for Gnome Todo Plugins',
+ filebase: meson.project_name(),
+ subdirs: gnome_todo_pkgincludedir,
+ variables: [
+ 'exec_prefix=${prefix}'
+ ],
+ install_dir: join_paths(gnome_todo_libdir, 'pkgconfig')
)
if get_option('enable-introspection')
- gir_sources = [
- join_paths('engine', 'gtd-manager.c'),
- join_paths('engine', 'gtd-manager.h'),
- join_paths('interfaces', 'gtd-activatable.c'),
- join_paths('interfaces', 'gtd-activatable.h'),
- join_paths('interfaces', 'gtd-panel.c'),
- join_paths('interfaces', 'gtd-panel.h'),
- join_paths('interfaces', 'gtd-provider.c'),
- join_paths('interfaces', 'gtd-provider.h'),
- join_paths('notification', 'gtd-notification.c'),
- join_paths('notification', 'gtd-notification.h'),
+ gir_sources = files(
+ 'engine/gtd-manager.c',
+ 'engine/gtd-manager.h',
+ 'interfaces/gtd-activatable.c',
+ 'interfaces/gtd-activatable.h',
+ 'interfaces/gtd-panel.c',
+ 'interfaces/gtd-panel.h',
+ 'interfaces/gtd-provider.c',
+ 'interfaces/gtd-provider.h',
+ 'notification/gtd-notification.c',
+ 'notification/gtd-notification.h',
'gtd-enums.h',
'gtd-object.c',
'gtd-object.h',
@@ -256,9 +194,9 @@ if get_option('enable-introspection')
'gtd-window.c',
'gtd-window.h',
'gtd-types.h'
- ]
+ )
- gir_inc = [
+ gir_incs = [
'Gio-2.0',
'GObject-2.0',
'Gtk-3.0'
@@ -274,12 +212,12 @@ if get_option('enable-introspection')
gnome.generate_gir(
gnome_todo,
sources: gir_sources,
- namespace: gnome_todo_gir_ns,
+ namespace: gnome_todo_gir_namespace,
nsversion: gnome_todo_gir_version,
- identifier_prefix: gnome_todo_gir_ns,
- symbol_prefix: gnome_todo_gir_ns.to_lower(),
- includes: gir_inc,
- include_directories: gnome_todo_inc,
+ identifier_prefix: gnome_todo_gir_namespace,
+ symbol_prefix: gnome_todo_gir_namespace.to_lower(),
+ includes: gir_incs,
+ include_directories: gnome_todo_incs,
install: true,
install_dir_gir: gir_dir,
install_dir_typelib: typelib_dir,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]