--- /dev/null
+From 4982923fdc7be9978d3b089fb443bcb0e20243eb Mon Sep 17 00:00:00 2001
+From: Alberto Mardegan <alberto.mardegan@canonical.com>
+Date: Tue, 21 Jun 2016 13:35:03 +0300
+Subject: [PATCH] Build: fix value of default options in configure.ac
+
+GLib assertions where always disabled, even if the --disable-*
+parameters where not passed to configure.ac.
+
+Quick reference:
+http://www.robster.org.uk/2011/02/07/autofoo-ac_arg_enable/
+---
+ configure.ac | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 364f9f2..3cde223 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -63,17 +63,20 @@ 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])])
++ [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])])
++ [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])])
++ [AS_HELP_STRING([--disable-checks], [compile with GLib checks disabled])],
++ [], [enable_checks=yes])
+ AS_IF([test "x$checks" = "xno"],
+ [CFLAGS="$CFLAGS -DG_DISABLE_CHECKS"])
+
+--
+libgit2 0.26.0
+
--- /dev/null
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python{2_7,3_4,3_5} )
+inherit autotools python-r1 vcs-snapshot xdg-utils
+
+DESCRIPTION="GLib binding for the D-Bus API provided by signond"
+HOMEPAGE="https://01.org/gsso/"
+SRC_URI="https://gitlab.com/accounts-sso/libsignon-glib/repository/archive.tar.gz?ref=VERSION_${PV} -> ${P}.tar.gz"
+
+SLOT="0"
+LICENSE="LGPL-2.1"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc +introspection python test"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} introspection )"
+
+RDEPEND="
+ dev-libs/glib:2
+ net-libs/signond
+ introspection? ( dev-libs/gobject-introspection:= )
+ python? (
+ ${PYTHON_DEPS}
+ dev-python/pygobject:3[${PYTHON_USEDEP}]
+ )
+"
+DEPEND="${RDEPEND}
+ dev-util/gdbus-codegen
+ doc? ( dev-util/gtk-doc )
+"
+
+DOCS=( AUTHORS NEWS README.md )
+
+# needs more love
+RESTRICT="test"
+
+PATCHES=( "${FILESDIR}/${P}-default-opts.patch" )
+
+src_prepare() {
+ default
+
+ if ! use doc; then
+ eapply "${FILESDIR}/${PN}-1.12-doc-disable.patch"
+ fi
+
+ eautoreconf
+}
+
+src_configure() {
+ xdg_environment_reset
+
+ myconfigure() {
+ local myeconfargs=(
+ $(use_enable debug)
+ $(use_enable doc gtk-doc)
+ $(use_enable introspection)
+ $(use_enable python)
+ $(use_enable test tests)
+ )
+
+ econf "${myeconfargs[@]}"
+ }
+
+ if use python; then
+ python_copy_sources
+ python_foreach_impl run_in_build_dir myconfigure
+ else
+ myconfigure
+ fi
+}
+
+src_compile() {
+ # fails to compile with more than one thread
+ MAKEOPTS="${MAKEOPTS} -j1"
+ default
+ if use python; then
+ python_foreach_impl run_in_build_dir default
+ fi
+}
+
+src_install() {
+ default
+ if use python; then
+ python_foreach_impl run_in_build_dir default
+ fi
+ find "${D}" -name '*.la' -delete || die
+}