[gucharmap] build: Port to meson



commit fac68554a562c8905eb9e4803995e950a7a47f1b
Author: Christian Persch <chpe src gnome org>
Date:   Sun Jun 30 22:33:19 2019 +0200

    build: Port to meson

 AUTHORS                                            |    4 -
 ChangeLog.README                                   |   16 -
 ChangeLog.pre-2-23                                 | 2596 --------------------
 Makefile.am                                        |   80 -
 Makefile.meson                                     |   43 +
 NEWS                                               |  190 --
 README.md                                          |   11 +
 acinclude.m4                                       |  319 ---
 autogen.sh                                         |   16 -
 configure.ac                                       |  348 ---
 data/Makefile.am                                   |   22 -
 data/gucharmap.desktop.in.in                       |   11 +
 ...ap.appdata.xml.in => gucharmap.metainfo.xml.in} |   13 +-
 data/meson.build                                   |   58 +
 data/meson_desktopfile.py                          |   28 +
 docs/Makefile.am                                   |    7 -
 docs/reference/Makefile.am                         |  115 -
 docs/reference/meson.build                         |   74 +
 git.mk                                             |  182 --
 gtkrc.win32                                        |    7 -
 gucharmap.desktop.in.in                            |   14 -
 gucharmap.nsi.in                                   |  178 --
 gucharmap.spec.in                                  |   79 -
 gucharmap/Makefile.am                              |  360 ---
 gucharmap/gen-guch-unicode-tables.pl               |   27 +-
 gucharmap/gucharmap-block-chapters-model.h         |    3 +
 gucharmap/gucharmap-block-codepoint-list.h         |    3 +
 gucharmap/gucharmap-chapters-model.h               |    7 +
 gucharmap/gucharmap-chapters-view.h                |   13 +
 gucharmap/gucharmap-charmap.c                      |    2 +-
 gucharmap/gucharmap-charmap.h                      |   29 +
 gucharmap/gucharmap-chartable-accessible.c         |    2 +-
 gucharmap/gucharmap-chartable.h                    |   15 +
 gucharmap/gucharmap-codepoint-list.h               |    5 +
 gucharmap/gucharmap-init.c                         |    5 -
 gucharmap/gucharmap-macros.h                       |   28 +
 gucharmap/gucharmap-script-chapters-model.h        |    3 +
 gucharmap/gucharmap-script-codepoint-list.h        |    6 +
 gucharmap/gucharmap-type-builtins.c.template       |    6 +-
 gucharmap/gucharmap-type-builtins.h.template       |    2 +
 gucharmap/gucharmap-unicode-info.h                 |   32 +-
 gucharmap/gucharmap-version.h.in                   |   36 +
 ...ap.gresource.xml.in => gucharmap.gresource.xml} |    0
 gucharmap/{gucharmap.h.in => gucharmap.h}          |    9 +-
 gucharmap.pc.in => gucharmap/gucharmap.pc.in       |    0
 gucharmap/gucharmaprc.rc                           |    1 -
 gucharmap/meson.build                              |  294 +++
 gucharmap/meson_compileschemas.py                  |   28 +
 gucharmap/org.gnome.Charmap.gschema.xml            |    5 +
 gucharmap/unicode.sha512sums                       |    6 -
 help/ChangeLog.pre-2-23                            |  153 --
 help/LINGUAS                                       |   20 +
 help/Makefile.am                                   |   18 -
 help/meson.build                                   |   25 +
 help/omf.make                                      |   53 -
 meson.build                                        |  303 +++
 meson_options.txt                                  |   63 +
 pixmaps/Makefile.am                                |   20 -
 pixmaps/gucharmap.ico                              |  Bin 9662 -> 0 bytes
 po/meson.build                                     |   19 +
 60 files changed, 1187 insertions(+), 4825 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/README.md b/README.md
new file mode 100644
index 00000000..66867c74
--- /dev/null
+++ b/README.md
@@ -0,0 +1,11 @@
+Gucharmap
+=========
+
+Unicode data
+------------
+
+Note that to build gucharmap, you need to provide the (absolute) path
+to the unicode data files to the -Ducd_path=... argument when running
+meson. These data files are not included in gucharmap; you need to
+download them separately, or use the package provided by your
+distribution. E.g. on fedora, install the unicode-ucd package.
diff --git a/data/gucharmap.desktop.in.in b/data/gucharmap.desktop.in.in
new file mode 100644
index 00000000..90ae492e
--- /dev/null
+++ b/data/gucharmap.desktop.in.in
@@ -0,0 +1,11 @@
+[Desktop Entry]
+# VERSION=@VERSION@
+Name=Character Map
+Comment=Insert special characters into documents
+Keywords=font;unicode;
+Exec=gucharmap
+Icon=accessories-character-map
+Terminal=false
+Type=Application
+Categories=GNOME;GTK;Utility;
+StartupNotify=true
diff --git a/data/gucharmap.appdata.xml.in b/data/gucharmap.metainfo.xml.in
similarity index 93%
rename from data/gucharmap.appdata.xml.in
rename to data/gucharmap.metainfo.xml.in
index 255c3ac8..7092b328 100644
--- a/data/gucharmap.appdata.xml.in
+++ b/data/gucharmap.metainfo.xml.in
@@ -34,20 +34,20 @@
   <id>gucharmap.desktop</id>
   <metadata_license>GPL-3.0+ or GFDL-1.3-only</metadata_license>
   <project_license>GPL-3.0+</project_license>
-  <_name>Character Map</_name>
-  <_summary>Insert special characters into documents</_summary>
+  <name>Character Map</name>
+  <summary>Insert special characters into documents</summary>
   <description>
-    <_p>
+    <p>
       GNOME Character Map is a Unicode character map program, part of GNOME desktop.
       This program allows characters to be displayed by unicode block or script type.
       It includes brief descriptions of related characters and occasionally meanings
       of the character in question.
-    </_p>
-    <_p>
+    </p>
+    <p>
       Gucharmap can also be used to input or enter characters (by copy and paste).
       The search functionality allows the use of several search methods, including
       by unicode name or code point of the character.
-    </_p>
+    </p>
   </description>
 <!--
   <screenshots>
@@ -55,7 +55,6 @@
   </screenshots>
 -->
   <kudos>
-    <kudo>AppMenu</kudo>
     <kudo>ModernToolkit</kudo>
     <kudo>UserDocs</kudo>
   </kudos>
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 00000000..11e4e8a6
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1,58 @@
+# 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 = gucharmap_prefix / gucharmap_datadir / 'metainfo'
+
+i18n.merge_file(
+  'gucharmap.metainfo.xml',
+  input: 'gucharmap.metainfo.xml.in',
+  output: '@BASENAME@',
+  po_dir: po_dir,
+  install: true,
+  install_dir: metainfodir,
+)
+
+# Desktop file
+
+desktopdatadir = gucharmap_prefix / gucharmap_datadir / 'applications'
+
+desktop_conf = {
+  'VERSION': gucharmap_version,
+}
+
+desktop_in = configure_file(
+  input: 'gucharmap.desktop.in.in',
+  output: '@BASENAME@',
+  configuration: desktop_conf,
+  install: false,
+)
+
+i18n.merge_file(
+  'gucharmap.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,
+  'gucharmap.desktop',
+)
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/docs/reference/meson.build b/docs/reference/meson.build
new file mode 100644
index 00000000..21eaa7d8
--- /dev/null
+++ b/docs/reference/meson.build
@@ -0,0 +1,74 @@
+# 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/>.
+
+libgucharmap_private_headers = [
+  'gucharmap-chartable-accessible.h',
+  'gucharmap-chartable-cell-accessible.h',
+  'gucharmap-font-codepoint-list.h',
+  'gucharmap-mini-fontsel.h',
+  'gucharmap-print-operation.h',
+  'gucharmap-private.h',
+  'gucharmap-search-dialog.h',
+  'gucharmap-settings.h',
+  'gucharmap-window.h',
+  'unicode-blocks.h',
+  'unicode-categories.h',
+  'unicode-names.h',
+  'unicode-nameslist.h',
+  'unicode-scripts.h',
+  'unicode-unihan.h',
+  'unicode-versions.h',
+]
+
+atk_dep   = dependency('atk')
+cairo_dep = dependency('cairo')
+pango_dep = dependency('pango')
+
+atk_prefix  = glib_dep.get_pkgconfig_variable('prefix')
+cairo_prefix = cairo_dep.get_pkgconfig_variable('prefix')
+glib_prefix  = glib_dep.get_pkgconfig_variable('prefix')
+pango_prefix = gtk3_dep.get_pkgconfig_variable('prefix')
+
+fixxrefs = [
+  '--extra-dir=' + atk_prefix    / gnome.gtkdoc_html_dir('atk'),
+  '--extra-dir=' + cairo_prefix  / gnome.gtkdoc_html_dir('cairo'),
+  '--extra-dir=' + glib_prefix   / gnome.gtkdoc_html_dir('glib'),
+  '--extra-dir=' + glib_prefix   / gnome.gtkdoc_html_dir('gobject'),
+  '--extra-dir=' + pango_prefix  / gnome.gtkdoc_html_dir('pango'),
+]
+
+if get_option('gtk3')
+
+  gtk3_prefix = gtk3_dep.get_pkgconfig_variable('prefix')
+  fixxrefs_gtk3 = fixxrefs + [
+    '--extra-dir=' + gtk3_prefix / gnome.gtkdoc_html_dir('gtk'),
+  ]
+
+  gnome.gtkdoc(
+    'gucharmap',
+    c_args: ['-DGUCHARMAP_COMPILATION', '-Wno-error'],
+    dependencies: libgucharmap_gtk3_dep,
+    fixxref_args: fixxrefs_gtk3,
+    gobject_typesfile: 'gucharmap.types',
+    ignore_headers: libgucharmap_private_headers,
+    include_directories: [top_inc, src_inc],
+    install: true,
+    main_sgml: 'gucharmap-docs.sgml',
+    mkdb_args: ['--sgml-mode', '--output-format=xml',],
+    module_version: libgucharmap_gtk3_api_version,
+    namespace: 'gucharmap',
+    src_dir: [top_inc, src_inc,],
+  )
+endif
diff --git a/gucharmap/gen-guch-unicode-tables.pl b/gucharmap/gen-guch-unicode-tables.pl
index ae7728cc..570fb898 100755
--- a/gucharmap/gen-guch-unicode-tables.pl
+++ b/gucharmap/gen-guch-unicode-tables.pl
@@ -11,7 +11,7 @@
 #  - unicode-scripts.h
 #  - unicode-versions.h
 #
