[eog-plugins/wip/port-to-meson: 1/4] build: Port to Meson




commit 5faaf28018629778488b37213a433de8ecc9e8d2
Author: Felix Riemann <friemann gnome org>
Date:   Wed Jan 12 22:56:09 2022 +0100

    build: Port to Meson
    
    Heavily based on gedit-plugin's port to Meson.

 meson.build                          | 143 +++++++++++++++++++++++++++++++++++
 meson_options.txt                    |  12 +++
 plugins/exif-display/meson.build     |  72 ++++++++++++++++++
 plugins/export-to-folder/meson.build |  58 ++++++++++++++
 plugins/fit-to-width/meson.build     |  54 +++++++++++++
 plugins/fullscreenbg/meson.build     |  58 ++++++++++++++
 plugins/light-theme/meson.build      |  54 +++++++++++++
 plugins/map/meson.build              |  60 +++++++++++++++
 plugins/maximize-windows/meson.build |  45 +++++++++++
 plugins/meson.build                  |   3 +
 plugins/postasa/meson.build          |  72 ++++++++++++++++++
 plugins/pythonconsole/meson.build    |  60 +++++++++++++++
 plugins/send-by-mail/meson.build     |  55 ++++++++++++++
 plugins/slideshowshuffle/meson.build |  45 +++++++++++
 po/meson.build                       |   3 +
 15 files changed, 794 insertions(+)
