[gnome-software] Split out a private library for internal use only



commit 81e458b42c5c95810654af625c7f55140c1259ac
Author: Richard Hughes <richard hughsie com>
Date:   Tue Mar 7 09:58:58 2017 +0000

    Split out a private library for internal use only
    
    62 source files in one directory is way too much to understand.

 Makefile.am                          |    1 +
 configure.ac                         |   21 ++++-
 doc/api/Makefile.am                  |   28 +++---
 lib/Makefile.am                      |   96 +++++++++++++++++++
 lib/README.md                        |    7 ++
 {src => lib}/gnome-software.h        |    0
 {src => lib}/gnome-software.pc.in    |    0
 {src => lib}/gs-app-list-private.h   |    0
 {src => lib}/gs-app-list.c           |    0
 {src => lib}/gs-app-list.h           |    0
 {src => lib}/gs-app-private.h        |    0
 {src => lib}/gs-app.c                |    0
 {src => lib}/gs-app.h                |    0
 {src => lib}/gs-auth.c               |    0
 {src => lib}/gs-auth.h               |    0
 {src => lib}/gs-category-private.h   |    0
 {src => lib}/gs-category.c           |    0
 {src => lib}/gs-category.h           |    0
 {src => lib}/gs-cmd.c                |    0
 {src => lib}/gs-debug.c              |    0
 {src => lib}/gs-debug.h              |    0
 {src => lib}/gs-os-release.c         |    0
 {src => lib}/gs-os-release.h         |    0
 {src => lib}/gs-plugin-event.c       |    0
 {src => lib}/gs-plugin-event.h       |    0
 {src => lib}/gs-plugin-loader-sync.c |    0
 {src => lib}/gs-plugin-loader-sync.h |    0
 {src => lib}/gs-plugin-loader.c      |    1 -
 {src => lib}/gs-plugin-loader.h      |    0
 {src => lib}/gs-plugin-private.h     |    0
 {src => lib}/gs-plugin-types.h       |    0
 {src => lib}/gs-plugin-vfuncs.h      |    0
 {src => lib}/gs-plugin.c             |    0
 {src => lib}/gs-plugin.h             |    0
 {src => lib}/gs-self-test.c          |    0
 {src => lib}/gs-utils.c              |    0
 {src => lib}/gs-utils.h              |    0
 po/POTFILES.in                       |    4 +-
 src/Makefile.am                      |  173 ++++-----------------------------
 src/plugins/Makefile.am              |   17 +---
 40 files changed, 162 insertions(+), 186 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 0a2b1c7..645f0ea 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,7 @@
 SUBDIRS =                                              \
        data                                            \
        po                                              \
+       lib                                             \
        src                                             \
        tests
 
diff --git a/configure.ac b/configure.ac
index 7bbaa3a..bc1de5e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -449,7 +449,7 @@ AC_SUBST(GS_PLUGIN_DIR, "\$(libdir)/gs-plugins-\${GS_PLUGIN_API_VERSION}")
 
 # common flags used by all plugins
 GS_PLUGIN_CFLAGS=""
-GS_PLUGIN_CFLAGS="$GS_PLUGIN_CFLAGS -I\$(top_srcdir)/src"
+GS_PLUGIN_CFLAGS="$GS_PLUGIN_CFLAGS -I\$(top_srcdir)/lib"
 GS_PLUGIN_CFLAGS="$GS_PLUGIN_CFLAGS -DI_KNOW_THE_GNOME_SOFTWARE_API_IS_SUBJECT_TO_CHANGE"
 GS_PLUGIN_CFLAGS="$GS_PLUGIN_CFLAGS $APPSTREAM_CFLAGS"
 GS_PLUGIN_CFLAGS="$GS_PLUGIN_CFLAGS $GLIB_CFLAGS"
@@ -467,6 +467,22 @@ GS_PLUGIN_LIBS="$GS_PLUGIN_LIBS $GTK_LIBS"
 GS_PLUGIN_LIBS="$GS_PLUGIN_LIBS $SOUP_LIBS"
 AC_SUBST(GS_PLUGIN_LIBS)
 