-# usage: ./gen-guch-unicode-tables.pl UNICODE-VERSION DIRECTORY
+# usage: ./gen-guch-unicode-tables.pl UNICODE-VERSION UNICODE-DIRECTORY OUTPUT-DIRECTORY
 # where DIRECTORY contains UnicodeData.txt Unihan.zip NamesList.txt Blocks.txt Scripts.txt
 #
 # NOTE! Some code copied from glib/glib/gen-unicode-tables.pl; keep in sync!
@@ -24,12 +24,12 @@ $PROG_UNZIP = "unzip" unless (defined $PROG_UNZIP);
 
 $| = 1;  # flush stdout buffer
 
-if (@ARGV != 2 && @ARGV != 3)
+if (@ARGV != 3 && @ARGV != 4)
 {
     $0 =~ s@.*/@@;
     die <<EOF
 
-Usage: $0 UNICODE-VERSION DIRECTORY [--i18n]
+Usage: $0 UNICODE-VERSION UNICODE-DIRECTORY OUTPUT-DIRECTORY [--i18n]
 
 DIRECTORY should contain the following Unicode data files:
 UnicodeData.txt Unihan.zip NamesList.txt Blocks.txt Scripts.txt
@@ -43,11 +43,12 @@ my ($unicodedata_txt, $unihan_zip, $nameslist_txt, $blocks_txt, $scripts_txt, $v
 
 my $v = $ARGV[0];
 my $d = $ARGV[1];
+my $outdir = $ARGV[2];
 
 my $gen_translatable_strings = 0;
-if (@ARGV == 3)
+if (@ARGV == 4)
 {
-    $gen_translatable_strings = 1 if ($ARGV[2] eq "--i18n") or die "Unknown option \"$ARGV[2]\"\n";
+    $gen_translatable_strings = 1 if ($ARGV[3] eq "--i18n") or die "Unknown option \"$ARGV[3]\"\n";
 }
 
 opendir (my $dir, $d) or die "Cannot open Unicode data dir $d: $!\n";
@@ -94,7 +95,7 @@ sub process_unicode_data_txt
     # part 1: names
 
     open (my $unicodedata, $unicodedata_txt) or die;
-    open (my $out, "> unicode-names.h") or die;
+    open (my $out, "> $outdir/unicode-names.h") or die;
 
     print "processing $unicodedata_txt...";
 
@@ -192,7 +193,7 @@ EOT
     # part 2: categories
 
     open ($unicodedata, $unicodedata_txt) or die;
-    open ($out, "> unicode-categories.h") or die;
+    open ($out, "> $outdir/unicode-categories.h") or die;
 
     # Map general category code onto symbolic name.
     my %mappings =
@@ -312,7 +313,7 @@ sub process_unihan_zip
     print "processing $unihan_zip.";
 
     open (my $unihan, "$PROG_UNZIP -c '$unihan_zip' |") or die;
-    open (my $out, "> unicode-unihan.h") or die;
+    open (my $out, "> $outdir/unicode-unihan.h") or die;
 
     print $out "/* unicode-unihan.h */\n";
     print $out "/* THIS IS A GENERATED FILE. CHANGES WILL BE OVERWRITTEN. */\n";
@@ -640,7 +641,7 @@ sub process_nameslist_txt
 
     close ($nameslist);
 
-    open (my $out, "> unicode-nameslist.h") or die;
+    open (my $out, "> $outdir/unicode-nameslist.h") or die;
 
     print $out "/* unicode-nameslist.h */\n";
     print $out "/* THIS IS A GENERATED FILE. CHANGES WILL BE OVERWRITTEN. */\n";
@@ -755,7 +756,7 @@ sub process_blocks_txt
 
     print "processing $blocks_txt...";
 
-    open (my $out, "> unicode-blocks.h") or die;
+    open (my $out, "> $outdir/unicode-blocks.h") or die;
 
     print $out "/* unicode-blocks.h */\n";
     print $out "/* THIS IS A GENERATED FILE. CHANGES WILL BE OVERWRITTEN. */\n";
@@ -866,7 +867,7 @@ sub process_scripts_txt
 
     read_scripts_txt ($scripts_txt, \%script_hash, \%scripts);
 
-    open (my $out, "> unicode-scripts.h") or die;
+    open (my $out, "> $outdir/unicode-scripts.h") or die;
 
     print $out "/* unicode-scripts.h */\n";
     print $out "/* THIS IS A GENERATED FILE. CHANGES WILL BE OVERWRITTEN. */\n";
@@ -940,7 +941,7 @@ sub process_translatable_strings
 
     read_scripts_txt ($scripts_txt, \%script_hash, \%scripts);
 
-    open (my $out, "> unicode-i18n.h") or die;
+    open (my $out, "> $outdir/unicode-i18n.h") or die;
 
     print $out "unicode-i18n.h for extraction by gettext\n";
     print $out "THIS IS A GENERATED FILE. CHANGES WILL BE OVERWRITTEN.\n";
@@ -975,7 +976,7 @@ sub process_versions_txt
     my %versions;
 
     open (my $versions, $versions_txt) or die;
-    open (my $out, "> unicode-versions.h") or die;
+    open (my $out, "> $outdir/unicode-versions.h") or die;
 
     print "processing $versions_txt...";
 
diff --git a/gucharmap/gucharmap-block-chapters-model.h b/gucharmap/gucharmap-block-chapters-model.h
index 77028c83..190a8b10 100644
--- a/gucharmap/gucharmap-block-chapters-model.h
+++ b/gucharmap/gucharmap-block-chapters-model.h
@@ -27,6 +27,7 @@
 #define GUCHARMAP_BLOCK_CHAPTERS_MODEL_H
 
 #include <gucharmap/gucharmap-chapters-model.h>
+#include <gucharmap/gucharmap-macros.h>
 
 G_BEGIN_DECLS
 
@@ -54,7 +55,9 @@ struct _GucharmapBlockChaptersModelClass
   GucharmapChaptersModelClass parent_class;
 };
 
+_GUCHARMAP_PUBLIC
 GType                   gucharmap_block_chapters_model_get_type (void);
+_GUCHARMAP_PUBLIC
 GucharmapChaptersModel* gucharmap_block_chapters_model_new      (void);
 
 G_END_DECLS
diff --git a/gucharmap/gucharmap-block-codepoint-list.h b/gucharmap/gucharmap-block-codepoint-list.h
index 468466cb..3c123dd4 100644
--- a/gucharmap/gucharmap-block-codepoint-list.h
+++ b/gucharmap/gucharmap-block-codepoint-list.h
@@ -26,6 +26,7 @@
 #include <glib-object.h>
 
 #include <gucharmap/gucharmap-codepoint-list.h>
+#include <gucharmap/gucharmap-macros.h>
 
 G_BEGIN_DECLS
 
@@ -53,8 +54,10 @@ struct _GucharmapBlockCodepointListClass
   GucharmapCodepointListClass parent_class;
 };
 
