[aisleriot] build: Use meson build system



commit 9e21bd12827d0780af3aedbd7d5e86d3941c5b0c
Author: Christian Persch <chpe src gnome org>
Date:   Sat Sep 14 20:30:32 2019 +0200

    build: Use meson build system

 Makefile.am                                        |  69 ---
 Makefile.meson                                     |  43 ++
 NEWS                                               | 106 ----
 acinclude.m4                                       | 319 -----------
 autogen.sh                                         |  15 -
 cards/Makefile.am                                  |  52 --
 cards/meson.build                                  |  84 +++
 cards/meson_svgz.sh                                |  29 +
 configure.ac                                       | 609 ---------------------
 data/Makefile.am                                   |  55 --
 data/icons/Makefile.am                             |  95 ----
 data/icons/meson.build                             |  78 +++
 data/icons/meson_updateiconcache.py                |  28 +
 data/meson.build                                   |  69 +++
 data/meson_desktopfile.py                          |  28 +
 data/sol.desktop.in                                |  10 +
 data/sol.desktop.in.in                             |  14 -
 data/{sol.appdata.xml.in => sol.metainfo.xml.in}   |   0
 data/sounds/Makefile.am                            |  14 -
 data/sounds/meson.build                            |  26 +
 games/Makefile.am                                  | 126 -----
 games/guile-compile                                |  13 +-
 games/meson.build                                  | 165 ++++++
 git.mk                                             | 200 -------
 help/LINGUAS                                       |  18 +
 help/Makefile.am                                   | 112 ----
 help/meson.build                                   | 130 +++++
 meson.build                                        | 499 +++++++++++++++++
 meson_options.txt                                  | 144 +++++
 po/POTFILES.in                                     |  16 +-
 po/meson.build                                     |  19 +
 src/Makefile.am                                    | 120 ----
 ...ot.gresource.xml.in => aisleriot.gresource.xml} |  10 +-
 src/{aisleriot.schemas.in => aisleriot.schemas}    |   2 +-
 src/ar-stock.c                                     |   5 +
 {data => src/data}/baize.png                       | Bin
 {data => src/data}/baize.xcf                       | Bin
 {data => src/data}/slot.svg                        |   0
 src/lib/Makefile.am                                | 176 ------
 src/lib/ar-card-theme-private.h                    |   6 +-
 src/lib/ar-card-themes.c                           |  16 +-
 src/lib/meson.build                                | 149 +++++
 src/lib/meson_compileschemas.py                    |  28 +
 ... => org.gnome.Patience.WindowState.gschema.xml} |   8 +-
 src/lib/render-cards.c                             |   2 +-
 src/meson.build                                    |  99 ++++
 src/meson_gconf.py                                 |  28 +
 47 files changed, 1723 insertions(+), 2111 deletions(-)