+# common cflags used by the private library
+GS_PRIVATE_CFLAGS="$GS_PLUGIN_CFLAGS"
+GS_PRIVATE_CFLAGS="$GS_PRIVATE_CFLAGS $JSON_GLIB_CFLAGS"
+GS_PRIVATE_CFLAGS="$GS_PRIVATE_CFLAGS $POLKIT_CFLAGS"
+GS_PRIVATE_CFLAGS="$GS_PRIVATE_CFLAGS $LIBSECRET_CFLAGS"
+GS_PRIVATE_CFLAGS="$GS_PRIVATE_CFLAGS $VALGRIND_CFLAGS"
+AC_SUBST(GS_PRIVATE_CFLAGS)
+
+# common libraries used by the private library
+GS_PRIVATE_LIBS="$GS_PLUGIN_LIBS"
+GS_PRIVATE_LIBS="$GS_PRIVATE_LIBS \$(top_builddir)/lib/libgnomesoftware.a"
+GS_PRIVATE_LIBS="$GS_PRIVATE_LIBS $JSON_GLIB_LIBS"
+GS_PRIVATE_LIBS="$GS_PRIVATE_LIBS $POLKIT_LIBS"
+GS_PRIVATE_LIBS="$GS_PRIVATE_LIBS $LIBSECRET_LIBS"
+AC_SUBST(GS_PRIVATE_LIBS)
+
 dnl ---------------------------------------------------------------------------
 dnl - Makefiles, etc.
 dnl ---------------------------------------------------------------------------
@@ -487,7 +503,8 @@ data/icons/hicolor/scalable/Makefile
 data/tests/Makefile
 doc/Makefile
 doc/api/Makefile
-src/gnome-software.pc
+lib/Makefile
+lib/gnome-software.pc
 src/Makefile
 src/plugins/Makefile
 tests/Makefile
diff --git a/doc/api/Makefile.am b/doc/api/Makefile.am
index d5c946b..80ca9ad 100644
--- a/doc/api/Makefile.am
+++ b/doc/api/Makefile.am
@@ -16,7 +16,7 @@ DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml
 # gtk-doc will search all .c and .h files beneath these paths
 # for inline comments documenting functions and macros.
 # e.g. DOC_SOURCE_DIR=$(top_srcdir)/gtk $(top_srcdir)/gdk
-DOC_SOURCE_DIR=$(top_srcdir)/src
+DOC_SOURCE_DIR=$(top_srcdir)/lib
 
 # Extra options to pass to gtkdoc-scangobj. Normally not needed.
 SCANGOBJ_OPTIONS=