+_GUCHARMAP_PUBLIC
 GType                    gucharmap_block_codepoint_list_get_type (void);
 
+_GUCHARMAP_PUBLIC
 GucharmapCodepointList * gucharmap_block_codepoint_list_new      (gunichar start,
                                                                   gunichar end);
 
diff --git a/gucharmap/gucharmap-chapters-model.h b/gucharmap/gucharmap-chapters-model.h
index b1deddca..93293d87 100644
--- a/gucharmap/gucharmap-chapters-model.h
+++ b/gucharmap/gucharmap-chapters-model.h
@@ -27,6 +27,7 @@
 #include <gtk/gtk.h>
 
 #include <gucharmap/gucharmap-codepoint-list.h>
+#include <gucharmap/gucharmap-macros.h>
 
 G_BEGIN_DECLS
 
@@ -70,14 +71,20 @@ enum {
   GUCHARMAP_CHAPTERS_MODEL_COLUMN_LABEL = 1
 };
 
+_GUCHARMAP_PUBLIC
 GType                    gucharmap_chapters_model_get_type                (void);
+_GUCHARMAP_PUBLIC
 GucharmapCodepointList * gucharmap_chapters_model_get_codepoint_list      (GucharmapChaptersModel *chapters,
                                                                                           GtkTreeIter        
    *iter);
+_GUCHARMAP_PUBLIC
 const char *             gucharmap_chapters_model_get_title               (GucharmapChaptersModel *chapters);
+_GUCHARMAP_PUBLIC
 GucharmapCodepointList * gucharmap_chapters_model_get_book_codepoint_list (GucharmapChaptersModel *chapters);
+_GUCHARMAP_PUBLIC
 gboolean                 gucharmap_chapters_model_character_to_iter       (GucharmapChaptersModel *chapters,
                                                                            gunichar                wc,
                                                                            GtkTreeIter            *iter);
+_GUCHARMAP_PUBLIC
 gboolean                 gucharmap_chapters_model_id_to_iter              (GucharmapChaptersModel 
*chapters_model,
                                                                            const char             *id,
                                                                            GtkTreeIter            *_iter);
diff --git a/gucharmap/gucharmap-chapters-view.h b/gucharmap/gucharmap-chapters-view.h
index 200d8a5d..3ac54b03 100644
--- a/gucharmap/gucharmap-chapters-view.h
+++ b/gucharmap/gucharmap-chapters-view.h
@@ -28,6 +28,7 @@
 #include <gtk/gtk.h>
 
 #include <gucharmap/gucharmap-chapters-model.h>
+#include <gucharmap/gucharmap-macros.h>
 
 G_BEGIN_DECLS
 
@@ -55,26 +56,38 @@ struct _GucharmapChaptersViewClass
   GtkTreeViewClass parent_class;
 };
 
+_GUCHARMAP_PUBLIC
 GType       gucharmap_chapters_view_get_type (void);
 
+_GUCHARMAP_PUBLIC
 GtkWidget * gucharmap_chapters_view_new      (void);
 
+_GUCHARMAP_PUBLIC
 void                    gucharmap_chapters_view_set_model (GucharmapChaptersView *view,
                                                            GucharmapChaptersModel *model);
+_GUCHARMAP_PUBLIC
 GucharmapChaptersModel *gucharmap_chapters_view_get_model (GucharmapChaptersView *view);
 
+_GUCHARMAP_PUBLIC
 gboolean           gucharmap_chapters_view_select_character (GucharmapChaptersView *view,
                                                              gunichar           wc);
+_GUCHARMAP_PUBLIC
 GucharmapCodepointList * gucharmap_chapters_view_get_codepoint_list      (GucharmapChaptersView *view);
+_GUCHARMAP_PUBLIC
 GucharmapCodepointList * gucharmap_chapters_view_get_book_codepoint_list (GucharmapChaptersView *view);
 
+_GUCHARMAP_PUBLIC
 void               gucharmap_chapters_view_next         (GucharmapChaptersView *view);
+_GUCHARMAP_PUBLIC
 void               gucharmap_chapters_view_previous     (GucharmapChaptersView *view);
 
+_GUCHARMAP_PUBLIC
 gchar *            gucharmap_chapters_view_get_selected  (GucharmapChaptersView *view);
+_GUCHARMAP_PUBLIC
 gboolean           gucharmap_chapters_view_set_selected  (GucharmapChaptersView *view,
                                                           const gchar       *name);
 
+_GUCHARMAP_PUBLIC
 gboolean           gucharmap_chapters_view_select_locale (GucharmapChaptersView *view);
 
 G_END_DECLS
diff --git a/gucharmap/gucharmap-charmap.c b/gucharmap/gucharmap-charmap.c
index e61c3cb1..75155b38 100644
--- a/gucharmap/gucharmap-charmap.c
+++ b/gucharmap/gucharmap-charmap.c
@@ -793,7 +793,7 @@ set_details (GucharmapCharmap *charmap,
          (0xE000 <= uc && uc <= 0xFFFD) ||
          (0x10000 <= uc && uc <= 0x10FFFF))
        {
-         temp = g_strdup_printf ("&#%d;", uc);
+         temp = g_strdup_printf ("&#%u;", uc);
          insert_vanilla_detail (charmap, buffer, &iter, 
                                 _("XML decimal entity:"), temp);
          g_free (temp);
diff --git a/gucharmap/gucharmap-charmap.h b/gucharmap/gucharmap-charmap.h
index 61497d42..7061c803 100644
--- a/gucharmap/gucharmap-charmap.h
+++ b/gucharmap/gucharmap-charmap.h
@@ -28,6 +28,7 @@
 #include <gucharmap/gucharmap-chapters-model.h>
 #include <gucharmap/gucharmap-chapters-view.h>
 #include <gucharmap/gucharmap-chartable.h>
+#include <gucharmap/gucharmap-macros.h>
 
 G_BEGIN_DECLS
 
@@ -64,44 +65,63 @@ struct _GucharmapCharmapClass
   void (* _gucharmap_reserved3) (void);
 };
 
+_GUCHARMAP_PUBLIC
 GType                 gucharmap_charmap_get_type           (void);
 
+_GUCHARMAP_PUBLIC
 GtkWidget *           gucharmap_charmap_new                (void);
 
+_GUCHARMAP_PUBLIC
 void      gucharmap_charmap_set_active_character (GucharmapCharmap *charmap,
                                                   gunichar           uc);
+_GUCHARMAP_PUBLIC
 gunichar  gucharmap_charmap_get_active_character (GucharmapCharmap *charmap);
 
+_GUCHARMAP_PUBLIC
 void      gucharmap_charmap_set_active_chapter (GucharmapCharmap *charmap,
                                                 const gchar *chapter);
+_GUCHARMAP_PUBLIC
 char *    gucharmap_charmap_get_active_chapter (GucharmapCharmap *charmap);
 
+_GUCHARMAP_PUBLIC
 void gucharmap_charmap_next_chapter     (GucharmapCharmap *charmap);
+_GUCHARMAP_PUBLIC
 void gucharmap_charmap_previous_chapter (GucharmapCharmap *charmap);
 
+_GUCHARMAP_PUBLIC
 void                     gucharmap_charmap_set_font_desc      (GucharmapCharmap  *charmap,
                                                                PangoFontDescription *font_desc);
 
+_GUCHARMAP_PUBLIC
 PangoFontDescription *   gucharmap_charmap_get_font_desc      (GucharmapCharmap  *charmap);
 
+_GUCHARMAP_PUBLIC
 void                     gucharmap_charmap_set_font_fallback  (GucharmapCharmap *charmap,
                                                                gboolean enable_font_fallback);
+_GUCHARMAP_PUBLIC
 gboolean                 gucharmap_charmap_get_font_fallback  (GucharmapCharmap *charmap);
 
+_GUCHARMAP_PUBLIC
 GucharmapChaptersView *  gucharmap_charmap_get_chapters_view  (GucharmapCharmap       *charmap);
 
+_GUCHARMAP_PUBLIC
 void                     gucharmap_charmap_set_chapters_model (GucharmapCharmap       *charmap,
                                                                GucharmapChaptersModel *model);
 
+_GUCHARMAP_PUBLIC
 GucharmapChaptersModel * gucharmap_charmap_get_chapters_model (GucharmapCharmap       *charmap);
 