---
diff --git a/Makefile.meson b/Makefile.meson
new file mode 100644
index 00000000..4e92f6f8
--- /dev/null
+++ b/Makefile.meson
@@ -0,0 +1,43 @@
+# Copyright © 2019 Christian Persch
+#
+# This programme is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or (at your
+# option) any later version.
+#
+# This programme is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this library.  If not, see <https://www.gnu.org/licenses/>.
+
+srcdir=@srcdir@
+builddir=@builddir@
+
+#
+
+NTHREADS = 1
+NJOBS = -j$(NTHREADS)
+NINJA = ninja $(NJOBS)
+
+#
+
+all:
+       $(NINJA)
+
+check:
+       MESON_TESTTHREADS=$(NTHREADS) $(NINJA) test
+
+clean:
+       $(NINJA) clean
+
+coverage:
+       $(NINJA) coverage
+
+install:
+       $(NINJA) install
+
+uninstall:
+       $(NINJA) uninstall
diff --git a/cards/meson.build b/cards/meson.build
new file mode 100644
index 00000000..e865f100
--- /dev/null
+++ b/cards/meson.build
@@ -0,0 +1,84 @@
+# Copyright © 2019 Christian Persch
+#
+# This programme is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or (at your
+# option) any later version.
+#
+# This programme is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this programme.  If not, see <https://www.gnu.org/licenses/>.
+
+# Cards
+
+xmllint_flags = [
+  '--nonet',
+  '--noblanks',
+]
+
+gzip_flags = [
+  '-9',
+  '-n',
+]
+
+cards_sources = [
+  'anglo.svg',
+  'anglo_bitmap.svg',
+  'bellot.svg',
+  'bonded.svg',
+  'dondorf.svg',
+  'gnomangelo.svg',
+  'gnomangelo_bitmap.svg',
+  'guyenne-classic.svg',
+  'ornamental.svg',
+  'paris.svg',
+  'swiss-xvii.svg',
+  'tango.svg',
+]
+
+cardsdir = ar_pkgdatadir / 'cards'
+
+# FIXME: this should use files('...') (allowed as per docs),
+# but that crashes meson, see https://gitlab.gnome.org/chpe/meson/issues/2
+compress_svg = find_program('meson_svgz.sh')
+
+cards_svgz = []
+foreach svg : cards_sources
+  svgz = svg.split('.')[0] + '.svgz'
+  cards_svgz += custom_target(
+    svgz,
+    command: [
+      compress_svg,
+      xmllint,
+      ' '.join(xmllint_flags),
+      gzip,
+      ' '.join(gzip_flags),
+      '@INPUT@',
+      '@OUTPUT@'
+    ],
+    input: svg,
+    install: true,
+    install_dir: cardsdir,
+    output: svgz,
+  )
+endforeach
+
+# SVGcrush
+
+libxml_dep = dependency('libxml-2.0')
+
+svgcrush_sources = files(
+  'svgcrush.c',
+)
+
+svgcrush = executable(
+  'svgcrush',
+  svgcrush_sources,
+  dependencies: [glib_dep, libxml_dep,],
+  include_directories: [top_inc,],
+  install: false,
+)
diff --git a/cards/meson_svgz.sh b/cards/meson_svgz.sh
new file mode 100755
index 00000000..20f0de96
--- /dev/null
+++ b/cards/meson_svgz.sh
@@ -0,0 +1,29 @@
+#!/usr/bin/bash
+# Copyright © 2019 Christian Persch
+#
+# This programme is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or (at your
+# option) any later version.
+#
+# This programme is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this programme.  If not, see <https://www.gnu.org/licenses/>.
+
+# Really sucks that meson has no simple way to just chain a few commands
+# together in a pipe to produce an output file.
+
+set -e
+
+xmllint="$1"
+xmllint_flags="$2"
+gzip="$3"
+gzip_flags="$4"
+infile="$5"
+outfile="$6"
+
+cat "${infile}" | "${xmllint}" ${xmllint_flags} - | "${gzip}" ${gzip_flags} > "${outfile}"
diff --git a/data/icons/meson.build b/data/icons/meson.build
new file mode 100644
index 00000000..72e09f76
--- /dev/null
+++ b/data/icons/meson.build
@@ -0,0 +1,78 @@
+# Copyright © 2019 Christian Persch
+#
+# This programme is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or (at your
+# option) any later version.
+#
+# This programme is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this programme.  If not, see <https://www.gnu.org/licenses/>.
+
+public_icons_themes = [
+  'hicolor',
+]
+
+public_icons_sources = [
+  'hicolor_apps_16x16_gnome-aisleriot.png',
+  'hicolor_apps_16x16_gnome-freecell.png',
+  'hicolor_apps_22x22_gnome-aisleriot.png',
+  'hicolor_apps_22x22_gnome-freecell.png',
+  'hicolor_apps_24x24_gnome-aisleriot.png',
+  'hicolor_apps_24x24_gnome-freecell.png',
+  'hicolor_apps_256x256_gnome-aisleriot.png',
+  'hicolor_apps_256x256_gnome-freecell.png',
+  'hicolor_apps_32x32_gnome-aisleriot.png',
+  'hicolor_apps_32x32_gnome-freecell.png',
+  'hicolor_apps_48x48_gnome-aisleriot.png',
+  'hicolor_apps_48x48_gnome-freecell.png',
+  'hicolor_apps_symbolic_gnome-aisleriot-symbolic.svg',
+]
+
+private_icons_sources = [
+  'hicolor_actions_16x16_cards-deal.png',
+  'hicolor_actions_22x22_cards-deal.png',
+  'hicolor_actions_24x24_cards-deal.png',
+  'hicolor_actions_32x32_cards-deal.png',
+  'hicolor_actions_48x48_cards-deal.png',
+  'hicolor_actions_scalable_cards-deal.svg',
+]
+
+public_icons_renames = []
+private_icons_renames = []
+
+foreach icon : public_icons_sources
+  components = icon.split('_')
+  public_icons_renames += components[0] / components[2] / components[1] / components[3]
+endforeach
+
+foreach icon : private_icons_sources
+  components = icon.split('_')
+  private_icons_renames += components[0] / components[2] / components[1] / components[3]
+endforeach
+
+icondir = ar_datadir / 'icons'
+pkgicondir = ar_pkgdatadir / 'icons'
+
+install_data(
+  sources: public_icons_sources,
+  rename: public_icons_renames,
+  install_dir: icondir,
+)
+
+install_data(
+  sources: private_icons_sources,
+  rename: private_icons_renames,
+  install_dir: pkgicondir,
+)
+
+foreach theme : public_icons_themes
+  meson.add_install_script(
+    'meson_updateiconcache.py',
+    icondir / theme,
+  )
+endforeach
diff --git a/data/icons/meson_updateiconcache.py b/data/icons/meson_updateiconcache.py
new file mode 100755
index 00000000..b625d073
--- /dev/null
+++ b/data/icons/meson_updateiconcache.py
@@ -0,0 +1,28 @@
+#!/usr/bin/env python3
+# Copyright © 2019 Christian Persch
+#
+# This programme is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or (at your
+# option) any later version.
+#
+# This programme is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this programme.  If not, see <https://www.gnu.org/licenses/>.
+
+import os
+import subprocess
+import sys
+
+if os.environ.get('DESTDIR'):
+    sys.exit(0)
+
+prefix = os.environ['MESON_INSTALL_PREFIX']
+icondir = os.path.join(prefix, sys.argv[1])
+
+rv = subprocess.call(['gtk-update-icon-cache', '-f', '-t', icondir])
+sys.exit(0)
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 00000000..9f88c2f3
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1,69 @@
+# Copyright © 2019 Christian Persch
+#
+# This programme is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or (at your
+# option) any later version.
+#
+# This programme is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this programme.  If not, see <https://www.gnu.org/licenses/>.
+
+# Appstream data
+
+metainfodir = ar_prefix / ar_datadir / 'metainfo'
+
+i18n.merge_file(
+  'sol.metainfo.xml',
+  input: 'sol.metainfo.xml.in',
+  output: '@BASENAME@',
+  po_dir: po_dir,
+  install: true,
+  install_dir: metainfodir,
+)
+
+# Desktop file
+
+desktopdatadir = ar_prefix / ar_datadir / 'applications'
+
+desktop_in = files(
+  'sol.desktop.in',
+)
+
+i18n.merge_file(
+  'sol.desktop',
+  input: desktop_in,
+  output: '@BASENAME@',
+  type: 'desktop',
+  po_dir: po_dir,
+  install: true,
+  install_dir: desktopdatadir,
+)
+
+meson.add_install_script(
+  'meson_desktopfile.py',
+  desktopdatadir,
+  'sol.desktop',
+)
+
+# Valgrind suppressions
+
+valgrinddir = ar_prefix / ar_libdir / 'valgrind'
+
+valgrind_data = [
+  'aisleriot.supp',
+]
+
+install_data(
+  sources: valgrind_data,
+  install_dir: valgrinddir,
+)
+
+# Subdirs
+
+subdir('icons')
+subdir('sounds')
diff --git a/data/meson_desktopfile.py b/data/meson_desktopfile.py
new file mode 100755
index 00000000..ced926f1
--- /dev/null
+++ b/data/meson_desktopfile.py
@@ -0,0 +1,28 @@
+#!/usr/bin/env python3
+# Copyright © 2019 Christian Persch
+#
+# This programme is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or (at your
+# option) any later version.
+#
+# This programme is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this programme.  If not, see <https://www.gnu.org/licenses/>.
+
+import os
+import subprocess
+import sys
+
+if os.environ.get('DESTDIR'):
+    sys.exit(0)
+
+prefix = os.environ['MESON_INSTALL_PREFIX']
+desktopfile = os.path.join(prefix, sys.argv[1], sys.argv[2])
+
+rv = subprocess.call(['desktop-file-validate', desktopfile])
+sys.exit(rv)
diff --git a/data/sol.desktop.in b/data/sol.desktop.in
new file mode 100644
index 00000000..4956acd0
--- /dev/null
+++ b/data/sol.desktop.in
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=AisleRiot Solitaire
+Comment=Play many different solitaire games
+Exec=sol
+Icon=gnome-aisleriot
+Terminal=false
+Type=Application
+Categories=GNOME;GTK;Game;CardGame;
+Keywords=solitaire;cards;klondike;spider;freecell;patience;
+StartupNotify=true
diff --git a/data/sol.appdata.xml.in b/data/sol.metainfo.xml.in
similarity index 100%
rename from data/sol.appdata.xml.in
rename to data/sol.metainfo.xml.in
diff --git a/data/sounds/meson.build b/data/sounds/meson.build
new file mode 100644
index 00000000..29793a31
--- /dev/null
+++ b/data/sounds/meson.build
@@ -0,0 +1,26 @@
+# Copyright © 2019 Christian Persch
+#
+# This programme is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or (at your
+# option) any later version.
+#
+# This programme is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this programme.  If not, see <https://www.gnu.org/licenses/>.
+
+sounds_sources = [
+  'click.ogg',
+  'slide.ogg',
+  'splat.ogg',
+  'victory.ogg',
+]
+
+install_data(
+  sources: sounds_sources,
+  install_dir: ar_pkgdatadir / 'sounds',
+)
diff --git a/games/guile-compile b/games/guile-compile
index 32dedfc8..1164f670 100755
--- a/games/guile-compile
+++ b/games/guile-compile
@@ -1,6 +1,17 @@
 #!/bin/sh
 # -*- scheme -*-
-exec $GUILE $GUILE_FLAGS -e '(@@ (guild) main)' -s "$0" "$@"
+this="$0"
+srcdir="$1"
+builddir="$2"
+GUILE="$3"
+
+shift 3
+
+export GUILE_AUTO_COMPILE=0
+export GUILE_LOAD_PATH=".:${srcdir}"
+export GUILE_LOAD_COMPILED_PATH=.
+
+exec ${GUILE:-/bin/false} -e '(@@ (guild) main)' -s "$this" "$@"
 !#
 
 ;;;; guild --- running scripts bundled with Guile
