diff --git a/Makefile.am b/Makefile.am index 17d24be5d17d8c56674748b0e865563b81b0ea1f..de2b715db9877dc5c53ee75f8ba4e532c9e85206 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 0000000000000000000000000000000000000000..b6c1dd52bd5f76bf61a8ae531847149478264c35 --- /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 0000000000000000000000000000000000000000..9c57fb54caa4a0ad9605f2ae405eefe41ffbe782 --- /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 0000000000000000000000000000000000000000..e058487fed44bdc73cffcee3431cd72d268eb7ca --- /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 0000000000000000000000000000000000000000..e704fb989eafd1d3dd35c713de67c8577c279f91 --- /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 0000000000000000000000000000000000000000..d6ca4693a566f2494561674d9233fc0f1c0b7e69 --- /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 0000000000000000000000000000000000000000..d5877fc26591d4c39eb68a40e0579878e0acd20c --- /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 0000000000000000000000000000000000000000..ab170fa6c74c8f09dc3ce1d150c0060f397571d2 --- /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 +)