[planner: 1/40] build: port to meson
- From: Mart Raudsepp <mraudsepp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [planner: 1/40] build: port to meson
- Date: Thu, 3 Jun 2021 16:28:54 +0000 (UTC)
commit ffd3fc94484f169a2e71061d876d6bc3b0c775b9
Author: Marty E. Plummer <hanetzer startmail com>
Date: Thu Mar 14 14:16:57 2019 -0500
build: port to meson
Signed-off-by: Marty E. Plummer <hanetzer startmail com>
data/dtd/meson.build | 7 +++
data/glade/meson.build | 19 ++++++
data/images/meson.build | 34 +++++++++++
data/meson.build | 16 +++++
data/sql/meson.build | 10 +++
data/stylesheets/meson.build | 15 +++++
data/ui/meson.build | 15 +++++
examples/meson.build | 9 +++
libplanner/meson.build | 80 ++++++++++++++++++++++++
meson.build | 56 +++++++++++++++++
meson_options.txt | 12 ++++
po/meson.build | 1 +
python/meson.build | 31 ++++++++++
src/meson.build | 141 +++++++++++++++++++++++++++++++++++++++++++
tests/meson.build | 49 +++++++++++++++
15 files changed, 495 insertions(+)
---
diff --git a/data/dtd/meson.build b/data/dtd/meson.build
new file mode 100644
index 00000000..60de83bb
--- /dev/null
+++ b/data/dtd/meson.build
@@ -0,0 +1,7 @@
+dtd_data = [
+ 'mrproject-0.5.1.dtd',
+ 'mrproject-0.6.dtd',
+]
+install_data(files(dtd_data),
+ install_dir: join_paths(get_option('datadir'), 'planner/dtd')
+)
diff --git a/data/glade/meson.build b/data/glade/meson.build
new file mode 100644
index 00000000..3669c93f
--- /dev/null
+++ b/data/glade/meson.build
@@ -0,0 +1,19 @@
+glade_data = [
+ 'add-predecessor.glade',
+ 'calendar-dialog.glade',
+ 'column-dialog.glade',
+ 'group-dialog.glade',
+ 'new-property.glade',
+ 'project-properties.glade',
+ 'property-dialog.glade',
+ 'resource-dialog.glade',
+ 'resource-input-dialog.glade',
+ 'sql.glade',
+ 'task-dialog.glade',
+ 'task-input-dialog.glade',
+ 'task-date-widget.glade',
+ 'eds.glade',
+]
+install_data(files(glade_data),
+ install_dir: join_paths(get_option('datadir'), 'planner/glade')
+)
diff --git a/data/images/meson.build b/data/images/meson.build
new file mode 100644
index 00000000..cc7d9239
--- /dev/null
+++ b/data/images/meson.build
@@ -0,0 +1,34 @@
+images_data = [
+ 'tasks.png',
+ 'gantt.png',
+ 'resources.png',
+ 'resources_usage.png',
+ '24_insert_task.png',
+ '24_remove_task.png',
+ '24_unlink_task.png',
+ '24_link_task.png',
+ '24_indent_task.png',
+ '24_unindent_task.png',
+ '24_insert_resource.png',
+ '24_remove_resource.png',
+ '24_edit_resource.png',
+ '24_groups.png',
+ '24_task_down.png',
+ '24_task_up.png',
+ 'gnome-planner.png',
+]
+install_data(files(images_data),
+ install_dir: join_paths(get_option('datadir'), 'planner/images')
+)
+
+install_data('gnome-mime-application-x-planner.png',
+ install_dir: join_paths(get_option('datadir'), 'icons/hicolor/48x48/mimetypes')
+)
+
+install_data('gnome-planner.png',
+ install_dir: join_paths(get_option('datadir'), 'icons/hicolor/48x48/apps')
+)
+
+install_data('gnome-planner.svg',
+ install_dir: join_paths(get_option('datadir'), 'icons/hicolor/scalable/apps')
+)
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 00000000..c7c327c4
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1,16 @@
+subdir('glade')
+subdir('images')
+subdir('ui')
+subdir('dtd')
+subdir('stylesheets')
+#subdir('mime')
+subdir('sql')
+install_man('planner.1')
+i18n.merge_file(
+ input: 'planner.desktop.in',
+ output: 'planner.desktop',
+ type: 'desktop',
+ po_dir: po_dir,
+ install: true,
+ install_dir: join_paths(get_option('datadir'), 'applications'),
+)
diff --git a/data/sql/meson.build b/data/sql/meson.build
new file mode 100644
index 00000000..fee13379
--- /dev/null
+++ b/data/sql/meson.build
@@ -0,0 +1,10 @@
+sql_data = [
+ 'database-0.13.sql',
+ 'database-0.11.sql',
+ 'database.sql',
+ 'upgrade-0.11-0.13.sql',
+ 'upgrade-0.6.x-0.11.sql',
+]
+install_data(files(sql_data),
+ install_dir: join_paths(get_option('datadir'), 'planner/sql')
+)
diff --git a/data/stylesheets/meson.build b/data/stylesheets/meson.build
new file mode 100644
index 00000000..44642e14
--- /dev/null
+++ b/data/stylesheets/meson.build
@@ -0,0 +1,15 @@
+stylesheets_data = [
+ 'planner2html.xsl',
+ 'html1_css.xsl',
+ 'html1_css_ie.xsl',
+ 'html1_css_ie7.xsl',
+ 'html1_gantt.xsl',
+ 'html1_resources.xsl',
+ 'html1_tasks.xsl',
+ 'planner2plannerv011.xsl',
+ 'msp2planner.xsl',
+ 'localizable.xml',
+]
+install_data(files(stylesheets_data),
+ install_dir: join_paths(get_option('datadir'), 'planner/stylesheets')
+)
diff --git a/data/ui/meson.build b/data/ui/meson.build
new file mode 100644
index 00000000..5f7360f3
--- /dev/null
+++ b/data/ui/meson.build
@@ -0,0 +1,15 @@
+ui_data = [
+ 'gantt-view.ui',
+ 'task-view.ui',
+ 'html-plugin.ui',
+ 'main-window.ui',
+ 'resource-view.ui',
+ 'sql-plugin.ui',
+ 'xml-planner-plugin.ui',
+ 'time-table-view.ui',
+ 'eds-plugin.ui',
+ 'msp-plugin.ui',
+]
+install_data(files(ui_data),
+ install_dir: join_paths(get_option('datadir'), 'planner/ui')
+)
diff --git a/examples/meson.build b/examples/meson.build
new file mode 100644
index 00000000..d2d1fe72
--- /dev/null
+++ b/examples/meson.build
@@ -0,0 +1,9 @@
+examples_data = [
+ 'sample-1.planner',
+ 'kitchen.planner',
+]
+if get_option('examples')
+ install_data(files(examples_data),
+ install_dir: join_paths(get_option('datadir'), 'doc/planner'),
+ )
+endif
diff --git a/libplanner/meson.build b/libplanner/meson.build
new file mode 100644
index 00000000..6df5a741
--- /dev/null
+++ b/libplanner/meson.build
@@ -0,0 +1,80 @@
+libplanner_srcs = [
+ 'mrp-application.c',
+ 'mrp-assignment.c',
+ 'mrp-calendar.c',
+ 'mrp-day.c',
+ 'mrp-error.c',
+ 'mrp-file-module.c',
+ 'mrp-group.c',
+ 'mrp-object.c',
+ 'mrp-paths-gnome.c',
+ 'mrp-project.c',
+ 'mrp-property.c',
+ 'mrp-relation.c',
+ 'mrp-resource.c',
+ 'mrp-storage-module-factory.c',
+ 'mrp-storage-module.c',
+ 'mrp-task-manager.c',
+ 'mrp-task.c',
+ 'mrp-time.c',
+ 'mrp-types.c',
+]
+libplanner_inc = include_directories('.')
+mrp_marshal_srcs = gnome.genmarshal('mrp-marshal',
+ sources: 'mrp-marshal.list',
+ prefix: 'mrp_marshal'
+)
+libplanner_library = shared_library('planner-1',
+ [libplanner_srcs, mrp_marshal_srcs],
+ dependencies: [libplanner_deps],
+ include_directories: [toplevel_inc, libplanner_inc],
+ install: true,
+ soversion: '0',
+ version: '0.0.0',
+)
+
+libplanner_dep = declare_dependency(
+ link_with: libplanner_library,
+ include_directories: [libplanner_inc],
+ dependencies: [libplanner_deps],
+)
+libstorage_mrproject_srcs = [
+ 'mrp-storage-mrproject.c',
+ 'mrp-parser.c',
+]
+libstorage_mrproject_module = shared_module('storage-mrproject-1', [libstorage_mrproject_srcs],
+ dependencies: [libplanner_dep],
+ include_directories: [toplevel_inc],
+ install: true,
+ install_dir: join_paths(get_option('libdir'), 'planner/storage-modules'),
+)
+
+if gda_dep.found()
+ libstorage_sql_srcs = [ 'mrp-storage-sql.c', 'mrp-sql.c']
+ libstorage_sql_module = shared_module('storage-sql', [libstorage_sql_srcs],
+ dependencies: [libplanner_dep, gda_dep],
+ include_directories: [toplevel_inc],
+ install: true,
+ install_dir: join_paths(get_option('libdir'), 'planner/storage-modules'),
+ )
+endif
+
+libmrp_xml_srcs = [
+ 'mrp-xml.c',
+ 'mrp-old-xml.c',
+]
+libmrp_xml_module = shared_module('mrp-xml', [libmrp_xml_srcs],
+ dependencies: [libplanner_dep],
+ include_directories: [toplevel_inc],
+ install: true,
+ install_dir: join_paths(get_option('libdir'), 'planner/file-modules'),
+)
+libmrp_xsl_srcs = [
+ 'mrp-xsl.c',
+]
+libmrp_xsl_module = shared_module('mrp-xsl', [libmrp_xsl_srcs],
+ dependencies: [libplanner_dep],
+ include_directories: [toplevel_inc],
+ install: true,
+ install_dir: join_paths(get_option('libdir'), 'planner/file-modules'),
+)
diff --git a/meson.build b/meson.build
new file mode 100644
index 00000000..dc319999
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,56 @@
+project('planner',
+ 'c',
+ version: '0.14.6',
+ license: 'GPL-2',
+ meson_version: '>= 0.48.0',
+)
+
+cc = meson.get_compiler('c')
+pygobject_codegen = find_program('pygobject-codegen-2.0')
+
+i18n = import('i18n')
+gnome = import('gnome')
+pymod = import('python')
+
+po_dir = join_paths(meson.source_root(), 'po')
+
+conf_data = configuration_data()
+conf_data.set('GETTEXT_PACKAGE', '"@0@"'.format(meson.project_name()))
+conf_data.set('VERSION', '"@0@"'.format(meson.project_version()))
+conf_data.set('GNOMELOCALEDIR', '"@0"'.format(join_paths(get_option('prefix'),get_option('localedir'))))
+conf_data.set('PLUGINDIR', '"@0@"'.format(join_paths(get_option('prefix'),get_option('libdir'),
'planner/plugins')))
+conf_data.set('STORAGEMODULEDIR', '"@0@"'.format(join_paths(get_option('prefix'),get_option('libdir'),
'planner/storage-modules')))
+conf_data.set('FILEMODULESDIR', '"@0@"'.format(join_paths(get_option('prefix'),get_option('libdir'),
'planner/file-modules')))
+conf_data.set('DATADIR', '"@0@"'.format(join_paths(get_option('prefix'),get_option('datadir'), 'planner')))
+configure_file(
+ output: 'config.h',
+ configuration: conf_data,
+)
+toplevel_inc = include_directories('.')
+
+m_dep = cc.find_library('m', required: false)
+gconf_dep = dependency('gconf-2.0', version: '>= 2.10.0')
+gda_dep = dependency('libgda-3.0', version: '>= 1.0', required: get_option('database-gda'))
+glade_dep = dependency('libglade-2.0', version: '>= 2.3.0')
+glib_dep = dependency('glib-2.0', version: '>= 2.38.0')
+gmodule_dep = dependency('gmodule-2.0')
+gnomecanvas_dep = dependency('libgnomecanvas-2.0', version: '>=2.10.0')
+gobject_dep = dependency('gobject-2.0')
+gtk_dep = dependency('gtk+-2.0', version: '>= 2.24.0')
+libxml_dep = dependency('libxml-2.0', version: '>= 2.6.27')
+pygobject_dep = dependency('pygobject-2.0')
+pygtk_dep = dependency('pygtk-2.0', version: '>= 2.6.0', required: get_option('python'))
+pygtk_defsdir = pygtk_dep.get_pkgconfig_variable('defsdir')
+python = pymod.find_installation('python2', required: get_option('python'))
+python_dep = python.dependency()
+libplanner_deps = [glib_dep, gmodule_dep, gobject_dep, libxml_dep, m_dep,]
+planner_deps = [glib_dep, gobject_dep, gmodule_dep, gtk_dep, gnomecanvas_dep, glade_dep, gconf_dep]
+subdir('po')
+subdir('libplanner')
+subdir('src')
+subdir('data')
+subdir('examples')
+subdir('tests')
+if python_dep.found() and pygobject_codegen.found()
+ subdir('python')
+endif
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 00000000..b56fc7a9
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,12 @@
+option('database-gda',
+ type: 'feature',
+ value: 'auto',
+)
+option('python',
+ type: 'feature',
+ value: 'auto',
+)
+option('examples',
+ type: 'boolean',
+ value: false,
+)
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 00000000..c6dddc87
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1 @@
+i18n.gettext(meson.project_name())
diff --git a/python/meson.build b/python/meson.build
new file mode 100644
index 00000000..e1b24a52
--- /dev/null
+++ b/python/meson.build
@@ -0,0 +1,31 @@
+#pygobject-codegen --override plannerui.override --load-types plannerui-arg-types.py --register
$(PYGTK_DEFSDIR)/gtk-types.def --prefix plannerui plannerui.defs > gen-plannerui.c
+
+pygobject_gen = generator(pygobject_codegen,
+ capture: true,
+ output: '@BASENAME@.c',
+ arguments: [
+ '--override', '@0@/@BASENAME@.override'.format(meson.current_source_dir()),
+ '--load-types', '@0@/planner-arg-types.py'.format(meson.current_source_dir()),
+ '--register', '@0@/gtk-types.defs'.format(pygtk_defsdir),
+ '--prefix', '@BASENAME@',
+ '@INPUT@',
+ ]
+)
+
+plannerui_gen = pygobject_gen.process('plannerui.defs')
+plannerui_module = python.extension_module('plannerui', ['planneruimodule.c', plannerui_gen],
+ dependencies: [ pygobject_dep, python_dep, libplanner_dep, planner_deps],
+ link_args: [ '-export-symbols-regex initplannerui'],
+ include_directories: [toplevel_inc, planner_inc],
+ install: true,
+ install_dir: python.get_install_dir()
+)
+
+planner_gen = pygobject_gen.process('planner.defs')
+planner_module = python.extension_module('planner', ['plannermodule.c', planner_gen],
+ dependencies: [ pygobject_dep, python_dep, libplanner_dep, planner_deps],
+ link_args: [ '-export-symbols-regex initplanner'],
+ include_directories: [toplevel_inc, planner_inc],
+ install: true,
+ install_dir: python.get_install_dir()
+)
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 00000000..d9dd2e30
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,141 @@
+libplanner_app_srcs = [
+ 'eel-canvas-rect.c',
+ 'dummy-canvas-item.c',
+ 'planner-application.c',
+ 'planner-assignment-model.c',
+ 'planner-conf-gconf.c',
+ 'planner-calendar.c',
+ 'planner-calendar-dialog.c',
+ 'planner-calendar-selector.c',
+ 'planner-canvas-line.c',
+ 'planner-cell-renderer-date.c',
+ 'planner-cell-renderer-list.c',
+ 'planner-cell-renderer-popup.c',
+ 'planner-cmd-manager.c',
+ 'planner-column-dialog.c',
+ 'planner-day-type-dialog.c',
+ 'planner-default-week-dialog.c',
+ 'planner-format.c',
+ 'planner-group-dialog.c',
+ 'planner-group-model.c',
+ 'planner-list-model.c',
+ 'planner-phase-dialog.c',
+ 'planner-plugin.c',
+ 'planner-plugin-loader.c',
+ 'planner-popup-button.c',
+ 'planner-popup-entry.c',
+ 'planner-predecessor-model.c',
+ 'planner-print-dialog.c',
+ 'planner-print-job.c',
+ 'planner-project-properties.c',
+ 'planner-property-dialog.c',
+ 'planner-property-model.c',
+ 'planner-resource-cmd.c',
+ 'planner-resource-dialog.c',
+ 'planner-resource-input-dialog.c',
+ 'planner-scale-utils.c',
+ 'planner-sidebar.c',
+ 'planner-table-print-sheet.c',
+ 'planner-task-cmd.c',
+ 'planner-task-date-widget.c',
+ 'planner-task-dialog.c',
+ 'planner-task-input-dialog.c',
+ 'planner-util.c',
+ 'planner-view.c',
+ 'planner-window.c',
+ 'planner-working-time-dialog.c',
+]
+
+gantt_task_srcs = [
+ 'planner-gantt-background.c',
+ 'planner-gantt-header.c',
+ 'planner-gantt-model.c',
+ 'planner-task-tree.c',
+ 'planner-task-popup.c',
+ 'planner-relation-arrow.c',
+ 'planner-gantt-chart.c',
+ 'planner-gantt-print.c',
+ 'planner-gantt-row.c',
+ 'planner-gantt-view.c',
+ 'planner-task-view.c',
+]
+
+resource_srcs = [
+ 'planner-resource-view.c',
+]
+
+usage_srcs = [
+ 'planner-usage-view.c',
+ 'planner-usage-chart.c',
+ 'planner-usage-model.c',
+ 'planner-usage-row.c',
+ 'planner-usage-tree.c',
+]
+planner_marshal_srcs = gnome.genmarshal('planner-marshal',
+ sources: 'planner-marshal.list',
+ prefix: 'planner_marshal',
+)
+planner_inc = include_directories('.')
+
+libplanner_app_library = static_library('libplannerapp',
+ [libplanner_app_srcs, gantt_task_srcs, resource_srcs, usage_srcs, planner_marshal_srcs],
+ dependencies: [planner_deps],
+ include_directories: [toplevel_inc, planner_inc],
+ install: false,
+)
+libplanner_app_dep = declare_dependency(
+ link_with: libplanner_app_library,
+ include_directories: planner_inc,
+ dependencies: [planner_deps, libplanner_dep],
+)
+planner_app = executable('planner',
+ ['planner-main.c'],
+ dependencies: [libplanner_app_dep, planner_deps, libplanner_dep],
+ export_dynamic: true,
+ include_directories: [toplevel_inc],
+ install: true,
+)
+
+if gda_dep.found()
+ libsql_plugin_srcs = [ 'planner-sql-plugin.c' ]
+ libsql_plugin_module = shared_module('sql-plugin', [libsql_plugin_srcs],
+ dependencies: [gda_dep],
+ )
+endif
+
+if pygtk_dep.found() and python_dep.found()
+ libpython_plugin_srcs = [ 'planner-python-plugin.c' ]
+ libpython_plugin_module = shared_module('python-plugin', [libpython_plugin_srcs],
+ dependencies: [pygtk_dep, python_dep],
+ include_directories: [toplevel_inc],
+ install: true,
+ install_dir: join_paths(get_option('libdir'), 'planner/plugins'),
+ )
+endif
+
+libhtml_plugin_srcs = [ 'planner-html-plugin.c' ]
+libhtml_plugin_module = shared_module('html-plugin',
+ [libhtml_plugin_srcs],
+ dependencies: [planner_deps],
+ include_directories: [toplevel_inc],
+ install: true,
+ install_dir: join_paths(get_option('libdir'), 'planner/plugins'),
+)
+
+libxmlplanner_plugin_srcs = [ 'planner-xml-planner-plugin.c' ]
+libxmlplanner_plugin_module = shared_module('xmlplanner-plugin',
+ [libxmlplanner_plugin_srcs],
+ dependencies: [planner_deps],
+ include_directories: [toplevel_inc],
+ install: true,
+ install_dir: join_paths(get_option('libdir'), 'planner/plugins'),
+)
+
+libmsp_plugin_srcs = [ 'planner-msp-plugin.c' ]
+libmsp_plugin_module = shared_module('msp-plugin',
+ [libmsp_plugin_srcs],
+ dependencies: [planner_deps],
+ include_directories: [toplevel_inc],
+ install: true,
+ install_dir: join_paths(get_option('libdir'), 'planner/plugins'),
+)
diff --git a/tests/meson.build b/tests/meson.build
new file mode 100644
index 00000000..8dbf1e6d
--- /dev/null
+++ b/tests/meson.build
@@ -0,0 +1,49 @@
+libselfcheck_srcs = [ 'self-check.c' ]
+#test_inc = include_directories('.')
+libselfcheck_library = static_library('selfcheck',
+ [libselfcheck_srcs],
+ dependencies: [libplanner_app_dep, libplanner_dep],
+ include_directories: [toplevel_inc],
+ install: false,
+)
+libselfcheck_dep = declare_dependency(
+ link_with: libselfcheck_library,
+ dependencies: [libplanner_app_dep, libplanner_dep],
+ include_directories: [toplevel_inc],
+)
+
+test_env = [
+ 'PLANNER_STORAGEMODULEDIR=@0@/libplanner'.format(meson.build_root()),
+ 'PLANNER_FILEMODULESDIR=@0@/libplanner'.format(meson.build_root()),
+ 'PLANNER_PLUGINDIR=@0@/src'.format(meson.build_root()),
+ 'PLANNER_DATADIR=@0@/data'.format(meson.source_root()),
+]
+scheduler_test = executable('scheduler-test', 'scheduler-test.c',
+ c_args: [
+ '-DG_LOG_DOMAIN="Planner"',
+ '-DEXAMPLESDIR="@0@/tests/files"'.format(meson.source_root()),
+ ],
+ dependencies: [libselfcheck_dep],
+ include_directories: [toplevel_inc],
+)
+test('scheduler-test', scheduler_test, env: test_env)
+
+time_test = executable('time-test', 'time-test.c',
+ dependencies: [libselfcheck_dep],
+)
+test('time-test', time_test, env: test_env)
+
+calendar_test = executable('calendar-test', 'calendar-test.c',
+ dependencies: [libselfcheck_dep],
+)
+test('calendar-test', calendar_test, env: test_env)
+
+task_test = executable('task-test', 'task-test.c',
+ dependencies: [libselfcheck_dep],
+)
+test('task-test', task_test, env: test_env)
+
+cmd_manager_test = executable('cmd-manager-test', 'cmd-manager-test.c',
+ dependencies: [libselfcheck_dep],
+)
+test('cmd-manager-test', cmd_manager_test, env: test_env)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]