@@ -39,8 +39,8 @@ 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)/src/*.h
-CFILE_GLOB=$(top_srcdir)/src/*.c
+HFILE_GLOB=$(top_srcdir)/lib/*.h
+CFILE_GLOB=$(top_srcdir)/lib/*.c
 
 # Extra header to include when scanning, which are not under DOC_SOURCE_DIR
 # e.g. EXTRA_HFILES=$(top_srcdir}/contrib/extra.h
@@ -72,22 +72,18 @@ expand_content_files=
 # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
 GTKDOC_CFLAGS=
 GTKDOC_LIBS=                                                   \
-       $(SOUP_LIBS)                                            \
-       $(GLIB_LIBS)                                            \
+       $(GS_PLUGIN_LIBS)                                       \
        $(POLKIT_LIBS)                                          \
-       $(APPSTREAM_LIBS)                                       \
-       $(LIBM)                                                 \
        $(LIBSECRET_LIBS)                                       \
        $(JSON_GLIB_LIBS)                                       \
-       $(GTK_LIBS)                                             \
-       $(top_builddir)/src/gnome_software-gs-app-list.o        \
-       $(top_builddir)/src/gnome_software-gs-app.o             \
-       $(top_builddir)/src/gnome_software-gs-auth.o            \
-       $(top_builddir)/src/gnome_software-gs-category.o        \
-       $(top_builddir)/src/gnome_software-gs-os-release.o      \
-       $(top_builddir)/src/gnome_software-gs-plugin.o          \
-       $(top_builddir)/src/gnome_software-gs-plugin-event.o    \
-       $(top_builddir)/src/gnome_software-gs-utils.o
+       $(top_builddir)/lib/libgnomesoftware_a-gs-app-list.o    \
+       $(top_builddir)/lib/libgnomesoftware_a-gs-app.o         \
+       $(top_builddir)/lib/libgnomesoftware_a-gs-auth.o        \
+       $(top_builddir)/lib/libgnomesoftware_a-gs-category.o    \
+       $(top_builddir)/lib/libgnomesoftware_a-gs-os-release.o  \
+       $(top_builddir)/lib/libgnomesoftware_a-gs-plugin.o      \
+       $(top_builddir)/lib/libgnomesoftware_a-gs-plugin-event.o \
+       $(top_builddir)/lib/libgnomesoftware_a-gs-utils.o
 
 # This includes the standard gtk-doc make rules, copied by gtkdocize.
 include $(top_srcdir)/gtk-doc.make
diff --git a/lib/Makefile.am b/lib/Makefile.am
new file mode 100644
index 0000000..7ea2898
--- /dev/null
+++ b/lib/Makefile.am
@@ -0,0 +1,96 @@
+
+AM_CPPFLAGS =                                          \
+       -DG_LOG_DOMAIN=\"Gs\"                           \
+       -DDATADIR=\"$(datadir)\"                        \
+       -DLIBDIR=\"$(libdir)\"                          \
+       -DLOCALEDIR=\""$(localedir)"\"                  \
+       -DLOCALSTATEDIR=\""$(localstatedir)"\"          \
+       -DTESTDATADIR=\""$(top_srcdir)/data"\"          \
+       -DLOCALPLUGINDIR=\""$(top_builddir)/src/plugins/.libs"\"
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = gnome-software.pc
+
+gnomesoftware_includedir = $(includedir)/gnome-software
+gnomesoftware_include_HEADERS =                                \
+       gnome-software.h                                \
+       gs-app.h                                        \
+       gs-app-list.h                                   \
+       gs-auth.h                                       \
+       gs-category.h                                   \
+       gs-os-release.h                                 \
+       gs-plugin-event.h                               \
+       gs-plugin.h                                     \
+       gs-plugin-types.h                               \
+       gs-plugin-vfuncs.h                              \
+       gs-utils.h
+
+noinst_LIBRARIES = libgnomesoftware.a
+libgnomesoftware_a_SOURCES =                           \
+       gnome-software.h                                \
+       gs-app.c                                        \
+       gs-app.h                                        \
+       gs-app-list.c                                   \
+       gs-app-list.h                                   \
+       gs-app-list-private.h                           \
+       gs-app-private.h                                \
+       gs-auth.c                                       \
+       gs-auth.h                                       \
+       gs-category.c                                   \
+       gs-category.h                                   \
+       gs-category-private.h                           \
+       gs-debug.c                                      \
+       gs-debug.h                                      \
+       gs-os-release.c                                 \
+       gs-os-release.h                                 \
+       gs-plugin.c                                     \
+       gs-plugin-event.c                               \
+       gs-plugin-event.h                               \
+       gs-plugin.h                                     \
+       gs-plugin-loader.c                              \
+       gs-plugin-loader.h                              \
+       gs-plugin-loader-sync.c                         \
+       gs-plugin-loader-sync.h                         \
+       gs-plugin-private.h                             \
+       gs-plugin-types.h                               \
+       gs-plugin-vfuncs.h                              \
+       gs-utils.c                                      \
+       gs-utils.h
+
+libgnomesoftware_a_CFLAGS = $(GS_PRIVATE_CFLAGS)
+
+libexec_PROGRAMS =                                     \
+       gnome-software-cmd
+
+gnome_software_cmd_SOURCES =                           \
+       gs-cmd.c
+
+gnome_software_cmd_LDADD =                             \
+       $(GS_PRIVATE_LIBS)
+
+gnome_software_cmd_CFLAGS =                            \
+       $(GS_PRIVATE_CFLAGS)
+
+gnome_software_cmd_LDFLAGS =                           \
+       $(PIE_LDFLAGS)                                  \
+       $(RELRO_LDFLAGS)
+
+EXTRA_DIST =                                           \
+       gnome-software.pc.in
+
+TESTS_ENVIRONMENT =                                    \
+       $(top_builddir)/libtool                         \
+       --mode=execute valgrind                         \
+       --quiet                                         \
+       --leak-check=full                               \
+       --show-possibly-lost=no
+
+if ENABLE_TESTS
+check_PROGRAMS = gs-self-test
+gs_self_test_SOURCES = gs-self-test.c
+gs_self_test_LDADD = $(GS_PRIVATE_LIBS)
+gs_self_test_CFLAGS = $(GS_PRIVATE_CFLAGS)
+TESTS = gs-self-test
+endif
+
+-include $(top_srcdir)/git.mk
diff --git a/lib/README.md b/lib/README.md
new file mode 100644
index 0000000..628c58e
--- /dev/null
+++ b/lib/README.md
@@ -0,0 +1,7 @@
+libgnomesoftware
+================
+
+This is a static library, and is not all API stable.
+
+Only the plugin headers installed into /usr/include/gnome-software should be
+considered API.
diff --git a/src/gnome-software.h b/lib/gnome-software.h
similarity index 100%
rename from src/gnome-software.h
rename to lib/gnome-software.h
diff --git a/src/gnome-software.pc.in b/lib/gnome-software.pc.in
similarity index 100%
rename from src/gnome-software.pc.in
rename to lib/gnome-software.pc.in
diff --git a/src/gs-app-list-private.h b/lib/gs-app-list-private.h
similarity index 100%
rename from src/gs-app-list-private.h
rename to lib/gs-app-list-private.h
diff --git a/src/gs-app-list.c b/lib/gs-app-list.c
similarity index 100%
rename from src/gs-app-list.c
rename to lib/gs-app-list.c
diff --git a/src/gs-app-list.h b/lib/gs-app-list.h
similarity index 100%
rename from src/gs-app-list.h
rename to lib/gs-app-list.h
diff --git a/src/gs-app-private.h b/lib/gs-app-private.h
similarity index 100%
rename from src/gs-app-private.h
rename to lib/gs-app-private.h
diff --git a/src/gs-app.c b/lib/gs-app.c
similarity index 100%
rename from src/gs-app.c
rename to lib/gs-app.c
diff --git a/src/gs-app.h b/lib/gs-app.h
similarity index 100%
rename from src/gs-app.h
rename to lib/gs-app.h
diff --git a/src/gs-auth.c b/lib/gs-auth.c
similarity index 100%
rename from src/gs-auth.c
rename to lib/gs-auth.c
diff --git a/src/gs-auth.h b/lib/gs-auth.h
similarity index 100%
rename from src/gs-auth.h
rename to lib/gs-auth.h
diff --git a/src/gs-category-private.h b/lib/gs-category-private.h
similarity index 100%
rename from src/gs-category-private.h
rename to lib/gs-category-private.h
diff --git a/src/gs-category.c b/lib/gs-category.c
similarity index 100%
rename from src/gs-category.c
rename to lib/gs-category.c
diff --git a/src/gs-category.h b/lib/gs-category.h
similarity index 100%
rename from src/gs-category.h
rename to lib/gs-category.h
diff --git a/src/gs-cmd.c b/lib/gs-cmd.c
similarity index 100%
rename from src/gs-cmd.c
rename to lib/gs-cmd.c
diff --git a/src/gs-debug.c b/lib/gs-debug.c
similarity index 100%
rename from src/gs-debug.c
rename to lib/gs-debug.c
diff --git a/src/gs-debug.h b/lib/gs-debug.h
similarity index 100%
rename from src/gs-debug.h
rename to lib/gs-debug.h
diff --git a/src/gs-os-release.c b/lib/gs-os-release.c
similarity index 100%
rename from src/gs-os-release.c
rename to lib/gs-os-release.c
diff --git a/src/gs-os-release.h b/lib/gs-os-release.h
similarity index 100%
rename from src/gs-os-release.h
rename to lib/gs-os-release.h
diff --git a/src/gs-plugin-event.c b/lib/gs-plugin-event.c
similarity index 100%
rename from src/gs-plugin-event.c
rename to lib/gs-plugin-event.c
diff --git a/src/gs-plugin-event.h b/lib/gs-plugin-event.h
similarity index 100%
rename from src/gs-plugin-event.h
rename to lib/gs-plugin-event.h
diff --git a/src/gs-plugin-loader-sync.c b/lib/gs-plugin-loader-sync.c
similarity index 100%
rename from src/gs-plugin-loader-sync.c
rename to lib/gs-plugin-loader-sync.c
diff --git a/src/gs-plugin-loader-sync.h b/lib/gs-plugin-loader-sync.h
similarity index 100%
rename from src/gs-plugin-loader-sync.h
rename to lib/gs-plugin-loader-sync.h
diff --git a/src/gs-plugin-loader.c b/lib/gs-plugin-loader.c
similarity index 99%
rename from src/gs-plugin-loader.c
rename to lib/gs-plugin-loader.c
index 88481fc..319fbe6 100644
--- a/src/gs-plugin-loader.c
+++ b/lib/gs-plugin-loader.c
@@ -32,7 +32,6 @@
 #include "gs-plugin.h"
 #include "gs-plugin-event.h"
 #include "gs-plugin-private.h"
-#include "gs-common.h"
 #include "gs-utils.h"
 
 #define GS_PLUGIN_LOADER_UPDATES_CHANGED_DELAY 3       /* s */
