summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Blanchard <tchaik@gmx.com>2019-05-30 13:55:45 +0200
committerRichard Hughes <richard@hughsie.com>2019-06-09 18:17:37 +0100
commit7f358c676ba0990421d6a038569c8b798353e52b (patch)
tree82a788799f3b586013248c50d66276788e310cc7
parenta87889cebedbf0b3d45a41e83287b0b0f8fae7b7 (diff)
downloadcolord-gtk-7f358c676ba0990421d6a038569c8b798353e52b.tar.gz
build: Port to the Meson build system
Introduce meson build scripts along autotools ones. Porting modules to the meson build system is a GNOME Goal, details here: https://wiki.gnome.org/Initiatives/GnomeGoals/MesonPorting https://github.com/hughsie/colord-gtk/issues/10
-rw-r--r--Makefile.am85
-rwxr-xr-xautogen.sh35
-rw-r--r--client/Makefile.am32
-rw-r--r--client/meson.build24
-rw-r--r--configure.ac202
-rw-r--r--contrib/Makefile.am1
-rw-r--r--doc/Makefile.am4
-rw-r--r--doc/api/Makefile.am71
-rwxr-xr-xdoc/api/clean.sh7
-rw-r--r--doc/api/meson.build19
-rw-r--r--doc/meson.build1
-rw-r--r--git.mk200
-rw-r--r--libcolord-gtk/Makefile.am169
-rw-r--r--libcolord-gtk/colord-gtk.pc.in11
-rw-r--r--libcolord-gtk/colord-gtk2.pc.in11
-rw-r--r--libcolord-gtk/meson.build166
-rw-r--r--m4/.gitignore1
-rw-r--r--m4/as-linguas.m424
-rw-r--r--man/Makefile.am30
-rw-r--r--man/meson.build29
-rw-r--r--meson.build149
-rw-r--r--meson_options.txt5
-rw-r--r--po/LINGUAS1
-rw-r--r--po/Makevars78
-rw-r--r--po/meson.build6
25 files changed, 400 insertions, 961 deletions
diff --git a/Makefile.am b/Makefile.am
deleted file mode 100644
index 2ef3a2e..0000000
--- a/Makefile.am
+++ /dev/null
@@ -1,85 +0,0 @@
-AUTOMAKE_OPTIONS = 1.7
-
-ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-
-NULL =
-
-SUBDIRS = \
- man \
- contrib \
- libcolord-gtk \
- po
-
-# this needs libcolord-gtk
-SUBDIRS += \
- client \
- doc
-
-snapshot:
- $(MAKE) dist distdir=$(PACKAGE)-$(VERSION)-`date +"%Y%m%d"`
-
-DISTCHECK_CONFIGURE_FLAGS = \
- --enable-introspection \
- --enable-vala \
- --enable-gtk2 \
- --enable-gtk-doc
-
-EXTRA_DIST = \
- COPYING \
- MAINTAINERS \
- AUTHORS \
- INSTALL \
- README \
- NEWS \
- autogen.sh \
- config.h
-
-MAINTAINERCLEANFILES = \
- $(srcdir)/INSTALL \
- $(srcdir)/ABOUT-NLS \
- $(srcdir)/aclocal.m4 \
- $(srcdir)/autoscan.log \
- $(srcdir)/compile \
- $(srcdir)/config.guess \
- $(srcdir)/config.rpath \
- $(srcdir)/config.h.in \
- $(srcdir)/config.sub \
- $(srcdir)/configure.scan \
- $(srcdir)/depcomp \
- $(srcdir)/install-sh \
- $(srcdir)/ltmain.sh \
- $(srcdir)/missing \
- $(srcdir)/mkinstalldirs \
- $(srcdir)/omf.make \
- $(srcdir)/xmldocs.make \
- $(srcdir)/gtk-doc.make \
- $(srcdir)/ChangeLog \
- $(srcdir)/po/Makefile.in.in~ \
- $(srcdir)/colord-*.tar.* \
- `find "$(srcdir)" -type f -name Makefile.in -print`
-
-GITIGNOREFILES = \
- .tx
-
-distclean-local:
- if test $(srdcir) = .; then :; else \
- rm -f ChangeLog; \
- fi
-
-ChangeLog:
- @echo Creating $@
- @if test -d "$(srcdir)/.git"; then \
- (GIT_DIR=$(top_srcdir)/.git ./missing --run git log e197d80c8937c622f21f569457d1bbd05746d951.. --stat -M -C --name-status --date=short --no-color) | fmt --split-only > $@.tmp \
- && mv -f $@.tmp $@ \
- || ($(RM) $@.tmp; \
- echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \
- (test -f $@ || echo git-log is required to generate this file >> $@)); \
- else \
- test -f $@ || \
- (echo A git checkout and git-log is required to generate ChangeLog >&2 && \
- echo A git checkout and git-log is required to generate this file >> $@); \
- fi
-
-.PHONY: ChangeLog
-
--include $(top_srcdir)/git.mk
diff --git a/autogen.sh b/autogen.sh
deleted file mode 100755
index 1996470..0000000
--- a/autogen.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2010 Richard Hughes <richard@hughsie.com>
-#
-# Run this to generate all the initial makefiles, etc.
-#
-# Licensed under the GNU General Public License Version 2
-# 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.
-
-test -n "$srcdir" || srcdir=`dirname "$0"`
-test -n "$srcdir" || srcdir=.
-
-olddir=`pwd`
-cd "$srcdir"
-
-GTKDOCIZE=`which gtkdocize`
-if test -z $GTKDOCIZE; then
- echo "*** No GTK-Doc found, please install it ***"
- exit 1
-fi
-
-AUTORECONF=`which autoreconf`
-if test -z $AUTORECONF; then
- echo "*** No autoreconf found, please install it ***"
- exit 1
-fi
-
-gtkdocize || exit $?
-autopoint --force
-ACLOCAL="${ACLOCAL-aclocal} $ACLOCAL_FLAGS" autoreconf --force --install --verbose
-
-cd "$olddir"
-test -n "$NOCONFIGURE" || "$srcdir/configure" "$@"
diff --git a/client/Makefile.am b/client/Makefile.am
deleted file mode 100644
index f143dcb..0000000
--- a/client/Makefile.am
+++ /dev/null
@@ -1,32 +0,0 @@
-INCLUDES = \
- $(GLIB_CFLAGS) \
- $(GTK3_CFLAGS) \
- $(COLORD_CFLAGS) \
- -I$(top_srcdir) \
- -I$(top_srcdir)/libcolord-gtk \
- -DG_LOG_DOMAIN=\"Cd\" \
- -DCD_COMPILATION \
- -DVERSION="\"$(VERSION)\"" \
- -DLOCALEDIR=\""$(localedir)"\"
-
-COLORD_GTK_LIBS = \
- $(top_builddir)/libcolord-gtk/libcolord-gtk.la
-
-bin_PROGRAMS = \
- cd-convert
-
-cd_convert_SOURCES = \
- cd-convert.c
-
-cd_convert_LDADD = \
- $(LCMS_LIBS) \
- $(COLORD_LIBS) \
- $(COLORD_GTK_LIBS) \
- $(GTK3_LIBS) \
- $(GLIB_LIBS) \
- -lm
-
-cd_convert_CFLAGS = \
- $(WARNINGFLAGS_C)
-
--include $(top_srcdir)/git.mk
diff --git a/client/meson.build b/client/meson.build
new file mode 100644
index 0000000..9c65a9d
--- /dev/null
+++ b/client/meson.build
@@ -0,0 +1,24 @@
+executable(
+ 'cd-convert',
+ sources : [
+ 'cd-convert.c',
+ ],
+ include_directories : [
+ root_incdir,
+ colord_gtk_incdir,
+ ],
+ dependencies : [
+ glib,
+ gio,
+ gtk,
+ colord,
+ ],
+ link_with : colord_gtk,
+ c_args : [
+ '-DG_LOG_DOMAIN="Cd"',
+ '-DVERSION="@0@"'.format(colord_gtk_version),
+ '-DLOCALEDIR="@0@"'.format(get_option('localedir')),
+ ],
+ install : true,
+ install_dir : bindir
+)
diff --git a/configure.ac b/configure.ac
deleted file mode 100644
index 5c39604..0000000
--- a/configure.ac
+++ /dev/null
@@ -1,202 +0,0 @@
-# Copyright (C) 2012 Richard Hughes <richard@hughsie.com>
-AC_PREREQ(2.63)
-
-m4_define([cd_major_version], [0])
-m4_define([cd_minor_version], [1])
-m4_define([cd_micro_version], [27])
-m4_define([cd_version],
- [cd_major_version.cd_minor_version.cd_micro_version])
-
-AC_INIT([colord-gtk],[cd_version],[http://hughsie.com])
-AC_CONFIG_SRCDIR(libcolord-gtk)
-AM_INIT_AUTOMAKE([1.9 no-dist-gzip dist-xz tar-ustar])
-AC_CONFIG_HEADERS([config.h])
-AC_CONFIG_MACRO_DIR([m4])
-AC_PROG_LIBTOOL
-
-GOBJECT_INTROSPECTION_CHECK([0.9.8])
-
-# set up gtk-doc
-GTK_DOC_CHECK(1.9)
-
-# use this in cd-version.h
-CD_GTK_MAJOR_VERSION=cd_major_version
-CD_GTK_MINOR_VERSION=cd_minor_version
-CD_GTK_MICRO_VERSION=cd_micro_version
-AC_SUBST(VERSION)
-AC_SUBST(CD_GTK_MAJOR_VERSION)
-AC_SUBST(CD_GTK_MINOR_VERSION)
-AC_SUBST(CD_GTK_MICRO_VERSION)
-
-# libtool versioning - this applies to libcolord-gtk
-#
-# See http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91 for details
-#
-# increment;
-# CURRENT If the API or ABI interface has changed (reset REVISION to 0)
-# REVISION If the API and ABI remains the same, but bugs are fixed.
-# AGE Don't use.
-LT_CURRENT=1
-LT_REVISION=3
-LT_AGE=0
-AC_SUBST(LT_CURRENT)
-AC_SUBST(LT_REVISION)
-AC_SUBST(LT_AGE)
-
-# enable nice build output on automake1.11
-m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
-
-AS_ALL_LINGUAS
-AC_PROG_CC
-AC_PROG_INSTALL
-LT_INIT
-AM_PROG_CC_C_O
-AC_PATH_PROG(XSLTPROC, xsltproc)
-
-dnl ---------------------------------------------------------------------------
-dnl - Use strict options (default enabled for devs, disabled in releases)
-dnl ---------------------------------------------------------------------------
-if test -d ".git"; then
- default_strict=yes
-else
- default_strict=no
-fi
-
-AC_ARG_ENABLE(strict, AS_HELP_STRING([--enable-strict],
- [Enable strict compilation options]),
- enable_strict=$enableval,
- enable_strict=$default_strict)
-if test x$enable_strict != xno; then
- CPPFLAGS="$CPPFLAGS -DG_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES"
- CPPFLAGS="$CPPFLAGS -DG_DISABLE_DEPRECATED"
- CPPFLAGS="$CPPFLAGS -DGSEAL_ENABLE"
-fi
-
-dnl ---------------------------------------------------------------------------
-dnl - Extra verbose warning switches
-dnl ---------------------------------------------------------------------------
-
-if test "$GCC" = "yes"; then
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wall"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wcast-align -Wno-uninitialized"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wmissing-declarations"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wpointer-arith"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wcast-align"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wwrite-strings"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Winit-self"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wreturn-type"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wformat-nonliteral"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wformat-security"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wmissing-include-dirs"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wmissing-format-attribute"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wclobbered"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wempty-body"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wignored-qualifiers"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wsign-compare"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wtype-limits"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wuninitialized"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Waggregate-return"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wdeclaration-after-statement"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wshadow"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wno-strict-aliasing"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Winline"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wmissing-parameter-type"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Woverride-init"
-else
- WARNINGFLAGS_C=""
-fi
-AC_SUBST(WARNINGFLAGS_C)
-
-dnl ---------------------------------------------------------------------------
-dnl - gettext stuff
-dnl ---------------------------------------------------------------------------
-AM_GNU_GETTEXT_VERSION([0.19.8])
-AM_GNU_GETTEXT([external])
-
-GETTEXT_PACKAGE=AC_PACKAGE_NAME
-AC_SUBST(GETTEXT_PACKAGE)
-AC_DEFINE(GETTEXT_PACKAGE, "AC_PACKAGE_NAME", [foo])
-
-GLIB_GSETTINGS
-
-dnl ---------------------------------------------------------------------------
-dnl - Check library dependencies
-dnl ---------------------------------------------------------------------------
-PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28.0 gobject-2.0 gthread-2.0 gio-2.0 >= 2.25.9)
-PKG_CHECK_MODULES(GTK3, gtk+-3.0)
-PKG_CHECK_MODULES(COLORD, colord >= 0.1.27)
-PKG_CHECK_MODULES(LCMS, lcms2 >= 2.2)
-
-dnl ---------------------------------------------------------------------------
-dnl - Build Gtk+2 support
-dnl ---------------------------------------------------------------------------
-AC_ARG_ENABLE(gtk2, AS_HELP_STRING([--enable-gtk2],[build Gtk2 library]),
- enable_gtk2=$enableval,enable_gtk2=no)
-if test x$enable_gtk2 != xno; then
- PKG_CHECK_MODULES(GTK2, gtk+-2.0)
-fi
-AM_CONDITIONAL(HAVE_GTK2, [test "x$enable_gtk2" = "xyes"])
-
-dnl ---------------------------------------------------------------------------
-dnl - Build VALA support
-dnl ---------------------------------------------------------------------------
-AC_ARG_ENABLE(vala, AS_HELP_STRING([--enable-vala],[build vala bindings]),
- enable_vala=$enableval,enable_vala=no)
-if test x$found_introspection != xno -a x$enable_vala != xno; then
- AC_PATH_PROG([VAPIGEN], [vapigen], [])
- if test "x$VAPIGEN" = "x"; then
- has_vapigen="no"
- AC_MSG_WARN([vapigen not found, will not build Vala binding])
- else
- has_vapigen="yes"
- fi
-else
- has_vapigen="no"
- if test x$found_introspection = xno; then
- AC_MSG_WARN([introspection not found, will not build Vala binding])
- fi
-fi
-AM_CONDITIONAL(HAVE_VAPIGEN, [test "x$has_vapigen" = "xyes"])
-
-dnl ---------------------------------------------------------------------------
-dnl - Is docbook2man available?
-dnl ---------------------------------------------------------------------------
-AC_PATH_PROG(DOCBOOK2MAN, docbook2man, no)
-if test "$DOCBOOK2MAN" = "no" ; then
- AC_MSG_WARN([docbook2man not found, will not be able to build man documentation (if tarball, pre-generated documentation will be installed)])
-fi
-AM_CONDITIONAL(HAVE_DOCBOOK2MAN, [test "$DOCBOOK2MAN" != "no"])
-
-dnl ---------------------------------------------------------------------------
-dnl - Makefiles, etc.
-dnl ---------------------------------------------------------------------------
-AC_CONFIG_FILES([
-Makefile
-contrib/Makefile
-doc/Makefile
-doc/api/Makefile
-doc/api/version.xml
-man/Makefile
-po/Makefile.in
-client/Makefile
-libcolord-gtk/cd-version.h
-libcolord-gtk/colord-gtk.pc
-libcolord-gtk/colord-gtk2.pc
-libcolord-gtk/Makefile
-])
-AC_OUTPUT
-
-dnl ==========================================================================
-echo "
- colord-gtk $VERSION
- ===================
-
- prefix: ${prefix}
- datadir: ${datadir}
- compiler: ${CC}
- cflags: ${CFLAGS}
- cppflags: ${CPPFLAGS}
- gobject-introspection: ${found_introspection}
- Vala API generator: ${has_vapigen}
- Additional Gtk+2 support: ${enable_gtk2}
-"
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
deleted file mode 100644
index ae44c94..0000000
--- a/contrib/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
--include $(top_srcdir)/git.mk
diff --git a/doc/Makefile.am b/doc/Makefile.am
deleted file mode 100644
index 1dc641b..0000000
--- a/doc/Makefile.am
+++ /dev/null
@@ -1,4 +0,0 @@
-SUBDIRS = \
- api
-
--include $(top_srcdir)/git.mk
diff --git a/doc/api/Makefile.am b/doc/api/Makefile.am
deleted file mode 100644
index 617692a..0000000
--- a/doc/api/Makefile.am
+++ /dev/null
@@ -1,71 +0,0 @@
-AUTOMAKE_OPTIONS = 1.7
-
-# The name of the module.
-DOC_MODULE=colord-gtk
-
-# The top-level SGML file.
-DOC_MAIN_SGML_FILE=colord-gtk-docs.xml
-
-# Extra options to supply to gtkdoc-scan
-SCAN_OPTIONS=--ignore-headers=config.h
-
-# The directory containing the source code. Relative to $(srcdir)
-DOC_SOURCE_DIR=$(top_srcdir)/libcolord-gtk $(top_builddir)/libcolord-gtk
-
-# Used for dependencies
-HFILE_GLOB=
-CFILE_GLOB=
-
-# Headers to ignore
-IGNORE_HFILES= \
- config.h
-
-# CFLAGS and LDFLAGS for compiling scan program. Only needed
-# if $(DOC_MODULE).types is non-empty.
-INCLUDES = \
- $(GLIB_CFLAGS) \
- -I$(top_srcdir)/libcolord-gtk \
- -I$(top_builddir)/libcolord-gtk
-
-COLORD_LIBS = $(top_builddir)/libcolord-gtk/libcolord-gtk.la
-
-GTKDOC_LIBS = \
- $(GLIB_LIBS) \
- $(COLORD_LIBS)
-
-# Extra options to supply to gtkdoc-mkdb
-MKDB_OPTIONS=--sgml-mode --output-format=xml
-
-# Extra options to supply to gtkdoc-mktmpl
-MKTMPL_OPTIONS=
-
-# Non-autogenerated SGML files to be included in $(DOC_MAIN_SGML_FILE)
-content_files = \
- ../../COPYING \
- version.xml
-
-# Images to copy into HTML directory
-HTML_IMAGES = \
- $(NULL)
-
-# Extra options to supply to gtkdoc-fixref
-FIXXREF_OPTIONS=
-
-MAINTAINERCLEANFILES = \
- *~ \
- Makefile.in \
- colord-gtk.types \
- colord-*.txt
-
-if ENABLE_GTK_DOC
-include $(top_srcdir)/gtk-doc.make
-CLEANFILES += tmpl
-else
-EXTRA_DIST =
-CLEANFILES = tmpl
-endif
-
-# Version information for marking the documentation
-EXTRA_DIST += version.xml.in
-
--include $(top_srcdir)/git.mk
diff --git a/doc/api/clean.sh b/doc/api/clean.sh
deleted file mode 100755
index ff8c845..0000000
--- a/doc/api/clean.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-rm -f *.txt
-rm -f colord-scan*
-rm -f colord.types
-rm -rf html/
-rm -rf tmpl/
-rm -f *.stamp
-
diff --git a/doc/api/meson.build b/doc/api/meson.build
new file mode 100644
index 0000000..5e641fb
--- /dev/null
+++ b/doc/api/meson.build
@@ -0,0 +1,19 @@
+version_xml = configure_file(
+ input : 'version.xml.in',
+ output : 'version.xml',
+ configuration : conf,
+)
+
+gnome.gtkdoc(
+ 'colord-gtk',
+ src_dir : [
+ join_paths(meson.source_root(), 'libcolord-gtk'),
+ join_paths(meson.build_root(), 'libcolord-gtk'),
+ ],
+ main_xml : 'colord-gtk-docs.xml',
+ content_files : [
+ '../../COPYING',
+ version_xml,
+ ],
+ install : true
+)
diff --git a/doc/meson.build b/doc/meson.build
new file mode 100644
index 0000000..dc2bb41
--- /dev/null
+++ b/doc/meson.build
@@ -0,0 +1 @@
+subdir('api')
diff --git a/git.mk b/git.mk
deleted file mode 100644
index abd6c0a..0000000
--- a/git.mk
+++ /dev/null
@@ -1,200 +0,0 @@
-# git.mk
-#
-# Copyright 2009, Red Hat, Inc.
-# Written by Behdad Esfahbod
-#
-# Copying and distribution of this file, with or without modification,
-# are permitted in any medium without royalty provided the copyright
-# notice and this notice are preserved.
-#
-# The canonical source for this file is pango/git.mk, or whereever the
-# header of pango/git.mk suggests in the future.
-#
-# To use in your project, import this file in your git repo's toplevel,
-# then do "make -f git.mk". This modifies all Makefile.am files in
-# your project to include git.mk.
-#
-# This enables automatic .gitignore generation. If you need to ignore
-# more files, add them to the GITIGNOREFILES variable in your Makefile.am.
-# But think twice before doing that. If a file has to be in .gitignore,
-# chances are very high that it's a generated file and should be in one
-# of MOSTLYCLEANFILES, CLEANFILES, DISTCLEANFILES, or MAINTAINERCLEANFILES.
-#
-# The only case that you need to manually add a file to GITIGNOREFILES is
-# when remove files in one of mostlyclean-local, clean-local, distclean-local,
-# or maintainer-clean-local.
-#
-# Note that for files like editor backup, etc, there are better places to
-# ignore them. See "man gitignore".
-#
-# If "make maintainer-clean" removes the files but they are not recognized
-# by this script (that is, if "git status" shows untracked files still), send
-# me the output of "git status" as well as your Makefile.am and Makefile for
-# the directories involved.
-#
-# For a list of toplevel files that should be in MAINTAINERCLEANFILES, see
-# pango/Makefile.am.
-#
-# Don't EXTRA_DIST this file. It is supposed to only live in git clones,
-# not tarballs. It serves no useful purpose in tarballs and clutters the
-# build dir.
-#
-# This file knows how to handle autoconf, automake, libtool, gtk-doc,
-# gnome-doc-utils, mallard, intltool, gsettings.
-#
-#
-# KNOWN ISSUES:
-#
-# - Recursive configure doesn't work as $(top_srcdir)/git.mk inside the
-# submodule doesn't find us. If you have configure.{in,ac} files in
-# subdirs, add a proxy git.mk file in those dirs that simply does:
-# "include $(top_srcdir)/../git.mk". Add more ..'s to your taste.
-# And add those files to git. See vte/gnome-pty-helper/git.mk for
-# example.
-#
-# ChangeLog
-#
-# - 2010-12-06 Add support for Mallard docs
-# - 2010-12-06 Start this change log
-
-git-all: git-mk-install
-
-git-mk-install:
- @echo Installing git makefile
- @any_failed=; find $(top_srcdir) -name Makefile.am | while read x; do \
- if grep 'include .*/git.mk' $$x >/dev/null; then \
- echo $$x already includes git.mk; \
- else \
- failed=; \
- echo "Updating $$x"; \
- { cat $$x; \
- echo ''; \
- echo '-include $$(top_srcdir)/git.mk'; \
- } > $$x.tmp || failed=1; \
- if test x$$failed = x; then \
- mv $$x.tmp $$x || failed=1; \
- fi; \
- if test x$$failed = x; then : else \
- echo Failed updating $$x; >&2 \
- any_failed=1; \
- fi; \
- fi; done; test -z "$$any_failed"
-
-.PHONY: git-all git-mk-install
-
-
-### .gitignore generation
-
-$(srcdir)/.gitignore: Makefile.am $(top_srcdir)/git.mk
- $(AM_V_GEN) \
- { \
- if test "x$(DOC_MODULE)" = x -o "x$(DOC_MAIN_SGML_FILE)" = x; then :; else \
- for x in \
- $(DOC_MODULE)-decl-list.txt \
- $(DOC_MODULE)-decl.txt \
- tmpl/$(DOC_MODULE)-unused.sgml \
- "tmpl/*.bak" \
- xml html \
- ; do echo /$$x; done; \
- fi; \
- if test "x$(DOC_MODULE)$(DOC_ID)" = x -o "x$(DOC_LINGUAS)" = x; then :; else \
- for x in \
- $(_DOC_C_DOCS) \
- $(_DOC_LC_DOCS) \
- $(_DOC_OMF_ALL) \
- $(_DOC_DSK_ALL) \
- $(_DOC_HTML_ALL) \
- $(_DOC_MOFILES) \
- $(_DOC_POFILES) \
- $(DOC_H_FILE) \
- "*/.xml2po.mo" \
- "*/*.omf.out" \
- ; do echo /$$x; done; \
- fi; \
- if test "x$(gsettings_SCHEMAS)" = x; then :; else \
- for x in \
- $(gsettings_SCHEMAS:.xml=.valid) \
- $(gsettings__enum_file) \
- ; do echo /$$x; done; \
- fi; \
- if test -f $(srcdir)/po/Makefile.in.in; then \
- for x in \
- po/Makefile.in.in \
- po/Makefile.in \
- po/Makefile \
- po/POTFILES \
- po/stamp-it \
- po/.intltool-merge-cache \
- "po/*.gmo" \
- "po/*.mo" \
- po/$(GETTEXT_PACKAGE).pot \
- intltool-extract.in \
- intltool-merge.in \
- intltool-update.in \
- ; do echo /$$x; done; \
- fi; \
- if test -f $(srcdir)/configure; then \
- for x in \
- autom4te.cache \
- configure \
- config.h \
- stamp-h1 \
- libtool \
- config.lt \
- ; do echo /$$x; done; \
- fi; \
- for x in \
- .gitignore \
- $(GITIGNOREFILES) \
- $(CLEANFILES) \
- $(PROGRAMS) \
- $(check_PROGRAMS) \
- $(EXTRA_PROGRAMS) \
- $(LTLIBRARIES) \
- so_locations \
- .libs _libs \
- $(MOSTLYCLEANFILES) \
- "*.$(OBJEXT)" \
- "*.lo" \
- $(DISTCLEANFILES) \
- $(am__CONFIG_DISTCLEAN_FILES) \
- $(CONFIG_CLEAN_FILES) \
- TAGS ID GTAGS GRTAGS GSYMS GPATH tags \
- "*.tab.c" \
- $(MAINTAINERCLEANFILES) \
- $(BUILT_SOURCES) \
- $(DEPDIR) \
- Makefile \
- Makefile.in \
- "*.orig" \
- "*.rej" \
- "*.bak" \
- "*~" \
- ".*.sw[nop]" \
- ".dirstamp" \
- ; do echo /$$x; done; \
- } | \
- sed "s@^/`echo "$(srcdir)" | sed 's/\(.\)/[\1]/g'`/@/@" | \
- sed 's@/[.]/@/@g' | \
- LC_ALL=C sort | uniq > $@.tmp && \
- mv $@.tmp $@;
-
-all: $(srcdir)/.gitignore gitignore-recurse-maybe
-gitignore-recurse-maybe:
- @if test "x$(SUBDIRS)" = "x$(DIST_SUBDIRS)"; then :; else \
- $(MAKE) $(AM_MAKEFLAGS) gitignore-recurse; \
- fi;
-gitignore-recurse:
- @for subdir in $(DIST_SUBDIRS); do \
- case " $(SUBDIRS) " in \
- *" $$subdir "*) :;; \
- *) test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) .gitignore gitignore-recurse || echo "Skipping $$subdir");; \
- esac; \
- done
-gitignore: $(srcdir)/.gitignore gitignore-recurse
-
-maintainer-clean: gitignore-clean
-gitignore-clean:
- -rm -f $(srcdir)/.gitignore
-
-.PHONY: gitignore-clean gitignore gitignore-recurse gitignore-recurse-maybe
diff --git a/libcolord-gtk/Makefile.am b/libcolord-gtk/Makefile.am
deleted file mode 100644
index 59ba72a..0000000
--- a/libcolord-gtk/Makefile.am
+++ /dev/null
@@ -1,169 +0,0 @@
-if HAVE_INTROSPECTION
--include $(INTROSPECTION_MAKEFILE)
-INTROSPECTION_GIRS =
-INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) \
- --add-include-path=$(top_builddir)/libcolord-gtk
-INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir) \
- --includedir=$(top_srcdir)/libcolord-gtk \
- --includedir=$(top_builddir)/libcolord-gtk
-endif
-
-AM_CPPFLAGS = \
- $(GLIB_CFLAGS) \
- $(COLORD_CFLAGS) \
- -I$(top_srcdir) \
- -I$(top_srcdir)/libcolord-gtk \
- -DCD_COMPILATION \
- -DG_LOG_DOMAIN=\"libcolord-gtk\" \
- -DTESTDATADIR=\""$(top_srcdir)/data/tests"\" \
- -DPACKAGE_DATA_DIR=\""$(datadir)"\"
-
-lib_LTLIBRARIES = \
- libcolord-gtk.la
-
-libcolord_includedir = $(includedir)/colord-1
-libcolord_include_HEADERS = \
- colord-gtk.h
-
-libcolordgtkbase_includedir = $(libcolord_includedir)/colord-gtk
-libcolordgtkbase_include_HEADERS = \
- cd-version.h \
- cd-sample-widget.h \
- cd-sample-window.h \
- cd-window.h \
- cd-window-sync.h
-
-libcolord_gtk_la_SOURCES = \
- cd-sample-widget.c \
- cd-sample-window.c \
- cd-window.c \
- cd-window-sync.c
-
-libcolord_gtk_la_LIBADD = \
- $(COLORD_LIBS) \
- $(GTK3_LIBS) \
- $(GLIB_LIBS)
-
-libcolord_gtk_la_CPPFLAGS = \
- $(AM_CPPFLAGS) \
- $(GTK3_CFLAGS)
-
-libcolord_gtk_la_LDFLAGS = \
- -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
- -export-dynamic \
- -no-undefined \
- -export-symbols-regex '^cd_.*'
-
-libcolord_gtk_la_CFLAGS = \
- $(WARNINGFLAGS_C)
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = colord-gtk.pc
-
-if HAVE_GTK2
-pkgconfig_DATA += colord-gtk2.pc
-lib_LTLIBRARIES += \
- libcolord-gtk2.la
-
-libcolord_gtk2_la_SOURCES = \
- cd-window.c \
- cd-window-sync.c
-
-libcolord_gtk2_la_LIBADD = \
- $(COLORD_LIBS) \
- $(GTK2_LIBS) \
- $(GLIB_LIBS)
-
-libcolord_gtk2_la_CPPFLAGS = \
- $(AM_CPPFLAGS) \
- $(GTK2_CFLAGS)
-
-libcolord_gtk2_la_LDFLAGS = \
- -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
- -export-dynamic \
- -no-undefined \
- -export-symbols-regex '^cd_.*'
-
-libcolord_gtk2_la_CFLAGS = \
- $(WARNINGFLAGS_C)
-endif
-
-check_PROGRAMS = \
- cd-self-test
-
-cd_self_test_SOURCES = \
- cd-self-test.c
-
-cd_self_test_CPPFLAGS = \
- $(AM_CPPFLAGS) \
- $(GTK3_CFLAGS)
-
-cd_self_test_LDADD = \
- $(COLORD_LIBS) \
- $(GLIB_LIBS) \
- $(GTK3_LIBS) \
- libcolord-gtk.la
-
-cd_self_test_CFLAGS = $(WARNINGFLAGS_C)
-
-TESTS = cd-self-test
-
-EXTRA_DIST = \
- colord-gtk.pc.in \
- colord-gtk2.pc.in
-
-MAINTAINERCLEANFILES = \
- $(noinst_LIBRARIES)
-
-CLEANFILES = $(BUILT_SOURCES)
-
-if HAVE_INTROSPECTION
-introspection_sources = \
- $(libcolord_gtk_la_SOURCES) \
- $(libcolordgtkbase_include_HEADERS)
-
-ColordGtk-1.0.gir: libcolord-gtk.la
-ColordGtk_1_0_gir_INCLUDES = GObject-2.0 Gio-2.0 Gtk-3.0 Colord-1.0
-ColordGtk_1_0_gir_CFLAGS = $(AM_CPPFLAGS)
-ColordGtk_1_0_gir_SCANNERFLAGS = --identifier-prefix=Cd \
- --symbol-prefix=cd \
- --warn-all \
- --add-include-path=$(srcdir) \
- --add-include-path=$(top_srcdir)/libcolord \
- --c-include="colord-gtk.h"
-ColordGtk_1_0_gir_EXPORT_PACKAGES = colord-gtk
-ColordGtk_1_0_gir_LIBS = libcolord-gtk.la
-ColordGtk_1_0_gir_FILES = $(introspection_sources)
-INTROSPECTION_GIRS += ColordGtk-1.0.gir
-
-girdir = $(datadir)/gir-1.0
-gir_DATA = $(INTROSPECTION_GIRS)
-
-typelibdir = $(libdir)/girepository-1.0
-typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
-
-CLEANFILES += $(gir_DATA) $(typelib_DATA)
-
-if HAVE_VAPIGEN
-colord-gtk.vapi: ColordGtk-1.0.gir
- $(MAKE) $(AM_MAKEFLAGS) ColordGtk-1.0.gir
- $(AM_V_GEN)$(VAPIGEN) $(VAPIGENFLAGS) \
- --library colord-gtk \
- --vapidir $(top_builddir)/libcolord \
- --pkg gio-2.0 \
- --pkg gtk+-3.0 \
- --pkg colord \
- ColordGtk-1.0.gir
- touch $@
-vapidir = $(datadir)/vala/vapi
-dist_vapi_DATA = \
- colord-gtk.vapi
-CLEANFILES += $(dist_vapi_DATA)
-endif
-
-endif
-
-clean-local:
- rm -f *~
-
--include $(top_srcdir)/git.mk
diff --git a/libcolord-gtk/colord-gtk.pc.in b/libcolord-gtk/colord-gtk.pc.in
deleted file mode 100644
index 72e3eca..0000000
--- a/libcolord-gtk/colord-gtk.pc.in
+++ /dev/null
@@ -1,11 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: colord-gtk
-Description: colord-gtk is GTK integration for libcolord
-Version: @VERSION@
-Requires: colord, gtk+-3.0
-Libs: -L${libdir} -lcolord-gtk
-Cflags: -I${includedir}/colord-1
diff --git a/libcolord-gtk/colord-gtk2.pc.in b/libcolord-gtk/colord-gtk2.pc.in
deleted file mode 100644
index 9d0a0eb..0000000
--- a/libcolord-gtk/colord-gtk2.pc.in
+++ /dev/null
@@ -1,11 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: colord-gtk2
-Description: colord-gtk is GTK2 integration for libcolord
-Version: @VERSION@
-Requires: colord, gtk+-2.0
-Libs: -L${libdir} -lcolord-gtk2
-Cflags: -I${includedir}/colord-1
diff --git a/libcolord-gtk/meson.build b/libcolord-gtk/meson.build
new file mode 100644
index 0000000..c4fe704
--- /dev/null
+++ b/libcolord-gtk/meson.build
@@ -0,0 +1,166 @@
+cargs = [
+ '-DG_LOG_DOMAIN="libcolord-gtk"',
+]
+
+colord_gtk_version_h = configure_file(
+ input : 'cd-version.h.in',
+ output : 'cd-version.h',
+ configuration : conf,
+)
+
+install_headers(
+ 'colord-gtk.h',
+ subdir : 'colord-1',
+)
+
+colord_gtk_incdir = include_directories('.')
+
+install_headers([
+ 'cd-sample-widget.h',
+ 'cd-sample-window.h',
+ 'cd-window.h',
+ 'cd-window-sync.h',
+ colord_gtk_version_h,
+ ],
+ subdir : 'colord-1/colord-gtk',
+)
+
+colord_gtk = shared_library(
+ 'colord-gtk',
+ sources : [
+ 'cd-sample-widget.c',
+ 'cd-sample-window.c',
+ 'cd-window.c',
+ 'cd-window-sync.c',
+ ],
+ soversion : lt_current,
+ version : lt_version,
+ dependencies : [
+ glib,
+ gio,
+ gtk,
+ colord,
+ ],
+ c_args : [
+ cargs,
+ ],
+ include_directories : [
+ root_incdir,
+ ],
+ install : true
+)
+
+pkgg = import('pkgconfig')
+pkgg.generate(
+ libraries : colord_gtk,
+ requires : [ 'colord', 'gtk+-3.0' ],
+ subdirs : 'colord-1',
+ version : meson.project_version(),
+ name : 'colord-gtk',
+ filebase : 'colord-gtk',
+ description : 'colord-gtk is GTK integration for libcolord',
+)
+
+libcolord_gtk_gir = gnome.generate_gir(
+ colord_gtk,
+ sources : [
+ 'cd-sample-widget.c',
+ 'cd-sample-widget.h',
+ 'cd-sample-window.c',
+ 'cd-sample-window.h',
+ 'cd-window.c',
+ 'cd-window.h',
+ 'cd-window-sync.c',
+ 'cd-window-sync.h',
+ colord_gtk_version_h,
+ ],
+ nsversion : '1.0',
+ namespace : 'ColordGtk',
+ symbol_prefix : 'cd',
+ identifier_prefix : 'Cd',
+ export_packages : 'colord-gtk',
+ extra_args : [
+ '--c-include=colord-gtk.h',
+ '-DCD_COMPILATION',
+ ],
+ dependencies : [
+ glib,
+ gio,
+ gtk,
+ colord,
+ ],
+ includes : [
+ 'GObject-2.0',
+ 'Gio-2.0',
+ 'Gtk-3.0',
+ 'Colord-1.0',
+ ],
+ install : true
+)
+
+if get_option('vapi')
+ gnome.generate_vapi(
+ 'colord-gtk',
+ sources: libcolord_gtk_gir[0],
+ packages: [ 'glib-2.0', 'gio-2.0', 'gtk+-3.0', 'colord' ],
+ install: true,
+ )
+endif
+
+if get_option('gtk2')
+ colord_gtk2 = shared_library(
+ 'colord-gtk2',
+ sources : [
+ 'cd-window.c',
+ 'cd-window-sync.c',
+ ],
+ soversion : lt_current,
+ version : lt_version,
+ dependencies : [
+ glib,
+ gio,
+ gtk2,
+ colord,
+ ],
+ c_args : [
+ cargs,
+ ],
+ include_directories : [
+ root_incdir,
+ ],
+ install : true
+ )
+
+ pkgg.generate(
+ libraries : colord_gtk2,
+ requires : [ 'colord', 'gtk+-2.0' ],
+ subdirs : 'colord-1',
+ version : meson.project_version(),
+ name : 'colord-gtk2',
+ filebase : 'colord-gtk2',
+ description : 'colord-gtk is GTK2 integration for libcolord',
+ )
+endif
+
+if get_option('tests')
+ e = executable(
+ 'colord-gtk-test',
+ sources : [
+ 'cd-self-test.c',
+ ],
+ include_directories : [
+ root_incdir,
+ ],
+ dependencies : [
+ glib,
+ gio,
+ gtk,
+ colord,
+ ],
+ link_with : colord_gtk,
+ c_args : [
+ cargs,
+ ]
+ )
+test('colord-test-private', e)
+endif
diff --git a/m4/.gitignore b/m4/.gitignore
deleted file mode 100644
index 0f4126c..0000000
--- a/m4/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-*.m4
diff --git a/m4/as-linguas.m4 b/m4/as-linguas.m4
deleted file mode 100644
index 92b28f7..0000000
--- a/m4/as-linguas.m4
+++ /dev/null
@@ -1,24 +0,0 @@
-# Set ALL_ALL_LINGUAS based on the .po files present. Optional argument is the
-# name of the po directory. $podir/LINGUAS.ignore can be used to ignore a
-# subset of the po files.
-
-AC_DEFUN([AS_ALL_LINGUAS],
-[
- AC_MSG_CHECKING([for linguas])
- podir="m4_default([$1],[$srcdir/po])"
- linguas=`cd $podir && ls *.po 2>/dev/null | awk 'BEGIN { FS="."; ORS=" " } { print $[]1 }'`
- if test -f "$podir/LINGUAS.ignore"; then
- ALL_LINGUAS="";
- ignore_linguas=`sed -n -e 's/^\s\+\|\s\+$//g' -e '/^#/b' -e '/\S/!b' \
- -e 's/\s\+/\n/g' -e p "$podir/LINGUAS.ignore"`;
- for lang in $linguas; do
- if ! echo "$ignore_linguas" | grep -q "^${lang}$"; then
- ALL_LINGUAS="$ALL_LINGUAS $lang";
- fi;
- done;
- else
- ALL_LINGUAS="$linguas";
- fi;
- AC_SUBST([ALL_LINGUAS])
- AC_MSG_RESULT($ALL_LINGUAS)
-])
diff --git a/man/Makefile.am b/man/Makefile.am
deleted file mode 100644
index f3721d7..0000000
--- a/man/Makefile.am
+++ /dev/null
@@ -1,30 +0,0 @@
-man_MANS_DIST = \
- cd-convert.1
-
-EXTRA_DIST = \
- cd-convert.xml \
- $(man_MANS_DIST)
-
-if HAVE_DOCBOOK2MAN
-man_MANS = \
- $(man_MANS_DIST)
-endif
-
-if HAVE_DOCBOOK2MAN
-cd-convert.1: cd-convert.xml
- $(AM_V_GEN) \
- docbook2man $? > /dev/null
-endif
-
-MAINTAINERCLEANFILES = \
- manpage.links \
- manpage.log \
- manpage.refs \
- $(man_MANS)
-
-clean-local :
- rm -f *~
- rm -f *.1
- rm -f manpage.*
-
--include $(top_srcdir)/git.mk
diff --git a/man/meson.build b/man/meson.build
new file mode 100644
index 0000000..9dc54ce
--- /dev/null
+++ b/man/meson.build
@@ -0,0 +1,29 @@
+xsltproc = find_program('xsltproc')
+
+stylesheet_url = 'http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl'
+ret = run_command(xsltproc, '--nonet', stylesheet_url)
+if ret.returncode() != 0
+ error('Cannot build man pages without docbook-xsl-ns')
+endif
+
+xsltproc_args = [
+ xsltproc,
+ '--output', '@OUTPUT@',
+ '--nonet',
+ '--stringparam', 'man.authors.section.enabled', '0',
+ '--stringparam', 'man.copyright.section.enabled', '0',
+ '--stringparam', 'man.output.quietly', '1',
+ '--stringparam', 'man.th.extra1.suppress', '1',
+ '--stringparam', 'funcsynopsis.style', 'ansi',
+ stylesheet_url,
+ '@INPUT@',
+]
+
+custom_target(
+ 'cd-convert-man',
+ input : 'cd-convert.xml',
+ output : '@BASENAME@.1',
+ command : xsltproc_args,
+ install : true,
+ install_dir : join_paths(mandir, 'man1'),
+)
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..d467d8c
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,149 @@
+project('colord-gtk', 'c',
+ version : '0.1.27',
+ license : 'LGPL-2.1+',
+ meson_version : '>=0.46.0',
+ default_options : ['c_std=c99']
+)
+
+colord_gtk_version = meson.project_version()
+varr = colord_gtk_version.split('.')
+colord_gtk_major_version = varr[0]
+colord_gtk_minor_version = varr[1]
+colord_gtk_micro_version = varr[2]
+
+conf = configuration_data()
+conf.set('CD_GTK_MAJOR_VERSION', colord_gtk_major_version)
+conf.set('CD_GTK_MINOR_VERSION', colord_gtk_minor_version)
+conf.set('CD_GTK_MICRO_VERSION', colord_gtk_micro_version)
+conf.set_quoted('PACKAGE_VERSION', colord_gtk_version)
+
+# libtool versioning - this applies to libcolord
+#
+# See http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91 for details
+#
+# - If interfaces have been changed or added, but binary compatibility
+# has been preserved, change:
+# CURRENT += 1
+# REVISION = 0
+# AGE += 1
+# - If binary compatibility has been broken (eg removed or changed
+# interfaces), change:
+# CURRENT += 1
+# REVISION = 0
+# AGE = 0
+# - If the interface is the same as the previous version, but bugs are
+# fixed, change:
+# REVISION += 1
+lt_current = '1'
+lt_revision = '3'
+lt_age = '0'
+lt_version = '@0@.@1@.@2@'.format(lt_current, lt_age, lt_revision)
+
+# get supported warning flags
+test_args = [
+ '-fstack-protector-strong',
+ '-Waggregate-return',
+ '-Wunused',
+ '-Warray-bounds',
+ '-Wcast-align',
+ '-Wclobbered',
+ '-Wdeclaration-after-statement',
+ '-Wempty-body',
+ '-Wextra',
+ '-Wformat=2',
+ '-Wformat-nonliteral',
+ '-Wformat-security',
+ '-Wformat-signedness',
+ '-Wignored-qualifiers',
+ '-Wimplicit-function-declaration',
+ '-Winit-self',
+ '-Wmissing-declarations',
+ '-Wmissing-format-attribute',
+ '-Wmissing-include-dirs',
+ '-Wmissing-noreturn',
+ '-Wmissing-parameter-type',
+ '-Wmissing-prototypes',
+ '-Wnested-externs',
+ '-Wno-discarded-qualifiers',
+ '-Wno-missing-field-initializers',
+ '-Wno-strict-aliasing',
+ '-Wno-suggest-attribute=format',
+ '-Wno-unused-parameter',
+ '-Wold-style-definition',
+ '-Woverride-init',
+ '-Wpointer-arith',
+ '-Wreturn-type',
+ '-Wshadow',
+ '-Wsign-compare',
+ '-Wstrict-aliasing',
+ '-Wstrict-prototypes',
+ '-Wswitch-default',
+ '-Wtype-limits',
+ '-Wundef',
+ '-Wuninitialized',
+ '-Wunused-but-set-variable',
+ '-Wwrite-strings'
+]
+
+cc = meson.get_compiler('c')
+foreach arg: test_args
+ if cc.has_argument(arg)
+ add_project_arguments(arg, language : 'c')
+ endif
+endforeach
+
+glib = dependency('glib-2.0', version : '>= 2.28.0')
+gio = dependency('gio-2.0', version : '>= 2.25.9Z')
+gtk = dependency('gtk+-3.0')
+colord = dependency('colord', version : '>= 0.1.27')
+
+if get_option('gtk2')
+ gtk2 = dependency('gtk+-2.0')
+ conf.set('HAVE_GTK2', '1')
+endif
+
+gnome = import('gnome')
+i18n = import('i18n')
+
+add_project_arguments('-DCD_COMPILATION', language: 'c')
+
+prefix = get_option('prefix')
+
+bindir = join_paths(prefix, get_option('bindir'))
+libdir = join_paths(prefix, get_option('libdir'))
+datadir = join_paths(prefix, get_option('datadir'))
+libexecdir = join_paths(prefix, get_option('libexecdir'))
+localstatedir = join_paths(prefix, get_option('localstatedir'))
+sysconfdir = join_paths(prefix, get_option('sysconfdir'))
+mandir = join_paths(prefix, get_option('mandir'))
+includedir = join_paths(prefix, get_option('includedir'))
+
+conf.set_quoted('SYSCONFDIR', sysconfdir)
+conf.set_quoted('BINDIR', bindir)
+conf.set_quoted('LIBDIR', libdir)
+conf.set_quoted('DATADIR', datadir)
+conf.set_quoted('LIBEXECDIR', libexecdir)
+conf.set_quoted('LOCALSTATEDIR', localstatedir)
+
+conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
+conf.set_quoted('PACKAGE_NAME', meson.project_name())
+conf.set_quoted('VERSION', meson.project_version())
+conf.set_quoted('LOCALEDIR', get_option('localedir'))
+
+configure_file(
+ output : 'config.h',
+ configuration : conf
+)
+
+root_incdir = include_directories('.')
+
+subdir('libcolord-gtk')
+subdir('po')
+
+subdir('client')
+if get_option('docs')
+ subdir('doc')
+endif
+if get_option('man')
+ subdir('man')
+endif
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..1c3cecc
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,5 @@
+option('gtk2', type : 'boolean', value : false, description : 'Build Gtk2 library')
+option('vapi', type : 'boolean', value : false, description : 'Build vala bindings')
+option('tests', type : 'boolean', value : true, description : 'Build self tests')
+option('man', type : 'boolean', value : true, description : 'Generate man pages')
+option('docs', type : 'boolean', value : true, description : 'Generate documentation')
diff --git a/po/LINGUAS b/po/LINGUAS
new file mode 100644
index 0000000..daa2955
--- /dev/null
+++ b/po/LINGUAS
@@ -0,0 +1 @@
+en_GB
diff --git a/po/Makevars b/po/Makevars
deleted file mode 100644
index 6562f72..0000000
--- a/po/Makevars
+++ /dev/null
@@ -1,78 +0,0 @@
-# Makefile variables for PO directory in any package using GNU gettext.
-
-# Usually the message domain is the same as the package name.
-DOMAIN = $(PACKAGE)
-
-# These two variables depend on the location of this directory.
-subdir = po
-top_builddir = ..
-
-# These options get passed to xgettext.
-XGETTEXT_OPTIONS = --from-code=UTF-8 --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_:1c,2 --keyword=g_dngettext:2,3 --add-comments
-
-# This is the copyright holder that gets inserted into the header of the
-# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
-# package. (Note that the msgstr strings, extracted from the package's
-# sources, belong to the copyright holder of the package.) Translators are
-# expected to transfer the copyright for their translations to this person
-# or entity, or to disclaim their copyright. The empty string stands for
-# the public domain; in this case the translators are expected to disclaim
-# their copyright.
-COPYRIGHT_HOLDER = The colord-gtk authors
-
-# This tells whether or not to prepend "GNU " prefix to the package
-# name that gets inserted into the header of the $(DOMAIN).pot file.
-# Possible values are "yes", "no", or empty. If it is empty, try to
-# detect it automatically by scanning the files in $(top_srcdir) for
-# "GNU packagename" string.
-PACKAGE_GNU = no
-
-# This is the email address or URL to which the translators shall report
-# bugs in the untranslated strings:
-# - Strings which are not entire sentences, see the maintainer guidelines
-# in the GNU gettext documentation, section 'Preparing Strings'.
-# - Strings which use unclear terms or require additional context to be
-# understood.
-# - Strings which make invalid assumptions about notation of date, time or
-# money.
-# - Pluralisation problems.
-# - Incorrect English spelling.
-# - Incorrect formatting.
-# It can be your email address, or a mailing list address where translators
-# can write to without being subscribed, or the URL of a web page through
-# which the translators can contact you.
-MSGID_BUGS_ADDRESS = https://github.com/hughsie/colord-gtk/issues
-
-# This is the list of locale categories, beyond LC_MESSAGES, for which the
-# message catalogs shall be used. It is usually empty.
-EXTRA_LOCALE_CATEGORIES =
-
-# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt'
-# context. Possible values are "yes" and "no". Set this to yes if the
-# package uses functions taking also a message context, like pgettext(), or
-# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument.
-USE_MSGCTXT = yes
-
-# These options get passed to msgmerge.
-# Useful options are in particular:
-# --previous to keep previous msgids of translated messages,
-# --quiet to reduce the verbosity.
-MSGMERGE_OPTIONS =
-
-# These options get passed to msginit.
-# If you want to disable line wrapping when writing PO files, add
-# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and
-# MSGINIT_OPTIONS.
-MSGINIT_OPTIONS =
-
-# This tells whether or not to regenerate a PO file when $(DOMAIN).pot
-# has changed. Possible values are "yes" and "no". Set this to no if
-# the POT file is checked in the repository and the version control
-# program ignores timestamps.
-PO_DEPENDS_ON_POT = no
-
-# This tells whether or not to forcibly update $(DOMAIN).pot and
-# regenerate PO files on "make dist". Possible values are "yes" and
-# "no". Set this to no if the POT file and PO files are maintained
-# externally.
-DIST_DEPENDS_ON_UPDATE_PO = no
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 0000000..4a32105
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1,6 @@
+i18n.gettext(meson.project_name(),
+ preset : 'glib',
+ args: [
+ '--default-domain=' + meson.project_name(),
+ ],
+)