[five-or-more] Migrate to Meson
- From: Robert Roth <robertroth src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [five-or-more] Migrate to Meson
- Date: Fri, 16 Mar 2018 01:08:48 +0000 (UTC)
commit 4e2c73b92151bf155acf7d678f66d2b94d67a220
Author: Ruxandra Simion <ruxandra simion93 gmail com>
Date: Thu Mar 15 17:48:42 2018 +0200
Migrate to Meson
https://bugzilla.gnome.org/show_bug.cgi?id=794026
Makefile.am | 6 ++++++
data/meson.build | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
help/LINGUAS | 22 ++++++++++++++++++++++
help/meson.build | 39 +++++++++++++++++++++++++++++++++++++++
meson.build | 46 ++++++++++++++++++++++++++++++++++++++++++++++
meson_post_install.py | 15 +++++++++++++++
po/meson.build | 3 +++
src/meson.build | 47 +++++++++++++++++++++++++++++++++++++++++++++++
8 files changed, 227 insertions(+), 0 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 17d24be..de2b715 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,11 @@
SUBDIRS = data help po src
+EXTRA_DIST = \
+ **/meson.build \
+ meson_options.txt \
+ meson_post_install.py \
+ $(NULL)
+
MAINTAINERCLEANFILES = \
$(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL) \
$(GITIGNORE_MAINTAINERCLEANFILES_MAKEFILE_IN)
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 0000000..b6c1dd5
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1,49 @@
+# Desktop file
+i18n.merge_file(
+ input: 'five-or-more.desktop.in',
+ output: 'five-or-more.desktop',
+ type: 'desktop',
+ po_dir: po_dir,
+ install: true,
+ install_dir: join_paths(pkgdata_dir, 'applications')
+)
+
+# Themes
+foreach file: ['balls.svg', 'dots.png', 'gumball.png', 'shapes.svg']
+ install_data (file,
+ install_dir: join_paths(pkgdata_dir, 'themes')
+ )
+endforeach
+
+# UI files
+foreach file: ['five-or-more.ui', 'five-or-more-preferences.ui', 'menu.ui']
+ install_data (file,
+ install_dir: join_paths(pkgdata_dir)
+ )
+endforeach
+
+# Icons
+install_subdir('icons',
+ install_dir: join_paths(pkgdata_dir),
+ exclude_files: [ 'Makefile', 'Makefile.in', 'Makefile.am', 'five-or-more-src.svg' ],
+)
+
+# Appdata
+i18n.merge_file(
+ input: 'five-or-more.appdata.xml.in',
+ output: 'five-or-more.appdata.xml',
+ type: 'xml',
+ po_dir: po_dir,
+ install: true,
+ install_dir: join_paths(pkgdata_dir, 'meta-info')
+)
+
+# Gschema
+install_data('org.gnome.five-or-more.gschema.xml',
+ install_dir: join_paths(pkgdata_dir, 'appdata')
+)
+
+# Manpage
+install_man(
+ 'five-or-more.6'
+)
diff --git a/help/LINGUAS b/help/LINGUAS
new file mode 100644
index 0000000..9c57fb5
--- /dev/null
+++ b/help/LINGUAS
@@ -0,0 +1,22 @@
+ca
+cs
+de
+el
+en_GB
+es
+eu
+fr
+gl
+hu
+it
+ja
+oc
+pl
+pt_BR
+ru
+sl
+sr
+sr@latin
+sv
+tr
+zh_CN
diff --git a/help/meson.build b/help/meson.build
new file mode 100644
index 0000000..e058487
--- /dev/null
+++ b/help/meson.build
@@ -0,0 +1,39 @@
+five_or_more_help_pages = [
+ 'bug-filing.page',
+ 'change-board-size.page',
+ 'change-theme.page',
+ 'develop.page',
+ 'documentation.page',
+ 'fast-moves.page',
+ 'index.page',
+ 'legal.xml',
+ 'license.page',
+ 'play.page',
+ 'rules.page',
+ 'scores.page',
+ 'shortcuts.page',
+ 'strategy.page',
+ 'translate.page'
+]
+
+five_or_more_help_media = [
+ 'figures/color-balls.png',
+ 'figures/color-dots.png',
+ 'figures/color-shapes.png',
+ 'figures/diagonal.png',
+ 'figures/glines-demo.ogv',
+ 'figures/glines-gameover.png',
+ 'figures/horizontal.png',
+ 'figures/large.png',
+ 'figures/logo.png',
+ 'figures/logo32.png',
+ 'figures/medium.png',
+ 'figures/pickcolor.png',
+ 'figures/small.png',
+ 'figures/vertical.png'
+]
+
+gnome.yelp(meson.project_name(),
+ sources: five_or_more_help_pages,
+ media: five_or_more_help_media
+)
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..e704fb9
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,46 @@
+project('five-or-more', ['c'],
+ version: '3.28.0',
+ meson_version: '>= 0.43.0',
+ license: 'GPLv2'
+)
+
+gnome = import('gnome')
+i18n = import('i18n')
+
+locale_dir = join_paths(get_option('prefix'), get_option('localedir'))
+po_dir = join_paths(meson.source_root(), 'po')
+data_dir = join_paths (get_option ('prefix'), get_option ('datadir'))
+pkgdata_dir = join_paths (data_dir, 'five-or-more')
+
+# Dependencies
+glib_min_version = '2.32'
+
+librsvg = dependency('librsvg-2.0', version: '>= 2.32.0')
+gio = dependency('gio-2.0', version: '>= ' + glib_min_version)
+glib = dependency('glib-2.0', version: '>= ' + glib_min_version)
+gmodule_export = dependency('gmodule-export-2.0')
+gtk = dependency('gtk+-3.0', version: '>= 3.20.0')
+
+# Libraries
+cc = meson.get_compiler('c')
+libmath = cc.find_library('m')
+
+# Configuration
+conf = configuration_data()
+
+conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
+conf.set_quoted('LOCALEDIR', locale_dir)
+conf.set_quoted('DATA_DIRECTORY', pkgdata_dir)
+conf.set_quoted('VERSION', meson.project_version())
+
+configure_file(output: 'config.h', configuration: conf)
+config_h_dir = include_directories('.')
+
+# Extra scripts
+meson.add_install_script('meson_post_install.py')
+
+# Subdirs
+subdir('data')
+subdir('help')
+subdir('po')
+subdir('src')
diff --git a/meson_post_install.py b/meson_post_install.py
new file mode 100644
index 0000000..d6ca469
--- /dev/null
+++ b/meson_post_install.py
@@ -0,0 +1,15 @@
+#!/usr/bin/env python3
+
+import os
+import subprocess
+
+install_prefix = os.environ['MESON_INSTALL_PREFIX']
+icondir = os.path.join(install_prefix, 'share', 'icons', 'hicolor')
+schemadir = os.path.join(install_prefix, 'share', 'glib-2.0', 'schemas')
+
+if not os.environ.get('DESTDIR'):
+ print('Update icon cache...')
+ subprocess.call(['gtk-update-icon-cache', '-f', '-t', icondir])
+
+ print('Compiling gsettings schemas...')
+ subprocess.call(['glib-compile-schemas', schemadir])
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 0000000..d5877fc
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1,3 @@
+i18n.gettext(meson.project_name(),
+ preset: 'glib'
+)
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000..ab170fa
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,47 @@
+#five-or-more executable
+
+five_or_more_c_sources = [
+ 'five-or-more.c',
+ 'five-or-more.h',
+ 'games-file-list.c',
+ 'games-file-list.h',
+ 'games-gridframe.c',
+ 'games-gridframe.h',
+ 'games-preimage.c',
+ 'games-preimage.h',
+ 'games-score.c',
+ 'games-score.h',
+ 'games-scores-backend.c',
+ 'games-scores-backend.h',
+ 'games-scores-dialog.c',
+ 'games-scores-dialog.h',
+ 'games-scores.c',
+ 'games-scores.h'
+]
+
+five_or_more_sources = [
+ five_or_more_c_sources
+]
+
+five_or_more_deps = [
+ libmath,
+ librsvg,
+ glib,
+ gio,
+ gtk
+]
+
+five_or_more_includes = [
+ config_h_dir
+]
+
+five_or_more_c_flags = [
+ '-include', 'config.h'
+]
+
+executable('five-or-more', five_or_more_sources,
+ dependencies: five_or_more_deps,
+ include_directories: five_or_more_includes,
+ c_args: five_or_more_c_flags,
+ install: true
+)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]