diff options
author | Richard Hughes <richard@hughsie.com> | 2016-01-21 15:51:30 +0000 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2016-01-21 15:51:30 +0000 |
commit | f1cdbd834f5baf5db5c7d73849161b186a2d9c54 (patch) | |
tree | 4e46efb7b0f526ae719eaa867c5dec8167ff84ee | |
parent | bdbc690fac186a2afbb8ef8a618aa510c9f3367a (diff) | |
download | appstream-glib-f1cdbd834f5baf5db5c7d73849161b186a2d9c54.tar.gz |
Allow disabling font support with --disable-fonts
-rw-r--r-- | Makefile.am | 1 | ||||
-rw-r--r-- | configure.ac | 20 | ||||
-rw-r--r-- | libappstream-builder/asb-self-test.c | 8 | ||||
-rw-r--r-- | libappstream-builder/plugins/Makefile.am | 9 |
4 files changed, 33 insertions, 5 deletions
diff --git a/Makefile.am b/Makefile.am index 2b8078c..6c441fd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -75,6 +75,7 @@ ChangeLog: DISTCHECK_CONFIGURE_FLAGS = \ --enable-dep11 \ --enable-firmware \ + --enable-fonts \ --enable-builder \ --with-bashcompletiondir=/${prefix}/share/bash-completion/completions diff --git a/configure.ac b/configure.ac index e4cffe8..a5df655 100644 --- a/configure.ac +++ b/configure.ac @@ -144,12 +144,25 @@ else fi AM_CONDITIONAL(HAVE_GCAB, test x$enable_firmware = xyes) +# font support (default enabled) +AC_ARG_ENABLE(firmware, AS_HELP_STRING([--disable-fonts],[Disable font support]), enable_fonts=$enableval) +if test x$enable_fonts != xno; then + AC_DEFINE(HAVE_FONTS,[1], [Use fonts]) + enable_fonts=yes +else + enable_fonts=no +fi +AM_CONDITIONAL(HAVE_FONTS, test x$enable_fonts = xyes) + # builder (default enabled) AC_ARG_ENABLE(builder, AS_HELP_STRING([--disable-builder],[Disable AppStream builder support]), enable_builder=$enableval) if test x$enable_builder != xno; then - PKG_CHECK_MODULES(GTK, gtk+-3.0) - PKG_CHECK_MODULES(SQLITE, sqlite3) - PKG_CHECK_MODULES(FREETYPE, pango fontconfig freetype2 >= 9.10.0) + + # only for fonts */ + if test x$enable_fonts != xno; then + PKG_CHECK_MODULES(GTK, gtk+-3.0) + PKG_CHECK_MODULES(FREETYPE, pango fontconfig freetype2 >= 9.10.0) + fi # only for firmware */ if test x$enable_firmware != xno; then @@ -276,5 +289,6 @@ AC_MSG_RESULT([ DEP-11 support: ${enable_dep11} Builder support: ${enable_builder} Firmware support: ${enable_firmware} + Fonts support: ${enable_fonts} Bash completion dir: ${with_bashcompletiondir} ]) diff --git a/libappstream-builder/asb-self-test.c b/libappstream-builder/asb-self-test.c index 18f8e15..2a68910 100644 --- a/libappstream-builder/asb-self-test.c +++ b/libappstream-builder/asb-self-test.c @@ -429,7 +429,11 @@ asb_test_context_test_func (AsbTestContextMode mode) ret = as_store_from_file (store, file, NULL, NULL, &error); g_assert_no_error (error); g_assert (ret); +#ifdef HAVE_FONTS g_assert_cmpint (as_store_get_size (store), ==, 4); +#else + g_assert_cmpint (as_store_get_size (store), ==, 3); +#endif app = as_store_get_app_by_pkgname (store, "app"); g_assert (app != NULL); app = as_store_get_app_by_id (store, "app.desktop"); @@ -439,6 +443,7 @@ asb_test_context_test_func (AsbTestContextMode mode) xml = as_store_to_xml (store, AS_NODE_TO_XML_FLAG_FORMAT_MULTILINE); expected_xml = "<components version=\"0.9\" builder_id=\"appstream-glib:4\" origin=\"asb-self-test\">\n" +#ifdef HAVE_FONTS "<component type=\"font\">\n" "<id>Liberation</id>\n" "<pkgname>font</pkgname>\n" @@ -474,6 +479,7 @@ asb_test_context_test_func (AsbTestContextMode mode) "<value key=\"X-CacheID\">font-1-1.fc21.noarch.rpm</value>\n" "</metadata>\n" "</component>\n" +#endif "<component type=\"addon\">\n" "<id>app-extra</id>\n" "<pkgname>app-extra</pkgname>\n" @@ -592,6 +598,7 @@ asb_test_context_test_func (AsbTestContextMode mode) xml_failed = as_store_to_xml (store_failed, AS_NODE_TO_XML_FLAG_FORMAT_MULTILINE); expected_xml = "<components version=\"0.9\" builder_id=\"appstream-glib:4\" origin=\"asb-self-test-failed\">\n" +#ifdef HAVE_FONTS "<component type=\"font\">\n" "<id>LiberationSerif</id>\n" "<pkgname>font-serif</pkgname>\n" @@ -629,6 +636,7 @@ asb_test_context_test_func (AsbTestContextMode mode) "<value key=\"X-CacheID\">font-serif-1-1.fc21.noarch.rpm</value>\n" "</metadata>\n" "</component>\n" +#endif "<component type=\"addon\">\n" "<id>app-core</id>\n" "<pkgname>app</pkgname>\n" diff --git a/libappstream-builder/plugins/Makefile.am b/libappstream-builder/plugins/Makefile.am index fddfc88..9a1e815 100644 --- a/libappstream-builder/plugins/Makefile.am +++ b/libappstream-builder/plugins/Makefile.am @@ -5,7 +5,6 @@ AM_CPPFLAGS = \ $(LIBARCHIVE_CFLAGS) \ $(SOUP_CFLAGS) \ $(RPM_CFLAGS) \ - $(SQLITE_CFLAGS) \ $(FREETYPE_CFLAGS) \ -I$(top_srcdir)/libappstream-glib \ -I$(top_builddir)/libappstream-glib \ @@ -21,7 +20,6 @@ plugin_LTLIBRARIES = \ libasb_plugin_desktop.la \ libasb_plugin_gir.la \ libasb_plugin_gresource.la \ - libasb_plugin_font.la \ libasb_plugin_gettext.la \ libasb_plugin_gstreamer.la \ libasb_plugin_hardcoded.la \ @@ -34,6 +32,11 @@ plugin_LTLIBRARIES += \ libasb_plugin_ostree.la endif +if HAVE_FONTS +plugin_LTLIBRARIES += \ + libasb_plugin_font.la +endif + libasb_plugin_dbus_la_SOURCES = asb-plugin-dbus.c libasb_plugin_dbus_la_LIBADD = $(GLIB_LIBS) libasb_plugin_dbus_la_LDFLAGS = -module -avoid-version @@ -94,10 +97,12 @@ libasb_plugin_nm_la_LIBADD = $(GLIB_LIBS) libasb_plugin_nm_la_LDFLAGS = -module -avoid-version libasb_plugin_nm_la_CFLAGS = $(GLIB_CFLAGS) $(WARNINGFLAGS_C) +if HAVE_FONTS libasb_plugin_font_la_SOURCES = asb-plugin-font.c libasb_plugin_font_la_LIBADD = $(GLIB_LIBS) $(FREETYPE_LIBS) $(GDKPIXBUF_LIBS) $(GTK_LIBS) libasb_plugin_font_la_LDFLAGS = -module -avoid-version libasb_plugin_font_la_CFLAGS = $(GLIB_CFLAGS) $(GTK_CFLAGS) $(WARNINGFLAGS_C) +endif if HAVE_OSTREE libasb_plugin_ostree_la_SOURCES = asb-plugin-ostree.c |