Commit 5172fbcb authored by Corentin Noël's avatar Corentin Noël Committed by Alberto Mardegan

Switch to meson build system

parent f04b0aab
Pipeline #29430562 failed with stages
in 17 minutes and 57 seconds
image: ubuntu:xenial
image: ubuntu:bionic
cache:
key: apt-cache
......@@ -6,10 +6,10 @@ cache:
- apt-cache/
variables:
LIB_PKGS: "autotools-dev gtk-doc-tools libglib2.0-dev libtool python3"
GIT_PKGS: "gobject-introspection libgirepository1.0-dev python3-gi python-gi-dev"
LIB_PKGS: "meson gtk-doc-tools libglib2.0-dev python3"
GIT_PKGS: "gobject-introspection libgirepository1.0-dev python3-gi python-gi-dev valac"
COVERAGE_PKGS: "signon-plugin-ssotest check dbus-test-runner lcov gcovr"
DAEMON_PKGS: "qt5-qmake qtbase5-dev qtchooser pkg-config libqt5sql5-sqlite doxygen libdbus-1-dev"
DAEMON_PKGS: "qt5-qmake qtbase5-dev qtchooser pkg-config libqt5sql5-sqlite doxygen libdbus-1-dev curl"
CI_TOOLS_PKGS: "unzip git"
GIT_SUBMODULE_STRATEGY: recursive
......@@ -31,10 +31,8 @@ build_amd64:
stage: build
script:
- export PYTHON=python3
- mkdir build
- cd build
- ../autogen.sh --enable-gtk-doc --enable-gcov --enable-debug --enable-python --prefix=/usr
- make -j 4
- meson build -Ddebug=true -Ddocumentation=true -Db_coverage=true
- ninja -C build
artifacts:
paths:
- ./
......@@ -42,9 +40,8 @@ build_amd64:
test_amd64:
stage: test
script:
- cd build
- make check || (cat tests/test-suite.log && /bin/false)
- make coverage-html
- ninja -C build test || (cat tests/test-suite.log && /bin/false)
- ninja -C build coverage-html
dependencies:
- build_amd64
artifacts:
......@@ -55,7 +52,7 @@ pages:
stage: deploy
script:
- mkdir public
- cp -a build/coveragereport public/coverage
- cp -a build/meson-logs/coveragereport public/coverage
- cp -a build/docs/reference/html/* public/
dependencies:
- test_amd64
......
Get the changelog by running git-log.
ACLOCAL_AMFLAGS = -I m4
DISTCHECK_CONFIGURE_FLAGS = \
--enable-gtk-doc \
--enable-introspection=yes
SUBDIRS = libsignon-glib docs
if ENABLE_PYTHON
SUBDIRS += pygobject
endif
if ENABLE_TESTS
SUBDIRS += tests
endif
include $(top_srcdir)/Makefile.am.coverage
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_in_files = libsignon-glib.pc.in
pkgconfig_DATA = $(pkgconfig_in_files:.pc.in=.pc)
dist_noinst_DATA = \
$(libsignondoc_DATA) \
m4/introspection.m4
dist-hook: git-changelog-hook
git-changelog-hook: Makefile
$(AM_V_at)if $(top_srcdir)/build-aux/missing --run git \
--git-dir=$(top_srcdir)/.git --work-tree=$(top_srcdir) log \
--no-merges --date=short --pretty='tformat:%cd %an <%ae>%n%n%s%n%n%b' | \
$(SED) -e '/[^ ]/,/^[ ]*$$/ !d' > .ChangeLog.tmp; \
then mv -f .ChangeLog.tmp "$(top_distdir)/ChangeLog"; \
else rm -f .ChangeLog.tmp; exit 1; fi
DISTCLEANFILES = \
$(pkgconfig_DATA)
.PHONY: git-changelog-hook
# Coverage targets
.PHONY: clean-gcda
clean-gcda:
@echo Removing old coverage results
-$(AM_V_at)find -name '*.gcda' -print | xargs -r rm
.PHONY: coverage-html generate-coverage-html clean-coverage-html
coverage-html: clean-gcda
-$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) generate-coverage-html
if HAVE_GCOV
generate-coverage-html:
@echo Collecting coverage data
$(AM_V_at)$(LCOV) --directory $(top_builddir) --capture --output-file coverage.info --no-checksum --compat-libtool
$(AM_V_at)$(LCOV) --remove coverage.info signon-enum-types.c signon-errors-enum.c signon-marshal.c "sso-*-gen.*" -o coverage.info # autogenerated files
$(AM_V_at)LANG=C $(GENHTML) --prefix $(top_builddir) --output-directory coveragereport --title "Code Coverage" --legend --show-details coverage.info
clean-coverage-html: clean-gcda
-$(AM_V_at)$(LCOV) --directory $(top_builddir) -z
-$(AM_V_at)rm -rf coverage.info coveragereport
clean-local: clean-coverage-html
else
generate-coverage-html:
$(AM_V_at)echo "Code coverage reporting not available"
clean-coverage-html: clean-gcda
-$(AM_V_at)rm -rf coverage.info coveragereport
clean-local: clean-coverage-html
endif # HAVE_GCOV
#!/bin/sh -e
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
(test -f $srcdir/libsignon-glib.pc.in ) || {
echo -n "Error: Directory "\`$srcdir\`" does not look like the "
echo "top-level libsignon-glib directory."
exit 1
}
cd "$srcdir"
gtkdocize --copy --flavour no-tmpl
cd "$OLDPWD"
autoreconf --install --force --verbose --warnings=all "$srcdir"
test -n "$NOCONFIGURE" || "$srcdir/configure" "$@"
import sys
import re
header = '''// File generated automatically -- DO NOT EDIT
#include <gio/gio.h>
#include "signon-errors.h"
#include "signon-internals.h"
static const GDBusErrorEntry signon_error_entries[] = {
'''
footer = '''
};
'''
f = open(sys.argv[2], 'w')
f.write(header)
regex = re.compile(r'SIGNON_ERROR_([A-Z_0-9]*).*', re.IGNORECASE)
for line in open(sys.argv[1], 'r'):
if re.search(r'^ *SIGNON_ERROR_*', line):
f.write(regex.sub(r'{ SIGNON_ERROR_\1, SIGNOND_\1_ERR_NAME },', line))
f.write(footer)
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ([2.64])
AC_INIT([libsignon-glib],
[1.15],
[https://gitlab.com/accounts-sso/libsignon-glib/issues],
[libsignon-glib],
[https://gitlab.com/accounts-sso/libsignon-glib])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([libsignon-glib.pc.in])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([1.11 -Wall check-news nostdinc silent-rules subdir-objects foreign -Wno-portability])
AC_PROG_CC
AC_PROG_CC_STDC
AM_PROG_CC_C_O
LT_PREREQ([2.2])
LT_INIT([disable-static])
# Gobject Introspection
GOBJECT_INTROSPECTION_CHECK([1.30.0])
VAPIGEN_CHECK()
PKG_CHECK_MODULES(
[DEPS],
[gio-2.0 >= 2.36
gio-unix-2.0
glib-2.0 >= 2.32
gobject-2.0 >= 2.35.1])
AC_SUBST(DEPS_CFLAGS)
AC_SUBST(DEPS_LIBS)
# Build tests.
CHECK_REQUIRED="check >= 0.9.4"
AC_ARG_ENABLE([tests],
[AS_HELP_STRING([--disable-tests], [build with testing support disabled])])
AS_IF([test "x$enable_tests" != "xno"],
[PKG_CHECK_EXISTS([$CHECK_REQUIRED], [have_check=yes], [have_check=no])],
[have_check=no])
AS_IF([test "x$have_check" = "xyes"],
[PKG_CHECK_MODULES([CHECK], [$CHECK_REQUIRED])
AC_SUBST([CHECK_CFLAGS])
AC_SUBST([CHECK_LIBS])],
[AS_IF([test "x$enable_tests" = "xyes"],
[AC_MSG_ERROR([tests enabled but required dependencies were not found])])])
# gcov coverage reporting
m4_include([m4/gcov.m4])
AC_TDD_GCOV
AC_SUBST(COVERAGE_CFLAGS)
AC_SUBST(COVERAGE_CXXFLAGS)
AC_SUBST(COVERAGE_LDFLAGS)
AM_CONDITIONAL([ENABLE_TESTS], [test "x$have_check" = "xyes"])
GTK_DOC_CHECK([1.14], [--flavour no-tmpl])
AC_ARG_ENABLE([cast-checks],
[AS_HELP_STRING([--disable-cast-checks], [compile with GLib cast checks disabled])],
[], [enable_cast_checks=yes])
AS_IF([test "x$enable_cast_checks" = "xno"],
[CFLAGS="$CFLAGS -DG_DISABLE_CAST_CHECKS"])
AC_ARG_ENABLE([asserts],
[AS_HELP_STRING([--disable-asserts], [compile with GLib assertions disabled])],
[], [enable_asserts=yes])
AS_IF([test "x$enable_asserts" = "xno"],
[CFLAGS="$CFLAGS -DG_DISABLE_ASSERTS"])
AC_ARG_ENABLE([checks],
[AS_HELP_STRING([--disable-checks], [compile with GLib checks disabled])],
[], [enable_checks=yes])
AS_IF([test "x$checks" = "xno"],
[CFLAGS="$CFLAGS -DG_DISABLE_CHECKS"])
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug], [enable printing of debug messages])])
AS_IF([test "x$enable_debug" = "xyes"],
[CFLAGS="$CFLAGS -DENABLE_DEBUG"])
# Python support.
PYGOBJECT_REQUIRED=2.90
AC_ARG_ENABLE([python],
[AS_HELP_STRING([--enable-python], [Build with python support])])
AS_IF([test "x$enable_python" != "xno"],
[PKG_CHECK_EXISTS([pygobject-3.0 >= $PYGOBJECT_REQUIRED],
[have_python=yes], [have_python=no])])
AS_IF([test "x$have_python" = "xyes"],
[AM_PATH_PYTHON
AC_SUBST([pyoverridesdir], [`$PYTHON -c "import gi;print (gi._overridesdir)" 2>/dev/null`])])
AM_CONDITIONAL([ENABLE_PYTHON], [test "x$have_python" = "xyes"])
AC_CONFIG_FILES([
Makefile
libsignon-glib/Makefile
libsignon-glib.pc
docs/Makefile
docs/reference/Makefile
docs/reference/version.xml
tests/Makefile
pygobject/Makefile
])
AC_OUTPUT
SUBDIRS = reference
subdir('reference')
## Process this file with automake to produce Makefile.in
# We require automake 1.6 at least.
AUTOMAKE_OPTIONS = 1.6
# This is a blank Makefile.am for using gtk-doc.
# Copy this to your project's API docs directory and modify the variables to
# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples
# of using the various options.
# The name of the module, e.g. 'glib'.
DOC_MODULE=libsignon-glib
# The top-level SGML file. You can change this if you want to.
DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml
# The directory containing the source code. Relative to $(srcdir).
# gtk-doc will search all .c & .h files beneath here for inline comments
# documenting the functions and macros.
# e.g. DOC_SOURCE_DIR=../../../gtk
DOC_SOURCE_DIR=$(top_srcdir)/libsignon-glib
# Extra options to pass to gtkdoc-scangobj. Not normally needed.
SCANGOBJ_OPTIONS=
# Extra options to supply to gtkdoc-scan.
# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED"
SCAN_OPTIONS=--rebuild-types --deprecated-guards="SIGNON_DISABLE_DEPRECATED"
# Extra options to supply to gtkdoc-mkdb.
# e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml
MKDB_OPTIONS=--source-dir=$(top_srcdir)/libsignon-glib --sgml-mode --output-format=xml --name-space=signon
# Extra options to supply to gtkdoc-fixref. Not normally needed.
# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html
FIXXREF_OPTIONS=
# Used for dependencies. The docs will be rebuilt if any of these change.
# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h
# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c
HFILE_GLOB=$(top_srcdir)/libsignon-glib/signon-*.h
CFILE_GLOB=$(top_srcdir)/libsignon-glib/signon-*.c
# Header files to ignore when scanning.
# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h
IGNORE_HFILES= \
signon-auth-session-client-glib-gen.h \
signon-client-glib-gen.h \
signon-identity-glib-gen.h \
signon-internals.h \
signon-proxy.h \
signon-utils.h \
signon-marshal.h \
sso-auth-service-gen.h \
sso-auth-service.h \
sso-auth-session-gen.h \
sso-identity-gen.h
# Images to copy into HTML directory.
# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png
HTML_IMAGES=
# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE).
# e.g. content_files=running.sgml building.sgml changes-2.0.sgml
content_files=
# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library.
# Only needed if you are using gtkdoc-scangobj to dynamically query widget
# signals and properties.
# e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS)
# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
AM_CPPFLAGS=$(DEPS_CFLAGS)
GTKDOC_LIBS=$(top_builddir)/libsignon-glib/libsignon-glib.la $(DEPS_LIBS)
# This includes the standard gtk-doc make rules, copied by gtkdocize.
include $(top_srcdir)/gtk-doc.make
# Other files to distribute
# e.g. EXTRA_DIST += version.xml.in
#EXTRA_DIST +=
#if ENABLE_GTK_DOC
#TESTS = $(GTKDOC_CHECK)
#endif
version_data = configuration_data()
version_data.set('PACKAGE_VERSION', meson.project_version())
configure_file(
input: 'version.xml.in',
output: '@BASENAME@',
configuration: version_data,
)
glib_prefix = glib_dep.get_pkgconfig_variable('prefix')
glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html')
#FIXME: requires Meson 0.46
doc_content_files = []
if (meson.version().version_compare('>=0.46'))
doc_content_files += dbus_auth_service_gen[2]
doc_content_files += dbus_auth_session_gen[2]
doc_content_files += dbus_identity_gen[2]
endif
gnome.gtkdoc(
meson.project_name(),
main_xml: meson.project_name() + '-docs.xml',
src_dir: libsignon_glib_dir,
dependencies: libsignon_glib_dep,
ignore_headers: [
'signon-auth-session-client-glib-gen.h',
'signon-client-glib-gen.h',
'signon-identity-glib-gen.h',
'signon-internals.h',
'signon-proxy.h',
'signon-utils.h',
'signon-marshal.h',
'sso-auth-service-gen.h',
'sso-auth-service.h',
'sso-auth-session-gen.h',
'sso-identity-gen.h',
],
scan_args: [
'--rebuild-types',
'--deprecated-guards="SIGNON_DISABLE_DEPRECATED"',
],
mkdb_args: [
'--name-space=signon',
],
gobject_typesfile: [
'libsignon-glib.types',
],
content_files: doc_content_files,
fixxref_args: [
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
],
install: true,
)
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: libsignon-glib
Description: A low-level library for managing account credentials.
Version: @VERSION@
Requires: glib-2.0 gobject-2.0 gio-unix-2.0
Libs: -L${libdir} -lsignon-glib
Cflags: -I${includedir}
lib_LTLIBRARIES = \
libsignon-glib.la
libsignon_glib_la_CPPFLAGS = \
-I$(top_srcdir) \
-I$(srcdir) \
-I$(top_builddir) \
-I$(builddir)
libsignon_glib_la_CFLAGS = \
$(DEPS_CFLAGS) \
$(COVERAGE_CFLAGS) \
-Wall -Werror -Wno-error=deprecated-declarations
libsignon_glib_la_LIBADD = $(DEPS_LIBS)
libsignon_glib_la_LDFLAGS = \
$(COVERAGE_LDFLAGS) \
-version-info 1:0:0 \
-export-symbols-regex '^signon_'
nodist_libsignon_glib_la_SOURCES = \
signon-marshal.c \
signon-marshal.h \
signon-enum-types.h \
signon-enum-types.c \
signon-errors-enum.c \
sso-auth-service-gen.c \
sso-auth-service-gen.h \
sso-auth-session-gen.c \
sso-auth-session-gen.h \
sso-identity-gen.c \
sso-identity-gen.h \
stamp-signon-enum-types.h
BUILT_SOURCES = \
$(nodist_libsignon_glib_la_SOURCES) \
signon-errors-map.c
CLEANFILES = \
$(BUILT_SOURCES) \
sso-auth-service-gen-doc-com.google.code.AccountsSSO.SingleSignOn.AuthService.xml \
sso-auth-session-gen-doc-com.google.code.AccountsSSO.SingleSignOn.AuthSession.xml \
sso-identity-gen-doc-com.google.code.AccountsSSO.SingleSignOn.Identity.xml
libsignon_glib_la_SOURCES = \
signon-auth-service.h \
signon-identity-info.h \
signon-identity.h \
signon-auth-session.h \
signon-internals.h \
signon-auth-service.c \
signon-identity-info.c \
signon-identity.c \
signon-auth-session.c \
signon-errors.h \
signon-errors.c \
signon-proxy.c \
signon-proxy.h \
signon-utils.h \
signon-utils.c \
signon-types.h \
sso-auth-service.c \
sso-auth-service.h
libsignon_glib_includedir = $(includedir)/libsignon-glib
libsignon_glib_include_HEADERS = \
signon-auth-service.h \
signon-auth-session.h \
signon-identity-info.h \
signon-identity.h \
signon-errors.h \
signon-enum-types.h \
signon-glib.h \
signon-types.h \
$(signon_headers)
# Headers with enums to be parsed with glib-mkenums;
# signon-errors.h is handled separately
libsignon_glib_headers_with_enums = \
signon-auth-session.h \
signon-identity-info.h
DBUS_INTERFACES_DIR = interfaces
sso-auth-service-gen.h sso-auth-service-gen.c: $(DBUS_INTERFACES_DIR)/com.google.code.AccountsSSO.SingleSignOn.AuthService.xml
$(AM_V_GEN)gdbus-codegen \
--generate-c-code sso-auth-service-gen \
--generate-docbook sso-auth-service-gen-doc \
--annotate "com.google.code.AccountsSSO.SingleSignOn.AuthService" org.gtk.GDBus.C.Name SsoAuthService \
$<
sso-auth-session-gen.h sso-auth-session-gen.c: $(DBUS_INTERFACES_DIR)/com.google.code.AccountsSSO.SingleSignOn.AuthSession.xml
$(AM_V_GEN)gdbus-codegen \
--generate-c-code sso-auth-session-gen \
--generate-docbook sso-auth-session-gen-doc \
--annotate "com.google.code.AccountsSSO.SingleSignOn.AuthSession" org.gtk.GDBus.C.Name SsoAuthSession \
$<
sso-identity-gen.h sso-identity-gen.c: $(DBUS_INTERFACES_DIR)/com.google.code.AccountsSSO.SingleSignOn.Identity.xml
$(AM_V_GEN)gdbus-codegen \
--generate-c-code sso-identity-gen \
--generate-docbook sso-identity-gen-doc \
--annotate "com.google.code.AccountsSSO.SingleSignOn.Identity" org.gtk.GDBus.C.Name SsoIdentity \
$<
signon-marshal.h: signon-marshal.list Makefile
$(AM_V_GEN)glib-genmarshal --header --prefix=_signon_marshal $< > $@
signon-marshal.c: signon-marshal.list Makefile
$(AM_V_GEN)glib-genmarshal --body --prefix=_signon_marshal $< > $@
signon-enum-types.h: stamp-signon-enum-types.h
$(AM_V_at)true
stamp-signon-enum-types.h: Makefile \
$(libsignon_glib_headers_with_enums) signon-errors.h
$(AM_V_GEN)( cd $(srcdir) && glib-mkenums \
--fhead "#ifndef __SIGNON_ENUM_TYPES_H__\n#define __SIGNON_ENUM_TYPES_H__\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
--fprod "/* enumerations from \"@filename@\" */\n" \
--vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define SIGNON_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
--ftail "G_END_DECLS\n\n#endif /* __SIGNON_ENUM_TYPES_H__ */" \
$(libsignon_glib_headers_with_enums) signon-errors.h ) >> xgen-geth \
&& (cmp -s xgen-geth signon-enum-types.h || cp xgen-geth signon-enum-types.h ) \
&& rm -f xgen-geth \
&& echo timestamp > $(@F)
signon-enum-types.c: Makefile $(libsignon_glib_headers_with_enums)
$(AM_V_GEN)( cd $(srcdir) && glib-mkenums \
--fhead "#include \"signon-enum-types.h\"\n" \
--fhead "#include \"signon-identity-info.h\"\n" \
--fhead "#include \"signon-auth-session.h\"\n" \
--fhead "#define g_intern_static_string(s) (s)\n" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--ftail "\n#define __SIGNON_ENUM_TYPES_C__\n" \
--vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (g_intern_static_string (\"@EnumName@\"), values);\n }\n return etype;\n}\n" \
$(libsignon_glib_headers_with_enums) ) > xgen-getc \
&& cp xgen-getc signon-enum-types.c \
&& rm -f xgen-getc
signon-errors-enum.c: Makefile signon-errors.h
$(AM_V_GEN)( cd $(srcdir) && glib-mkenums \
--fhead "#include \"signon-enum-types.h\"\n#include \"signon-errors.h\"\n#include \"signon-internals.h\"\n#define g_intern_static_string(s) (s)\n" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--ftail "\n#define __SIGNON_ENUM_TYPES_C__\n" \
--vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \
--vprod " { @VALUENAME@, SED@VALUENAME@, \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (g_intern_static_string (\"@EnumName@\"), values);\n }\n return etype;\n}\n" \
signon-errors.h ) | \
$(SED) -e 's/SEDSIGNON_ERROR_\([^,]*\)/SIGNOND_\1_ERR_NAME/' \
> xgen-getc-enum \
&& cp xgen-getc-enum signon-errors-enum.c \
&& rm -f xgen-getc-enum
signon-errors-map.c: Makefile signon-errors.h
$(AM_V_GEN)( cd $(srcdir) && \
echo "static const GDBusErrorEntry signon_error_entries[] = {" && \
grep "^ *SIGNON_ERROR_" signon-errors.h | \
$(SED) -e 's/SIGNON_ERROR_\([A-Z_0-9]*\).*/{ SIGNON_ERROR_\1, SIGNOND_\1_ERR_NAME },/' && \
echo -e "};\n" ) > signon-errors-map.c
dist_noinst_DATA = \
signon-marshal.list \
stamp-signon-enum-types.h
-include $(INTROSPECTION_MAKEFILE)
INTROSPECTION_GIRS =
INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir)
INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
if HAVE_INTROSPECTION
introspection_sources = \
signon-auth-service.c \
signon-auth-service.h \
signon-auth-session.c \
signon-auth-session.h \
signon-enum-types.h \
signon-enum-types.c \
signon-errors.c \
signon-errors.h \
signon-identity-info.c \
signon-identity-info.h \
signon-identity.c \
signon-identity.h
Signon-1.0.gir: libsignon-glib.la
Signon_1_0_gir_INCLUDES = GObject-2.0 Gio-2.0
Signon_1_0_gir_SCANNERFLAGS = \
--identifier-prefix=Signon \
--symbol-prefix=signon \
--c-include="libsignon-glib/signon-glib.h" \
--warn-all
Signon_1_0_gir_CFLAGS = \
-I$(top_srcdir) \
-I$(top_builddir) \
$(DEPS_CFLAGS)
Signon_1_0_gir_LIBS = libsignon-glib.la
Signon_1_0_gir_FILES = $(introspection_sources)
INTROSPECTION_GIRS += Signon-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)
endif
# Vala bindings
if ENABLE_VAPIGEN
-include $(VAPIGEN_MAKEFILE)
libsignon-glib.vapi: Signon-1.0.gir Signon-1.0.metadata
VAPIGEN_VAPIS = libsignon-glib.vapi
libsignon_glib_vapi_DEPS = gio-2.0
libsignon_glib_vapi_METADATADIRS = $(srcdir)
libsignon_glib_vapi_FILES = Signon-1.0.gir Signon-1.0.metadata
vapidir = $(datadir)/vala/vapi
vapi_DATA = $(VAPIGEN_VAPIS)
endif
# Makefile for Vala API Generator (vapigen)
# Written by Evan Nemerson
#
# The author disclaims copyright to this source code. In place of
# a legal notice, here is a blessing:
#
# May you do good and not evil.
# May you find forgiveness for yourself and forgive others.
# May you share freely, never taking more than you give.
#
# See http://live.gnome.org/Vala/UpstreamGuide for detailed documentation
#
# Variables:
#
# VAPIGEN_FILES
#
# VAPIs to create
#
# *_DEPS / VAPIGEN_DEPS
#
# The dependencies. Generally the pkg-config names.
#
# *_METADATADIRS / VAPIGEN_METADATADIRS
#
# Directory containing the metadata.
#
# *_VAPIDIRS / VAPIGEN_VAPIDIRS
#
# Additional location(s) to search for VAPI dependencies.
#
# *_GIRDIRS / VAPIGEN_GIRDIRS
#
# Additional location(s) to search for GIR dependencies.
#
# *_FILES
#
# The files which should be used to generate the VAPI.
_vapigen_silent_prefix = $(_vapigen_silent_prefix_$(V))
_vapigen_silent_prefix_ = $(_vapigen_silent_prefix_$(AM_DEFAULT_VERBOSITY))
_vapigen_silent_prefix_0 = @echo " VAPIGEN $(1)";
_vapigen_silent_opts = $(_vapigen_silent_opts_$(V))
_vapigen_silent_opts_ = $(_vapigen_silent_opts_$(AM_DEFAULT_VERBOSITY))
_vapigen_silent_opts_0 = --quiet
$(if $(VAPIGEN),,$(error You must define VAPIGEN))
_vapi_name = $(subst /,_,$(subst -,_,$(subst .,_,$(1))))
define vapigen
$(1): $$($(_vapi_name)_GIR)
$(_vapigen_silent_prefix) $(VAPIGEN) $(_vapigen_silent_opts) \
--library $(1:.vapi=) \
$(foreach _vapi_metadatadir_name,$(if $($(_vapi_name)_METADATADIRS),$($(_vapi_name)_METADATADIRS),$(VAPIGEN_METADATADIRS)),--metadatadir $(_vapi_metadatadir_name)) \
$(foreach _vapi_dir_name,$(if $($(_vapi_name)_VAPIDIRS),$($(_vapi_name)_VAPIDIRS),$(VAPIGEN_VAPIDIRS)),--vapidir $(_vapi_dir_name)) \
$(foreach _gir_dir_name,$(if $($(_vapi_name)_GIRDIRS),$($(_vapi_name)_GIRDIRS),$(VAPIGEN_GIRDIRS)),--girdir $(_gir_dir_name)) \
$(foreach _vapi_dep_name,$(if $($(_vapi_name)_DEPS),$($(_vapi_name)_DEPS),$(VAPIGEN_DEPS)),--pkg $(_vapi_dep_name)) \
$$($(_vapi_name)_FILES)
endef
$(foreach vapi,$(VAPIGEN_VAPIS),$(eval $(call vapigen,$(vapi))))
libsignon_glib_public_headers = files(
'signon-auth-service.h',
'signon-auth-session.h',
'signon-errors.h',
'signon-identity.h',
'signon-identity-info.h',
'signon-glib.h',
'signon-types.h',
)