diff --git a/src/gs-plugin-loader.h b/lib/gs-plugin-loader.h
similarity index 100%
rename from src/gs-plugin-loader.h
rename to lib/gs-plugin-loader.h
diff --git a/src/gs-plugin-private.h b/lib/gs-plugin-private.h
similarity index 100%
rename from src/gs-plugin-private.h
rename to lib/gs-plugin-private.h
diff --git a/src/gs-plugin-types.h b/lib/gs-plugin-types.h
similarity index 100%
rename from src/gs-plugin-types.h
rename to lib/gs-plugin-types.h
diff --git a/src/gs-plugin-vfuncs.h b/lib/gs-plugin-vfuncs.h
similarity index 100%
rename from src/gs-plugin-vfuncs.h
rename to lib/gs-plugin-vfuncs.h
diff --git a/src/gs-plugin.c b/lib/gs-plugin.c
similarity index 100%
rename from src/gs-plugin.c
rename to lib/gs-plugin.c
diff --git a/src/gs-plugin.h b/lib/gs-plugin.h
similarity index 100%
rename from src/gs-plugin.h
rename to lib/gs-plugin.h
diff --git a/src/gs-self-test.c b/lib/gs-self-test.c
similarity index 100%
rename from src/gs-self-test.c
rename to lib/gs-self-test.c
diff --git a/src/gs-utils.c b/lib/gs-utils.c
similarity index 100%
rename from src/gs-utils.c
rename to lib/gs-utils.c
diff --git a/src/gs-utils.h b/lib/gs-utils.h
similarity index 100%
rename from src/gs-utils.h
rename to lib/gs-utils.h
diff --git a/po/POTFILES.in b/po/POTFILES.in
index a72ef14..702802b 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -13,7 +13,7 @@ src/gs-app-tile.c
 src/gs-app-tile.ui
 src/gs-auth-dialog.c
 src/gs-auth-dialog.ui