diff --git a/games/meson.build b/games/meson.build
new file mode 100644
index 00000000..afbd003e
--- /dev/null
+++ b/games/meson.build
@@ -0,0 +1,165 @@
+# Copyright © 2019 Christian Persch
+#
+# This programme is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or (at your
+# option) any later version.
+#
+# This programme is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this programme.  If not, see <https://www.gnu.org/licenses/>.
+
+games_sources = [
+  'accordion.scm',
+  'agnes.scm',
+  'athena.scm',
+  'auld-lang-syne.scm',
+  'aunt-mary.scm',
+  'backbone.scm',
+  'bakers-dozen.scm',
+  'bakers-game.scm',
+  'bear-river.scm',
+  'beleaguered-castle.scm',
+  'block-ten.scm',
+  'bristol.scm',
+  'camelot.scm',
+  'canfield.scm',
+  'carpet.scm',
+  'chessboard.scm',
+  'clock.scm',
+  'cover.scm',
+  'cruel.scm',
+  'diamond-mine.scm',
+  'doublets.scm',
+  'eagle-wing.scm',
+  'easthaven.scm',
+  'eight-off.scm',
+  'elevator.scm',
+  'eliminator.scm',
+  'escalator.scm',
+  'first-law.scm',
+  'fortress.scm',
+  'fortunes.scm',
+  'forty-thieves.scm',
+  'fourteen.scm',
+  'freecell.scm',
+  'gaps.scm',
+  'gay-gordons.scm',
+  'giant.scm',
+  'glenwood.scm',
+  'gold-mine.scm',
+  'golf.scm',
+  'gypsy.scm',
+  'hamilton.scm',
+  'helsinki.scm',
+  'hopscotch.scm',
+  'isabel.scm',
+  'jamestown.scm',
+  'jumbo.scm',
+  'kansas.scm',
+  'king-albert.scm',
+  'kings-audience.scm',
+  'klondike.scm',
+  'labyrinth.scm',
+  'lady-jane.scm',
+  'maze.scm',
+  'monte-carlo.scm',
+  'napoleons-tomb.scm',
+  'neighbor.scm',
+  'odessa.scm',
+  'osmosis.scm',
+  'peek.scm',
+  'pileon.scm',
+  'plait.scm',
+  'poker.scm',
+  'quatorze.scm',
+  'royal-east.scm',
+  'saratoga.scm',
+  'scorpion.scm',
+  'scuffle.scm',
+  'seahaven.scm',
+  'sir-tommy.scm',
+  'spider-three-decks.scm',
+  'spider.scm',
+  'spiderette.scm',
+  'straight-up.scm',
+  'streets-and-alleys.scm',
+  'ten-across.scm',
+  'terrace.scm',
+  'thieves.scm',
+  'thirteen.scm',
+  'thumb-and-pouch.scm',
+  'treize.scm',
+  'triple-peaks.scm',
+  'union-square.scm',
+  'valentine.scm',
+  'wall.scm',
+  'westhaven.scm',
+  'whitehead.scm',
+  'will-o-the-wisp.scm',
+  'yield.scm',
+  'yukon.scm',
+  'zebra.scm',
+]
+
+module_sources = [
+  'api.scm',
+]
+
+guile_warnings = [
+  '-Warity-mismatch',
+  '-Wbad-case-datum',
+  '-Wduplicate-case-datum',
+  '-Wformat',
+  '-Wunbound-variable',
+  '-Wunsupported-warning',
+  '-Wunused-toplevel',
+  '-Wunused-variable',
+]
+
+# FIXME: this should use files('...') (allowed as per docs),
+# but that crashes meson, see https://gitlab.gnome.org/chpe/meson/issues/2
+guile_compile_prog = find_program('guile-compile')
+
+guile_compile = [
+  guile_compile_prog,
+  meson.current_source_dir(),
+  meson.current_build_dir(),
+  guile,
+  'compile',
+  guile_warnings,
+  '-o',
+  '@OUTPUT@',
+  '@INPUT@',
+]
+
+games_objects = []
+modules_objects = []
+
+foreach src : games_sources
+  obj = src.split('.')[0] + '.go'
+  games_objects += custom_target(
+    obj,
+    command: guile_compile,
+    input: src,
+    install: true,
+    install_dir: ar_prefix / ar_pkgguiledir,
+    output: obj,
+)
+endforeach
+
+foreach src : module_sources
+  obj = src.split('.')[0] + '.go'
+  modules_objects += custom_target(
+    obj,
+    command: guile_compile,
+    input: src,
+    install: true,
+    install_dir: ar_prefix / ar_pkgguiledir / 'aisleriot',
+    output: obj,
+)
+endforeach
diff --git a/help/LINGUAS b/help/LINGUAS
new file mode 100644
index 00000000..6feccbd2
--- /dev/null
+++ b/help/LINGUAS
@@ -0,0 +1,18 @@
+ca
+cs
+de
+el
+en_GB
+es
+eu
+fr
+gl
+hu
+oc
+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 00000000..cc202fe2
--- /dev/null
+++ b/help/meson.build
@@ -0,0 +1,130 @@
+# Copyright © 2019 Christian Persch
+#
+# This programme is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or (at your
+# option) any later version.
+#
+# This programme is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this programme.  If not, see <https://www.gnu.org/licenses/>.
+
+# Documentation
+
+help_media = [
+  'figures/camelot-goal.png',
+  'figures/clock-rules.png',
+]
+
+help_pages = [
+  'accordion.xml',
+  'agnes.xml',
+  'athena.xml',
+  'auld_lang_syne.xml',
+  'aunt_mary.xml',
+  'backbone.xml',
+  'bakers_dozen.xml',
+  'bakers_game.xml',
+  'bear_river.xml',
+  'beleaguered_castle.xml',
+  'block_ten.xml',
+  'bristol.xml',
+  'camelot.xml',
+  'canfield.xml',
+  'carpet.xml',
+  'chessboard.xml',
+  'clock.xml',
+  'cover.xml',
+  'cruel.xml',
+  'definitions.xml',
+  'diamond_mine.xml',
+  'doublets.xml',
+  'eagle-wing.xml',
+  'easthaven.xml',
+  'eight_off.xml',
+  'elevator.xml',
+  'eliminator.xml',
+  'escalator.xml',
+  'first_law.xml',
+  'fortress.xml',
+  'fortunes.xml',
+  'forty_thieves.xml',
+  'fourteen.xml',
+  'freecell.xml',
+  'gaps.xml',
+  'gay_gordons.xml',
+  'giant.xml',
+  'glenwood.xml',
+  'gold_mine.xml',
+  'golf.xml',
+  'gypsy.xml',
+  'hamilton.xml',
+  'helsinki.xml',
+  'hopscotch.xml',
+  'index.docbook',
+  'isabel.xml',
+  'jamestown.xml',
+  'jumbo.xml',
+  'kansas.xml',
+  'king_albert.xml',
+  'kings_audience.xml',
+  'klondike.xml',
+  'labyrinth.xml',
+  'lady_jane.xml',
+  'legal.xml',
+  'maze.xml',
+  'monte_carlo.xml',
+  'napoleons_tomb.xml',
+  'neighbor.xml',
+  'odessa.xml',
+  'osmosis.xml',
+  'peek.xml',
+  'pileon.xml',
+  'plait.xml',
+  'poker.xml',
+  'quatorze.xml',
+  'royal_east.xml',
+  'saratoga.xml',
+  'scorpion.xml',
+  'scuffle.xml',
+  'seahaven.xml',
+  'sir_tommy.xml',
+  'spider.xml',
+  'spider_three_decks.xml',
+  'spiderette.xml',
+  'straight_up.xml',
+  'streets_and_alleys.xml',
+  'ten_across.xml',
+  'terrace.xml',
+  'thieves.xml',
+  'thirteen.xml',
+  'thumb_and_pouch.xml',
+  'treize.xml',
+  'triple_peaks.xml',
+  'union_square.xml',
+  'valentine.xml',
+  'wall.xml',
+  'westhaven.xml',
+  'whitehead.xml',
+  'will_o_the_wisp.xml',
+  'yield.xml',
+  'yukon.xml',
+  'zebra.xml',
+]
+
+gnome.yelp(
+  'aisleriot',
+  media: help_media,
+  sources: help_pages,
+)
+
+# Man page
+
+install_data(
+  'sol.6',
+  install_dir: ar_mandir / 'man6',
+)
diff --git a/meson.build b/meson.build
new file mode 100644
index 00000000..01009b94
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,499 @@
+# Copyright © 2019 Christian Persch
+#
+# This programme is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or (at your
+# option) any later version.
+#
+# This programme is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this programme.  If not, see <https://www.gnu.org/licenses/>.
+
+project(
+  'aisleriot',
+  ['c', 'cpp',],
+  default_options: [
+    'buildtype=release',
+    'c_std=gnu11',
+    'cpp_std=gnu++11',
+    'warning_level=' + (meson.version().version_compare('>= 0.50.0') ? '0' : '1'),
+    'b_ndebug=false',
+  ],
+  license: [
+    'GPL-3.0-or-later',
+    'LGPL-3.0-or-later',
+    'GFDL-1.1-or-later',
+    'GFDL-1.3-only',
+  ],
+  meson_version: '>= 0.49.0',
+  version: '3.22.10',
+)
+
+# Naming
+
+ar_name = 'aisleriot'
+
+# Requirements
+
+cairo_req_version           = '1.10.0'
+gconf_req_version           = '2.0'
+gio_req_version             = '2.32.0'
+glib_req_version            = '2.32.0'
+gtk_req_version             = '3.18.0'
+guile_2_0_req_version       = '2.0.0'
+guile_2_2_req_version       = '2.2.0'
+libcanberra_gtk_req_version = '0.26'
+qt5svg_req_version          = '5.0.0'
+rsvg_req_version            = '2.32.0'
+
+# Versioning
+
+ar_version = meson.project_version()
+
+version_split = meson.project_version().split('.')
+ar_major_version = version_split[0].to_int()
+ar_minor_version = version_split[1].to_int()
+ar_micro_version = version_split[2].to_int()
+
+# i18n
+
+ar_gettext_domain = ar_name
+po_dir = meson.current_source_dir() / 'po'
+
+# Directories
+
+ar_prefix        = get_option('prefix')
+
+ar_bindir        = get_option('bindir')
+ar_datadir       = get_option('datadir')
+ar_includedir    = get_option('includedir')
+ar_libdir        = get_option('libdir')
+ar_libexecdir    = get_option('libexecdir')
+ar_localedir     = get_option('localedir')
+ar_mandir        = get_option('mandir')
+ar_sysconfdir    = get_option('sysconfdir')
+
+ar_pkgdatadir    = ar_datadir    / ar_name
+ar_pkglibdir     = ar_libdir     / ar_name
+ar_pkglibexecdir = ar_libexecdir / ar_name
+
+# Debug
+
+enable_debug = get_option('dbg') or get_option('debug') or get_option('buildtype').contains('debug')
+enable_debug_ui = get_option('dbgui') and enable_debug
+
+# Meson modules
+
+gnome = import('gnome')
+i18n  = import('i18n')
+pkg   = import('pkgconfig')
+
+# Compilers
+
+cc = meson.get_compiler('c')
+cxx = meson.get_compiler('cpp')
+
+# Meson has a misfeature where it allows the user to override the -std option
+# for the C/C++ compiler. Disallow that.
+
+assert(get_option('c_std') == 'gnu11', 'cannot override C std version')
+assert(get_option('cpp_std') == 'gnu++11', 'cannot override C++ std version')
+
+# Asserts must not be disabled
+
+assert(get_option('b_ndebug') == 'false', 'assertions may not be disabled')
+
+# Start config.h
+
+config_h = configuration_data()
+
+config_h.set_quoted('GETTEXT_PACKAGE', ar_gettext_domain)
+config_h.set_quoted('PACKAGE', ar_name)
+config_h.set_quoted('VERSION', ar_version)
+config_h.set('ENABLE_DEBUG', enable_debug)
+config_h.set('ENABLE_DEBUG_UI', enable_debug_ui)
+config_h.set('GNOME_ENABLE_DEBUG', enable_debug)
+
+# FIXME AC_USE_SYSTEM_EXTENSIONS also supported non-gnu systems
+config_h.set10('_GNU_SOURCE', true)
+
+# Options
+
+config_h.set('ENABLE_CARD_THEME_FORMAT_FIXED', get_option('theme_fixed'))
+config_h.set('ENABLE_CARD_THEME_FORMAT_KDE', get_option('theme_kde'))
+config_h.set('ENABLE_CARD_THEME_FORMAT_NATIVE', get_option('theme_svg_qtsvg'))
+config_h.set('ENABLE_CARD_THEME_FORMAT_PYSOL', get_option('theme_pysol'))
+config_h.set('ENABLE_CARD_THEME_FORMAT_SVG', get_option('theme_svg_rsvg'))
+
+config_h.set_quoted('AR_CARD_THEME_DEFAULT', get_option('default_theme'))
+
+if get_option('default_theme_format') == 'svg-rsvg'
+  default_theme_format='svg'
+elif get_option('default_theme_format') == 'svg-qtsvg'
+  default_teme_format='native'
+else
+  default_theme_format = get_option('default_theme_format')
+endif
+
+config_h.set_quoted('AR_CARD_THEME_DEFAULT_FORMAT_STRING', default_theme_format)
+
+# Compiler flags
+
+compiler_flags_common = [
+  '-Wall',
+  '-Wcast-align',
+  '-Wempty-body',
+  '-Wformat-signedness',
+  '-Werror=implicit-function-declaration',
+  '-Wextra',
+  '-Wformat-nonliteral',
+  '-Winit-self',
+  '-Wlogical-op',
+  '-Wmissing-declarations',
+  '-Wmissing-format-attribute',
+  '-Wno-missing-field-initializers',
+  '-Wno-switch-enum',
+  '-Wno-unused-parameter',
+  '-Wpacked',
+  '-Wpointer-arith',
+  '-Wshadow',
+  '-Wstrict-aliasing=2',
+  '-Wundef',
+  '-Wuninitialized',
+  '-Wunsafe-loop-optimizations',
+  '-Wwrite-strings',
+  '-fno-common',
+]
+
+compiler_flags_c_only = [
+  '-Waggregate-return',
+  '-Wimplicit',
+  '-Wmissing-prototypes',
+  '-Wnested-externs',
+  '-Wold-style-definition',
+  '-Wsign-compare',
+  '-Wstrict-prototypes',
+]
+
+compiler_flags_cxx_only = [
+]
+
+if enable_debug
+  compiler_flags_common += [
+    '-ggdb3',
+  ]
+endif
+
+# These are currently needed but the code should be fixed instead
+compiler_flags_common_undesirable = [
+  '-fno-strict-aliasing'
+]
+
+compiler_flags_c_required = [
+]
+
+compiler_flags_cxx_required = [
+]
+
+global_cflags = cc.get_supported_arguments(compiler_flags_common +
+                                           compiler_flags_common_undesirable +
+                                           compiler_flags_c_only +
+                                           compiler_flags_c_required)
+
+global_cxxflags = cxx.get_supported_arguments(compiler_flags_common +
+                                              compiler_flags_common_undesirable +
+                                              compiler_flags_cxx_only +
+                                              compiler_flags_cxx_required)
+
+foreach flag : compiler_flags_c_required
+  assert(cc.has_argument(flag), flag + ' is required but not supported')
+endforeach
+
+foreach flag : compiler_flags_cxx_required
+  assert(cxx.has_argument(flag), flag + ' is required but not supported')
+endforeach
+
+# Meson problem: GCC only accepts the latter 2 options of the 3 below
+# if the first is *also* passed, which doesn't work with get_supported_arguments()
+# above. So just add these unconditionally, since all compilers we support
+# accept these flags.
+
+compiler_flags_format_warnings = [
+# '-Werror=format=2',
+# '-Werror=format-nonliteral',
+# '-Werror=format-security',
+]
+
+global_cflags += compiler_flags_format_warnings
+global_cxxflags += compiler_flags_format_warnings
+
+# ... and now make these flags the default
+
+add_project_arguments(global_cflags, language: 'c',)
+add_project_arguments(global_cxxflags, language: 'cpp',)
+
+# Linker flags
+
+linker_flags = [
+]
+
+foreach flag: linker_flags
+  assert(cc.has_link_argument(flag), flag + ' is required but not supported')
+  add_project_link_arguments(flag, language: 'c',)
+  add_project_link_arguments(flag, language: 'cpp',)
+endforeach
+
+# Distribution
+
+distro = run_command(
+  'bash',
+  '-c',
+  'source /etc/os-release && echo $ID || echo unknown; exit 0'
+).stdout().strip()
+
+# Options
+
+theme_kde_base_paths = {
+  'centos':   '/usr/share/carddecks',
+  'debian':   '/usr/share/kde4/apps/carddecks',
+  'fedora':   '/usr/share/carddecks',
+  'opensuse': '/usr/share/kde4/apps/carddecks',
+  'rhel':     '/usr/share/carddecks',
+  'ubuntu':   '/usr/share/kde4/apps/carddecks',
+}
+
+theme_pysol_base_paths = {
+  'centos':   '/usr/share/PySolFC',
+  'debian':   '/usr/share/games/pysol',
+  'fedora':   '/usr/share/PySolFC',
+  'opensuse': '/usr/share/games/pysol/data',
+  'rhel':     '/usr/share/PySolFC',
+  'ubuntu':   '/usr/share/games/pysol',
+}
+
+theme_kde_path = get_option('theme_kde_path')
+if get_option('theme_kde')
+  if theme_kde_path == ''
+    foreach id, path : theme_kde_base_paths
+      if distro == id
+        theme_kde_path = path
+        break
+      endif
+    endforeach
+  endif
+
+  assert(theme_kde_path != '', 'Must specify base path to KDE card themes',)
+endif
+
+theme_pysol_path = get_option('theme_pysol_path')
+if get_option('theme_pysol')
+  if theme_pysol_path == ''
+    foreach id, path : theme_pysol_base_paths
+      if distro == id
+        theme_pysol_path = path
+        break
+      endif
+    endforeach
+  endif
+
+  assert(theme_pysol_path != '', 'Must specify base path to PySolFC card themes',)
+endif
+
+config_h.set_quoted('KDE_CARD_THEME_PATH', theme_kde_path,)
+config_h.set_quoted('PYSOL_CARD_THEME_PATH', theme_pysol_path,)
+
+# Guile
+
+if get_option('guile') == 'auto'
+  if dependency('guile-2.2', required: false,).found()
+    guile_version = '2.2'
+  elif dependency('guile-2.0', required: false,).found()
+    guile_version = '2.0'
+  else
+    assert(false, 'Guile not found')
+  endif
+else
+  guile_version = get_option('guile').to_string()
+endif
+
+guile_req = 'guile-' + guile_version
+
+if guile_version == '2.2'
+  guile_req_version = guile_2_2_req_version
+elif guile_version == '2.0'
+  guile_req_version = guile_2_0_req_version
+else
+  assert(false, 'unsupported guile version')
+endif
+
+ar_pkgguiledir = ar_pkglibdir / 'guile' / guile_version
+
+# Dependencies
+
+cairo_dep = dependency('cairo',     version: '>=' + cairo_req_version,)
+gio_dep   = dependency('gio-2.0',   version: '>=' + gio_req_version,)
+glib_dep  = dependency('glib-2.0',  version: '>=' + glib_req_version,)
+gtk_dep   = dependency('gtk+-3.0',  version: '>=' + gtk_req_version,)
+guile_dep = dependency(guile_req,   version: '>=' + guile_req_version,)
+
+if get_option('gconf')
+  gconf_dep = dependency('gconf-2.0', version: '>=' + gconf_req_version, required: true,)
+  config_h.set('HAVE_GNOME', true)
+else
+  gconf_dep = dependency('', required: false,)
+  config_h.set('HAVE_GNOME', false)
+endif
+
+if get_option('sound')
+  libcanberra_gtk_dep = dependency('libcanberra-gtk3', version: '>=' + libcanberra_gtk_req_version, 
required: true,)
+  config_h.set('ENABLE_SOUND', true,)
+else
+  libcanberra_gtk_dep = dependency('', required: false,)
+  config_h.set('ENABLE_SOUND', false,)
+endif
+
+if get_option('theme_svg_rsvg')
+  rsvg_dep = dependency('librsvg-2.0', version: '>=' + rsvg_req_version, required: true,)
+  config_h.set('HAVE_RSVG', true)
+else
+  rsvg_dep = dependency('', required: false,)
+  config_h.set('HAVE_RSVG', false)
+endif
+
+if get_option('theme_svg_qtsvg') or get_option('theme_kde')
+  qt5 = import('qt5')
+  qtsvg_dep = dependency('qt5', modules: ['Svg',],)
+
+#  qtsvg_dep = dependency('Qt5Svg', version: '>=' + qt5svg_req_version, required: true,)
+  config_h.set('HAVE_QTSVG', true)
+else
+  qtsvg_dep = dependency('', required: false,)
+  config_h.set('HAVE_QTSVG', false)
+endif
+
+libm_dep = cc.find_library('m')
+
+# Binreloc
+
+config_h.set('ENABLE_BINRELOC', get_option('binreloc'))
+
+# Auxiliary programmes
+
+guild = guile_dep.get_pkgconfig_variable('guild')
+guile = guile_dep.get_pkgconfig_variable('guile')
+gzip = find_program('gzip', required: true,)
+xmllint = find_program('xmllint', required: true,)
+
+if get_option('gconf')
+  gconftool = find_program('gconftool-2', required: true,)
+endif
+
+# Documentation
+
+# We support various ways to present help to the user:
+# ghelp: using the ghelp: protocol, most likely displaying in Yelp
+# file: showing html or xhtml files in the web browser
+# library: in the web browser loaded remotedly from library.gnome.org
+#
+# Note that for help using [x]html files, we can't use gnome-doc-utils.make
+# since it doesn't currently support this. The packager will have to use
+# gnome-doc-tool directly to build the documentation in the right format.
+# The help files must be installed in $(pkgdatadir)/$(DOC_MODULE)/$(LOCALE) .
+
+config_h.set('WITH_HELP_METHOD_GHELP', get_option('help_method') == 'ghelp')
+config_h.set('WITH_HELP_METHOD_FILE', get_option('help_method') == 'file')
+config_h.set('WITH_HELP_METHOD_LIBRARY', get_option('help_method') == 'library')
+config_h.set_quoted('HELP_FILE_FORMAT', get_option('help_format'))
+
+# Write config.h
+
+configure_file(
+  output: 'config.h',
+  configuration: config_h,
+)
+
+# Subdirs
+
+top_inc = include_directories('.')
+
+subdir('data')
+subdir('games')
+subdir('src')
+subdir('po')
+
+if get_option('docs')
+  subdir('help')
+endif
+
+if get_option('theme_svg_rsvg') or get_option('theme_svg_qtsvg')
+  subdir('cards')
+endif
+
+# Simple compat Makefile
+
+makefile_conf = configuration_data()
+makefile_conf.set('srcdir', meson.current_source_dir())
+makefile_conf.set('builddir', meson.current_build_dir())
+
+configure_file(
+  input: 'Makefile.meson',
+  output: '@BASENAME@',
+  configuration: makefile_conf,
+)
+
+# .gitignore everything in the build directory
+
+configure_file(
+  output: '.gitignore',
+  command: ['echo', '**/**',],
+  capture: true,
+  install: false,
+)
+
+# Summary
+
+output = '\n'
+output += 'Configuration for Aisleriot Solitaire:\n\n'
+output += '  Version:                 ' + ar_version + '\n'
+output += '\n'
+output += '  C compiler:              ' + cc.get_id() + ' (version ' + cc.version() + ')\n'
+output += '  C++ compiler:            ' + cxx.get_id() + ' (version ' + cxx.version() + ')\n'
+output += '  GUILE compiler:          ' + guile + ' (version ' + guile_version + ')\n'
+output += '\n'
+output += '  Coverage:                ' + get_option('b_coverage').to_string() + '\n'
+output += '  Debug:                   ' + enable_debug.to_string() + '\n'
+output += '  Debug UI:                ' + enable_debug_ui.to_string() + '\n'
+output += '\n'
+output += '  Distribution:            ' + distro + '\n'
+output += '  Prefix:                  ' + get_option('prefix') + '\n'
+output += '  Desktop data dir:        ' + desktopdatadir + '\n'
+output += '  Schemas dir:             ' + schemadir + '\n'
+output += '\n'
+output += '  Card themes support:\n'
+output += '    Prerendered:           ' + get_option('theme_fixed').to_string() + '\n'
+output += '    KDE:                   ' + get_option('theme_kde').to_string() + '\n'
+if get_option('theme_kde')
+  output += '      Base path:           ' + theme_kde_path + '\n'
+endif
+output += '    PySolFC:               ' + get_option('theme_pysol').to_string() + '\n'
+if get_option('theme_pysol')
+  output += '      Base path:           ' + theme_pysol_path + '\n'
+endif
+output += '    SVG using Rsvg:        ' + get_option('theme_svg_rsvg').to_string() + '\n'
+output += '    SVG using Qt5Svg:      ' + get_option('theme_svg_qtsvg').to_string() + '\n'
+output += '\n'
+output += '  Documentation:           ' + get_option('docs').to_string() + '\n'
+output += '    Method:                ' + get_option('help_method') + '\n'
+if get_option('help_method') == 'file'
+output += '      Format:                ' + get_option('help_format') + '\n'
+endif
+output += '\n'
+output += '  Binreloc:                ' + get_option('binreloc').to_string() + '\n'
+
+message(output)
+
+# Done
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 00000000..9dc4d283
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,144 @@
+# Copyright © 2019 Christian Persch
+#
+# This programme is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or (at your
+# option) any later version.
+#
+# This programme is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this programme.  If not, see <https://www.gnu.org/licenses/>.
+
+option(
+  'binreloc',
+  type: 'boolean',
+  value: false,
+  description: 'Binary relocation',
+)
+
+option(
+  'dbg',
+  type: 'boolean',
+  value: false,
+  description: 'Enable extra debugging functionality',
+)
+
+option(
+  'dbgui',
+  type: 'boolean',
+  value: false,
+  description: 'Enable extra debugging functionality UI',
+)
+
+option(
+  'default_theme_format',
+  type: 'combo',
+  choices: ['fixed', 'kde', 'pysol', 'svg-rsvg', 'svg-qtsvg',],
+  value: 'svg-rsvg',
+  description: 'The default card theme format',
+)
+
+option(
+  'default_theme',
+  type: 'string',
+  value: 'gnomangelo_bitmap.svgz',
+  description: 'The default card theme',
+)
+
+option(
+  'docs',
+  type: 'boolean',
+  value: true,
+  description: 'Enable documentation',
+)
+
+option(
+  'gconf',
+  type: 'boolean',
+  value: false,
+  description: 'Enable GConf support',
+)
+
+option(
+  'guile',
+  type: 'combo',
+  choices: ['2.2', '2.0', 'auto',],
+  value: 'auto',
+  description: 'Which guile version to use',
+)
+
+option(
+  'help_format',
+  type: 'combo',
+  choices: ['html', 'xhtml',],
+  value: 'html',
+  description: 'Which help format to use for file method',
+)
+
+option(
+  'help_method',
+  type: 'combo',
+  choices: ['ghelp', 'file', 'library',],
+  value: 'ghelp', # FIXME: this may need to be different per platform
+  description: 'Which help method to use',
+)
+
+option(
+  'sound',
+  type: 'boolean',
+  value: true,
+  description: 'Enable sound support',
+)
+
+option(
+  'theme_fixed',
+  type: 'boolean',
+  value: true,
+  description: 'Enable support for prerendered card themes',
+)
+
+option(
+  'theme_kde',
+  type: 'boolean',
+  value: true,
+  description: 'Enable support for KDE card themes',
+)
+
+option(
+  'theme_kde_path',
+  type: 'string',
+  value: '',
+  description: 'Base path to KDE card themes',
+)
+
+option(
+  'theme_pysol',
+  type: 'boolean',
+  value: false,
+  description: 'Enable support for PySolFC card themes',
+)
+
+option(
+  'theme_pysol_path',
+  type: 'string',
+  value: '',
+  description: 'Base path to PySolFC card themes',
+)
+
+option(
+  'theme_svg_qtsvg',
+  type: 'boolean',
+  value: false,
+  description: 'Enable support for SVG card themes (using QtSvg)',
+)
+
+option(
+  'theme_svg_rsvg',
+  type: 'boolean',
+  value: true,
+  description: 'Enable support for SVG card themes (using Rsvg)',
+)
diff --git a/po/POTFILES.in b/po/POTFILES.in
index a19df237..67434d2a 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,22 +1,20 @@
 # List of source files containing translatable strings.
 # Please keep this file in alphabetical order.