---
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..34716b4
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,143 @@
+project(
+  'eog-plugins', 'c', # vala is added below if needed, with add_languages().
+  version: '42.alpha',
+  license: 'GPL2+',
+  default_options: 'buildtype=debugoptimized',
+  meson_version: '>= 0.51'
+)
+
+gnome = import('gnome')
+i18n = import('i18n')
+pkg = import('pkgconfig')
+python = import('python')
+
+# Paths
+root_include_dir = include_directories('.')
+
+src_root = meson.current_source_dir()
+po_dir = src_root / 'po'
+
+libdir = get_option('prefix') / get_option('libdir')
+datadir = get_option('prefix') / get_option('datadir')
+
+pkglibdir = libdir / 'eog'
+pkgdatadir = datadir / 'eog'
+
+pluginlibdir = pkglibdir / 'plugins'
+plugindatadir = pkgdatadir / 'plugins'
+
+appstreamdir = datadir / 'metainfo'
+glibdir = datadir / 'glib-2.0'
+localedir = datadir / 'locale'
+
+gio_dep = dependency('gio-2.0', version: '>= 2.53.4')
+gio_schemasdir = gio_dep.get_variable(
+  'schemasdir',
+  pkgconfig_define: ['datadir', datadir],
+  default_value: glibdir / 'schemas',
+)
+
+# Dependencies in common for all plugins
+libpeas_dep = dependency('libpeas-1.0', version: '>= 1.14.1')
+libpeasgtk_dep = dependency('libpeas-gtk-1.0', version: '>= 1.14.1')
+
+eog_dep = dependency('eog', version: '>= 41.0')
+
+appstream_util = find_program('appstream-util', required: false)
+
+source_root = meson.current_source_dir()
+cc = meson.get_compiler('c')
+common_flags = ['-DHAVE_CONFIG_H']
+compiler_flags = []
+if get_option('buildtype').contains('debug')
+  compiler_flags += cc.get_supported_arguments([
+    '-Werror=format=2',
+    '-Werror=implicit-function-declaration',
+    '-Werror=init-self',
+    '-Werror=missing-include-dirs',
+    '-Werror=missing-prototypes',
+    '-Werror=pointer-arith',
+    '-Werror=return-type',
+    '-Wnested-externs',
+    '-Wstrict-prototypes',
+  ])
+endif
+add_project_arguments(common_flags + compiler_flags, language: 'c')
+
+# config.h
+config_h = configuration_data()
+config_h.set_quoted('GETTEXT_PACKAGE', meson.project_name())
+
+# Options
+enabled_plugins = []
+disabled_plugins = []
+extra_languages = []
+all_plugins = {
+  'exif-display': {'language': 'c'},
+  'export-to-folder': {'language': 'python'},
+  'fit-to-width': {'language': 'c'},
+  'fullscreenbg': {'language': 'python'},
+  'light-theme': {'language': 'c'},
+  'map': {'language': 'c'},
+  'maximize-windows': {'language': 'c'},
+  'postasa': {'language': 'c'},
+  'postr': {'language': 'c'},
+  'pythonconsole': {'language': 'python'},
+  'send-by-mail': {'language': 'c'},
+  'slideshowshuffle': {'language': 'python'},
+}
+
+foreach plugin_name, plugin_metadata : all_plugins
+  if get_option('plugin_@0@'.format(plugin_name))
+    enabled_plugins += plugin_name
+
+    plugin_language = plugin_metadata.get('language')
+    if plugin_language != 'c'
+      extra_languages += plugin_language
+    endif
+  else
+    disabled_plugins += plugin_name
+  endif
+endforeach
+
+if 'python' in extra_languages
+  python3 = python.find_installation('python3')
+endif
+
+subdir('po')
+libexif_dep = dependency('libexif', version: '>= 0.6.16', required: false)
+subdir('plugins')
+
+configure_file(
+  output: 'config.h',
+  configuration: config_h
+)
+
+# Summary message
+
+summary = [
+  'Configuration:',
+  '',
+  '        eog-plugins version @0@'.format(meson.project_version()),
+  '',
+  '        Prefix: @0@'.format(get_option('prefix')),
+  '',
+  '        Enabled plugins:'
+]
+
+foreach plugin_name : enabled_plugins
+  summary += '                ' + plugin_name
+endforeach
+
+summary += [
+  '',
+  '        Disabled plugins:'
+]
+
+foreach plugin_name : disabled_plugins
+  summary += '                ' + plugin_name
+endforeach
+
+summary += ''
+
+message('\n'.join(summary))
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..fd384bf
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,12 @@
+option('plugin_exif-display', type: 'boolean')
+option('plugin_export-to-folder', type: 'boolean')
+option('plugin_fit-to-width', type: 'boolean')
+option('plugin_fullscreenbg', type: 'boolean')
+option('plugin_light-theme', type: 'boolean')
+option('plugin_map', type: 'boolean')
+option('plugin_maximize-windows', type: 'boolean')
+option('plugin_postasa', type: 'boolean')
+option('plugin_postr', type: 'boolean', value: false)
+option('plugin_pythonconsole', type: 'boolean')
+option('plugin_send-by-mail', type: 'boolean')
+option('plugin_slideshowshuffle', type: 'boolean')
diff --git a/plugins/exif-display/meson.build b/plugins/exif-display/meson.build
new file mode 100644
index 0000000..cf36536
--- /dev/null
+++ b/plugins/exif-display/meson.build
@@ -0,0 +1,72 @@
+exifdisplay_sources = files(
+  'eog-exif-display-plugin.c',
+  'eog-exif-display-plugin-setup.c',
+)
+
+exifdisplay_res = gnome.compile_resources(
+  'eog-exif-display-resources',
+  'eog-exif-display-plugin.gresource.xml',
+)
+
+exifdisplay_sources += [ exifdisplay_res.get(0) ]
+
+exifdisplay_deps = [
+  eog_dep,
+  libexif_dep,
+  libpeas_dep,
+  libpeasgtk_dep,
+]
+
+exifdisplay_sha = shared_module(
+  'exif-display',
+  sources: exifdisplay_sources,
+  include_directories: root_include_dir,
+  dependencies: exifdisplay_deps,
+  install: true,
+  install_dir: pluginlibdir,
+)
+
+# FIXME: Remove `args` parameter when gettext acquires plugin support.
+#        http://lists.gnu.org/archive/html/bug-gettext/2017-06/msg00001.html
+# NOTE:  We need to keep the .desktop suffix on the source file to be able
+#        to extract translatable strings. .plugin is not recognized.
+i18n.merge_file(
+  input: 'exif-display.plugin.desktop.in',
+  output: 'exif-display.plugin',
+  po_dir: po_dir,
+  type: 'desktop',
+  args: ['--keyword=Name', '--keyword=Description'],
+  install: true,
+  install_dir: pluginlibdir,
+)
+
+configure_file(
+  input: 'org.gnome.eog.plugins.exif-display.gschema.xml.in',
+  output: '@BASENAME@',
+  configuration: {'GETTEXT_PACKAGE': 'eog-plugins'},
+  install: true,
+  install_dir: gio_schemasdir,
+)
+
+exifdisplay_appdata = i18n.merge_file(
+  'eog-exif-display.appdata.xml',
+  input: 'eog-exif-display.appdata.xml.in',
+  output: '@BASENAME@',
+  po_dir: src_root / 'po',
+  type: 'xml',
+  install: true,
+  install_dir: appstreamdir,
+)
+
+if appstream_util.found()
+  test(
+    'validate-eog-exif-display.appdata.xml',
+    appstream_util,
+    args: [
+      'validate',
+      '--nonet',
+      exifdisplay_appdata.full_path(),
+    ]
+  )
+endif
+
diff --git a/plugins/export-to-folder/meson.build b/plugins/export-to-folder/meson.build
new file mode 100644
index 0000000..19decc0
--- /dev/null
+++ b/plugins/export-to-folder/meson.build
@@ -0,0 +1,58 @@
+exporttofolder_sources = files(
+  'export-to-folder.py',
+)
+
+install_data(
+  exporttofolder_sources,
+  install_dir: pluginlibdir,
+)
+
+install_data(
+  files('preferences_dialog.ui'),
+  install_dir: plugindatadir / 'export-to-folder'
+)
+
+# FIXME: Remove `args` parameter when gettext acquires plugin support.
+#        http://lists.gnu.org/archive/html/bug-gettext/2017-06/msg00001.html
+# NOTE:  We need to keep the .desktop suffix on the source file to be able
+#        to extract translatable strings. .plugin is not recognized.
+i18n.merge_file(
+  input: 'export-to-folder.plugin.desktop.in',
+  output: 'export-to-folder.plugin',
+  po_dir: po_dir,
+  type: 'desktop',
+  args: ['--keyword=Name', '--keyword=Description'],
+  install: true,
+  install_dir: pluginlibdir,
+)
+
+configure_file(
+  input: 'org.gnome.eog.plugins.export-to-folder.gschema.xml.in',
+  output: '@BASENAME@',
+  configuration: {'GETTEXT_PACKAGE': 'eog-plugins'},
+  install: true,
+  install_dir: gio_schemasdir,
+)
+
+exporttofolder_appdata = i18n.merge_file(
+  'eog-export-to-folder.appdata.xml',
+  input: 'eog-export-to-folder.appdata.xml.in',
+  output: '@BASENAME@',
+  po_dir: src_root / 'po',
+  type: 'xml',
+  install: true,
+  install_dir: appstreamdir,
+)
+
+if appstream_util.found()
+  test(
+    'validate-eog-export-to-folder.appdata.xml',
+    appstream_util,
+    args: [
+      'validate',
+      '--nonet',
+      exporttofolder_appdata.full_path(),
+    ]
+  )
+endif
+
diff --git a/plugins/fit-to-width/meson.build b/plugins/fit-to-width/meson.build
new file mode 100644
index 0000000..703050e
--- /dev/null
+++ b/plugins/fit-to-width/meson.build
@@ -0,0 +1,54 @@
+fittowidth_sources = files(
+  'eog-fit-to-width-plugin.c',
+)
+
+fittowidth_deps = [
+  eog_dep,
+  libpeas_dep,
+]
+
+fittowidth_plugin = shared_module(
+  'fit-to-width',
+  sources: fittowidth_sources,
+  include_directories: root_include_dir,
+  dependencies: fittowidth_deps,
+  install: true,
+  install_dir: pluginlibdir,
+)
+
+# FIXME: Remove `args` parameter when gettext acquires plugin support.
+#        http://lists.gnu.org/archive/html/bug-gettext/2017-06/msg00001.html
+# NOTE:  We need to keep the .desktop suffix on the source file to be able
+#        to extract translatable strings. .plugin is not recognized.
+i18n.merge_file(
+  input: 'fit-to-width.plugin.desktop.in',
+  output: 'fit-to-width.plugin',
+  po_dir: po_dir,
+  type: 'desktop',
+  args: ['--keyword=Name', '--keyword=Description'],
+  install: true,
+  install_dir: pluginlibdir,
+)
+
+fittowidth_appdata = i18n.merge_file(
+  'eog-fit-to-width.appdata.xml',
+  input: 'eog-fit-to-width.appdata.xml.in',
+  output: '@BASENAME@',
+  po_dir: src_root / 'po',
+  type: 'xml',
+  install: true,
+  install_dir: appstreamdir,
+)
+
+if appstream_util.found()
+  test(
+    'validate-eog-fit-to-width.appdata.xml',
+    appstream_util,
+    args: [
+      'validate',
+      '--nonet',
+      exifdisplay_appdata.full_path(),
+    ]
+  )
+endif
+
diff --git a/plugins/fullscreenbg/meson.build b/plugins/fullscreenbg/meson.build
new file mode 100644
index 0000000..648598e
--- /dev/null
+++ b/plugins/fullscreenbg/meson.build
@@ -0,0 +1,58 @@
+fullscreenbg_sources = files(
+  'fullscreenbg.py',
+)
+
+install_data(
+  fullscreenbg_sources,
+  install_dir: pluginlibdir,
+)
+
+install_data(
+  files('preferences_dialog.ui'),
+  install_dir: plugindatadir / 'fullscreenbg'
+)
+
+# FIXME: Remove `args` parameter when gettext acquires plugin support.
+#        http://lists.gnu.org/archive/html/bug-gettext/2017-06/msg00001.html
+# NOTE:  We need to keep the .desktop suffix on the source file to be able
+#        to extract translatable strings. .plugin is not recognized.
+i18n.merge_file(
+  input: 'fullscreenbg.plugin.desktop.in',
+  output: 'fullscreenbg.plugin',
+  po_dir: po_dir,
+  type: 'desktop',
+  args: ['--keyword=Name', '--keyword=Description'],
+  install: true,
+  install_dir: pluginlibdir,
+)
+
+configure_file(
+  input: 'org.gnome.eog.plugins.fullscreenbg.gschema.xml.in',
+  output: '@BASENAME@',
+  configuration: {'GETTEXT_PACKAGE': 'eog-plugins'},
+  install: true,
+  install_dir: gio_schemasdir,
+)
+
+fullscreenbg_appdata = i18n.merge_file(
+  'eog-fullscreenbg.appdata.xml',
+  input: 'eog-fullscreenbg.appdata.xml.in',
+  output: '@BASENAME@',
+  po_dir: src_root / 'po',
+  type: 'xml',
+  install: true,
+  install_dir: appstreamdir,
+)
+
+if appstream_util.found()
+  test(
+    'validate-eog-fullscreenbg.appdata.xml',
+    appstream_util,
+    args: [
+      'validate',
+      '--nonet',
+      fullscreenbg_appdata.full_path(),
+    ]
+  )
+endif
+
diff --git a/plugins/light-theme/meson.build b/plugins/light-theme/meson.build
new file mode 100644
index 0000000..b56b0f3
--- /dev/null
+++ b/plugins/light-theme/meson.build
@@ -0,0 +1,54 @@
+lighttheme_sources = files(
+  'eog-light-theme-plugin.c',
+)
+
+lighttheme_deps = [
+  eog_dep,
+  libpeas_dep,
+]
+
+lighttheme_plugin = shared_module(
+  'light-theme',
+  sources: lighttheme_sources,
+  include_directories: root_include_dir,
+  dependencies: lighttheme_deps,
+  install: true,
+  install_dir: pluginlibdir,
+)
+
+# FIXME: Remove `args` parameter when gettext acquires plugin support.
+#        http://lists.gnu.org/archive/html/bug-gettext/2017-06/msg00001.html
+# NOTE:  We need to keep the .desktop suffix on the source file to be able
+#        to extract translatable strings. .plugin is not recognized.
+i18n.merge_file(
+  input: 'light-theme.plugin.desktop.in',
+  output: 'light-theme.plugin.desktop',
+  po_dir: po_dir,
+  type: 'desktop',
+  args: ['--keyword=Name', '--keyword=Description'],
+  install: true,
+  install_dir: pluginlibdir,
+)
+
+lighttheme_appdata = i18n.merge_file(
+  'eog-light-theme.appdata.xml',
+  input: 'eog-light-theme.appdata.xml.in',
+  output: '@BASENAME@',
+  po_dir: src_root / 'po',
+  type: 'xml',
+  install: true,
+  install_dir: appstreamdir,
+)
+
+if appstream_util.found()
+  test(
+    'validate-eog-light-theme.appdata.xml',
+    appstream_util,
+    args: [
+      'validate',
+      '--nonet',
+      exifdisplay_appdata.full_path(),
+    ]
+  )
+endif
+
diff --git a/plugins/map/meson.build b/plugins/map/meson.build
new file mode 100644
index 0000000..eafedce
--- /dev/null
+++ b/plugins/map/meson.build
@@ -0,0 +1,60 @@
+map_sources = files(
+  'eog-map-plugin.c',
+)
+
+map_deps = [
+  eog_dep,
+  libexif_dep,
+  libpeas_dep,
+  libpeasgtk_dep,
+  dependency('champlain-0.12', version: '>= 0.9.0'),
+  dependency('champlain-gtk-0.12', version: '>= 0.9.0'),
+  dependency('clutter-1.0', version: '>= 1.9.4'),
+  dependency('clutter-gtk-1.0', version: '>= 1.1.2'),
+]
+
+map_plugin = shared_module(
+  'map',
+  sources: map_sources,
+  include_directories: root_include_dir,
+  dependencies: map_deps,
+  install: true,
+  install_dir: pluginlibdir,
+)
+
+# FIXME: Remove `args` parameter when gettext acquires plugin support.
+#        http://lists.gnu.org/archive/html/bug-gettext/2017-06/msg00001.html
+# NOTE:  We need to keep the .desktop suffix on the source file to be able
+#        to extract translatable strings. .plugin is not recognized.
+i18n.merge_file(
+  input: 'map.plugin.desktop.in',
+  output: 'map.plugin',
+  po_dir: po_dir,
+  type: 'desktop',
+  args: ['--keyword=Name', '--keyword=Description'],
+  install: true,
+  install_dir: pluginlibdir,
+)
+
+exifdisplay_appdata = i18n.merge_file(
+  'eog-map.appdata.xml',
+  input: 'eog-map.appdata.xml.in',
+  output: '@BASENAME@',
+  po_dir: src_root / 'po',
+  type: 'xml',
+  install: true,
+  install_dir: appstreamdir,
+)
+
+if appstream_util.found()
+  test(
+    'validate-eog-map.appdata.xml.in',
+    appstream_util,
+    args: [
+      'validate',
+      '--nonet',
+      exifdisplay_appdata.full_path(),
+    ]
+  )
+endif
+
diff --git a/plugins/maximize-windows/meson.build b/plugins/maximize-windows/meson.build
new file mode 100644
index 0000000..c3683b6
--- /dev/null
+++ b/plugins/maximize-windows/meson.build
@@ -0,0 +1,45 @@
+maximizewindows_sources = files(
+  'maximize-windows.py',
+)
+
+install_data(
+  maximizewindows_sources,
+  install_dir: pluginlibdir,
+)
+
+# FIXME: Remove `args` parameter when gettext acquires plugin support.
+#        http://lists.gnu.org/archive/html/bug-gettext/2017-06/msg00001.html
+# NOTE:  We need to keep the .desktop suffix on the source file to be able
+#        to extract translatable strings. .plugin is not recognized.
+i18n.merge_file(
+  input: 'maximize-windows.plugin.desktop.in',
+  output: 'maximize-windows.plugin',
+  po_dir: po_dir,
+  type: 'desktop',
+  args: ['--keyword=Name', '--keyword=Description'],
+  install: true,
+  install_dir: pluginlibdir,
+)
+
+maximizewindows_appdata = i18n.merge_file(
+  'eog-maximize-windows.appdata.xml',
+  input: 'eog-maximize-windows.appdata.xml.in',
+  output: '@BASENAME@',
+  po_dir: src_root / 'po',
+  type: 'xml',
+  install: true,
+  install_dir: appstreamdir,
+)
+
+if appstream_util.found()
+  test(
+    'validate-eog-maximize-windows.appdata.xml',
+    appstream_util,
+    args: [
+      'validate',
+      '--nonet',
+      maximizewindows_appdata.full_path(),
+    ]
+  )
+endif
+
diff --git a/plugins/meson.build b/plugins/meson.build
new file mode 100644
index 0000000..f195cbb
--- /dev/null
+++ b/plugins/meson.build
@@ -0,0 +1,3 @@
+foreach plugin_name : enabled_plugins
+  subdir(plugin_name)
+endforeach
diff --git a/plugins/postasa/meson.build b/plugins/postasa/meson.build
new file mode 100644
index 0000000..1481dd3
--- /dev/null
+++ b/plugins/postasa/meson.build
@@ -0,0 +1,72 @@
+postasa_sources = files(
+  'eog-postasa-plugin.c',
+)
+
+postasa_res = gnome.compile_resources(
+  'eog-postasa-resources',
+  'eog-postasa-plugin.gresource.xml',
+)
+
+postasa_sources += [ postasa_res.get(0) ]
+libgdata_dep = dependency('libgdata', version: '>= 0.6.0')
+
+postasa_deps = [
+  eog_dep,
+  libexif_dep,
+  libpeas_dep,
+  libpeasgtk_dep,
+  libgdata_dep,
+]
+
+config_h.set('HAVE_LIBGDATA_0_8',
+             libgdata_dep.version().version_compare('>= 0.8'),
+             description: 'Define to be compatible with the API of libgdata-0.8')
+config_h.set('HAVE_LIBGDATA_0_9',
+             libgdata_dep.version().version_compare('>= 0.9'),
+             description: 'Define to be compatible with the API of libgdata-0.9')
+
+postasa_plugin = shared_module(
+  'postasa',
+  sources: postasa_sources,
+  include_directories: root_include_dir,
+  dependencies: postasa_deps,
+  install: true,
+  install_dir: pluginlibdir,
+)
+
+# FIXME: Remove `args` parameter when gettext acquires plugin support.
+#        http://lists.gnu.org/archive/html/bug-gettext/2017-06/msg00001.html
+# NOTE:  We need to keep the .desktop suffix on the source file to be able
+#        to extract translatable strings. .plugin is not recognized.
+i18n.merge_file(
+  input: 'postasa.plugin.desktop.in',
+  output: 'postasa.plugin',
+  po_dir: po_dir,
+  type: 'desktop',
+  args: ['--keyword=Name', '--keyword=Description'],
+  install: true,
+  install_dir: pluginlibdir,
+)
+
+postasa_appdata = i18n.merge_file(
+  'eog-postasa.appdata.xml',
+  input: 'eog-postasa.appdata.xml.in',
+  output: '@BASENAME@',
+  po_dir: src_root / 'po',
+  type: 'xml',
+  install: true,
+  install_dir: appstreamdir,
+)
+
+if appstream_util.found()
+  test(
+    'validate-eog-postasa.appdata.xml',
+    appstream_util,
+    args: [
+      'validate',
+      '--nonet',
+      postasa_appdata.full_path(),
+    ]
+  )
+endif
+
diff --git a/plugins/pythonconsole/meson.build b/plugins/pythonconsole/meson.build
new file mode 100644
index 0000000..4ddadd7
--- /dev/null
+++ b/plugins/pythonconsole/meson.build
@@ -0,0 +1,60 @@
+pythonconsole_sources = files(
+  'config.py',
+  'console.py',
+  '__init__.py',
+)
+
+install_data(
+  pythonconsole_sources,
+  install_dir: pluginlibdir / 'pythonconsole',
+)
+
+install_data(
+  files('config.ui'),
+  install_dir: plugindatadir / 'pythonconsole'
+)
+
+# FIXME: Remove `args` parameter when gettext acquires plugin support.
+#        http://lists.gnu.org/archive/html/bug-gettext/2017-06/msg00001.html
+# NOTE:  We need to keep the .desktop suffix on the source file to be able
+#        to extract translatable strings. .plugin is not recognized.
+i18n.merge_file(
+  input: 'pythonconsole.plugin.desktop.in',
+  output: 'pythonconsole.plugin',
+  po_dir: po_dir,
+  type: 'desktop',
+  args: ['--keyword=Name', '--keyword=Description'],
+  install: true,
+  install_dir: pluginlibdir,
+)
+
+configure_file(
+  input: 'org.gnome.eog.plugins.pythonconsole.gschema.xml.in',
+  output: '@BASENAME@',
+  configuration: {'GETTEXT_PACKAGE': 'eog-plugins'},
+  install: true,
+  install_dir: gio_schemasdir,
+)
+
+pythonconsole_appdata = i18n.merge_file(
+  'eog-export-to-folder.appdata.xml',
+  input: 'eog-pythonconsole.appdata.xml.in',
+  output: '@BASENAME@',
+  po_dir: src_root / 'po',
+  type: 'xml',
+  install: true,
+  install_dir: appstreamdir,
+)
+
+if appstream_util.found()
+  test(
+    'validate-eog-pythonconsole.appdata.xml',
+    appstream_util,
+    args: [
+      'validate',
+      '--nonet',
+      pythonconsole_appdata.full_path(),
+    ]
+  )
+endif
+
diff --git a/plugins/send-by-mail/meson.build b/plugins/send-by-mail/meson.build
new file mode 100644
index 0000000..bdeebaa
--- /dev/null
+++ b/plugins/send-by-mail/meson.build
@@ -0,0 +1,55 @@
+sendbymail_sources = files(
+  'eog-send-by-mail-plugin.c',
+  'eog-send-by-mail-plugin.h',
+)
+
+sendbymail_deps = [
+  eog_dep,
+  libpeas_dep,
+]
+
+sendbymail_plugin = shared_module(
+  'send-by-mail',
+  sources: sendbymail_sources,
+  include_directories: root_include_dir,
+  dependencies: sendbymail_deps,
+  install: true,
+  install_dir: pluginlibdir,
+)
+
+# FIXME: Remove `args` parameter when gettext acquires plugin support.
+#        http://lists.gnu.org/archive/html/bug-gettext/2017-06/msg00001.html
+# NOTE:  We need to keep the .desktop suffix on the source file to be able
+#        to extract translatable strings. .plugin is not recognized.
+i18n.merge_file(
+  input: 'send-by-mail.plugin.desktop.in',
+  output: 'send-by-mail.plugin',
+  po_dir: po_dir,
+  type: 'desktop',
+  args: ['--keyword=Name', '--keyword=Description'],
+  install: true,
+  install_dir: pluginlibdir,
+)
+
+sendbymail_appdata = i18n.merge_file(
+  'eog-send-by-mail.appdata.xml',
+  input: 'eog-send-by-mail.appdata.xml.in',
+  output: '@BASENAME@',
+  po_dir: src_root / 'po',
+  type: 'xml',
+  install: true,
+  install_dir: appstreamdir,
+)
+
+if appstream_util.found()
+  test(
+    'validate-eog-send-by-mail.appdata.xml',
+    appstream_util,
+    args: [
+      'validate',
+      '--nonet',
+      exifdisplay_appdata.full_path(),
+    ]
+  )
+endif
+
diff --git a/plugins/slideshowshuffle/meson.build b/plugins/slideshowshuffle/meson.build
new file mode 100644
index 0000000..6ed7d4d
--- /dev/null
+++ b/plugins/slideshowshuffle/meson.build
@@ -0,0 +1,45 @@
+slideshowshuffle_sources = files(
+  'slideshowshuffle.py',
+)
+
+install_data(
+  slideshowshuffle_sources,
+  install_dir: pluginlibdir,
+)
+
+# FIXME: Remove `args` parameter when gettext acquires plugin support.
+#        http://lists.gnu.org/archive/html/bug-gettext/2017-06/msg00001.html
+# NOTE:  We need to keep the .desktop suffix on the source file to be able
+#        to extract translatable strings. .plugin is not recognized.
+i18n.merge_file(
+  input: 'slideshowshuffle.plugin.desktop.in',
+  output: 'slideshowshuffle.plugin',
+  po_dir: po_dir,
+  type: 'desktop',
+  args: ['--keyword=Name', '--keyword=Description'],
+  install: true,
+  install_dir: pluginlibdir,
+)
+
+slideshowshuffle_appdata = i18n.merge_file(
+  'eog-slideshowshuffle.appdata.xml',
+  input: 'eog-slideshowshuffle.appdata.xml.in',
+  output: '@BASENAME@',
+  po_dir: src_root / 'po',
+  type: 'xml',
+  install: true,
+  install_dir: appstreamdir,
+)
+
+if appstream_util.found()
+  test(
+    'validate-eog-slideshowshuffle.appdata.xml',
+    appstream_util,
+    args: [
+      'validate',
+      '--nonet',
+      slideshowshuffle_appdata.full_path(),
+    ]
+  )
+endif
+
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 0000000..ff222b2
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1,3 @@
+i18n.gettext(meson.project_name(),
+             preset: 'glib',
+             args: [ '--keyword=Description' ])


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]