-src/gs-category.c
+lib/gs-category.c
 src/gs-category-page.ui
 src/gs-common.c
 src/gs-content-rating.c
@@ -37,7 +37,7 @@ src/gs-moderate-page.ui
 src/gs-overview-page.c
 src/gs-overview-page.ui
 src/gs-page.c
-src/gs-plugin-loader.c
+lib/gs-plugin-loader.c
 src/gs-popular-tile.c
 src/gs-popular-tile.ui
 src/gs-removal-dialog.c
diff --git a/src/Makefile.am b/src/Makefile.am
index ec9d264..7bc70ef 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2,46 +2,21 @@ SUBDIRS =                                             \
        plugins
 
 AM_CPPFLAGS =                                          \
-       $(APPSTREAM_CFLAGS)                             \
-       $(GLIB_CFLAGS)                                  \
-       $(GTK_CFLAGS)                                   \
+       $(GS_PRIVATE_CFLAGS)                            \
        $(GTKSPELL_CFLAGS)                              \
-       $(SOUP_CFLAGS)                                  \
-       $(PACKAGEKIT_CFLAGS)                            \
        $(GNOME_DESKTOP_CFLAGS)                         \
-       $(POLKIT_CFLAGS)                                \
-       $(JSON_GLIB_CFLAGS)                             \
-       $(LIBSECRET_CFLAGS)                             \
-       $(PIE_CFLAGS)                                   \
-       $(VALGRIND_CFLAGS)                              \
+       -I$(top_srcdir)/lib                             \
        -DG_LOG_DOMAIN=\"Gs\"                           \
-       -DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE  \
        -DLIBDIR=\"$(libdir)\"                          \
        -DBINDIR=\"$(bindir)\"                          \
        -DDATADIR=\"$(datadir)\"                        \
        -DVERSION="\"$(VERSION)\""                      \
        -DLOCALEDIR=\""$(localedir)"\"                  \
        -DLOCALSTATEDIR=\""$(localstatedir)"\"          \
+       -DLIBEXECDIR=\"$(libexecdir)\"                  \
        -DTESTDATADIR=\""$(top_srcdir)/data"\"          \
        -DLOCALPLUGINDIR=\""$(top_builddir)/src/plugins/.libs"\"
 
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = gnome-software.pc
-
-gnomesoftware_includedir = $(includedir)/gnome-software
-gnomesoftware_include_HEADERS =                                \
-       gnome-software.h                                \
-       gs-app.h                                        \
-       gs-app-list.h                                   \
-       gs-auth.h                                       \
-       gs-category.h                                   \
-       gs-os-release.h                                 \
-       gs-plugin.h                                     \
-       gs-plugin-event.h                               \
-       gs-plugin-types.h                               \
-       gs-plugin-vfuncs.h                              \
-       gs-utils.h
-
 %.desktop: %.desktop.in
        $(AM_V_GEN) msgfmt --desktop -d $(top_srcdir)/po --template $< -o $@
 
