gimp-help-2 r2583 - in branches/xml2po-support: . tools
- From: romanofski svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp-help-2 r2583 - in branches/xml2po-support: . tools
- Date: Tue, 14 Oct 2008 20:02:22 +0000 (UTC)
Author: romanofski
Date: Tue Oct 14 20:02:22 2008
New Revision: 2583
URL: http://svn.gnome.org/viewvc/gimp-help-2?rev=2583&view=rev
Log:
2008-10-14 Roman Joost <romanofski gimp org>
* INSTALL
* tools/build-system.dot: Added Ulfs great dot file to create a
map of the build system. Makefile target 'dot' added.
* configure.ac
* Makefile.am: new target converted: pot->po. Programs are
checked during configure and variables are set.
* autogen.sh: uncomment the Makefile defines
Added:
branches/xml2po-support/tools/build-system.dot
Modified:
branches/xml2po-support/ChangeLog
branches/xml2po-support/INSTALL
branches/xml2po-support/Makefile.am
branches/xml2po-support/autogen.sh
branches/xml2po-support/configure.ac
Modified: branches/xml2po-support/INSTALL
==============================================================================
--- branches/xml2po-support/INSTALL (original)
+++ branches/xml2po-support/INSTALL Tue Oct 14 20:02:22 2008
@@ -57,6 +57,12 @@
./configure --without-gimp
+Other useful make targets
+-------------------------
+
+dot: Creates a build-system.png using dot, which displays a map of the
+ build-system targets.
+
-- The GIMP-Help team.
Modified: branches/xml2po-support/Makefile.am
==============================================================================
--- branches/xml2po-support/Makefile.am (original)
+++ branches/xml2po-support/Makefile.am Tue Oct 14 20:02:22 2008
@@ -90,10 +90,11 @@
podir = po
+
+#### POT directories
xml2pot = $(XML2PO) --output="$(2)" $(1) 2>&1 \
| sed -e '/Warning: image file .* not found./d'
-#### POT directories
$(POT_FILES): $(potdir)/%.pot : $(xmldir)/%.xml
@f=$@; d=$${f%/*}; test -d $$d || $(mkdir_p) $$d
@@ -110,6 +111,39 @@
potfiles: $(POT_FILES)
+#### POT -> PO
+# XXX TODO -> configure.ac
+PO_LANGS = $(filter-out $(XML_LANG), $(ALL_LINGUAS))
+
+pot2po = if [ -f $@ ]; then \
+ $(MSGFMT) $(MSGFMTFLAGS) $(3); \
+ $(MSGMERGE) $(MSGMERGEFLAGS) $(3) $(1) && touch $(3); \
+ else \
+ $(MSGINIT) $(MSGINITFLAGS) --input $(1) --locale=$(2) --output $(3); \
+ fi
+
+# HIDE FROM AUTOMAKE #define MAKE_PO_RULES
+# HIDE FROM AUTOMAKE #$(1)_PO_FILES = $$(patsubst $$(potdir)/%.pot, $$(podir)/$(1)/%.po, $$(POT_FILES))
+# HIDE FROM AUTOMAKE #$$($(1)_PO_FILES): $$(podir)/$(1)/%.po : $$(potdir)/%.pot
+# HIDE FROM AUTOMAKE # @f=$$@; d=$$$${f%/*}; test -d $$$$d || $$(mkdir_p) $$$$d
+# HIDE FROM AUTOMAKE # @echo "[PO] $$@"
+# HIDE FROM AUTOMAKE # @if test -s $$<; then $$(call pot2po,$$<,$(1),$$@); else touch $$@; fi
+# HIDE FROM AUTOMAKE ## Debugging
+# HIDE FROM AUTOMAKE #list-pofiles-$(1) list-po-files-$(1) list-po-$(1):
+# HIDE FROM AUTOMAKE # @echo $$($(1)_PO_FILES)
+# HIDE FROM AUTOMAKE #po-$(1): $$($(1)_PO_FILES)
+# HIDE FROM AUTOMAKE # $$(cmd) if test -e messages.mo; then rm -f messages.mo; fi
+# HIDE FROM AUTOMAKE #endef
+
+$(foreach LANG,$(PO_LANGS),$(eval $(call MAKE_PO_RULES,$(LANG))))
+
+# Targets suitable for command line
+update-po-%: po-%
+
+# Special case 'en': do nothing :-)
+po-en: ;
+
+
#### XML profiling
# Note that "src/gimp.xml" must be the first prerequisite
@@ -375,6 +409,15 @@
echo >&2 "*** Cannot check image references (no Python installed?) ***"; \
fi
+if HAVE_DOT
+
+build-system.png: tools/build-system.dot
+ @$(DOT) -Tpng -o $@ $<; \
+ echo "build-system.png created."
+
+dot: build-system.png
+
+endif
#### AUTHORS file creation
@@ -462,6 +505,9 @@
rm -rf preview-*
rm -rf xml
rm -rf $(tarball_prefix)-*
+ rm -rf po
+ rm -rf pot
+
maintainer-clean-local:
rm -rf html
Modified: branches/xml2po-support/autogen.sh
==============================================================================
--- branches/xml2po-support/autogen.sh (original)
+++ branches/xml2po-support/autogen.sh Tue Oct 14 20:02:22 2008
@@ -97,6 +97,13 @@
fi
$AUTOMAKE --add-missing || exit 1
+if [ -e Makefile.in ]; then
+ sed -e 's/^# HIDE FROM AUTOMAKE #//' Makefile.in > Makefile.in.tmp &&
+ mv Makefile.in.tmp Makefile.in
+else
+ echo >&2 "Error: cannot find Makefile.in"
+ exit 1
+fi
autoconf || exit 1
rm -rf autom4te.cache
Modified: branches/xml2po-support/configure.ac
==============================================================================
--- branches/xml2po-support/configure.ac (original)
+++ branches/xml2po-support/configure.ac Tue Oct 14 20:02:22 2008
@@ -28,7 +28,11 @@
# GIMP 2.2 Linguas: Content for those language code exist, but they
# haven't been worked on for a while:
# ALL_LINGUAS="cs de en es fr hr it ko nl no ru sv zh_CN"
+#
+XML_LANG="en"
+
QUICKREFERENCE_ALL_LINGUAS="de en fr it ko ru sv"
+
if test "x$ALL_LINGUAS" = "x"; then
ALL_LINGUAS="de en es fr it ko nl no pl ru sv"
else
@@ -43,6 +47,7 @@
QUICKREFERENCE_ALL_LINGUAS=$QUICKREFERENCE_LINGUAS
fi
+AC_SUBST(XML_LANG)
AC_SUBST(ALL_LINGUAS)
AC_SUBST(QUICKREFERENCE_ALL_LINGUAS)
@@ -107,6 +112,16 @@
AM_CONDITIONAL(HAVE_DBLATEX, test -n "$DBLATEX")
+# Optional: dot to create build system map
+
+AC_PATH_PROG(DOT, dot)
+if test -z "$DOT"; then
+ AC_MSG_WARN([cannot find dot(1), creating build system PNG disabled])
+fi
+
+AM_CONDITIONAL(HAVE_DOT, test -n "$DOT")
+
+
# Search for docbook2odf
AC_PATH_PROG(DOCBOOK2ODF, docbook2odf)
@@ -128,6 +143,40 @@
AM_CONDITIONAL(HAVE_XML2PO, test -n "$XML2PO")
+# Search for msgfmt, msginit, msgmerge
+
+AC_PATH_PROG(MSGFMT, msgfmt)
+if test -z "$MSGFMT" && test "x$enable_build" = "xyes"; then
+ AC_MSG_ERROR([
+** Couldn't find msgfmt(1). You will need it to build the help files.
+** See the file 'INSTALL' for more help.])
+fi
+
+MSGFMTFLAGS="--check --use-fuzzy --statistics"
+AC_SUBST(MSGFMTFLAGS)
+
+
+AC_PATH_PROG(MSGINIT, msginit)
+if test -z "$MSGINIT" && test "x$enable_build" = "xyes"; then
+ AC_MSG_ERROR([
+** Couldn't find msginit(1). You will need it to build the help files.
+** See the file 'INSTALL' for more help.])
+fi
+
+MSGINITFLAGS="--no-translator"
+AC_SUBST(MSGINITFLAGS)
+
+
+AC_PATH_PROG(MSGMERGE, msgmerge)
+if test -z "$MSGMERGE" && test "x$enable_build" = "xyes"; then
+ AC_MSG_ERROR([
+** Couldn't find msgmerge(1). You will need it to build the help files.
+** See the file 'INSTALL' for more help.])
+fi
+
+MSGMERGEFLAGS="--quiet --backup=none --update"
+AC_SUBST(MSGMERGEFLAGS)
+
# Optionally allow xsltproc to access DTDs over the network
AC_ARG_ENABLE(network,
Added: branches/xml2po-support/tools/build-system.dot
==============================================================================
--- (empty file)
+++ branches/xml2po-support/tools/build-system.dot Tue Oct 14 20:02:22 2008
@@ -0,0 +1,105 @@
+/*
+ Proposed gettext-based gimp-help build system
+
+ Shapes:
+ - circle main targets
+ - ellipse lang-dependent or auxiliary targets
+ - box file or directory targets
+ - hexagon TODO etc.
+ Colors:
+ - blue default, language-independent
+ - green language-dependent
+ - red TODO
+ - grey TODO, ignore, etc.
+*/
+digraph gimp {
+ node[shape=box];
+
+ all[label="all" color=blue shape="circle"]
+
+ all -> validate[label="?"];
+ all -> html;
+ all -> index[label="?" color=grey];
+ all -> authors;
+
+ /* do_nothing[label="do nothing" color=grey shape=hexagon] */
+ todo[label="TODO" color=red shape=hexagon]
+
+ /* $(POT_FILES): $(potdir)/%.pot : $(xmldir)/%.xml */
+
+ src_files[label="src/*.xml" color=blue ]
+ pot_files[label="pot/*.pot" color=blue]
+ po_files[label="po/LANG/*.po" color=green]
+ node[shape=ellipse];
+ xml[label="xml" color=blue]
+ pot[label="pot" color=blue]
+
+ pot -> pot_files -> src_files
+
+ /* XX_PO_FILES = $(patsubst $(potdir)/%.pot, $(podir)/XX/%.po, $(POT_FILES)) */
+
+ po[color=green shape=ellipse]
+ po_lang[label="po-LANG" color=green]
+ po -> po_lang[label="TODO" color=red]
+ po_lang -> po_files -> pot_files
+ /* po_en[label="po-en" color=grey] */
+ /* po_en -> do_nothing */
+
+ /* XX_XML_FILES = $(XML_FILES:$(xmldir)/%=$(xmlpodir)/$(1)/%)
+ $(XX_XML_FILES): $(xmlpodir)/XX/%.xml : $(podir)/XX/%.po */
+
+ xml[label="xml" color=blue shape=circle]
+ xml_files[label="xml/LANG/*.xml" color=green shape=box]
+ xml_dir[label="xml/LANG" color=green shape=box]
+ xml_dir_en[label="xml/en" color=green shape=box]
+ xml_lang[label="xml-LANG" color=green]
+ xml_en[label="xml-en" color=green shape=ellipse]
+
+ xml_dir -> xml_files -> po_files
+ xml_lang -> xml_files
+ xml_en -> xml_dir_en
+ xml_dir_en -> xml_files[label="link" color="grey"]
+
+ /* html-%: po-% index-% html/%/index.html */
+ /* html/%/index.html: $(xmlpodir)/% $(HTML_STYLESHEETS) */
+
+ /* html/%/gimp-xrefs.xml: html/%/index.html */
+
+ html_lang[label="html-LANG" color=green shape=ellipse]
+ html_main[label="html/LANG/index.html" color=green shape=box]
+ index_lang[label="index-LANG" color=green shape=ellipse]
+ xrefs_lang[label="html/LANG/gimp-xrefs.html" shape="box" color="green"]
+
+ html_lang -> po_lang
+ html_lang -> index_lang
+ html_lang -> html_main -> xml_dir
+ xrefs_lang -> html_main
+
+ /* index: $(foreach lang,$(LANGUAGES),index-$(lang)) */
+ /* index-%: html/%/gimp-help.xml */
+
+ /* html/%/gimp-help.xml: html/%/gimp-xrefs.xml stylesheets/makeindex.xsl */
+
+ index[color=grey shape=ellipse]
+ index_lang[label="index-LANG" color=green shape=ellipse]
+ help_lang[label="html/LANG/gimp-help.xml" color=green shape=box]
+
+ index -> index_lang[color=grey label="?"]
+ index_lang -> help_lang -> xrefs_lang
+
+ /* TODO */
+
+ html[shape=circle]
+ xml[shape=circle]
+ check[color=blue shape=ellipse]
+ validate[color=blue shape=ellipse]
+ authors[label="AUTHORS" color=blue shape=box]
+
+ xml -> xml_lang[label="TODO" color=red]
+ xml -> xml_en[color=grey]
+ xml -> po[color=grey label="TODO?"]
+ html -> html_lang[label="TODO" color=red]
+ authors -> todo
+ check -> validate -> todo
+}
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]