-[encoding: UTF-8]
-data/sol.appdata.xml.in
-data/sol.desktop.in.in
-src/aisleriot.schemas.in
+data/sol.desktop.in
+data/sol.metainfo.xml.in
 src/ar-application.c
 src/ar-game-chooser.c
 src/ar-stock.c
 src/board-noclutter.c
 src/conf.c
-src/game.c
 src/game-names.h
-[type: gettext/glade]src/help-overlay.ui
+src/game.c
+src/help-overlay.ui
 src/lib/ar-card.c
 src/lib/ar-help.c
 src/lib/ar-runtime.c
 src/lib/ar-show.c
-src/lib/org.gnome.Patience.WindowState.gschema.xml.in
+src/lib/org.gnome.Patience.WindowState.gschema.xml
 src/sol.c
 src/stats-dialog.c
 src/util.c
@@ -91,9 +89,9 @@ games/scorpion.scm
 games/scuffle.scm
 games/seahaven.scm
 games/sir-tommy.scm
-games/spiderette.scm
-games/spider.scm
 games/spider-three-decks.scm
+games/spider.scm
+games/spiderette.scm
 games/straight-up.scm
 games/streets-and-alleys.scm
 games/ten-across.scm
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 00000000..4da2cdae
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1,19 @@
+# Copyright © 2019 Christian Persch
+#
+# This programme is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or (at your
+# option) any later version.
+#
+# This programme is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this programme.  If not, see <https://www.gnu.org/licenses/>.
+
+i18n.gettext(
+  ar_gettext_domain,
+  preset: 'glib',
+)
diff --git a/src/aisleriot.gresource.xml.in b/src/aisleriot.gresource.xml
similarity index 75%
rename from src/aisleriot.gresource.xml.in
rename to src/aisleriot.gresource.xml
index f19bf19a..d862ce49 100644
--- a/src/aisleriot.gresource.xml.in
+++ b/src/aisleriot.gresource.xml
@@ -17,10 +17,10 @@
 -->
 <gresources>
   <gresource prefix="/org/gnome/aisleriot">
