[gnome-tetravex] build: Add meson support



commit 5f516489cf9d36be90185444efb207a7bcfcc632
Author: Jeremy Bicha <jbicha ubuntu com>
Date:   Sun Dec 9 09:07:31 2018 -0500

    build: Add meson support

 data/meson.build              | 29 +++++++++++++++++++++++++++++
 data/meson_compile_gschema.py | 10 ++++++++++
 help/LINGUAS                  | 24 ++++++++++++++++++++++++
 help/meson.build              | 12 ++++++++++++
 meson.build                   | 26 ++++++++++++++++++++++++++
 po/LINGUAS                    |  2 +-
 po/meson.build                |  3 +++
 src/meson.build               | 20 ++++++++++++++++++++
 8 files changed, 125 insertions(+), 1 deletion(-)
---
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 0000000..e9eeede
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1,29 @@
+foreach size: [ '16x16', '22x22', '24x24', '32x32', '48x48']
+    install_data (join_paths ('icons', 'hicolor', size, 'gnome-tetravex.png'),
+                  install_dir: join_paths (datadir, 'icons', 'hicolor', size, 'apps'))
+endforeach
+install_data (join_paths ('icons', 'hicolor', 'scalable', 'gnome-tetravex.svg'),
+              install_dir: join_paths (datadir, 'icons', 'hicolor', 'scalable', 'apps'))
+install_data (join_paths ('icons', 'hicolor', 'scalable', 'gnome-tetravex-symbolic.svg'),
+              install_dir: join_paths (datadir, 'icons', 'hicolor', 'scalable', 'apps'))
+
+install_data ('org.gnome.tetravex.gschema.xml',
+              install_dir: join_paths (datadir, 'glib-2.0', 'schemas'))
+meson.add_install_script ('meson_compile_gschema.py')
+
+i18n.merge_file ('desktop-file',
+                 input: 'gnome-tetravex.desktop.in',
+                 output: 'gnome-tetravex.desktop',
+                 install: true,
+                 install_dir: join_paths (datadir, 'applications'),
+                 po_dir: '../po',
+                 type: 'desktop')
+
+i18n.merge_file ('appdata-file',
+                 input: 'gnome-tetravex.appdata.xml.in',
+                 output: 'gnome-tetravex.appdata.xml',
+                 install: true,
+                 install_dir: join_paths (datadir, 'metainfo'),
+                 po_dir: '../po')
+
+install_man ('gnome-tetravex.6')
diff --git a/data/meson_compile_gschema.py b/data/meson_compile_gschema.py
new file mode 100755
index 0000000..d0248f4
--- /dev/null
+++ b/data/meson_compile_gschema.py
@@ -0,0 +1,10 @@
+#!/usr/bin/env python3
+
+import os
+import subprocess
+
+schemadir = os.path.join(os.environ['MESON_INSTALL_PREFIX'], 'share', 'glib-2.0', 'schemas')
+
+if not os.environ.get('DESTDIR'):
+    print('Compiling gsettings schemas...')
+    subprocess.call(['glib-compile-schemas', schemadir])
diff --git a/help/LINGUAS b/help/LINGUAS
new file mode 100644
index 0000000..26a5fd5
--- /dev/null
+++ b/help/LINGUAS
@@ -0,0 +1,24 @@
+# please keep this list sorted alphabetically
+#
+ca
+cs
+da
+de
+el
+en_GB
+es
+eu
+fr
+gl
+hu
+it
+oc
+pl
+pt_BR
+ro
+ru
+sl
+sr
+sr@latin
+sv
+zh_CN
diff --git a/help/meson.build b/help/meson.build
new file mode 100644
index 0000000..77f9e90
--- /dev/null
+++ b/help/meson.build
@@ -0,0 +1,12 @@
+gnome.yelp ('gnome-tetravex',
+            sources: [ 'hint.page',
+                       'index.page',
+                       'license.page',
+                       'move.page',
+                       'shortcut.page',
+                       'size.page',
+                       'usage.page',
+                       'winning.page' ],
+            media: [ 'figures/gnome-tetravex-logo.png',
+                     'figures/gnome-tetravex-video.ogv' ],
+            symlink_media: true)
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..1141e8b
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,26 @@
+project ('gnome-tetravex', ['vala', 'c'],
+         version: '3.31.1',
+         license: 'GPLv2+',
+         default_options: [
+             'warning_level=1',
+             'buildtype=debugoptimized',
+         ],
+         meson_version: '>= 0.37.1')
+
+gnome = import ('gnome')
+i18n = import ('i18n')
+
+# Paths
+mandir = join_paths (get_option ('prefix'), get_option ('mandir'))
+localedir = join_paths (get_option ('prefix'), get_option ('localedir'))
+datadir = join_paths (get_option ('prefix'), get_option ('datadir'))
+pkgdatadir = join_paths (datadir, 'gnome-mines')
+
+# Dependencies
+glib_dep = dependency ('glib-2.0', version: '>= 2.40.0')
+gtk_dep = dependency ('gtk+-3.0', version: '>= 3.14')
+
+subdir ('po')
+subdir ('data')
+subdir ('help')
+subdir ('src')
diff --git a/po/LINGUAS b/po/LINGUAS
index e2650e5..612460a 100644
--- a/po/LINGUAS
+++ b/po/LINGUAS
@@ -82,7 +82,7 @@ te
 tg
 th
 tr
-ug 
+ug
 uk
 vi
 wa
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 0000000..7e27a58
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1,3 @@
+i18n.gettext ('gnome-tetravex', preset: 'glib')
+
+podir = meson.current_source_dir ()
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000..412c442
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,20 @@
+resources = gnome.compile_resources ('resources', 'gnome-tetravex.gresource.xml',
+                                     source_dir: '.',
+                                     c_name: 'resources')
+
+gnome_mines = executable ('gnome-tetravex',
+                          [ 'config.vapi',
+                            'gnome-tetravex.vala',
+                            'history.vala',
+                            'puzzle.vala',
+                            'puzzle-view.vala',
+                            'score-dialog.vala',
+                            'theme.vala'] + resources,
+                          dependencies: [ glib_dep,
+                                          gtk_dep ],
+                          vala_args: [ '--pkg=posix' ],
+                          c_args: [ '-DVERSION="@0@"'.format (meson.project_version ()),
+                                    '-DGETTEXT_PACKAGE="gnome-tetravex"',
+                                    '-DLOCALEDIR="@0@"'.format (localedir),
+                                    '-DDATA_DIRECTORY="@0@"'.format (pkgdatadir) ],
+                          install: true )


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