@@ -111,79 +86,32 @@ gnome-software-service.desktop: gnome-software-service.desktop.in Makefile
        $(AM_V_GEN) sed -e "s|\@bindir\@|$(bindir)|" $<> $@
 
 libexec_PROGRAMS =                                     \
-       gnome-software-restarter                        \
-       gnome-software-cmd
-
-gnome_software_cmd_SOURCES =                           \
-       gs-app.c                                        \
-       gs-app-list.c                                   \
-       gs-auth.c                                       \
-       gs-cmd.c                                        \
-       gs-common.c                                     \
-       gs-debug.c                                      \
-       gs-utils.c                                      \
-       gs-os-release.c                                 \
-       gs-plugin-event.c                               \
-       gs-plugin-loader.c                              \
-       gs-plugin-loader-sync.c                         \
-       gs-category.c                                   \
-       gs-plugin.c
-
-gnome_software_cmd_LDADD =                             \
-       $(APPSTREAM_LIBS)                               \
-       $(POLKIT_LIBS)                                  \
-       $(SOUP_LIBS)                                    \
-       $(LIBSECRET_LIBS)                               \
-       $(GLIB_LIBS)                                    \
-       $(GTK_LIBS)                                     \
-       $(JSON_GLIB_LIBS)                               \
-       $(LIBM)
-
-gnome_software_cmd_CFLAGS =                            \
-       $(WARN_CFLAGS)
-
-gnome_software_cmd_LDFLAGS =                           \
-       $(PIE_LDFLAGS)                                  \
-       $(RELRO_LDFLAGS)
+       gnome-software-restarter
 
 bin_PROGRAMS =                                         \
        gnome-software
 
 gnome_software_SOURCES =                               \
