[aisleriot] cards: Switch to SVGZ format



commit 37106f3670fd0d76c8e8320525879ae574608bba
Author: Christian Persch <chpe gnome org>
Date:   Wed Oct 5 21:34:46 2011 +0200

    cards: Switch to SVGZ format

 cards/Makefile.am                |   20 ++++++++++++++++++--
 configure.ac                     |   27 +++++++++++++++++++++++++--
 data/Makefile.am                 |   15 ++++++++++++++-
 src/lib/ar-card-theme-preimage.c |    8 ++------
 4 files changed, 59 insertions(+), 11 deletions(-)
---
diff --git a/cards/Makefile.am b/cards/Makefile.am
index 335b997..9af80c5 100644
--- a/cards/Makefile.am
+++ b/cards/Makefile.am
@@ -1,8 +1,9 @@
 NULL =
 
-carddir = $(pkgdatadir)/cards
+XMLLINT_FLAGS = --nonet --noblanks
+GZIP_FLAGS = -9
 
-dist_card_DATA = \
+SVGS = \
 	anglo.svg \
 	anglo_bitmap.svg \
 	bellot.svg \
@@ -15,11 +16,26 @@ dist_card_DATA = \
 	tango.svg \
 	$(NULL)
 
+carddir = $(pkgdatadir)/cards
+nodist_card_DATA = $(SVGS:.svg=.svgz)
+
 EXTRA_DIST = \
 	README.bellot \
 	README.dondorf \
 	README.ornamental \
 	README.paris \
+	$(SVGS)
+	$(NULL)
+
+CLEANFILES = \
+	$(nodist_card_DATA) \
+	$(NULL)
+
+DISTCLEANFILES = \
+	$(nodist_card_DATA) \
 	$(NULL)
 
+%.svgz: %.svg
+	$(AM_V_GEN)$(XMLLINT) $(XMLLINT_FLAGS) $< | $(GZIP) $(GZIP_FLAGS) > $@
+
 -include $(top_srcdir)/git.mk
diff --git a/configure.ac b/configure.ac
index d912545..90424fb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -305,7 +305,6 @@ esac
 GCONF_REQUIRED=2.0
 GLIB_REQUIRED=2.26.0
 GIO_REQUIRED=2.26.0
-GSTREAMER_REQUIRED=0.10.11
 
 # Check for common modules
 
@@ -450,10 +449,34 @@ AM_CONDITIONAL([WITH_SMCLIENT_QUARTZ],[test "$with_smclient" = "quartz"])
 # Extra build tools
 # *****************
 
-AC_PATH_PROG([GLIB_GENMARSHAL],[glib-genmarshal])
+AC_ARG_VAR([GLIB_GENMARSHAL],[the glib-genmarschal programme])
+AC_MSG_CHECKING([for glib-genmarshal])
+AC_PATH_PROG([GLIB_GENMARSHAL],[glib-genmarshal],[])
+AC_MSG_RESULT([$GLIB_GENMARSHAL])
+if test -z "$GLIB_GENMARSHAL"; then
+  AC_MSG_ERROR([glib-genmarshal not found])
+fi
+
+AC_ARG_VAR([GZIP],[the gzip programme])
+AC_MSG_CHECKING([for gzip])
+AC_PATH_PROG([GZIP],[gzip],[])
+AC_MSG_RESULT([$GZIP])
+if test -z "$GZIP"; then
+  AC_MSG_ERROR([gzip not found])
+fi
+
+AC_ARG_VAR([XMLLINT],[the xmllint programme])
+AC_MSG_CHECKING([for xmllint])
+AC_PATH_PROG([XMLLINT],[xmllint],[])
+AC_MSG_RESULT([$XMLLINT])
+if test -z "$XMLLINT"; then
+  AC_MSG_ERROR([xmllint not found])
+fi
 
 if test "$platform_win32" = "yes" -a "$os_win32" = "yes"; then
+  AC_MSG_CHECKING([for windres])
   AC_CHECK_TOOL([WINDRES],[windres],[no])
+  AC_MSG_RESULT([$WINDRES])
   if test "$WINDRES" = "no"; then
     AC_MSG_ERROR([windres is required for native win32])
   fi
diff --git a/data/Makefile.am b/data/Makefile.am
index 128908a..954c829 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -6,9 +6,16 @@ if ENABLE_SOUND
 SUBDIRS += sounds
 endif
 
+XMLLINT_FLAGS = --nonet --noblanks
+GZIP_FLAGS = -9
+
+SVGS = \
+	slot.svg \
+	$(NULL)
+
 if HAVE_RSVG
 slotdir = $(pkgdatadir)/pixmaps
-dist_slot_DATA = slot.svg
+nodist_slot_DATA = $(SVGS:.svg=.svgz)
 endif # HAVE_RSVG
 
 themeinstalldir = $(pkgdatadir)
@@ -24,16 +31,22 @@ desktop_DATA = $(desktop_in_files:.desktop.in.in=.desktop)
 
 EXTRA_DIST = \
 	aisleriot.supp \
+	$(SVGS)
 	$(NULL)
 
 CLEANFILES = \
 	$(desktop_DATA) \
+	$(nodist_slot_DATA) \
 	$(NULL)
 
 DISTCLEANFILES = \
 	$(desktop_DATA) \
+	$(nodist_slot_DATA) \
 	$(NULL)
 
+%.svgz: %.svg
+	$(AM_V_GEN)$(XMLLINT) $(XMLLINT_FLAGS) $< | $(GZIP) $(GZIP_FLAGS) > $@
+
 @INTLTOOL_DESKTOP_RULE@
 
 -include $(top_srcdir)/git.mk
diff --git a/src/lib/ar-card-theme-preimage.c b/src/lib/ar-card-theme-preimage.c
index 8056706..f937612 100644
--- a/src/lib/ar-card-theme-preimage.c
+++ b/src/lib/ar-card-theme-preimage.c
@@ -67,7 +67,7 @@ ar_card_theme_preimage_load (ArCardTheme *card_theme,
   /* First the slot image */
   /* FIXMEchpe: use uninstalled data dir for rendering the card theme! */
   slot_dir = ar_runtime_get_directory (AR_RUNTIME_PIXMAP_DIRECTORY);
-  path = g_build_filename (slot_dir, "slot.svg", NULL);
+  path = g_build_filename (slot_dir, "slot.svgz", NULL);
   theme->slot_preimage = ar_svg_new_from_filename_sync (path, NULL, error);
   g_free (path);
   if (!theme->slot_preimage)
@@ -222,11 +222,7 @@ ar_card_theme_preimage_class_get_theme_info (ArCardThemeClass *klass,
   ArCardThemeInfo *info;
   char *display_name;
 
-  if (!g_str_has_suffix (filename, ".svg")
-#if defined(LIBRSVG_HAVE_SVGZ) && LIBRSVG_HAVE_SVGZ
-      && !g_str_has_suffix (filename, ".svgz")
-#endif
-     )
+  if (!g_str_has_suffix (filename, ".svgz"))
     return NULL;
 
   display_name = ar_filename_to_display_name (filename);



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