+_GUCHARMAP_PUBLIC
 GucharmapCodepointList * gucharmap_charmap_get_active_codepoint_list (GucharmapCharmap *charmap);
 
+_GUCHARMAP_PUBLIC
 GucharmapCodepointList * gucharmap_charmap_get_book_codepoint_list (GucharmapCharmap *charmap);
 
+_GUCHARMAP_PUBLIC
 void     gucharmap_charmap_set_chapters_visible (GucharmapCharmap *charmap,
                                                  gboolean visible);
 
+_GUCHARMAP_PUBLIC
 gboolean gucharmap_charmap_get_chapters_visible (GucharmapCharmap *charmap);
 
 typedef enum {
@@ -109,32 +129,41 @@ typedef enum {
   GUCHARMAP_CHARMAP_PAGE_DETAILS
 } GucharmapCharmapPageType;
 
+_GUCHARMAP_PUBLIC
 void     gucharmap_charmap_set_page_visible (GucharmapCharmap *charmap,
                                              int page,
                                              gboolean visible);
 
+_GUCHARMAP_PUBLIC
 gboolean gucharmap_charmap_get_page_visible (GucharmapCharmap *charmap,
                                              int page);
 
+_GUCHARMAP_PUBLIC
 void gucharmap_charmap_set_active_page (GucharmapCharmap *charmap,
                                         int page);
 
+_GUCHARMAP_PUBLIC
 int  gucharmap_charmap_get_active_page (GucharmapCharmap *charmap);
 
+_GUCHARMAP_PUBLIC
 void gucharmap_charmap_set_snap_pow2 (GucharmapCharmap *charmap,
                                       gboolean snap);
+_GUCHARMAP_PUBLIC
 gboolean gucharmap_charmap_get_snap_pow2 (GucharmapCharmap *charmap);
 
 /* private; FIXMEchpe remove */
+_GUCHARMAP_PUBLIC
 GucharmapChartable *     gucharmap_charmap_get_chartable      (GucharmapCharmap  *charmap);
 
 /* Hide deprecated stuff from GI */
 
 #ifndef __GI_SCANNER__
 
+_GUCHARMAP_PUBLIC
 GUCHARMAP_DEPRECATED_FOR(gtk_orientable_set_orientation)
 void           gucharmap_charmap_set_orientation (GucharmapCharmap *charmap,
                                                   GtkOrientation orientation);
+_GUCHARMAP_PUBLIC
 GUCHARMAP_DEPRECATED_FOR(gtk_orientable_get_orientation)
 GtkOrientation gucharmap_charmap_get_orientation (GucharmapCharmap *charmap);
 
diff --git a/gucharmap/gucharmap-chartable-accessible.c b/gucharmap/gucharmap-chartable-accessible.c
index cca7b882..ecb95761 100644
--- a/gucharmap/gucharmap-chartable-accessible.c
+++ b/gucharmap/gucharmap-chartable-accessible.c
@@ -134,7 +134,7 @@ gucharmap_chartable_accessible_ref_child (AtkObject *obj,
   gucharmap_chartable_cell_accessible_initialise (GUCHARMAP_CHARTABLE_CELL_ACCESSIBLE (child),
                             GTK_WIDGET (chartable), obj, index);
   /* Set the name of the cell */
-  name = g_strdup_printf("U+%4.4X %s", index, gucharmap_get_unicode_name (index));
+  name = g_strdup_printf("U+%4.4X %s", (unsigned int)index, gucharmap_get_unicode_name (index));
   atk_object_set_name (child, name);
   g_free (name);
   set_cell_visibility (chartable, GUCHARMAP_CHARTABLE_CELL_ACCESSIBLE (child), FALSE);
diff --git a/gucharmap/gucharmap-chartable.h b/gucharmap/gucharmap-chartable.h
index cf95dead..7df332fb 100644
--- a/gucharmap/gucharmap-chartable.h
+++ b/gucharmap/gucharmap-chartable.h
@@ -27,6 +27,7 @@
 #include <gtk/gtk.h>
 
 #include <gucharmap/gucharmap-codepoint-list.h>
+#include <gucharmap/gucharmap-macros.h>
 
 G_BEGIN_DECLS
 
@@ -67,25 +68,39 @@ struct _GucharmapChartableClass
   void (* status_message) (GucharmapChartable *chartable, const gchar *message);
 };
 
+_GUCHARMAP_PUBLIC
 GType gucharmap_chartable_get_type (void);
+_GUCHARMAP_PUBLIC
 GtkWidget * gucharmap_chartable_new (void);
+_GUCHARMAP_PUBLIC
 void gucharmap_chartable_set_font_desc (GucharmapChartable *chartable,
                                         PangoFontDescription *font_desc);
+_GUCHARMAP_PUBLIC
 PangoFontDescription * gucharmap_chartable_get_font_desc (GucharmapChartable *chartable);
+_GUCHARMAP_PUBLIC
 void gucharmap_chartable_set_font_fallback (GucharmapChartable *chartable,
                                             gboolean enable_font_fallback);
+_GUCHARMAP_PUBLIC
 gboolean gucharmap_chartable_get_font_fallback (GucharmapChartable *chartable);
+_GUCHARMAP_PUBLIC
 gunichar gucharmap_chartable_get_active_character (GucharmapChartable *chartable);
+_GUCHARMAP_PUBLIC
 void gucharmap_chartable_set_active_character (GucharmapChartable *chartable,
                                                gunichar wc);
+_GUCHARMAP_PUBLIC
 void gucharmap_chartable_set_zoom_enabled (GucharmapChartable *chartable,
                                            gboolean enabled);
+_GUCHARMAP_PUBLIC
 gboolean gucharmap_chartable_get_zoom_enabled (GucharmapChartable *chartable);
+_GUCHARMAP_PUBLIC
 void gucharmap_chartable_set_snap_pow2 (GucharmapChartable *chartable,
                                         gboolean snap);
+_GUCHARMAP_PUBLIC
 gboolean gucharmap_chartable_get_snap_pow2 (GucharmapChartable *chartable);
+_GUCHARMAP_PUBLIC
 void gucharmap_chartable_set_codepoint_list (GucharmapChartable         *chartable,
                                              GucharmapCodepointList *codepoint_list);
+_GUCHARMAP_PUBLIC
 GucharmapCodepointList * gucharmap_chartable_get_codepoint_list (GucharmapChartable *chartable);
 
 G_END_DECLS
diff --git a/gucharmap/gucharmap-codepoint-list.h b/gucharmap/gucharmap-codepoint-list.h
index 1b656b50..35c516ce 100644
--- a/gucharmap/gucharmap-codepoint-list.h
+++ b/gucharmap/gucharmap-codepoint-list.h
@@ -24,6 +24,7 @@
 #define GUCHARMAP_CODEPOINT_LIST_H
 
 #include <glib-object.h>
+#include <gucharmap/gucharmap-macros.h>
 
 G_BEGIN_DECLS
 
@@ -58,14 +59,18 @@ struct _GucharmapCodepointListClass
                               gunichar                wc);
 };
 
+_GUCHARMAP_PUBLIC
 GType                    gucharmap_codepoint_list_get_type       (void);
 
+_GUCHARMAP_PUBLIC
 gunichar                 gucharmap_codepoint_list_get_char       (GucharmapCodepointList *list,
                                                                   gint                    index);
 
+_GUCHARMAP_PUBLIC
 gint                     gucharmap_codepoint_list_get_index      (GucharmapCodepointList *list, 
                                                                   gunichar                wc);
 
+_GUCHARMAP_PUBLIC
 gint                     gucharmap_codepoint_list_get_last_index (GucharmapCodepointList *list);
 
 G_END_DECLS
diff --git a/gucharmap/gucharmap-init.c b/gucharmap/gucharmap-init.c
index 6d086f77..ce77c347 100644
--- a/gucharmap/gucharmap-init.c
+++ b/gucharmap/gucharmap-init.c
@@ -31,11 +31,6 @@ _gucharmap_intl_ensure_initialized (void)
   if (initialised)
     return;
 
-#ifdef ENABLE_NLS
   bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
-#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
   bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
-#endif
-#endif /* #ifdef ENABLE_NLS */
 }