-       gnome-software.h                                \
        gs-app-addon-row.c                              \
        gs-app-addon-row.h                              \
-       gs-app.c                                        \
        gs-app-folder-dialog.c                          \
        gs-app-folder-dialog.h                          \
-       gs-app.h                                        \
        gs-application.c                                \
        gs-application.h                                \
-       gs-app-list.c                                   \
-       gs-app-list.h                                   \
-       gs-app-list-private.h                           \
-       gs-app-private.h                                \
        gs-app-row.c                                    \
        gs-app-row.h                                    \
        gs-app-tile.c                                   \
        gs-app-tile.h                                   \
-       gs-auth.c                                       \
        gs-auth-dialog.c                                \
        gs-auth-dialog.h                                \
-       gs-auth.h                                       \
-       gs-category.c                                   \
-       gs-category.h                                   \
        gs-category-page.c                              \
        gs-category-page.h                              \
-       gs-category-private.h                           \
        gs-category-tile.c                              \
        gs-category-tile.h                              \
        gs-common.c                                     \
        gs-common.h                                     \
        gs-content-rating.c                             \
        gs-content-rating.h                             \
-       gs-debug.c                                      \
-       gs-debug.h                                      \
        gs-details-page.c                               \
        gs-details-page.h                               \
        gs-extras-page.c                                \
@@ -211,23 +139,10 @@ gnome_software_SOURCES =                          \
        gs-main.c                                       \
        gs-moderate-page.c                              \
        gs-moderate-page.h                              \
-       gs-os-release.c                                 \
-       gs-os-release.h                                 \
        gs-overview-page.c                              \
        gs-overview-page.h                              \
        gs-page.c                                       \
        gs-page.h                                       \
-       gs-plugin.c                                     \
-       gs-plugin-event.c                               \
-       gs-plugin-event.h                               \
-       gs-plugin.h                                     \
-       gs-plugin-loader.c                              \
-       gs-plugin-loader.h                              \
-       gs-plugin-loader-sync.c                         \
-       gs-plugin-loader-sync.h                         \
-       gs-plugin-private.h                             \
-       gs-plugin-types.h                               \
-       gs-plugin-vfuncs.h                              \
        gs-popular-tile.c                               \
        gs-popular-tile.h                               \
        gs-progress-button.c                            \
@@ -268,8 +183,6 @@ gnome_software_SOURCES =                            \
        gs-updates-page.h                               \
        gs-upgrade-banner.c                             \
        gs-upgrade-banner.h                             \
-       gs-utils.c                                      \
-       gs-utils.h                                      \
        gs-vendor.c                                     \
        gs-vendor.h
 
@@ -279,37 +192,33 @@ nodist_gnome_software_SOURCES =                           \
        gs-shell-search-provider-generated.c            \
        gs-shell-search-provider-generated.h
 
-if HAVE_PACKAGEKIT
-gnome_software_SOURCES +=                              \
-       gs-dbus-helper.c                                \
-       gs-dbus-helper.h
-
-nodist_gnome_software_SOURCES +=                       \
-       $(packagekit_built_sources)                     \
-       $(packagekit_modify2_built_sources)
-endif
-
 gnome_software_LDADD =                                 \
-       $(APPSTREAM_LIBS)                               \
-       $(GLIB_LIBS)                                    \
-       $(GTK_LIBS)                                     \
+       $(GS_PRIVATE_LIBS)                              \
        $(GTKSPELL_LIBS)                                \
-       $(SOUP_LIBS)                                    \
-       $(LIBSECRET_LIBS)                               \
        $(PACKAGEKIT_LIBS)                              \
