[Groonga-commit] groonga/groonga [master] logo: support auto PNG generation

Back to archive index

null+****@clear***** null+****@clear*****
2012年 3月 26日 (月) 15:45:35 JST


Kouhei Sutou	2012-03-26 15:45:35 +0900 (Mon, 26 Mar 2012)

  New Revision: 267dc194be2e23a6eb6f7d306f5424bd53e45d20

  Log:
    logo: support auto PNG generation

  Added files:
    data/images/files.am
    data/images/update-files.sh
  Modified files:
    configure.ac
    data/images/Makefile.am

  Modified: configure.ac (+26 -0)
===================================================================
--- configure.ac    2012-03-26 15:44:54 +0900 (7829a19)
+++ configure.ac    2012-03-26 15:45:35 +0900 (f17d021)
@@ -703,6 +703,32 @@ AM_CONDITIONAL([WITH_UNIT_TEST],
 AM_CONDITIONAL([WITH_FUNCTION_TEST],
                [test "$ac_cv_ruby_available" = "yes"])
 
+# check Inkscape for generating PNG images
+inkscape_available="no"
+AC_ARG_WITH([inkscape],
+            AS_HELP_STRING([--with-inkscape=PATH],
+                           [Inkscape path (default: auto)]),
+            [INKSCAPE="$withval"],
+            [INKSCAPE="auto"])
+
+if test "x$INKSCAPE" = "xno"; then
+  INKSCAPE=
+else
+  if test "x$INKSCAPE" = "xyes"; then
+    AC_PATH_PROGS(INKSCAPE, [inkscape], none)
+    if test "$INKSCAPE" != "none"; then
+      inkscape_available="yes"
+    fi
+  else
+    AC_CHECK_FILE([$INKSCAPE],
+		  [inkscape_available="yes"],
+		  [AC_MSG_WARN([$INKSCAPE is not found.
+                                Disable PNG image generation.])])
+  fi
+fi
+AC_SUBST(INKSCAPE)
+AM_CONDITIONAL([WITH_INKSCAPE], [test "$inkscape_available" = "yes"])
+
 # libedit
 AC_ARG_ENABLE(libedit,
   [AS_HELP_STRING([--disable-libedit],

  Modified: data/images/Makefile.am (+16 -23)
===================================================================
--- data/images/Makefile.am    2012-03-26 15:44:54 +0900 (fd8bb64)
+++ data/images/Makefile.am    2012-03-26 15:45:35 +0900 (e373361)
@@ -1,26 +1,19 @@
+include files.am
+
 imagesdir = $(pkgdatadir)/images
-images_DATA =							\
-	groonga-icon-foreground-white.svg			\
-	groonga-icon.svg					\
-	groonga-logo-foreground-white.svg			\
-	groonga-logo.svg					\
-	groonga-powered-by-banner-bar-foreground-white.svg	\
-	groonga-powered-by-banner-bar.svg			\
-	groonga-powered-by-banner-foreground-white.svg		\
-	groonga-powered-by-banner-large.svg			\
-	groonga-powered-by-banner.svg				\
-	mroonga-icon-foreground-white.svg			\
-	mroonga-icon.svg					\
-	mroonga-logo-foreground-white.svg			\
-	mroonga-logo.svg					\
-	nroonga-icon-foreground-white.svg			\
-	nroonga-icon.svg					\
-	nroonga-logo-foreground-white.svg			\
-	nroonga-logo.svg					\
-	rroonga-icon-foreground-white.svg			\
-	rroonga-icon.svg					\
-	rroonga-logo-foreground-white.svg			\
-	rroonga-logo.svg
+images_DATA = $(image_files)
 
 EXTRA_DIST =					\
-	$(images_DATA)
+	$(images_DATA)				\
+	update-files.sh
+
+SUFFIXES = .svg .png
+.svg.png:
+	$(INKSCAPE) --export-dpi 90 --export-png $@ $<
+
+$(srcdir)/files.am: $(srcdir)/update-files.sh
+	$(srcdir)/update-files.sh > $(srcdir)/files.am
+
+update-files:
+	rm $(srcdir)/files.am
+	$(MAKE) $(srcdir)/files.am

  Added: data/images/files.am (+45 -0) 100644
===================================================================
--- /dev/null
+++ data/images/files.am    2012-03-26 15:45:35 +0900 (9075762)
@@ -0,0 +1,45 @@
+image_files = \
+	groonga-icon-foreground-white.png \
+	groonga-icon-foreground-white.svg \
+	groonga-icon.png \
+	groonga-icon.svg \
+	groonga-logo-foreground-white.png \
+	groonga-logo-foreground-white.svg \
+	groonga-logo.png \
+	groonga-logo.svg \
+	groonga-powered-by-banner-bar-foreground-white.png \
+	groonga-powered-by-banner-bar-foreground-white.svg \
+	groonga-powered-by-banner-bar.png \
+	groonga-powered-by-banner-bar.svg \
+	groonga-powered-by-banner-foreground-white.png \
+	groonga-powered-by-banner-foreground-white.svg \
+	groonga-powered-by-banner-large.png \
+	groonga-powered-by-banner-large.svg \
+	groonga-powered-by-banner.png \
+	groonga-powered-by-banner.svg \
+	mroonga-icon-foreground-white.png \
+	mroonga-icon-foreground-white.svg \
+	mroonga-icon.png \
+	mroonga-icon.svg \
+	mroonga-logo-foreground-white.png \
+	mroonga-logo-foreground-white.svg \
+	mroonga-logo.png \
+	mroonga-logo.svg \
+	nroonga-icon-foreground-white.png \
+	nroonga-icon-foreground-white.svg \
+	nroonga-icon.png \
+	nroonga-icon.svg \
+	nroonga-logo-foreground-white.png \
+	nroonga-logo-foreground-white.svg \
+	nroonga-logo.png \
+	nroonga-logo.svg \
+	rroonga-icon-foreground-white.png \
+	rroonga-icon-foreground-white.svg \
+	rroonga-icon.png \
+	rroonga-icon.svg \
+	rroonga-logo-foreground-white.png \
+	rroonga-logo-foreground-white.svg \
+	rroonga-logo.png \
+	rroonga-logo.svg \
+	$(NULL)
+

  Added: data/images/update-files.sh (+17 -0) 100755
===================================================================
--- /dev/null
+++ data/images/update-files.sh    2012-03-26 15:45:35 +0900 (347568b)
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+list_paths()
+{
+    variable_name=$1
+    echo "$variable_name = \\"
+    sort | \
+    sed \
+      -e 's,^,\t,' \
+      -e 's,$, \\,'
+    echo "\t\$(NULL)"
+    echo
+}
+
+# image files.
+ls *.svg *.png | \
+    list_paths "image_files"




Groonga-commit メーリングリストの案内
Back to archive index