-    <file alias="art/slot.svg" compressed="true" 
preprocess="xml-stripblanks">@top_srcdir@/data/slot.svg</file>
-    <file alias="art/baize.png">@top_srcdir@/data/baize.png</file>
-    <file alias="gtk/help-overlay.ui" preprocess="xml-stripblanks" 
compressed="true">@srcdir@/help-overlay.ui</file>
-    <file alias="ui/menus.xml">@srcdir@/aisleriot-ui.xml</file>
-    <file alias="ui/debug-menus.xml">@srcdir@/aisleriot-debug-ui.xml</file>
+    <file alias="art/slot.svg" compressed="true" preprocess="xml-stripblanks">data/slot.svg</file>
+    <file alias="art/baize.png">data/baize.png</file>
+    <file alias="gtk/help-overlay.ui" preprocess="xml-stripblanks" compressed="true">help-overlay.ui</file>
+    <file alias="ui/menus.xml">aisleriot-ui.xml</file>
+    <file alias="ui/debug-menus.xml">aisleriot-debug-ui.xml</file>
   </gresource>
 </gresources>
diff --git a/src/aisleriot.schemas.in b/src/aisleriot.schemas
similarity index 99%
rename from src/aisleriot.schemas.in
rename to src/aisleriot.schemas
index 3edeb243..69416f42 100644
--- a/src/aisleriot.schemas.in
+++ b/src/aisleriot.schemas
@@ -97,7 +97,7 @@
        <long>A list of strings that come in the form of a quintuple: name, wins, total games played, best 