-       $(GNOME_DESKTOP_LIBS)                           \
-       $(POLKIT_LIBS)                                  \
-       $(JSON_GLIB_LIBS)                               \
-       $(LIBM)
+       $(GNOME_DESKTOP_LIBS)
 
 gnome_software_CFLAGS =                                        \
-       -DLIBEXECDIR=\"$(libexecdir)\"                  \
-       $(WARN_CFLAGS)
+       $(GS_PRIVATE_CFLAGS)
 
 gnome_software_LDFLAGS =                               \
        $(PIE_LDFLAGS)                                  \
        $(RELRO_LDFLAGS)
 
+if HAVE_PACKAGEKIT
+gnome_software_SOURCES +=                              \
+       gs-dbus-helper.c                                \
+       gs-dbus-helper.h
+
+gnome_software_CFLAGS +=                               \
+       -DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE \
+        $(PACKAGEKIT_CFLAGS)
+
+nodist_gnome_software_SOURCES +=                       \
+       $(packagekit_built_sources)                     \
+       $(packagekit_modify2_built_sources)
+endif
+
 gnome_software_restarter_SOURCES =                     \
        gs-restarter.c
 
@@ -361,51 +270,11 @@ BUILT_SOURCES =                                           \
        gs-resources.c                                  \
        gs-resources.h
 
-TESTS_ENVIRONMENT =                                            \
-       $(top_builddir)/libtool --mode=execute valgrind         \
-       --quiet                                                 \
-       --leak-check=full                                       \
-       --show-possibly-lost=no
-
-if ENABLE_TESTS
-check_PROGRAMS =                                               \
-       gs-self-test
-
-gs_self_test_SOURCES =                                         \
-       gs-app.c                                                \
-       gs-app-list.c                                           \
-       gs-auth.c                                               \
-       gs-category.c                                           \
-       gs-common.c                                             \
-       gs-os-release.c                                         \
-       gs-plugin-event.c                                       \
-       gs-plugin-loader-sync.c                                 \
-       gs-plugin-loader.c                                      \
-       gs-plugin.c                                             \
-       gs-utils.c                                              \
-       gs-self-test.c
-
-gs_self_test_LDADD =                                           \
-       $(APPSTREAM_LIBS)                                       \
-       $(POLKIT_LIBS)                                          \
-       $(SOUP_LIBS)                                            \
-       $(LIBSECRET_LIBS)                                       \
-       $(GLIB_LIBS)                                            \
-       $(GTK_LIBS)                                             \
-       $(JSON_GLIB_LIBS)                                       \
-       $(LIBM)
-
-gs_self_test_CFLAGS = $(WARN_CFLAGS)
-
-TESTS = gs-self-test
-endif
-
 EXTRA_DIST =                                           \
        shell-search-provider-dbus-interfaces.xml       \
        org.freedesktop.PackageKit.xml                  \
        org.freedesktop.PackageKit.Modify2.xml          \
        gnome-software.gresource.xml                    \
-       gnome-software.pc.in                            \
        gnome-software.xml                              \
        gtk-style.css                                   \
        gtk-style-hc.css                                \
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index 011677d..3363fb2 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -410,19 +410,10 @@ EXTRA_DIST = $(appdata_in_files)
 CLEANFILES = $(appdata_DATA)
 
 if ENABLE_TESTS
-check_PROGRAMS =                                               \
-       gs-self-test
-
-gs_self_test_SOURCES =                                         \
-       gs-markdown.c                                           \
-       gs-self-test.c
-
-gs_self_test_LDADD =                                           \
-       $(GLIB_LIBS)                                            \
-       $(GTK_LIBS)
-
-gs_self_test_CFLAGS = $(WARN_CFLAGS)
-
+check_PROGRAMS = gs-self-test
+gs_self_test_SOURCES = gs-self-test.c gs-markdown.c
+gs_self_test_LDADD = $(GS_PRIVATE_LIBS)
+gs_self_test_CFLAGS = $(GS_PRIVATE_CFLAGS)
 TESTS = gs-self-test
 endif
 


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