[gnome-mines] Add Meson build rules
- From: Robert Roth <robertroth src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-mines] Add Meson build rules
- Date: Mon, 22 May 2017 15:03:12 +0000 (UTC)
commit 1e5d34d944d5b149d465f77f17691d4ee7f12d14
Author: Robert Ancell <robert ancell canonical com>
Date: Fri May 12 16:07:20 2017 +1200
Add Meson build rules
https://bugzilla.gnome.org/show_bug.cgi?id=782540
data/meson.build | 43 ++++++++++++++++++++++++++++++++++++++
data/meson_compile_gschema.py | 10 +++++++++
help/meson.build | 46 +++++++++++++++++++++++++++++++++++++++++
meson.build | 30 ++++++++++++++++++++++++++
po/meson.build | 8 +++++++
src/meson.build | 18 ++++++++++++++++
6 files changed, 155 insertions(+), 0 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 0000000..98b599e
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1,43 @@
+foreach size: [ '16x16', '22x22', '24x24', '32x32', '48x48' ]
+ install_data (join_paths ('icons', 'hicolor', size, 'gnome-mines.png'),
+ install_dir: join_paths (datadir, 'icons', 'hicolor', size, 'apps'))
+endforeach
+install_data (join_paths ('icons', 'hicolor', 'scalable', 'gnome-mines-symbolic.svg'),
+ install_dir: join_paths (datadir, 'icons', 'hicolor', size, 'apps'))
+install_data ('flag-symbolic.svg',
+ install_dir: join_paths (datadir, 'icons', 'hicolor', '16x16', 'actions'))
+
+install_data ('org.gnome.mines.gschema.xml',
+ install_dir: join_paths (datadir, 'glib-2.0', 'schemas'))
+meson.add_install_script ('meson_compile_gschema.py')
+
+install_data ('gnome-mines.css',
+ install_dir: pkgdatadir)
+install_data ('interface.ui',
+ install_dir: pkgdatadir)
+
+foreach theme: [ 'default', 'bgcolors', 'classic' ]
+ foreach file: [ 'theme.css',
+ '1mines.svg', '2mines.svg', '3mines.svg', '4mines.svg', '5mines.svg', '6mines.svg',
'7mines.svg', '8mines.svg',
+ 'mine.svg', 'flag.svg', 'incorrect.svg', 'exploded.svg', 'overmine.svg', 'maybe.svg' ]
+ install_data (join_paths ('themes', theme, file), install_dir: join_paths (pkgdatadir, 'themes',
theme))
+ endforeach
+endforeach
+
+# Note the keywords explicitly listed to stop the icon field being translated
+# https://bugs.launchpad.net/bugs/1624662
+custom_target ('gnome-mines.desktop',
+ output: 'gnome-mines.desktop',
+ input: 'gnome-mines.desktop.in',
+ command: [ msgfmt, '--desktop', '--keyword=Name', '--keyword=GenericName',
'--keyword=Comment', '--keyword=Keywords', '--template', '@INPUT@', '-d', podir, '-o', '@OUTPUT@' ],
+ install: true,
+ install_dir: join_paths (datadir, 'applications'))
+
+custom_target ('gnome-mines.appdata.xml',
+ output: 'gnome-mines.appdata.xml',
+ input: 'gnome-mines.appdata.xml.in',
+ command: [ msgfmt, '--xml', '--template', '@INPUT@', '-d', podir, '-o', '@OUTPUT@' ],
+ install: true,
+ install_dir: join_paths (datadir, 'appdata'))
+
+install_man ('gnome-mines.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/meson.build b/help/meson.build
new file mode 100644
index 0000000..8f87582
--- /dev/null
+++ b/help/meson.build
@@ -0,0 +1,46 @@
+languages = [ 'ca', 'cs',
+ 'da', 'de',
+ 'el', 'en_GB', 'es', 'eu',
+ 'fr',
+ 'gl',
+ 'hu',
+ 'it',
+ 'ja',
+ 'oc',
+ 'pt_BR',
+ 'sl', 'sr', 'sr@latin', 'sv',
+ 'zh_CN' ]
+
+gnome.yelp ('gnome-mines',
+ sources: [ 'board-size.page',
+ 'bug-filing.page',
+ 'develop.page',
+ 'documentation.page',
+ 'flags.page',
+ 'get-help.page',
+ 'high-scores.page',
+ 'index.page',
+ 'license.page',
+ 'new-game.page',
+ 'rules.page',
+ 'shortcuts.page',
+ 'translate.page' ],
+ media: [ 'figures/easy-hints-1.png',
+ 'figures/easy-hints-2.png',
+ 'figures/easy-hints-3.png',
+ 'figures/flag-question.svg',
+ 'figures/flags.png',
+ 'figures/flag.svg',
+ 'figures/gnome-mines.png',
+ 'figures/hard-hints-1.png',
+ 'figures/hard-hints-2.png',
+ 'figures/hard-hints-3.png',
+ 'figures/highscores.png',
+ 'figures/imnotsureflagscheckbox.png',
+ 'figures/logo32.png',
+ 'figures/logo.png',
+ 'figures/main-window.png',
+ 'figures/preferences.png',
+ 'figures/statusbar.png' ],
+ languages: languages,
+ symlink_media: true)
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..2652dab
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,30 @@
+project ('gnome-mines', ['vala', 'c'],
+ version: '3.24.0',
+ license: 'GPLv3+',
+ 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')
+gee_dep = dependency ('gee-0.8')
+gtk_dep = dependency ('gtk+-3.0', version: '>= 3.12')
+librsvg_dep = dependency ('librsvg-2.0', version: '>=2.32.0')
+libgnome_games_support_dep = dependency ('libgnome-games-support-1')
+msgfmt = find_program ('msgfmt')
+
+subdir ('po')
+subdir ('data')
+subdir ('help')
+subdir ('src')
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 0000000..37f9b3f
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1,8 @@
+i18n.gettext ('gnome-mines',
+ args: [ '--default-domain="' + meson.project_name (),
+ '--from-code=UTF-8',
+ '--add-comments',
+ '--keyword=_',
+ '--keyword=N_' ] )
+
+podir = meson.current_source_dir ()
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000..ad6403e
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,18 @@
+gnome_mines = executable ('gnome-mines',
+ [ 'config.vapi',
+ 'gnome-mines.vala',
+ 'minefield.vala',
+ 'minefield-view.vala',
+ 'tile.vala',
+ 'theme-selector-dialog.vala'],
+ dependencies: [ glib_dep,
+ gee_dep,
+ gtk_dep,
+ librsvg_dep,
+ libgnome_games_support_dep ],
+ vala_args: [ '--pkg=posix' ],
+ c_args: [ '-DVERSION="@0@"'.format (meson.project_version ()),
+ '-DGETTEXT_PACKAGE="gnome-mines"',
+ '-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]