[tali] build: Add meson support



commit f8411c3d6e136789b8f89c1419f6cd5f1317941e
Author: Jeremy Bicha <jbicha ubuntu com>
Date:   Sun Dec 9 12:01:18 2018 -0500

    build: Add meson support

 data/meson.build              | 43 +++++++++++++++++++++++++++++++++++++++++++
 data/meson_compile_gschema.py | 10 ++++++++++
 help/LINGUAS                  | 23 +++++++++++++++++++++++
 help/meson.build              |  6 ++++++
 meson.build                   | 31 +++++++++++++++++++++++++++++++
 po/LINGUAS                    |  2 +-
 po/meson.build                |  3 +++
 src/meson.build               | 23 +++++++++++++++++++++++
 8 files changed, 140 insertions(+), 1 deletion(-)
---
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 0000000..c27eebc
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1,43 @@
+foreach size: [ '16x16', '22x22', '24x24', '32x32', '48x48', '256x256', '512x512']
+    install_data (join_paths ('icons', size, 'tali.png'),
+                  install_dir: join_paths (datadir, 'icons', 'hicolor', size, 'apps'))
+endforeach
+install_data (join_paths ('icons', 'symbolic', 'tali-symbolic.svg'),
+              install_dir: join_paths (datadir, 'icons', 'hicolor', 'scalable', 'apps'))
+
+install_data ([ 'gnome-dice-1.svg',
+                'gnome-dice-2.svg',
+                'gnome-dice-3.svg',
+                'gnome-dice-4.svg',
+                'gnome-dice-5.svg',
+                'gnome-dice-6.svg',
+                'gnome-dice-none.svg',
+                'kismet1.svg',
+                'kismet2.svg',
+                'kismet3.svg',
+                'kismet4.svg',
+                'kismet5.svg',
+                'kismet6.svg',
+                'kismet-none.svg'],
+                install_dir: pkgdatadir)
+
+install_data ('org.gnome.tali.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: 'tali.desktop.in',
+                 output: 'tali.desktop',
+                 install: true,
+                 install_dir: join_paths (datadir, 'applications'),
+                 po_dir: '../po',
+                 type: 'desktop')
+
+i18n.merge_file ('appdata-file',
+                 input: 'tali.appdata.xml.in',
+                 output: 'tali.appdata.xml',
+                 install: true,
+                 install_dir: join_paths (datadir, 'metainfo'),
+                 po_dir: '../po')
+
+install_man ('tali.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..eae3fa2
--- /dev/null
+++ b/help/LINGUAS
@@ -0,0 +1,23 @@
+# please keep this list sorted alphabetically
+#
+ca
+cs
+da
+de
+el
+en_GB
+es
+eu
+fr
+gl
+hu
+it
+oc
+pl
+pt_BR
+ru
+sl
+sr
+sr@latin
+sv
+zh_CN
diff --git a/help/meson.build b/help/meson.build
new file mode 100644
index 0000000..a6bb4e6
--- /dev/null
+++ b/help/meson.build
@@ -0,0 +1,6 @@
+gnome.yelp ('tali',
+            sources: [ 'index.docbook',
+                       'legal.xml' ],
+            media: [ 'figures/mainwindow.png',
+                     'figures/preferences.png' ],
+            symlink_media: true)
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..0f2fd74
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,31 @@
+project ('tali', ['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
+config_h_dir = include_directories('.')
+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, 'tali')
+
+# Dependencies
+gtk_dep = dependency ('gtk+-3.0', version: '>= 3.16')
+
+# Configuration
+conf = configuration_data()
+conf.set_quoted('VERSION', meson.project_version())
+configure_file(output: 'config.h', configuration: conf)
+
+subdir ('po')
+subdir ('data')
+subdir ('help')
+subdir ('src')
diff --git a/po/LINGUAS b/po/LINGUAS
index 53a9136..ba1b5c5 100644
--- a/po/LINGUAS
+++ b/po/LINGUAS
@@ -81,7 +81,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..be85b78
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1,3 @@
+i18n.gettext ('tali', preset: 'glib')
+
+podir = meson.current_source_dir ()
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000..0fc35d0
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,23 @@
+resources = gnome.compile_resources ('resources', 'tali.gresource.xml',
+                                     source_dir: '.',
+                                     c_name: 'resources')
+
+executable ('tali',
+            [ 'clist.c',
+              'computer.c',
+              'games-frame.c',
+              'games-score.c',
+              'games-scores-backend.c',
+              'games-scores.c',
+              'games-scores-dialog.c',
+              'gyahtzee.c',
+              'setup.c',
+              'yahtzee.c'] + resources,
+             dependencies: [ gtk_dep ],
+             c_args: [ '-include', 'config.h',
+                       '-DVERSION="@0@"'.format (meson.project_version ()),
+                       '-DGETTEXT_PACKAGE="tali"',
+                       '-DLOCALEDIR="@0@"'.format (localedir),
+                       '-DDATA_DIRECTORY="@0@"'.format (pkgdatadir) ],
+             include_directories: config_h_dir,
+             install: true )


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