[gnome-software/wip/libappstream] Initial preparations for libappstream support



commit ae867c025f34ff705a4c8297ad92af6fd41ad450
Author: Matthias Klumpp <matthias tenstral net>
Date:   Fri May 2 03:07:15 2014 +0200

    Initial preparations for libappstream support

 configure.ac                         |    1 +
 src/plugins/Makefile.am              |   32 ++++++++++++++----------
 src/plugins/gs-plugin-libappstream.c |   44 ++++++++++++++++++++++++++++++++++
 3 files changed, 64 insertions(+), 13 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 4161442..b9e33c2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -62,6 +62,7 @@ dnl ---------------------------------------------------------------------------
 PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.11.5 gio-unix-2.0)
 PKG_CHECK_MODULES(PACKAGEKIT, packagekit-glib2 >= 0.8.12)
 PKG_CHECK_MODULES(APPSTREAM, appstream-glib >= 0.1.3)
+PKG_CHECK_MODULES(LIBAPPSTREAM, appstream >= 0.6.1)
 PKG_CHECK_MODULES(SQLITE, sqlite3)
 PKG_CHECK_MODULES(SOUP, libsoup-2.4)
 PKG_CHECK_MODULES(GSETTINGS_DESKTOP_SCHEMAS, gsettings-desktop-schemas >= 3.11.5)
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index 737cc60..d405251 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -2,7 +2,7 @@
 AUTOMAKE_OPTIONS = 1.7
 
 AM_CPPFLAGS =                                          \
-       $(APPSTREAM_CFLAGS)                             \
+       $(LIBAPPSTREAM_CFLAGS)                          \
        $(GLIB_CFLAGS)                                  \
        $(GTK_CFLAGS)                                   \
        $(SQLITE_CFLAGS)                                \
@@ -26,8 +26,7 @@ noinst_LTLIBRARIES =                                  \
 
 plugindir = $(libdir)/gs-plugins-${GS_PLUGIN_API_VERSION}
 plugin_LTLIBRARIES =                                   \
-       libgs_plugin_appdata.la                         \
-       libgs_plugin_appstream.la                       \
+       libgs_plugin_libappstream.la                    \
        libgs_plugin_datadir_apps.la                    \
        libgs_plugin_datadir_filename.la                \
        libgs_plugin_datadir_filename_local.la          \
@@ -75,17 +74,24 @@ libgs_plugin_self_test_la_LIBADD = $(GS_PLUGIN_LIBS)
 libgs_plugin_self_test_la_LDFLAGS = -module -avoid-version
 libgs_plugin_self_test_la_CFLAGS = $(GS_PLUGIN_CFLAGS) $(WARN_CFLAGS)
 
-libgs_plugin_appstream_la_SOURCES =                    \
-       gs-plugin-appstream.c
-libgs_plugin_appstream_la_LIBADD = $(GS_PLUGIN_LIBS) $(APPSTREAM_LIBS)
-libgs_plugin_appstream_la_LDFLAGS = -module -avoid-version
-libgs_plugin_appstream_la_CFLAGS = $(GS_PLUGIN_CFLAGS) $(WARN_CFLAGS)
-
-libgs_plugin_appdata_la_SOURCES =                      \
-       gs-plugin-appdata.c
-libgs_plugin_appdata_la_LIBADD = $(GS_PLUGIN_LIBS) $(APPSTREAM_LIBS)
-libgs_plugin_appdata_la_LDFLAGS = -module -avoid-version
-libgs_plugin_appdata_la_CFLAGS = $(GS_PLUGIN_CFLAGS) $(WARN_CFLAGS)
+# libappstream and libappstream-glib are conflicting, so we can't have both, unfortunately...
+#libgs_plugin_appstream_la_SOURCES =                   \
+#      gs-plugin-appstream.c
+#libgs_plugin_appstream_la_LIBADD = $(GS_PLUGIN_LIBS) $(APPSTREAM_LIBS)
+#libgs_plugin_appstream_la_LDFLAGS = -module -avoid-version
+#libgs_plugin_appstream_la_CFLAGS = $(GS_PLUGIN_CFLAGS) $(WARN_CFLAGS)
+
+libgs_plugin_libappstream_la_SOURCES =                 \
+       gs-plugin-libappstream.c
+libgs_plugin_libappstream_la_LIBADD = $(GS_PLUGIN_LIBS) $(LIBAPPSTREAM_LIBS)
+libgs_plugin_libappstream_la_LDFLAGS = -module -avoid-version
+libgs_plugin_libappstream_la_CFLAGS = $(GS_PLUGIN_CFLAGS) $(WARN_CFLAGS)
+
+#libgs_plugin_appdata_la_SOURCES =                     \
+#      gs-plugin-appdata.c
+#libgs_plugin_appdata_la_LIBADD = $(GS_PLUGIN_LIBS) $(APPSTREAM_LIBS)
+#libgs_plugin_appdata_la_LDFLAGS = -module -avoid-version
+#libgs_plugin_appdata_la_CFLAGS = $(GS_PLUGIN_CFLAGS) $(WARN_CFLAGS)
 
 libgs_plugin_moduleset_la_SOURCES =                    \
        gs-moduleset.c                                  \
diff --git a/src/plugins/gs-plugin-libappstream.c b/src/plugins/gs-plugin-libappstream.c
new file mode 100644
index 0000000..b7b0f6a
--- /dev/null
+++ b/src/plugins/gs-plugin-libappstream.c
@@ -0,0 +1,44 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2014 Matthias Klumpp <matthias tenstral net>
+ *
+ * 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.
+ *
+ * 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-1301 USA.
+ */
+
+#include <config.h>
+#include <glib/gi18n.h>
+#include <locale.h>
+#include <appstream.h>
+
+#include <gs-plugin.h>
+#include <gs-plugin-loader.h>
+
+#define        GS_PLUGIN_APPSTREAM_MAX_SCREENSHOTS     5
+
+struct GsPluginPrivate {
+       AsDatabase              *db;
+       gchar                   *locale;
+};
+
+/**
+ * gs_plugin_get_name:
+ */
+const gchar *
+gs_plugin_get_name (void)
+{
+       return "libappstream";
+}


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