-
diff --git a/gucharmap/gucharmap-macros.h b/gucharmap/gucharmap-macros.h
new file mode 100644
index 00000000..8d99afc9
--- /dev/null
+++ b/gucharmap/gucharmap-macros.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright © 2014 Christian Persch
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#if !defined (__GUCHARMAP_GUCHARMAP_H_INSIDE__) && !defined (GUCHARMAP_COMPILATION)
+#error "Only <gucharmap/gucharmap.h> can be included directly."
+#endif
+
+#ifndef __GUCHARMAP_GUCHARMAP_MACROS_H__
+#define __GUCHARMAP_GUCHARMAP_MACROS_H__
+
+#define _GUCHARMAP_PUBLIC __attribute__((__visibility__("default"))) extern
+
+#endif /* __GUCHARMAP_GUCHARMAP_MACROS_H__ */
diff --git a/gucharmap/gucharmap-script-chapters-model.h b/gucharmap/gucharmap-script-chapters-model.h
index ab59696b..131093bb 100644
--- a/gucharmap/gucharmap-script-chapters-model.h
+++ b/gucharmap/gucharmap-script-chapters-model.h
@@ -25,6 +25,7 @@
 #define GUCHARMAP_SCRIPT_CHAPTERS_MODEL_H
 
 #include <gucharmap/gucharmap-chapters-model.h>
+#include <gucharmap/gucharmap-macros.h>
 
 G_BEGIN_DECLS
 
@@ -52,7 +53,9 @@ struct _GucharmapScriptChaptersModelClass
   GucharmapChaptersModelClass parent_class;
 };
 
+_GUCHARMAP_PUBLIC
 GType                   gucharmap_script_chapters_model_get_type (void);
+_GUCHARMAP_PUBLIC
 GucharmapChaptersModel* gucharmap_script_chapters_model_new      (void);
 
 G_END_DECLS
diff --git a/gucharmap/gucharmap-script-codepoint-list.h b/gucharmap/gucharmap-script-codepoint-list.h
index 312f50cd..9b1c761d 100644
--- a/gucharmap/gucharmap-script-codepoint-list.h
+++ b/gucharmap/gucharmap-script-codepoint-list.h
@@ -26,6 +26,7 @@
 #include <glib-object.h>
 
 #include <gucharmap/gucharmap-codepoint-list.h>
+#include <gucharmap/gucharmap-macros.h>
 
 G_BEGIN_DECLS
 
@@ -53,12 +54,17 @@ struct _GucharmapScriptCodepointListClass
   GucharmapCodepointListClass parent_class;
 };
 
+_GUCHARMAP_PUBLIC
 GType                    gucharmap_script_codepoint_list_get_type       (void);
+_GUCHARMAP_PUBLIC
 GucharmapCodepointList * gucharmap_script_codepoint_list_new            (void);
+_GUCHARMAP_PUBLIC
 gboolean                 gucharmap_script_codepoint_list_set_script     (GucharmapScriptCodepointList  *list,
                                                                         const gchar                   
*script);
+_GUCHARMAP_PUBLIC
 gboolean                 gucharmap_script_codepoint_list_set_scripts    (GucharmapScriptCodepointList  *list,
                                                                         const gchar                  
**scripts);
+_GUCHARMAP_PUBLIC
 gboolean                 gucharmap_script_codepoint_list_append_script  (GucharmapScriptCodepointList  *list,
                                                                          const gchar                   
*script);
 /* XXX: gucharmap_script_codepoint_list_get_script? seems unnecessary */
diff --git a/gucharmap/gucharmap-type-builtins.c.template b/gucharmap/gucharmap-type-builtins.c.template
index 1ba59eff..9aafe856 100644
--- a/gucharmap/gucharmap-type-builtins.c.template
+++ b/gucharmap/gucharmap-type-builtins.c.template
@@ -1,16 +1,12 @@
 /*** BEGIN file-header ***/
 #include <config.h>
 
-#include "gucharmap.h"
-#include "gucharmap-type-builtins.h"
+#include <gucharmap/gucharmap.h>
 
 /*** END file-header ***/
 
 /*** BEGIN file-production ***/
 /* enumerations from "@filename@" */
-
-#include "@filename@"
-
 /*** END file-production ***/
 
 /*** BEGIN value-header ***/
diff --git a/gucharmap/gucharmap-type-builtins.h.template b/gucharmap/gucharmap-type-builtins.h.template
index 5740753a..6774aa7d 100644
--- a/gucharmap/gucharmap-type-builtins.h.template
+++ b/gucharmap/gucharmap-type-builtins.h.template
@@ -7,6 +7,7 @@
 #define GUCHARMAP_TYPE_BUILTINS_H
 
 #include <glib-object.h>
+#include <gucharmap/gucharmap-macros.h>
 
 G_BEGIN_DECLS
 /*** END file-header ***/
@@ -17,6 +18,7 @@ G_BEGIN_DECLS
 /*** END file-production ***/
 
 /*** BEGIN value-header ***/
+_GUCHARMAP_PUBLIC
 GType @enum_name@_get_type (void);
 #define GUCHARMAP_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
 /*** END value-header ***/
diff --git a/gucharmap/gucharmap-unicode-info.h b/gucharmap/gucharmap-unicode-info.h
index f4857728..8087d81d 100644
--- a/gucharmap/gucharmap-unicode-info.h
+++ b/gucharmap/gucharmap-unicode-info.h
@@ -26,6 +26,8 @@
 
 #include <glib.h>
 
