[gnome-sudoku/wip/ernestask/meson: 16/19] Add Meson support



commit 8251dbc7984e3a0efc6a76ec15750f3ed09ad2d9
Author: Ernestas Kulik <ernestask gnome org>
Date:   Sat Dec 2 20:41:25 2017 +0200

    Add Meson support
    
    The minimum supported version is 0.44.0, however, because of a bug in
    earlier versions.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=791212

 data/meson.build |   42 +++++++++++++++++++++++++++++++++++++++++
 help/LINGUAS     |   22 +++++++++++++++++++++
 help/meson.build |   30 +++++++++++++++++++++++++++++
 lib/meson.build  |   26 +++++++++++++++++++++++++
 meson.build      |   55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 po/meson.build   |    1 +
 src/meson.build  |   23 ++++++++++++++++++++++
 7 files changed, 199 insertions(+), 0 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 0000000..569fd10
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1,42 @@
+resource_files = files('gnome-sudoku.gresource.xml')
+
+resources = gnome.compile_resources('gnome-sudoku', resource_files)
+
+desktop = i18n.merge_file('desktop',
+  input: 'gnome-sudoku.desktop.in',
+  output: 'gnome-sudoku.desktop',
+  install: true,
+  install_dir: join_paths(datadir, 'applications'),
+  po_dir: '../po',
+  type: 'desktop'
+)
+
+appdata = i18n.merge_file('appdata',
+  input: 'gnome-sudoku.appdata.xml.in',
+  output: 'gnome-sudoku.appdata.xml',
+  install: true,
+  install_dir: join_paths(datadir, 'appdata'),
+  po_dir: '../po'
+)
+
+install_data('org.gnome.sudoku.gschema.xml',
+  install_dir: join_paths(datadir, 'glib-2.0', 'schemas')
+)
+
+install_data('footprints.png',
+  install_dir: join_paths(datadir, meson.project_name(), 'images'))
+
+install_man('gnome-sudoku.6')
+
+icondir = join_paths(datadir, 'icons', 'hicolor')
+
+foreach icon_size: ['16x16', '22x22', '24x24', '32x32', '48x48']
+  install_data('icons/hicolor/@0@/gnome-sudoku.png'.format(icon_size),
+    install_dir: join_paths(icondir, icon_size, 'apps')
+  )
+endforeach
+
+install_data('icons/hicolor/scalable/gnome-sudoku.svg',
+  'icons/hicolor/scalable/gnome-sudoku-symbolic.svg',
+  install_dir: join_paths(icondir, 'scalable', 'apps')
+)
diff --git a/help/LINGUAS b/help/LINGUAS
new file mode 100644
index 0000000..7b8c3ad
--- /dev/null
+++ b/help/LINGUAS
@@ -0,0 +1,22 @@
+ca
+cs
+da
+de
+en_GB
+el
+es
+eu
+fr
+gl
+hu
+it
+ko
+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..fbc1908
--- /dev/null
+++ b/help/meson.build
@@ -0,0 +1,30 @@
+help_media = [
+  'figures/logo32.png',
+  'figures/logo.png',
+  'figures/rowcolumnbox.png',
+  'figures/strategy1.png',
+  'figures/strategy2.png'
+]
+
+help_sources = [
+  'basics.page',
+  'bug-filing.page',
+  'develop.page',
+  'documentation.page',
+  'earmarks.page',
+  'highlighting.page',
+  'index.page',
+  'keyboard-shortcuts.page',
+  'legal.xml',
+  'license.page',
+  'print-blank-puzzles.page',
+  'print-inprogress-game.page',
+  'rules.page',
+  'save-resume.page',
+  'strategy.page',
+  'translate.page'
+]
+
+gnome.yelp('gnome-sudoku',
+  media: help_media,
+  sources: help_sources)
diff --git a/lib/meson.build b/lib/meson.build
new file mode 100644
index 0000000..c2bef72
--- /dev/null
+++ b/lib/meson.build
@@ -0,0 +1,26 @@
+libsudoku_sources = [
+  'sudoku-board.vala',
+  'sudoku-game.vala',
+  'sudoku-generator.vala',
+  'sudoku-saver.vala',
+  'qqwing-wrapper.cpp',
+  'qqwing-wrapper.h'
+]
+
+libsudoku_dependencies = [
+  gee,
+  json_glib,
+  threads,
+  qqwing
+]
+
+libsudoku = static_library('sudoku', libsudoku_sources,
+  dependencies: libsudoku_dependencies,
+  vala_header: 'libsudoku.h',
+  vala_vapi: 'libsudoku.vapi'
+)
+
+libsudoku_dep = declare_dependency(dependencies: libsudoku_dependencies,
+  include_directories: include_directories('.'),
+  link_with: libsudoku
+)
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..027106e
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,55 @@
+project('gnome-sudoku', ['c', 'cpp', 'vala'],
+  default_options: [
+    'cpp_std=c++11'
+  ],
+  license: 'GPL3+',
+  meson_version: '>= 0.44.0',
+  version: '3.26.0'
+)
+
+add_project_arguments([
+    '-include', 'config.h'
+  ],
+  language: 'c'
+)
+
+add_project_arguments([
+    '--vapidir', join_paths(meson.current_source_dir(), 'lib')
+  ],
+  language: 'vala'
+)
+
+gnome = import('gnome')
+i18n = import('i18n')
+
+datadir = get_option('datadir')
+localedir = get_option('localedir')
+prefix = get_option('prefix')
+
+glib_version = '2.40.0'
+
+gee = dependency('gee-0.8')
+gio = dependency('gio-2.0', version: '>= @0@'.format(glib_version))
+glib = dependency('glib-2.0', version: '>= @0@'.format(glib_version))
+gtk = dependency('gtk+-3.0', version: '>= 3.19.0')
+json_glib = dependency('json-glib-1.0')
+qqwing = dependency('qqwing', version: '>= 1.3.4')
+threads = dependency('threads')
+
+config_include_dir = include_directories('.')
+
+conf = configuration_data()
+
+conf.set_quoted('GETTEXT_PACKAGE', 'gnome-sudoku')
+conf.set_quoted('LOCALEDIR', join_paths(prefix, localedir))
+conf.set_quoted('VERSION', meson.project_version())
+
+configure_file(output: 'config.h',
+  configuration: conf
+)
+
+subdir('data')
+subdir('help')
+subdir('lib')
+subdir('po')
+subdir('src')
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 0000000..6074e2a
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1 @@
+i18n.gettext('gnome-sudoku', preset: 'glib')
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000..cff61bc
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,23 @@
+gnome_sudoku_vala_args = [
+  '--gresources', resource_files,
+  '--pkg', 'posix'
+]
+
+gnome_sudoku_sources = [
+  'config.vapi',
+  'gnome-sudoku.vala',
+  'number-picker.vala',
+  'print-dialog.vala',
+  'sudoku-printer.vala',
+  'sudoku-view.vala',
+  resources
+]
+
+gnome_sudoku_dependencies = [gtk, libsudoku_dep]
+
+gnome_sudoku = executable('gnome-sudoku', gnome_sudoku_sources,
+  vala_args: gnome_sudoku_vala_args,
+  dependencies: gnome_sudoku_dependencies,
+  link_with: libsudoku,
+  install: true
+)


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