time (in seconds) and worst time (also in seconds). Unplayed games do not need to be represented.</long>
       </locale>
     </schema>
-       
+
     <schema>
       <key>/schemas/apps/aisleriot/recent_games_list</key>
       <applyto>/apps/aisleriot/recent_games_list</applyto>
diff --git a/src/ar-stock.c b/src/ar-stock.c
index 8883c45d..f46eda17 100644
--- a/src/ar-stock.c
+++ b/src/ar-stock.c
@@ -278,8 +278,13 @@ ar_get_licence (const gchar *game_name)
        "along with this program.  If not, see <http://www.gnu.org/licenses/>.");
 
   license_trans = g_strjoin ("\n\n", _(license0), _(license1), _(license3), NULL);
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
   license_str =
     g_strdup_printf (license_trans, game_name, version, game_name, game_name);
+#pragma GCC diagnostic pop
+
   g_free (license_trans);
 
   return license_str;
diff --git a/data/baize.png b/src/data/baize.png
similarity index 100%
rename from data/baize.png
rename to src/data/baize.png
diff --git a/data/baize.xcf b/src/data/baize.xcf
similarity index 100%
rename from data/baize.xcf
rename to src/data/baize.xcf
diff --git a/data/slot.svg b/src/data/slot.svg
similarity index 100%
rename from data/slot.svg
rename to src/data/slot.svg
diff --git a/src/lib/ar-card-theme-private.h b/src/lib/ar-card-theme-private.h
index ebaaf395..426ab732 100644
--- a/src/lib/ar-card-theme-private.h
+++ b/src/lib/ar-card-theme-private.h
@@ -187,9 +187,9 @@ ArCardTheme* ar_card_theme_svg_new (void);
 
 #endif /* HAVE_RSVG */
 