+#include <gucharmap/gucharmap-macros.h>
+
 G_BEGIN_DECLS
 
 typedef enum {
@@ -55,45 +57,73 @@ typedef enum {
 } GucharmapUnicodeVersion;
 
 /* return values are read-only */
+_GUCHARMAP_PUBLIC
 const gchar *  gucharmap_get_unicode_name                (gunichar uc);
+_GUCHARMAP_PUBLIC
 const gchar *  gucharmap_get_unicode_data_name           (gunichar uc);
+_GUCHARMAP_PUBLIC
 gint                    gucharmap_get_unicode_data_name_count     (void);
+_GUCHARMAP_PUBLIC
 GucharmapUnicodeVersion gucharmap_get_unicode_version             (gunichar uc);
+_GUCHARMAP_PUBLIC
 const gchar *  gucharmap_get_unicode_category_name       (gunichar uc);
+_GUCHARMAP_PUBLIC
 gint                    gucharmap_get_unihan_count                (void);
+_GUCHARMAP_PUBLIC
 const gchar *  gucharmap_get_unicode_kDefinition         (gunichar uc);
+_GUCHARMAP_PUBLIC
 const gchar *  gucharmap_get_unicode_kCantonese          (gunichar uc);
+_GUCHARMAP_PUBLIC
 const gchar *  gucharmap_get_unicode_kMandarin           (gunichar uc);
+_GUCHARMAP_PUBLIC
 const gchar *  gucharmap_get_unicode_kTang               (gunichar uc);
+_GUCHARMAP_PUBLIC
 const gchar *  gucharmap_get_unicode_kKorean             (gunichar uc);
+_GUCHARMAP_PUBLIC
 const gchar *  gucharmap_get_unicode_kJapaneseKun        (gunichar uc);
+_GUCHARMAP_PUBLIC
 const gchar *  gucharmap_get_unicode_kJapaneseOn         (gunichar uc);
+_GUCHARMAP_PUBLIC
 const gchar *  gucharmap_get_unicode_kHangul             (gunichar uc);
+_GUCHARMAP_PUBLIC
 const gchar *  gucharmap_get_unicode_kVietnamese         (gunichar uc);
 
 /* nameslist stuff */
+_GUCHARMAP_PUBLIC
 const gchar ** gucharmap_get_nameslist_stars             (gunichar  uc);
+_GUCHARMAP_PUBLIC
 const gchar ** gucharmap_get_nameslist_equals            (gunichar  uc);
+_GUCHARMAP_PUBLIC
 gunichar *              gucharmap_get_nameslist_exes              (gunichar  uc);
+_GUCHARMAP_PUBLIC
 const gchar ** gucharmap_get_nameslist_pounds            (gunichar  uc);
+_GUCHARMAP_PUBLIC
 const gchar ** gucharmap_get_nameslist_colons            (gunichar  uc);
+_GUCHARMAP_PUBLIC
 gboolean                gucharmap_unichar_validate                (gunichar  uc);
+_GUCHARMAP_PUBLIC
 gint                    gucharmap_unichar_to_printable_utf8       (gunichar  uc,
                                                                    gchar    *outbuf);
+_GUCHARMAP_PUBLIC
 GUnicodeType            gucharmap_unichar_type                    (gunichar  uc);
+_GUCHARMAP_PUBLIC
 gboolean                gucharmap_unichar_isdefined               (gunichar  uc);
+_GUCHARMAP_PUBLIC
 gboolean                gucharmap_unichar_isgraph                 (gunichar  uc);
 
 /* defined in gucharmap-script-codepoint-list.c */
+_GUCHARMAP_PUBLIC
 const gchar ** gucharmap_unicode_list_scripts            (void);
+_GUCHARMAP_PUBLIC
 const gchar *  gucharmap_unicode_get_script_for_char     (gunichar wc);
 
+_GUCHARMAP_PUBLIC
 const gchar *  gucharmap_unicode_version_to_string       (GucharmapUnicodeVersion version);
 
 /* doesn't really belong here, but no better place was available */
+_GUCHARMAP_PUBLIC
 gunichar     gucharmap_unicode_get_locale_character (void);
 
 G_END_DECLS
 
 #endif  /* #ifndef GUCHARMAP_UNICODE_INFO_H */
-
diff --git a/gucharmap/gucharmap-version.h.in b/gucharmap/gucharmap-version.h.in
new file mode 100644
index 00000000..1bbcc375
--- /dev/null
+++ b/gucharmap/gucharmap-version.h.in
@@ -0,0 +1,36 @@
+/*
+ * Copyright © 2004 Noah Levitt
+ * Copyright © 2008 Christian Persch
+ *
+ * This program 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 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program 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 program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+ */
+
+#if !defined (__GUCHARMAP_GUCHARMAP_H_INSIDE__) && !defined (GUCHARMAP_COMPILATION)
+#error "Only <gucharmap/gucharmap.h> can be included directly."
+#endif
+
+#ifndef GUCHARMAP_VERSION_H
+#define GUCHARMAP_VERSION_H
+
+#define GUCHARMAP_VERSION_MAJOR (@GUCHARMAP_VERSION_MAJOR@)
+#define GUCHARMAP_VERSION_MINOR (@GUCHARMAP_VERSION_MINOR@)
+#define GUCHARMAP_VERSION_MICRO (@GUCHARMAP_VERSION_MICRO@)
+
+#define GUCHARMAP_CHECK_VERSION(major,minor,micro) \
+  (GUCHARMAP_VERSION_MAJOR > (major) || \
+   (GUCHARMAP_VERSION_MAJOR == (major) && GUCHARMAP_VERSION_MINOR > (minor)) || \
+   (GUCHARMAP_VERSION_MAJOR == (major) && GUCHARMAP_VERSION_MINOR == (minor) && GUCHARMAP_VERSION_MICRO >= 
(micro)))
+
+#endif /* #ifndef GUCHARMAP_VERSION_H */
diff --git a/gucharmap/gucharmap.gresource.xml.in b/gucharmap/gucharmap.gresource.xml
similarity index 100%
rename from gucharmap/gucharmap.gresource.xml.in
rename to gucharmap/gucharmap.gresource.xml
diff --git a/gucharmap/gucharmap.h.in b/gucharmap/gucharmap.h
similarity index 79%
rename from gucharmap/gucharmap.h.in
rename to gucharmap/gucharmap.h
index da070eba..6ca59eda 100644
--- a/gucharmap/gucharmap.h.in
+++ b/gucharmap/gucharmap.h
@@ -32,14 +32,7 @@
 #define GUCHARMAP_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f)
 #endif
 
-#define GUCHARMAP_VERSION_MAJOR (@GUCHARMAP_VERSION_MAJOR@)
-#define GUCHARMAP_VERSION_MINOR (@GUCHARMAP_VERSION_MINOR@)
-#define GUCHARMAP_VERSION_MICRO (@GUCHARMAP_VERSION_MICRO@)
-
-#define GUCHARMAP_CHECK_VERSION(major,minor,micro) \
-  (GUCHARMAP_VERSION_MAJOR > (major) || \
-   (GUCHARMAP_VERSION_MAJOR == (major) && GUCHARMAP_VERSION_MINOR > (minor)) || \
-   (GUCHARMAP_VERSION_MAJOR == (major) && GUCHARMAP_VERSION_MINOR == (minor) && GUCHARMAP_VERSION_MICRO >= 
(micro)))
+#include <gucharmap/gucharmap-version.h>
 
 #include <gucharmap/gucharmap-codepoint-list.h>
 #include <gucharmap/gucharmap-block-codepoint-list.h>
diff --git a/gucharmap.pc.in b/gucharmap/gucharmap.pc.in
similarity index 100%
rename from gucharmap.pc.in
rename to gucharmap/gucharmap.pc.in
diff --git a/gucharmap/meson.build b/gucharmap/meson.build
new file mode 100644
index 00000000..921a3f52
--- /dev/null
+++ b/gucharmap/meson.build
@@ -0,0 +1,294 @@
+# 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('.')
+
+disable_deprecated_cppflags = [
+  '-DATK_DISABLE_DEPRECATION_WARNINGS',
+  '-DGDK_DISABLE_DEPRECATION_WARNINGS',
+  '-DGDK_PIXBUF_DISABLE_DEPRECATION_WARNINGS',
+  '-DGLIB_DISABLE_DEPRECATION_WARNINGS',
+  '-DGTK_DISABLE_DEPRECATION_WARNINGS',
+  '-DPANGO_DISABLE_DEPRECATION_WARNINGS',
+]
+
+# Library
+
+libgucharmap_gtk3_includedir = gucharmap_includedir / libgucharmap_gtk3_api_path
+
+version_conf = {
+  'GUCHARMAP_VERSION_MAJOR': gucharmap_major_version.to_string(),
+  'GUCHARMAP_VERSION_MINOR': gucharmap_minor_version.to_string(),
+  'GUCHARMAP_VERSION_MICRO': gucharmap_micro_version.to_string(),
+}
+
+libgucharmap_version_header = configure_file(
+  configuration: version_conf,
+  input: 'gucharmap-version.h.in',
+  install: false,
+  output: '@BASENAME@',
+)
+
+libgucharmap_enum_headers = files(
+  'gucharmap-chapters-model.h',
+  'gucharmap-charmap.h',
+  'gucharmap-unicode-info.h',
+)
+
+libgucharmap_public_headers = libgucharmap_enum_headers + [libgucharmap_version_header,] + files(
+  'gucharmap-block-chapters-model.h',
+  'gucharmap-block-codepoint-list.h',
+  'gucharmap-chapters-view.h',
+  'gucharmap-chartable.h',
+  'gucharmap-codepoint-list.h',
+  'gucharmap-script-chapters-model.h',
+  'gucharmap-script-codepoint-list.h',
+  'gucharmap.h',
+)
+
+install_headers(
+  libgucharmap_public_headers,
+  subdir: libgucharmap_gtk3_api_path,
+)
+
+libgucharmap_enum_sources = gnome.mkenums(
+  'gucharmap-type-builtins.h',
+  c_template: 'gucharmap-type-builtins.c.template',
+  h_template: 'gucharmap-type-builtins.h.template',
+  install_dir: libgucharmap_gtk3_includedir,
+  install_header: true,
+  sources: libgucharmap_enum_headers,
+)
+
+# Due to a meson bug, this header cannot be installed with the rule above. Instead,
+# use the install_header attribute in the mkenums call, and add the header afterwards
+# to the list. See https://gitlab.gnome.org/chpe/meson/issues/4
+libgucharmap_public_headers += libgucharmap_enum_sources[1]
+
+libgucharmap_sources = libgucharmap_enum_sources + files(
+  'gucharmap-block-chapters-model.c',
+  'gucharmap-block-chapters-model.h',
+  'gucharmap-block-codepoint-list.c',
+  'gucharmap-block-codepoint-list.h',
+  'gucharmap-chapters-model.c',
+  'gucharmap-chapters-model.h',
+  'gucharmap-chapters-view.c',
+  'gucharmap-chapters-view.h',
+  'gucharmap-charmap.c',
+  'gucharmap-charmap.h',
+  'gucharmap-chartable-accessible.c',
+  'gucharmap-chartable-accessible.h',
+  'gucharmap-chartable-cell-accessible.c',
+  'gucharmap-chartable-cell-accessible.h',
+  'gucharmap-chartable.c',
+  'gucharmap-chartable.h',
+  'gucharmap-codepoint-list.c',
+  'gucharmap-codepoint-list.h',
+  'gucharmap-init.c',
+  'gucharmap-private.h',
+  'gucharmap-script-chapters-model.c',
+  'gucharmap-script-chapters-model.h',
+  'gucharmap-script-codepoint-list.c',
+  'gucharmap-script-codepoint-list.h',
+  'gucharmap-unicode-info.c',
+  'gucharmap-unicode-info.h',
+)
+
+libgucharmap_sources += gnome.genmarshal(
+  'gucharmap-marshal',
+  internal: true,
+  prefix: '_gucharmap_marshal',
+  sources: 'gucharmap-marshal.list',
+)
+
+ucd_path = get_option('ucd_path')
+assert(ucd_path != '', 'must specify path to UCD files')
+
+# Meson bug! This should use files('...') (allowed as per docs), but that
+# crashes meson; see https://gitlab.gnome.org/chpe/meson/issues/2
+generate_unicode_data = find_program('gen-guch-unicode-tables.pl')
+
+unicode_sources = custom_target(
+  'unicode-data',
+  command: [generate_unicode_data, unicode_req_version, ucd_path, '@OUTDIR@'],
+  install: false,
+  output: [
+    'unicode-blocks.h',
+    'unicode-categories.h',
+    'unicode-names.h',
+    'unicode-nameslist.h',
+    'unicode-scripts.h',
+    'unicode-unihan.h',
+    'unicode-versions.h',
+  ],
+)
+
+libgucharmap_gtk3_public_deps = [
+  gio_dep,
+  glib_dep,
+  gtk3_dep,
+]
+
+libgucharmap_gtk3_deps = libgucharmap_gtk3_public_deps
+
+libgucharmap_gtk3_cppflags = disable_deprecated_cppflags + [
+  '-DGUCHARMAP_COMPILATION',
+  '-DG_LOG_DOMAIN="Gucharmap"',
+  '-DLOCALEDIR="@0@"'.format(gucharmap_localedir),
+]
+
+libgucharmap_gtk3_sources = libgucharmap_sources
+libgucharmap_gtk3_public_headers = libgucharmap_public_headers
+
+# for legacy reasons
+libgucharmap_gtk3_libname = 'gucharmap_@0@_@1@'.format(gucharmap_api_major_version, 
gucharmap_api_minor_version)
+
+libgucharmap_gtk3 = shared_library(
+  libgucharmap_gtk3_libname,
+  c_args: libgucharmap_gtk3_cppflags,
+  dependencies: libgucharmap_gtk3_deps,
+  include_directories: [top_inc, src_inc,],
+  install: true,
+  sources: libgucharmap_gtk3_sources + [unicode_sources,],
+  version: libgucharmap_gtk3_soversion,
+)
+
+libgucharmap_gtk3_dep = declare_dependency(
+  dependencies: libgucharmap_gtk3_deps,
+  include_directories: [top_inc, src_inc,],
+  link_with: libgucharmap_gtk3,
+  sources: libgucharmap_gtk3_public_headers,
+)
+
+# pkg-config file
+
+pkg.generate(
+  libgucharmap_gtk3,
+  description: 'Gucharmap widget for GTK+ 3.0',
+  filebase: libgucharmap_gtk3_api_name,
+  name: 'gucharmap',
+  requires: libgucharmap_gtk3_public_deps,
+  subdirs: libgucharmap_gtk3_api_name,
+  version: gucharmap_version,
+  variables: [
+    'exec_prefix=${prefix}',
+  ],
+)
+
+# Introspection
+
+if get_option('gir')
+  libgucharmap_gtk3_gir_includes = [
+    'Gtk-3.0',
+    'Pango-1.0'
+  ]
+
+  libgucharmap_gtk3_gir = gnome.generate_gir(
+    libgucharmap_gtk3,
+    dependencies: libgucharmap_gtk3_dep,
+    export_packages: libgucharmap_gtk3_api_name,
+    extra_args: '-DGUCHARMAP_COMPILATION',
+    header: 'gucharmap' / 'gucharmap.h',
+    includes: libgucharmap_gtk3_gir_includes,
+    install: true,
+    namespace: 'Gucharmap',
+    nsversion: libgucharmap_gtk3_api_version,
+    sources: libgucharmap_gtk3_public_headers,
+  )
+endif
+
+# Vala bindings
+
+if get_option('vapi')
+  assert(get_option('gir'), 'gir is required for vala support')
+  assert(get_option('gtk3'), 'vala support only available for gtk3')
+
+  add_languages('vala', required: true,)
+
+  valac = meson.get_compiler('vala')
+  assert(valac.version().version_compare('>= 0.16'), 'vala >= 0.16 required')
+
+  libgucharmap_gtk3_vapi_deps = [
+    'gio-2.0',
+    'glib-2.0',
+    'gtk+-3.0',
+    'pango',
+  ]
+
+  libgucharmap_gtk3_vapi = gnome.generate_vapi(
+    libgucharmap_gtk3_api_name,
+    install: true,
+    packages: libgucharmap_gtk3_vapi_deps,
+    sources: libgucharmap_gtk3_gir[0],
+  )
+endif
+
+# Charmap application
+
+gucharmap_sources = files(
+  'gucharmap-mini-fontsel.c',
+  'gucharmap-mini-fontsel.h',
+  'gucharmap-print-operation.c',
+  'gucharmap-print-operation.h',
+  'gucharmap-search-dialog.c',
+  'gucharmap-search-dialog.h',
+  'gucharmap-settings.c',
+  'gucharmap-settings.h',
+  'gucharmap-window.c',
+  'gucharmap-window.h',
+  'main.c',
+)
+
+gucharmap_gtk3_sources = gucharmap_sources
+
+gucharmap_gtk3_sources += gnome.compile_resources(
+  'gucharmap-resources',
+  'gucharmap.gresource.xml',
+  c_name: 'gucharmap',
+)
+
+gucharmap_gtk3_cppflags = disable_deprecated_cppflags + [
+  '-DLOCALEDIR="@0@"'.format(gucharmap_localedir),
+]
+
+gucharmap_gtk3_deps = [
+  freetype2_dep,
+  gtk3_dep,
+  libdl_dep,
+  libgucharmap_gtk3_dep,
+]
+
+gucharmap = executable(
+  'gucharmap',
+  gucharmap_gtk3_sources,
+  c_args: gucharmap_gtk3_cppflags,
+  dependencies: gucharmap_gtk3_deps,
+  include_directories: [top_inc, src_inc,],
+  install: get_option('charmap'),
+)
+
+# Install settings schemas
+
+schemadir = gucharmap_prefix / gucharmap_datadir / 'glib-2.0' / 'schemas'
+
+install_data(
+  'org.gnome.Charmap.gschema.xml',
+  install_dir: schemadir,
+)
+
+meson.add_install_script(
+  'meson_compileschemas.py',
+  schemadir,
+)
diff --git a/gucharmap/meson_compileschemas.py b/gucharmap/meson_compileschemas.py
new file mode 100755
index 00000000..3268ddc0
--- /dev/null
+++ b/gucharmap/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/gucharmap/org.gnome.Charmap.gschema.xml b/gucharmap/org.gnome.Charmap.gschema.xml
index 2d0ed22b..4da1b86b 100644
--- a/gucharmap/org.gnome.Charmap.gschema.xml
+++ b/gucharmap/org.gnome.Charmap.gschema.xml
@@ -22,6 +22,11 @@
 -->
 
 <schemalist gettext-domain='gucharmap'>
+  <enum id='org.gnome.Charmap.GucharmapChaptersMode'>
+    <value nick='script' value='0'/>
+    <value nick='block' value='1'/>
+  </enum>
+
   <schema id='org.gnome.Charmap' path='/org/gnome/charmap/'>
     <key name='group-by' enum='org.gnome.Charmap.GucharmapChaptersMode'>
       <summary>Character map grouping method</summary>
diff --git a/help/LINGUAS b/help/LINGUAS
new file mode 100644
index 00000000..b2ff7ce7
--- /dev/null
+++ b/help/LINGUAS
@@ -0,0 +1,20 @@
+bg
+ca
+cs
+de
+el
+en_GB
+es
+fi
+fr
+gl
+hu
+ko
+oc
+pl
+pt_BR
+ru
+sl
+sv
+vi
+zh_CN
diff --git a/help/meson.build b/help/meson.build
new file mode 100644
index 00000000..103719d5
--- /dev/null
+++ b/help/meson.build
@@ -0,0 +1,25 @@
+# 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/>.
+
+gnome.yelp(
+  'gucharmap',
+  media: [
+    'figures/gucharmap_window.png',
+  ],
+  sources: [
+    'index.docbook',
+    'legal.xml',
+  ],
+)
diff --git a/meson.build b/meson.build
new file mode 100644
index 00000000..34227142
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,303 @@
+# 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(
+  'gucharmap',
+  ['c',],
+  default_options: [
+    'buildtype=release',
+    'c_std=gnu11',
+    'warning_level=' + (meson.version().version_compare('>= 0.50.0') ? '0' : '1'),
+    'b_ndebug=false',
+  ],
+  license: ['GPL-3.0-or-later',],
+  meson_version: '>= 0.49.0',
+  version: '12.0.3',
+)
+
+# Naming
+
+gucharmap_name = 'gucharmap'
+
+# Requirements
+
+freetype2_req_version = '1.0'
+gio_req_version       = '2.32.0'
+glib_req_version      = '2.32.0'
+gtk3_req_version      = '3.4.0'
+
+# NOTE! This is an exact requirement. Each gucharmap version (major.minor) is
+# designed to work with, and only with, this unicode version. Upgrading to
+# a newer unicode version does not simply mean bumping this requirement, but
+# also requires more or less (depending on the unicode version) extensive code
+# changes to gucharmap. Therefore, you should NOT upgrade the unicode version
+# of a released gucharmap, but upgrade to the gucharmap version corresponding
+# to the desired unicode version.
+unicode_req_version   = '12.0.0'
+
+# API
+
+gucharmap_api_major_version = 2
+gucharmap_api_minor_version = 90
+
+libgucharmap_gtk3_api_version = '@0@.@1@'.format(gucharmap_api_major_version, gucharmap_api_minor_version)
+libgucharmap_gtk3_api_name = gucharmap_name + '-' + libgucharmap_gtk3_api_version
+libgucharmap_gtk3_api_path = libgucharmap_gtk3_api_name / 'gucharmap'
+
+# Versioning
+
+gucharmap_version = meson.project_version()
+
+version_split = meson.project_version().split('.')
+gucharmap_major_version = version_split[0].to_int()
+gucharmap_minor_version = version_split[1].to_int()
+gucharmap_micro_version = version_split[2].to_int()
+
+# Library versioning
+
+lt_current  = 7
+lt_revision = 0
+lt_age      = 0
+
+libgucharmap_gtk3_soversion = '@0@.@1@.@2@'.format(lt_current, lt_revision, lt_age)
+
+libgucharmap_gtk4_soversion = '0'
+
+# i18n
+
+gucharmap_gettext_domain = gucharmap_name
+po_dir = meson.current_source_dir() / 'po'
+
+# Directories
+
+gucharmap_datadir    = get_option('datadir')
+gucharmap_includedir = get_option('includedir')
+gucharmap_libdir     = get_option('libdir')
+gucharmap_libexecdir = get_option('libexecdir')
+gucharmap_localedir  = get_option('localedir')
+gucharmap_prefix     = get_option('prefix')
+
+gucharmap_pkgdatadir = gucharmap_datadir / gucharmap_name
+
+# Debug
+
+enable_debug = get_option('dbg') or get_option('debug') or get_option('buildtype').contains('debug')
+
+# Meson modules
+
+gnome = import('gnome')
+i18n  = import('i18n')
+pkg   = import('pkgconfig')
+
+# Compilers
+
+cc = meson.get_compiler('c')
+
+# 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')
+
+# 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', gucharmap_gettext_domain)
+config_h.set_quoted('VERSION', gucharmap_version)
+config_h.set('ENABLE_DEBUG', enable_debug)
+
+# FIXME AC_USE_SYSTEM_EXTENSIONS also supported non-gnu systems
+config_h.set10('_GNU_SOURCE', true)
+
+# Check for functions
+
+libdl_dep = cc.find_library('dl')
+
+check_dl_functions_required = [
+  'dlsym',
+]
+
+foreach func: check_dl_functions_required
+  assert(cc.has_function(func, dependencies: libdl_dep), func + ' not found')
+endforeach
+
+# Compiler flags
+
+compiler_flags_common = [
+  '-Waggregate-return',
+  '-Wall',
+  '-Wcast-align',
+  '-Wdeclaration-after-statement',
+  '-Werror=implicit-function-declaration',
+  '-Wextra',
+  '-Wformat-signedness',
+  '-Wimplicit',
+  '-Winit-self',
+  '-Wmissing-declarations',
+  '-Wmissing-format-attribute',
+  '-Wmissing-prototypes',
+  '-Wnested-externs',
+  '-Wno-missing-field-initializers',
+  '-Wno-cast-function-type',
+  '-Wno-deprecated-declarations',
+  '-Wno-switch-enum',
+  '-Wno-unused-parameter',
+  '-Wold-style-definition',
+  '-Wpacked',
+  '-Wpointer-arith',
+  '-Wshadow',
+  '-Wsign-compare',
+  '-Wstrict-aliasing=2',
+  '-Wstrict-prototypes',
+  '-Wuninitialized',
+  '-Wunsafe-loop-optimizations',
+  '-Wwrite-strings',
+  '-fno-common',
+]
+
+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_cc_required = [
+  '-fvisibility=hidden',
+]
+
+global_cflags = cc.get_supported_arguments(compiler_flags_common +
+                                           compiler_flags_common_undesirable +
+                                           compiler_flags_cc_required)
+
+foreach flag: compiler_flags_cc_required
+  assert(cc.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.
+
+# FIXME: these flags break the gtkdoc-scangobj run
+# compiler_flags_format_warnings = [
+#  '-Werror=format=2',
+#  '-Werror=format-nonliteral',
+#  '-Werror=format-security',
+#]
+#
+# global_cflags += compiler_flags_format_warnings
+
+# ... and now make these flags the default
+
+add_project_arguments(global_cflags, language: 'c',)
+
+# Linker flags
+
+linker_flags = [
+  '-Wl,-Bsymbolic-functions'
+]
+
+foreach flag: linker_flags
+  assert(cc.has_link_argument(flag), flag + ' is required but not supported')
+  add_project_link_arguments(flag, language: 'c',)
+endforeach
+
+# Dependencies
+
+freetype2_dep = dependency('freetype2', version: '>=' + freetype2_req_version,)
+gio_dep       = dependency('gio-2.0',   version: '>=' + gio_req_version,)
+glib_dep      = dependency('glib-2.0',  version: '>=' + glib_req_version,)
+
+if get_option('gtk3')
+  gtk3_dep = dependency('gtk+-3.0',  version: '>=' + gtk3_req_version,)
+else
+  gtk3_dep = dependency('', required: false,)
+endif
+
+# Write config.h
+
+configure_file(
+  output: 'config.h',
+  configuration: config_h,
+)
+
+# Subdirs
+
+top_inc = include_directories('.')
+
+subdir('data')
+subdir('gucharmap')
+subdir('po')
+
+if get_option('docs')
+  subdir('docs' / 'reference')
+endif
+
+if get_option('docs') and get_option('charmap')
+  subdir('help')
+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 Gucharmap:\n\n'
+output += '  Version:                ' + gucharmap_version + '\n'
+output += '  Unicode version:        ' + unicode_req_version + '\n'
+output += '\n'
+output += '  C compiler:             ' + cc.get_id() + '\n\n'
+output += '  Coverage:               ' + get_option('b_coverage').to_string() + '\n'
+output += '  Charmap:                ' + get_option('charmap').to_string() + '\n'
+output += '  Documentation:          ' + get_option('docs').to_string() + '\n'
+output += '  Debug:                  ' + enable_debug.to_string() + '\n'
+output += '  GIR:                    ' + get_option('gir').to_string() + '\n'
+output += '  GTK+ 3.0:               ' + get_option('gtk3').to_string() + '\n'
+output += '  Vala:                   ' + get_option('vapi').to_string() + '\n'
+output += '\n'
+output += '  Prefix:                 ' + get_option('prefix') + '\n'
+output += '  Desktop data dir:       ' + desktopdatadir + '\n'
+output += '  Schemas dir:            ' + schemadir + '\n'
+message(output)
+
+# Done
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 00000000..91ef8065
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,63 @@
+# 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(
+  'charmap',
+  type: 'boolean',
+  value: true,
+  description: 'Build the charmap programme',
+)
+
+option(
+  'dbg',
+  type: 'boolean',
+  value: false,
+  description: 'Enable extra debugging functionality',
+)
+
+option(
+  'docs',
+  type: 'boolean',
+  value: true,
+  description: 'Enable documentation',
+)
+
+option(
+  'gir',
+  type: 'boolean',
+  value: true,
+  description: 'Enable GObject Introspection',
+)
+
+option(
+  'gtk3',
+  type: 'boolean',
+  value: true,
+  description: 'Enable GTK+ 3.0 widget',
+)
+
+option(
+  'ucd_path',
+  type: 'string',
+  value: '',
+  description: 'Path to Unicode database files',
+)
+
+option(
+  'vapi', # would use 'vala' but that name is reserved
+  type: 'boolean',
+  value: true,
+  description: 'Enable Vala bindings',
+)
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 00000000..a9695d20
--- /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(
+  gucharmap_gettext_domain,
+  preset: 'glib',
+)
\ No newline at end of file


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