Commit fe76afa7 authored by Bilal Elmoussaoui's avatar Bilal Elmoussaoui Committed by Arnaud B.

ditch autotools and migrate to meson

Squash of the 6 main commits from Bilal
Elmoussaoui branch (no app-id changes).

Edited a bit by Arnaud Bonatti, to keep
the COPYING file, avoid adding trailing
spaces, use a variable named pkgdatadir
instead of datadir (as suggested by Jan
Tojnar), use new-lines at end of files,
consistently use 4 spaces and not tabs.

Closes !4 (see also following patches).
parent 464016cf
SUBDIRS = data help po src
MAINTAINERCLEANFILES = \
$(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL) \
$(GITIGNORE_MAINTAINERCLEANFILES_MAKEFILE_IN)
# We currently have no custom macros
GITIGNOREFILES = m4
-include $(top_srcdir)/git.mk
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
test -n "$srcdir" || srcdir=`dirname "$0"`
test -n "$srcdir" || srcdir=.
olddir=`pwd`
cd $srcdir
(test -f configure.ac) || {
echo "*** ERROR: Directory "\`$srcdir\'" does not look like the top-level project directory ***"
exit 1
}
# Use the style-checker as pre-commit and pre-applypatch hooks
if [ -d $srcdir/.git ]; then
for HOOK in pre-commit pre-applypatch; do
if [ ! -L $srcdir/.git/hooks/$HOOK ]; then
ln -s ../../../libgnome-games-support/style-checker \
$srcdir/.git/hooks/$HOOK && echo "Enabled $HOOK style checker."
fi
done
fi
PKG_NAME=`autoconf --trace 'AC_INIT:$1' configure.ac`
if [ "$#" = 0 -a "x$NOCONFIGURE" = "x" ]; then
echo "*** WARNING: I am going to run \`configure' with no arguments." >&2
echo "*** If you wish to pass any to it, please specify them on the" >&2
echo "*** \`$0\' command line." >&2
echo "" >&2
fi
aclocal --install || exit 1
intltoolize --force --copy --automake || exit 1
autoreconf --verbose --force --install -Wno-portability || exit 1
cd $olddir
if [ "$NOCONFIGURE" = "" ]; then
$srcdir/configure "$@" || exit 1
if [ "$1" = "--help" ]; then exit 0 else
echo "Now type \`make\' to compile $PKG_NAME" || exit 1
fi
else
echo "Skipping configure process."
fi
#!/usr/bin/env python3
from os import environ, path
from subprocess import call
if not environ.get('DESTDIR', ''):
PREFIX = environ.get('MESON_INSTALL_PREFIX', '/usr/local')
DATA_DIR = path.join(PREFIX, 'share')
print('Updating icon cache...')
call(['gtk-update-icon-cache', '-qtf', path.join(DATA_DIR, 'icons/hicolor')])
print("Compiling new schemas")
call(["glib-compile-schemas", path.join(DATA_DIR, 'glib-2.0/schemas')])
print("Updating desktop database")
call(["update-desktop-database", path.join(DATA_DIR, 'applications')])
AC_PREREQ([2.63])
AC_INIT([Iagno], [3.31.4],
[https://gitlab.gnome.org/GNOME/iagno/issues],
[iagno], [https://wiki.gnome.org/Apps/Iagno])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-xz foreign])
AM_SILENT_RULES([yes])
AM_MAINTAINER_MODE
AM_PROG_VALAC([0.27.1])
AM_PROG_CC_C_O
GLIB_GSETTINGS
APPSTREAM_XML
dnl ###########################################################################
dnl Dependencies
dnl ###########################################################################
GLIB_REQUIRED=2.40.0
GTK_REQUIRED=3.15.0
RSVG_REQUIRED=2.32.0
CANBERRA_GTK_REQUIRED=0.26
PKG_CHECK_MODULES(IAGNO, [
glib-2.0 >= $GLIB_REQUIRED
gtk+-3.0 >= $GTK_REQUIRED
librsvg-2.0 >= $RSVG_REQUIRED
libcanberra-gtk3 >= $CANBERRA_GTK_REQUIRED
])
AC_SUBST([GLIB_REQUIRED])
AC_PATH_PROG([DESKTOP_FILE_VALIDATE], [desktop-file-validate], [/bin/true])
AC_PATH_PROG([GTESTER], [gtester])
if ! test -x "${GTESTER}" ; then
AC_MSG_ERROR([Please install gtester])
fi
dnl ###########################################################################
dnl GResources
dnl ###########################################################################
AC_PATH_PROG([GLIB_COMPILE_RESOURCES],[glib-compile-resources])
dnl ###########################################################################
dnl Internationalization
dnl ###########################################################################
AM_GNU_GETTEXT_VERSION([0.19.8])
AM_GNU_GETTEXT([external])
AC_SUBST(GETTEXT_PACKAGE, iagno)
dnl ###########################################################################
dnl Documentation
dnl ###########################################################################
YELP_HELP_INIT
dnl ###########################################################################
dnl Files to generate
dnl ###########################################################################
AC_CONFIG_FILES([
Makefile
po/Makefile.in
data/Makefile
data/icons/Makefile
data/icons/hicolor/Makefile
data/themes/Makefile
help/Makefile
src/Makefile
])
AC_OUTPUT
SUBDIRS = \
icons \
themes
dist_noinst_DATA = \
iagno-screens.ui \
iagno-themes.ui \
iagno.ui \
iagno.css
themedir = $(datadir)/iagno/themes/svg
theme_DATA = \
high_contrast.svg \
sun_and_star.svg \
black_and_white.svg
soundsdir = $(datadir)/iagno/sounds
sounds_DATA = \
flip-piece.ogg \
gameover.ogg
desktopdir = $(datadir)/applications
desktop_in_files = iagno.desktop.in
desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
$(desktop_DATA): $(desktop_in_files)
$(AM_V_GEN)$(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@
appstream_in_files = iagno.appdata.xml.in
appstream_XML = $(appstream_in_files:.xml.in=.xml)
@APPSTREAM_XML_RULES@
$(appstream_XML): $(appstream_in_files)
$(AM_V_GEN)$(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
gsettings_SCHEMAS = org.gnome.iagno.gschema.xml
@GSETTINGS_RULES@
man_MANS = iagno.6
EXTRA_DIST = \
$(theme_DATA) \
$(sounds_DATA) \
$(appstream_in_files) \
$(desktop_in_files) \
$(gsettings_SCHEMAS) \
$(man_MANS)
CLEANFILES = \
$(appstream_XML) \
$(desktop_DATA)
check-local: $(desktop_DATA)
$(DESKTOP_FILE_VALIDATE) $(desktop_DATA)
DISTCHECK_CONFIGURE_FLAGS = --enable-appdata-check
-include $(top_srcdir)/git.mk
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/iagno/ui">
<file preprocess="xml-stripblanks" compressed="true" alias="game-window.ui">ui/iagno.ui</file>
<file preprocess="xml-stripblanks" compressed="true" alias="themes.ui">ui/iagno-themes.ui</file>
<file preprocess="xml-stripblanks" compressed="true" alias="iagno-screens.ui">ui/iagno-screens.ui</file>
<file compressed="true">iagno.css</file>
</gresource>
</gresources>
SUBDIRS = hicolor
-include $(top_srcdir)/git.mk
icon16dir=$(datadir)/icons/hicolor/16x16/apps
icon22dir=$(datadir)/icons/hicolor/22x22/apps
icon24dir=$(datadir)/icons/hicolor/24x24/apps
icon32dir=$(datadir)/icons/hicolor/32x32/apps
icon48dir=$(datadir)/icons/hicolor/48x48/apps
icon256dir=$(datadir)/icons/hicolor/256x256/apps
iconscalabledir=$(datadir)/icons/hicolor/scalable/apps
icon16_DATA = 16x16/iagno.png
icon22_DATA = 22x22/iagno.png
icon24_DATA = 24x24/iagno.png
icon32_DATA = 32x32/iagno.png
icon48_DATA = 48x48/iagno.png
icon256_DATA = 256x256/iagno.png
iconscalable_DATA = scalable/iagno-symbolic.svg
EXTRA_DIST = $(icon16_DATA) $(icon22_DATA) $(icon24_DATA) $(icon32_DATA) $(icon48_DATA) $(icon256_DATA) $(iconscalable_DATA)
-include $(top_srcdir)/git.mk
# Install icons
icon_sizes = ['16', '22', '24', '32', '48', '256']
foreach size : icon_sizes
install_data(
join_paths('icons', 'hicolor', '@0@x@0@'.format(size), '@0@.png'.format(project_id)),
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', '@0@x@0@'.format(size), 'apps')
)
endforeach
# Install symbolic icon
install_data(
join_paths('icons', 'hicolor', 'symbolic', '@0@-symbolic.svg'.format(project_id)),
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', 'symbolic', 'apps')
)
# Install gschema
install_data(
'@0@.gschema.xml'.format(project_id),
install_dir : join_paths(get_option('datadir'), 'glib-2.0', 'schemas')
)
# Compiling gresoruce
resources = gnome.compile_resources(
'resources', '@0@.gresource.xml'.format(meson.project_name()),
source_dir: '.'
)
# Desktop file
desktop_file = i18n.merge_file(
input: '@0@.desktop.in'.format(project_id),
output: '@0@.desktop'.format(project_id),
po_dir: join_paths(meson.source_root(), 'po'),
type: 'desktop',
install: true,
install_dir: join_paths(get_option('datadir'), 'applications')
)
# Validate desktop file
desktop_file_validate = find_program('desktop-file-validate', required: false)
if desktop_file_validate.found()
test(
'validate-desktop',
desktop_file_validate,
args: [
desktop_file.full_path()
]
)
endif
# AppData file
appdata_file = i18n.merge_file(
input: '@0@.appdata.xml.in'.format(project_id),
output: '@0@.appdata.xml'.format(project_id),
po_dir: join_paths(meson.source_root(), 'po'),
install: true,
install_dir: join_paths(get_option('datadir'), 'metainfo')
)
# Validate AppData file
appstream_util = find_program('appstream-util', required: false)
if appstream_util.found()
test(
'validate-appdata', appstream_util,
args: [
'validate-relax', appdata_file.full_path()
]
)
endif
# Install man page
install_man('@0@.6'.format(meson.project_name()))
# Install sounds
install_data(
[
'sounds/flip-piece.ogg',
'sounds/gameover.ogg'
],
install_dir: join_paths(get_option('datadir'), meson.project_name(), 'sounds')
)
# Install themes
install_data(
[
'black_and_white.svg',
'high_contrast.svg',
'sun_and_star.svg'
],
install_dir: join_paths(get_option('datadir'), meson.project_name(), 'themes', 'svg')
)
subdir('themes')
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2013 Michael Catanzaro and contributors -->
<component type="desktop">
<id>iagno.desktop</id>
<id>org.gnome.iagno</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0+</project_license>
<name>Iagno</name>
......
[Desktop Entry]
# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
Icon=iagno
Icon=org.gnome.iagno
Name=Iagno
GenericName=Reversi
Comment=Dominate the board in a classic version of Reversi
......
themes_keydir = $(datadir)/iagno/themes/key
themes_key_in_files = \
adwaita.theme.desktop.in \
classic.theme.desktop.in \
high_contrast.theme.desktop.in \
sun_and_star.theme.desktop.in
themes_key_DATA = $(themes_key_in_files:.theme.desktop.in=.theme)
$(themes_key_DATA): %.theme: %.theme.desktop.in $(wildcard $(top_srcdir)/po/*po)
$(AM_V_GEN)$(MSGFMT) --desktop --keyword=Name --template $< -d $(top_srcdir)/po -o $@
EXTRA_DIST = $(themes_key_in_files)
CLEANFILES = $(themes_key_DATA)
-include $(top_srcdir)/git.mk
themes = [
'adwaita',
'classic',
'high_contrast',
'sun_and_star'
]
foreach theme: themes
i18n.merge_file(
input: '@0@.theme.desktop.in'.format(theme),
output: '@0@.theme'.format(theme),
po_dir: join_paths(meson.source_root(), 'po'),
type: 'desktop',
install: true,
install_dir: join_paths(get_option('datadir'), 'iagno', 'themes','key')
)
endforeach
ca
cs
de
el
en_GB
es
eu
fr
gl
hu
it
oc
pl
pt_BR
sl
sr
sr@latin
sv
zh_CN
@YELP_HELP_RULES@
HELP_ID = iagno
HELP_MEDIA = \
figures/block.png \
figures/first.png \
figures/iagno-video.ogv \
figures/logo32.png \
figures/logo.png \
figures/start.png
HELP_FILES = \
2player.page \
ai-game.page \
bug-filing.page \
change-color.page \
develop.page \
documentation.page \
index.page \
legal.xml \
license.page \
play.page \
rules.page \
shortcuts.page \
sound.page \
strategy.page \
translate.page
HELP_LINGUAS = ca cs de el en_GB es eu fr gl hu it oc pl pt_BR sl sr sr@latin sv zh_CN
-include $(top_srcdir)/git.mk
help_media = [
'figures/block.png',
'figures/first.png',
'figures/iagno-video.ogv',
'figures/logo32.png',
'figures/logo.png',
'figures/start.png'
]
help_files = [
'2player.page',
'ai-game.page',
'bug-filing.page',
'change-color.page',
'develop.page',
'documentation.page',
'index.page',
'legal.xml',
'license.page',
'play.page',
'rules.page',
'shortcuts.page',
'sound.page',
'strategy.page',
'translate.page'
]
gnome.yelp(meson.project_name(),
sources: help_files,
media: help_media,
symlink_media: true
)
project('iagno', ['vala', 'c'],
version: '3.30.0')
project_id = 'org.gnome.iagno'
i18n = import('i18n')
# used to install help
gnome = import('gnome')
# used to run post install script
python3 = import('python3')
canberra_dependency = dependency('libcanberra')
canberra_gtk3_dependency = dependency('libcanberra-gtk3', version: '>= 0.26')
gio_dependency = dependency('gio-2.0', version: '>= 2.40.0')
glib_dependency = dependency('glib-2.0', version: '>= 2.40.0')
gtk_dependency = dependency('gtk+-3.0', version: '>= 3.15.0')
posix_dependency = meson.get_compiler('vala').find_library('posix')
rsvg_dependency = dependency('librsvg-2.0', version: '>= 2.32.0')
# Set gettext package name
add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format (meson.project_name()), language: 'c')
localedir = join_paths(get_option('prefix'), get_option('localedir'))
pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name())
soundsdir = join_paths(pkgdatadir, 'sounds')
conf = configuration_data ()
conf.set_quoted ('VERSION', meson.project_version())
conf.set_quoted ('GETTEXT_PACKAGE', meson.project_name())
conf.set_quoted ('DATA_DIRECTORY', pkgdatadir)
conf.set_quoted ('SOUND_DIRECTORY', soundsdir)
conf.set_quoted ('LOCALEDIR', localedir)
configure_file(output: 'config.h', configuration: conf)
config_h_dir = include_directories('.')
subdir('data')
subdir('po')
subdir('help')
subdir('src')
meson.add_install_script(python3.find_python().path(), join_paths(meson.source_root(),
'build-aux',
'meson_post_install.py'))
......@@ -43,6 +43,7 @@
"modules" : [
{
"name" : "iagno",
"buildsystem": "meson",
"sources" : [
{
"type" : "git",
......
# Makefile variables for PO directory in any package using GNU gettext.
# Usually the message domain is the same as the package name.
DOMAIN = $(PACKAGE)
# These two variables depend on the location of this directory.
subdir = po
top_builddir = ..
# These options get passed to xgettext.
XGETTEXT_OPTIONS = --from-code=UTF-8 --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_:1c,2 --keyword=g_dngettext:2,3 --add-comments
# This is the copyright holder that gets inserted into the header of the
# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
# package. (Note that the msgstr strings, extracted from the package's
# sources, belong to the copyright holder of the package.) Translators are
# expected to transfer the copyright for their translations to this person
# or entity, or to disclaim their copyright. The empty string stands for
# the public domain; in this case the translators are expected to disclaim
# their copyright.
COPYRIGHT_HOLDER = Iagno Contributors
# This tells whether or not to prepend "GNU " prefix to the package
# name that gets inserted into the header of the $(DOMAIN).pot file.
# Possible values are "yes", "no", or empty. If it is empty, try to
# detect it automatically by scanning the files in $(top_srcdir) for
# "GNU packagename" string.
PACKAGE_GNU = no
# This is the email address or URL to which the translators shall report
# bugs in the untranslated strings:
# - Strings which are not entire sentences, see the maintainer guidelines
# in the GNU gettext documentation, section 'Preparing Strings'.
# - Strings which use unclear terms or require additional context to be
# understood.
# - Strings which make invalid assumptions about notation of date, time or
# money.
# - Pluralisation problems.
# - Incorrect English spelling.
# - Incorrect formatting.
# It can be your email address, or a mailing list address where translators
# can write to without being subscribed, or the URL of a web page through
# which the translators can contact you.
MSGID_BUGS_ADDRESS = https://gitlab.gnome.org/GNOME/iagno/issues
# This is the list of locale categories, beyond LC_MESSAGES, for which the
# message catalogs shall be used. It is usually empty.
EXTRA_LOCALE_CATEGORIES =
# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt'
# context. Possible values are "yes" and "no". Set this to yes if the
# package uses functions taking also a message context, like pgettext(), or
# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument.
USE_MSGCTXT = yes
# These options get passed to msgmerge.
# Useful options are in particular:
# --previous to keep previous msgids of translated messages,
# --quiet to reduce the verbosity.
MSGMERGE_OPTIONS =
# These options get passed to msginit.
# If you want to disable line wrapping when writing PO files, add
# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and
# MSGINIT_OPTIONS.
MSGINIT_OPTIONS =
# This tells whether or not to regenerate a PO file when $(DOMAIN).pot
# has changed. Possible values are "yes" and "no". Set this to no if
# the POT file is checked in the repository and the version control
# program ignores timestamps.
PO_DEPENDS_ON_POT = no
# This tells whether or not to forcibly update $(DOMAIN).pot and
# regenerate PO files on "make dist". Possible values are "yes" and
# "no". Set this to no if the POT file and PO files are maintained
# externally.
DIST_DEPENDS_ON_UPDATE_PO = no
# List of source files containing translatable strings.
# Please keep this file in alphabetical order.
data/iagno.appdata.xml.in
data/iagno.desktop.in
data/iagno-screens.ui
data/iagno-themes.ui
data/iagno.ui
data/org.gnome.iagno.appdata.xml.in
data/org.gnome.iagno.desktop.in
data/ui/iagno-screens.ui
data/ui/iagno-themes.ui
data/ui/iagno.ui
data/themes/adwaita.theme.desktop.in
data/themes/classic.theme.desktop.in
data/themes/high_contrast.theme.desktop.in
......
i18n.gettext(meson.project_name(), preset: 'glib')
bin_PROGRAMS = iagno
check_PROGRAMS = test-iagno
BUILT_SOURCES = iagno-resources.c
iagno_SOURCES = \
config.vapi \
computer-player.vala \
game.vala \
game-view.vala \
game-window.vala \
iagno.vala \
player.vala \