From: Sam Hartman Date: Sun, 2 Dec 2018 17:37:32 +0000 (-0500) Subject: Configure support for libsecret X-Git-Url: http://www.project-moonshot.org/gitweb/?p=moonshot-ui.git;a=commitdiff_plain;h=07819ac4d445f68161fb33b829405b9b200f1712 Configure support for libsecret Support building either against gnome keyring or libsecret. --- diff --git a/Makefile.am b/Makefile.am index 900c0ae..50f5245 100644 --- a/Makefile.am +++ b/Makefile.am @@ -58,6 +58,7 @@ src_moonshot_SOURCES = \ src/moonshot-local-flat-file-store.vala \ src/moonshot-keyring-store-base.vala \ src/moonshot-keyring-store-gnome.vala \ + src/moonshot-keyring-store-secret.vala \ src/moonshot-idcard-store.vala \ src/moonshot-id.vala \ src/moonshot-identity-dialog.vala \ @@ -122,10 +123,10 @@ endif if OS_LINUX -AM_CPPFLAGS += -I/usr/include/gnome-keyring-1 -AM_VALAFLAGS += --pkg moonshot-gnome-keyring --define=GNOME_KEYRING -src_moonshot_LDFLAGS += -lgnome-keyring -lcrypto -src_moonshot_webp_LDFLAGS += -lgnome-keyring -lcrypto +AM_CPPFLAGS += $(KEYRING_CFLAGS) +AM_VALAFLAGS += $(KEYRING_VALAFLAGS) +src_moonshot_LDADD += $(KEYRING_LIBS) -lcrypto +src_moonshot_webp_LDFLAGS += $(KEYRING_LIBS) -lcrypto ## Installing mime type data mimedir = $(datadir)/mime/packages diff --git a/configure.ac b/configure.ac index 11329d7..55cf276 100644 --- a/configure.ac +++ b/configure.ac @@ -12,6 +12,7 @@ AC_CONFIG_HEADERS([config.h]) AC_CONFIG_SRCDIR([configure.ac]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR([build-aux]) +AC_SUBST([KEYRING_VALAFLAGS],[]) AM_INIT_AUTOMAKE([1.11 -Wall foreign subdir-objects tar-pax no-dist-gzip dist-xz]) AM_SILENT_RULES([yes]) @@ -61,6 +62,17 @@ case "$host" in win32=no linux=yes + PKG_CHECK_MODULES([KEYRING], + [libsecret-1], + [KEYRING_VALAFLAGS=" --pkg libsecret-1 --define LIBSECRET_KEYRING"], + [ + PKG_CHECK_MODULES([KEYRING], [gnome-keyring-1], + [KEYRING_VALAFLAGS="--pkg moonshot-gnome-keyring --define GNOME_KEYRING"], + [AC_ERROR(["Neither gnome-keyring not libsecret is found]) + ]) + ]) + + # We require dbus-glib for the client library even if we are using GDBus # in the server. The reason we can't always use dbus-glib in the server is # because Vala drops support for it, but as it ships with DBus there is very