-#if 1 //def HAVE_QTSVG
+#ifdef HAVE_QTSVG
 
-/* ArCardThemeQSvg (abstract) */
+/* ArCardThemeQSvg */
 
 #define AR_TYPE_CARD_THEME_QSVG            (ar_card_theme_qsvg_get_type ())
 #define AR_CARD_THEME_QSVG(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), AR_TYPE_CARD_THEME_QSVG, 
ArCardThemeQSvg))
@@ -203,6 +203,8 @@ typedef struct _ArCardThemeQSvg      ArCardThemeQSvg;
 
 GType ar_card_theme_qsvg_get_type (void);
 
+ArCardTheme* ar_card_theme_qsvg_new (void);
+
 /* ArCardThemeNative */
 
 #define AR_TYPE_CARD_THEME_NATIVE            (ar_card_theme_native_get_type ())
diff --git a/src/lib/ar-card-themes.c b/src/lib/ar-card-themes.c
index db51a196..31282195 100644
--- a/src/lib/ar-card-themes.c
+++ b/src/lib/ar-card-themes.c
@@ -74,22 +74,26 @@ theme_type_from_string (const char *type_str,
     GType type;
   } type_strings[] = {
 #ifdef HAVE_QTSVG
-#if defined(ENABLE_CARD_THEME_NATIVE) && !defined(ENABLE_CARD_THEME_FORMAT_SVG)
+#if defined(ENABLE_CARD_THEME_FORMAT_NATIVE) && !defined(ENABLE_CARD_THEME_FORMAT_SVG)
     { "svg", AR_TYPE_CARD_THEME_NATIVE },
-#endif /* HAVE_QTSVG */
-#else
+#endif
+#endif  /* HAVE_QTSVG */
+
 #ifdef HAVE_RSVG
 #ifdef ENABLE_CARD_THEME_FORMAT_SVG
     { "svg", AR_TYPE_CARD_THEME_SVG },
 #endif
 #endif /* HAVE_RSVG */
-#endif /* HAVE_QTSVG */
+
 #ifdef HAVE_QTSVG
+#ifdef ENABLE_CARD_THEME_FORMAT_NATIVE
     { "native", AR_TYPE_CARD_THEME_NATIVE },
+#endif
 #ifdef ENABLE_CARD_THEME_FORMAT_KDE
     { "kde", AR_TYPE_CARD_THEME_KDE },
 #endif
 #endif /* HAVE_QTSVG */
+
 #ifdef ENABLE_CARD_THEME_FORMAT_PYSOL
     { "pysol", AR_TYPE_CARD_THEME_PYSOL },
 #endif
@@ -217,7 +221,7 @@ ar_card_themes_foreach_theme_type_and_dir (ArCardThemes *theme_manager,
   const GType types[] = {
   /* List of supported theme types, in order of decreasing precedence */
 #ifdef HAVE_QTSVG
-#ifdef ENABLE_CARD_THEME_NATIVE
+#if defined(ENABLE_CARD_THEME_FORMAT_NATIVE) && !defined(ENABLE_CARD_THEME_FORMAT_SVG)
     AR_TYPE_CARD_THEME_NATIVE,
 #endif
 #endif /* HAVE_QTSVG */
@@ -230,7 +234,7 @@ ar_card_themes_foreach_theme_type_and_dir (ArCardThemes *theme_manager,
 #ifdef ENABLE_CARD_THEME_FORMAT_KDE
   AR_TYPE_CARD_THEME_KDE,
 #endif
-#if !defined(ENABLE_CARD_THEME_SVG) && !defined(ENABLE_CARD_THEME_NATIVE)
+#ifdef ENABLE_CARD_THEME_NATIVE
     AR_TYPE_CARD_THEME_NATIVE,
 #endif
 #endif /* HAVE_QTSVG */
diff --git a/src/lib/meson.build b/src/lib/meson.build
new file mode 100644
index 00000000..03f90e59
--- /dev/null
+++ b/src/lib/meson.build
@@ -0,0 +1,149 @@
+# Copyright © 2019 Christian Persch
+#
+# This programme is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or (at your
+# option) any later version.
+#
+# This programme is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this programme.  If not, see <https://www.gnu.org/licenses/>.
+
+lib_inc = include_directories('.')
+
+# Library
+
+libaisleriot_deps = [
+  cairo_dep,
+  gconf_dep,
+  glib_dep,
+  gtk_dep,
+  libcanberra_gtk_dep,
+  libm_dep,
+  qtsvg_dep,
+  rsvg_dep,
+]
+
+libaisleriot_sources = files(
+  'ar-card-private.h',
+  'ar-card-surface-cache.c',
+  'ar-card-surface-cache.h',
+  'ar-card-theme-private.h',
+  'ar-card-theme.c',
+  'ar-card-theme.h',
+  'ar-card-themes.c',
+  'ar-card-themes.h',
+  'ar-card.c',
+  'ar-card.h',
+  'ar-conf.c',
+  'ar-conf.h',
+  'ar-debug.c',
+  'ar-debug.h',
+  'ar-gsettings.c',
+  'ar-gsettings.h',
+  'ar-help.c',
+  'ar-help.h',
+  'ar-profile.c',
+  'ar-profile.h',
+  'ar-runtime.c',
+  'ar-runtime.h',
+  'ar-show.c',
+  'ar-show.h',
+  'ar-sound.c',
+  'ar-sound.h',
+  'ar-string-utils.c',
+  'ar-string-utils.h',
+)
+
+if get_option('theme_fixed')
+  libaisleriot_sources += files(
+    'ar-card-theme-fixed.c',
+  )
+endif
+
+if get_option('theme_kde')
+  libaisleriot_sources += files(
+    'ar-card-theme-kde.cpp',
+  )
+endif
+
+if get_option('theme_svg_rsvg')
+  libaisleriot_sources += files(
+    'ar-card-theme-preimage.c',
+    'ar-card-theme-svg.c',
+    'ar-svg.c',
+    'ar-svg.h',
+  )
+endif
+
+if get_option('theme_pysol')
+  libaisleriot_sources += files(
+    'ar-card-theme-pysol.c',
+  )
+endif
+
+if get_option('theme_svg_qtsvg')
+  libaisleriot_sources += files(
+    'ar-card-theme-native.cpp',
+  )
+endif
+
+if get_option('theme_svg_qtsvg') or get_option('theme_kde')
+  libaisleriot_sources += files(
+    'ar-card-theme-qsvg-private.h',
+    'ar-card-theme-qsvg.cpp',
+  )
+endif
+
+libaisleriot_sources += gnome.genmarshal(
+  'ar-marshal',
+  internal: true,
+  prefix: 'ar_marshal',
+  sources: 'ar-marshal.list',
+)
+
+libaisleriot_cflags = [
+  '-DDATADIR="@0@"'.format(ar_prefix / ar_datadir),
+  '-DLIBDIR="@0@"'.format(ar_prefix / ar_libdir),
+  '-DPKGDATADIR="@0@"'.format(ar_prefix / ar_pkgdatadir),
+  '-DPKGLIBDIR="@0@"'.format(ar_prefix / ar_pkglibdir),
+  '-DPREFIX="@0@"'.format(ar_prefix),
+  '-DGDK_DISABLE_DEPRECATION_WARNINGS',
+]
+
+# Auxiliary programme to prerender card images
+
+if get_option('theme_svg_rsvg')
+  render_cards_sources = libaisleriot_sources + files(
+    'render-cards.c',
+  )
+
+  render_cards = executable(
+    'ar-cards-renderer',
+    c_args: libaisleriot_cflags,
+    cpp_args: libaisleriot_cflags,
+    dependencies: libaisleriot_deps,
+    include_directories: [top_inc, lib_inc,],
+    install: true,
+    install_dir: ar_pkglibexecdir,
+    sources: render_cards_sources,
+  )
+endif
+
+# Settings schemas
+
+schemadir = ar_prefix / ar_datadir / 'glib-2.0' / 'schemas'
+
+install_data(
+  'org.gnome.Patience.WindowState.gschema.xml',
+  install_dir: schemadir,
+)
+
+meson.add_install_script(
+  'meson_compileschemas.py',
+  schemadir,
+)
diff --git a/src/lib/meson_compileschemas.py b/src/lib/meson_compileschemas.py
new file mode 100755
index 00000000..3268ddc0
--- /dev/null
+++ b/src/lib/meson_compileschemas.py
@@ -0,0 +1,28 @@
+#!/usr/bin/env python3
+# Copyright © 2019 Christian Persch
+#
+# This programme is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or (at your
+# option) any later version.
+#
+# This programme is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this programme.  If not, see <https://www.gnu.org/licenses/>.
+
+import os
+import subprocess
+import sys
+
+if os.environ.get('DESTDIR'):
+    sys.exit(0)
+
+prefix = os.environ['MESON_INSTALL_PREFIX']
+schemasdir = os.path.join(prefix, sys.argv[1])
+
+rv = subprocess.call(['glib-compile-schemas', schemasdir])
+sys.exit(rv)
diff --git a/src/lib/org.gnome.Patience.WindowState.gschema.xml.in 
b/src/lib/org.gnome.Patience.WindowState.gschema.xml
similarity index 86%
rename from src/lib/org.gnome.Patience.WindowState.gschema.xml.in
rename to src/lib/org.gnome.Patience.WindowState.gschema.xml
index 63088e8c..ec4fc64d 100644
--- a/src/lib/org.gnome.Patience.WindowState.gschema.xml.in
+++ b/src/lib/org.gnome.Patience.WindowState.gschema.xml
@@ -21,21 +21,21 @@
   <schema id="org.gnome.Patience.WindowState" gettext-domain="aisleriot">
     <key name="maximized" type="b">
       <default>false</default>
-      <_summary>Whether the window is maximized</_summary>
+      <summary>Whether the window is maximized</summary>
     </key>
     <key name="fullscreen" type="b">
       <default>false</default>
-      <_summary>Whether the window is fullscreen</_summary>
+      <summary>Whether the window is fullscreen</summary>
     </key>
     <key name="width" type="i">
       <!-- <range min="-1" max="65535" /> -->
       <default>-1</default>
-      <_summary>Window width</_summary>
+      <summary>Window width</summary>
     </key>
     <key name="height" type="i">
       <!-- <range min="-1" max="65535" /> -->
       <default>-1</default>
-      <_summary>Window height</_summary>
+      <summary>Window height</summary>
     </key>
   </schema>
 </schemalist>
diff --git a/src/lib/render-cards.c b/src/lib/render-cards.c
index 4709844f..00cd3997 100644
--- a/src/lib/render-cards.c
+++ b/src/lib/render-cards.c
@@ -184,7 +184,7 @@ main (int argc, char *argv[])
 
     ar_card_theme_set_size (theme, size, -1, 1.0);
 
-    g_snprintf (sizestr, sizeof (sizestr), "%d", size);
+    g_snprintf (sizestr, sizeof (sizestr), "%u", size);
     sizepath = g_build_filename (basepath, sizestr, NULL);
 
     if (g_mkdir_with_parents (sizepath, 0755) < 0) {
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 00000000..7475ed1e
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,99 @@
+# Copyright © 2019 Christian Persch
+#
+# This programme is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or (at your
+# option) any later version.
+#
+# This programme is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this programme.  If not, see <https://www.gnu.org/licenses/>.
+
+src_inc = include_directories('.')
+
+subdir('lib')
+
+# Aisleriot Solitaire
+
+sol_help_id = 'aisleriot'
+
+sol_sources = libaisleriot_sources + files(
+  'ar-application.c',
+  'ar-application.h',
+  'ar-clock.c',
+  'ar-clock.h',
+  'ar-cursor.c',
+  'ar-cursor.h',
+  'ar-game-chooser.c',
+  'ar-game-chooser.h',
+  'ar-stock.c',
+  'ar-stock.h',
+  'ar-style-gtk.c',
+  'ar-style-gtk.h',
+  'ar-style-private.h',
+  'ar-style.c',
+  'ar-style.h',
+  'board-noclutter.c',
+  'board-noclutter.h',
+  'conf.c',
+  'conf.h',
+  'game.c',
+  'game.h',
+  'sol.c',
+  'stats-dialog.c',
+  'stats-dialog.h',
+  'util.c',
+  'util.h',
+  'window.c',
+  'window.h',
+)
+
+sol_sources += gnome.compile_resources(
+  'ar-resources',
+  'aisleriot.gresource.xml',
+  c_name: 'aisleriot',
+  export: true,
+)
+
+sol_cflags = libaisleriot_cflags + [
+  '-DDOC_MODULE="@0@"'.format(sol_help_id)
+]
+
+sol_deps = libaisleriot_deps + [
+  guile_dep,
+]
+
+sol = executable(
+  'sol',
+  c_args: sol_cflags,
+  cpp_args: sol_cflags,
+  dependencies: sol_deps,
+  include_directories: [top_inc, src_inc, lib_inc,],
+  install: true,
+  sources: sol_sources,
+)
+
+# Install gconf schemas
+
+if get_option('gconf')
+  gconfschemadir = ar_sysconfdir / 'gconf' / 'schemas'
+
+  gconf_schema_sources = [
+    'aisleriot.schemas',
+  ]
+
+  install_data(
+    gconf_schema_sources,
+    install_dir: gconfschemadir,
+  )
+
+  meson.add_install_script(
+    'meson_gconf.py',
+    gconfschemadir,
+    gconf_schema_sources,
+  )
+endif
diff --git a/src/meson_gconf.py b/src/meson_gconf.py
new file mode 100755
index 00000000..e3b9d96c
--- /dev/null
+++ b/src/meson_gconf.py
@@ -0,0 +1,28 @@
+#!/usr/bin/env python3
+# Copyright © 2019 Christian Persch
+#
+# This programme is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or (at your
+# option) any later version.
+#
+# This programme is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this programme.  If not, see <https://www.gnu.org/licenses/>.
+
+import os
+import subprocess
+import sys
+
+if os.environ.get('DESTDIR'):
+    sys.exit(0)
+
+prefix = os.environ['MESON_INSTALL_PREFIX']
+schemasdir = os.path.join(prefix, sys.argv[1])
+
+rv = subprocess.call(['gconftool-2', '--install-schema-file', os.path.join(schemasdir, sys.argv[2])])
+sys.exit(rv)


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