local.mk 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # GNU Guix --- Functional package management for GNU
  2. # Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
  3. #
  4. # This file is part of GNU Guix.
  5. #
  6. # GNU Guix is free software; you can redistribute it and/or modify it
  7. # under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 3 of the License, or (at
  9. # your option) any later version.
  10. #
  11. # GNU Guix is distributed in the hope that it will be useful, but
  12. # WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  18. DOC_PO_FILES= \
  19. %D%/guix-manual.de.po \
  20. %D%/guix-manual.fr.po
  21. EXTRA_DIST = \
  22. %D%/guix-manual.pot \
  23. $(DOC_PO_FILES)
  24. POT_OPTIONS = --package-name "guix" --package-version "$(VERSION)" \
  25. --copyright-holder "Ludovic Courtès" \
  26. --msgid-bugs-address "ludo@gnu.org"
  27. $(srcdir)/po/doc/guix-manual.%.po: $(srcdir)/po/doc/guix-manual.pot
  28. @lang=`echo $$(basename "$@") | sed -e 's|^guix-manual.||' -e 's|.po$$||'` ;\
  29. if test -f "$@"; then \
  30. test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
  31. echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $@ $<"; \
  32. cd $(srcdir) \
  33. && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
  34. '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
  35. $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $@ $<;; \
  36. *) \
  37. $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $@ $<;; \
  38. esac; \
  39. }; \
  40. touch "$@"; \
  41. else \
  42. echo "File $@ does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
  43. exit 1; \
  44. fi
  45. $(srcdir)/po/doc/%.pot-update: doc/%.texi
  46. $(AM_V_PO4A)$(PO4A_UPDATEPO) -M UTF-8 -f texinfo -m "$<" \
  47. -p "$$(echo $@ | sed 's|-update||')" $(POT_OPTIONS)
  48. @touch "$$(echo $@ | sed 's|-update||')"
  49. TMP_POT_FILES=contributing.pot guix.pot
  50. doc-pot-update:
  51. for f in $(TMP_POT_FILES); do \
  52. $(MAKE) $(srcdir)/po/doc/guix.pot-update; \
  53. $(MAKE) $(srcdir)/po/doc/contributing.pot-update; \
  54. done
  55. msgcat $(addprefix $(srcdir)/po/doc/, $(TMP_POT_FILES)) > $(srcdir)/po/doc/guix-manual.pot
  56. rm -f $(addprefix $(srcdir)/po/doc/, $(TMP_POT_FILES))
  57. doc-po-update: doc-pot-update
  58. for f in $(DOC_PO_FILES); do \
  59. $(MAKE) "$$f"; \
  60. done