From patchwork Sat May 13 10:36:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: gemmaro X-Patchwork-Id: 49986 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 72A5527BBE2; Sat, 13 May 2023 11:38:28 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 783AC27BBEE for ; Sat, 13 May 2023 11:38:25 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pxmda-0008O4-PH; Sat, 13 May 2023 06:38:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pxmdZ-0008Md-2I for guix-patches@gnu.org; Sat, 13 May 2023 06:38:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pxmdY-0001VY-Pl for guix-patches@gnu.org; Sat, 13 May 2023 06:38:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pxmdW-00054D-SS; Sat, 13 May 2023 06:38:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63483] [PATCH 2/4] build: Update po4a process for Makefiles. Resent-From: gemmaro Original-Sender: "Debbugs-submit" Resent-CC: pelzflorian@pelzflorian.de, julien@lepiller.eu, guix-patches@gnu.org Resent-Date: Sat, 13 May 2023 10:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63483 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63483@debbugs.gnu.org Cc: gemmaro , Florian Pelz , Julien Lepiller X-Debbugs-Original-Xcc: Florian Pelz , Julien Lepiller Received: via spool by 63483-submit@debbugs.gnu.org id=B63483.168397423519399 (code B ref 63483); Sat, 13 May 2023 10:38:02 +0000 Received: (at 63483) by debbugs.gnu.org; 13 May 2023 10:37:15 +0000 Received: from localhost ([127.0.0.1]:36055 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxmck-00052j-6U for submit@debbugs.gnu.org; Sat, 13 May 2023 06:37:15 -0400 Received: from mail-pl1-f170.google.com ([209.85.214.170]:54782) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxmch-00052B-4O for 63483@debbugs.gnu.org; Sat, 13 May 2023 06:37:12 -0400 Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-1ab13da70a3so105078545ad.1 for <63483@debbugs.gnu.org>; Sat, 13 May 2023 03:37:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683974225; x=1686566225; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=v7s18vUnpIxW6b1W0EKqsUc3DUTo030BipSRr0f2pDQ=; b=BpDCCVGALsr7AjcgSOwA00Z2S2egx7voI/vRuN0Nj3RsG6ndje/s6K4sXpgKPARbE5 OQBTrBUGEA9QjYNuYwoqXFIhbBTnnwaKGN5c2uy/3kkADmR2QPajpzoT80BAsKurgO6U A3voGdySo4ypjKF7TRpB9ki9Kk8934n8UdobgRURdn9H4PGfff/Zlc9g5W+vpXxaDlNr xIYRH7tgL8ZLd1VkzwPQvUdqtYJ8i444YV4eiXc9mUd2Pu3ruWNZ2dq7aoye0FrYCvMK nbwMyTpglCnVEkBzwEmc6XGVxZNmOw9LuN9o6e5rWqyaT5XsZ00KwumH+KCYYXziPraT 8dtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683974225; x=1686566225; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=v7s18vUnpIxW6b1W0EKqsUc3DUTo030BipSRr0f2pDQ=; b=TqphbN4ODYbuSLhFp2ZMmlYzADU5/wDeAe2CDqkAeKS0+Xtap34p8jwQ6U3Q3uHrPI VYgzOwfCxt4fhNffWmCsuyn9KhaUannQub2cKW7MRzqAo9kaJEgbyEBIZ84hBn9xSxtg 6+aEOhCk8By/euHZWjKWKZbv3kBm3YjltlxHFc94bDxGl/8KNH6YlZsA97ZA/oDdGNb/ C+zLza7j8m1WbF7UQzvJOn1sV+KZ4qwH+wAG+XjWGtmwdzTv/PIn+Ek9zDfhaZqFfjxL U+Wc/Yxawt8ViqSXDsqfu3XRbFbxGWzDtkxnaVuoBwtsmKXsfWyZHpmJubJC5ETdq2wa ESAg== X-Gm-Message-State: AC+VfDw9ejevWuMMWp80/BMs0wwjZ3l+uDRIPXsRGDWkWUN0KwMZtYeG ayzo4zh068ZJAYhWYrpkKE3IXN/FIUO4Wg== X-Google-Smtp-Source: ACHHUZ610ZeeI6/CCgOsZKoecseFaKAsFyy/Z1n+a4UFDmg+MIWGWt9nq8HvtnU4za5sRV/Ssy0zuQ== X-Received: by 2002:a17:902:c14b:b0:1aa:fdab:24a5 with SMTP id 11-20020a170902c14b00b001aafdab24a5mr7282911plj.10.1683974225347; Sat, 13 May 2023 03:37:05 -0700 (PDT) Received: from mac.gemmaro.name ([240f:74:d1f0:1:ba1:e787:c9e:b1dc]) by smtp.gmail.com with ESMTPSA id 3-20020a170902c10300b001aaed524541sm9483236pli.227.2023.05.13.03.37.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 May 2023 03:37:04 -0700 (PDT) From: gemmaro Date: Sat, 13 May 2023 19:36:14 +0900 Message-Id: <82eab96fe2d17ab13beea1bdcd8aea8a3d1e325c.1683969802.git.gemmaro.dev@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches --- po4a adds deprecation warnings for po4a-updatepo and po4a-translate as of version 0.68[1]. Since po4a supports split mode[2] for POT files, intermediate POT files po/doc/guix.pot and po/doc/contributing.pot are no longer generated. Note that the po4a option translate-only can't be used here, because po4a doesn't support it in this split mode. In the po4a.cfg file, the destdir option is used to override it with the po4a command line flag, which is needed by the translate-texi-manuals function in guix/self.scm (see also third patch). [1] mquinson/po4a: The High Hopes release https://github.com/mquinson/po4a/releases/tag/v0.68 [2] po4a(1): Centralized or split PO files? https://po4a.org/man/man1/po4a.1.php configure.ac | 3 +-- doc/local.mk | 67 ++++++++++++++++++++++++++++--------------------- po/doc/local.mk | 49 +++++++++++++++--------------------- po/doc/po4a.cfg | 42 +++++++++++++++++++++++++++++++ 4 files changed, 101 insertions(+), 60 deletions(-) create mode 100644 po/doc/po4a.cfg diff --git a/configure.ac b/configure.ac index 92dede80141..a9488967c3f 100644 --- a/configure.ac +++ b/configure.ac @@ -255,8 +255,7 @@ dnl Manual pages. AM_MISSING_PROG([HELP2MAN], [help2man]) dnl Documentation translation. -AM_MISSING_PROG([PO4A_TRANSLATE], [po4a-translate]) -AM_MISSING_PROG([PO4A_UPDATEPO], [po4a-updatepo]) +AM_MISSING_PROG([PO4A], [po4a]) case "$storedir" in /gnu/store) diff --git a/doc/local.mk b/doc/local.mk index 89285b9f35a..68e518a4933 100644 --- a/doc/local.mk +++ b/doc/local.mk @@ -5,6 +5,7 @@ # Copyright © 2016 Taylan Ulrich Bayırlı/Kammer # Copyright © 2016, 2018 Mathieu Lirzin # Copyright © 2018, 2021 Julien Lepiller +# Copyright © 2023 gemmaro # # This file is part of GNU Guix. # @@ -21,32 +22,43 @@ # You should have received a copy of the GNU General Public License # along with GNU Guix. If not, see . -# If adding a language, update the following variables, and info_TEXINFOS. -MANUAL_LANGUAGES = de es fr pt_BR ru zh_CN -COOKBOOK_LANGUAGES = de fr ko sk +info_TEXINFOS = \ + %D%/guix.texi \ + %D%/guix-cookbook.texi \ + $(TRANSLATED_INFO_TEXINFOS) -# Arg1: A list of languages codes. -# Arg2: The file name stem. -lang_to_texinfo = $(foreach lang,$(1),%D%/$(2).$(lang).texi) +%C%_guix_TEXINFOS = \ + %D%/contributing.texi \ + $(TRANSLATED_GUIX_TEXINFOS) \ + %D%/fdl-1.3.texi +# If adding a language, update the following and po4a_langs section in +# po/doc/po4a.cfg. And if the file name is guix.xx.texi, also update +# TRANSLATED_GUIX_TEXINFOS. +# # Automake does not understand GNU Make non-standard extensions, -# unfortunately, so we cannot use the above patsubst-based function here. -info_TEXINFOS = %D%/guix.texi \ +# unfortunately, so we cannot use the patsubst-based function here. +TRANSLATED_INFO_TEXINFOS = \ %D%/guix.de.texi \ %D%/guix.es.texi \ %D%/guix.fr.texi \ %D%/guix.pt_BR.texi \ %D%/guix.ru.texi \ %D%/guix.zh_CN.texi \ - %D%/guix-cookbook.texi \ %D%/guix-cookbook.de.texi \ %D%/guix-cookbook.fr.texi \ %D%/guix-cookbook.ko.texi \ %D%/guix-cookbook.sk.texi -%C%_guix_TEXINFOS = \ - %D%/contributing.texi \ - %D%/fdl-1.3.texi +TRANSLATED_GUIX_TEXINFOS = \ + %D%/contributing.de.texi \ + %D%/contributing.es.texi \ + %D%/contributing.fr.texi \ + %D%/contributing.pt_BR.texi \ + %D%/contributing.ru.texi \ + %D%/contributing.zh_CN.texi + +TRANSLATED_INFO = $(TRANSLATED_INFO_TEXINFOS) $(TRANSLATED_GUIX_TEXINFOS) DOT_FILES = \ %D%/images/bootstrap-graph.dot \ @@ -76,19 +88,13 @@ OS_CONFIG_EXAMPLES_TEXI = \ %D%/os-config-lightweight-desktop.texi \ %D%/he-config-bare-bones.scm -TRANSLATED_INFO = \ - $(call lang_to_texinfo,$(MANUAL_LANGUAGES),guix) \ - $(call lang_to_texinfo,$(MANUAL_LANGUAGES),contributing) \ - $(call lang_to_texinfo,$(COOKBOOK_LANGUAGES),guix-cookbook) - # Bundle this file so that makeinfo finds it in out-of-source-tree builds. BUILT_SOURCES += $(OS_CONFIG_EXAMPLES_TEXI) $(TRANSLATED_INFO) EXTRA_DIST += $(OS_CONFIG_EXAMPLES_TEXI) $(TRANSLATED_INFO) MAINTAINERCLEANFILES = $(OS_CONFIG_EXAMPLES_TEXI) $(TRANSLATED_INFO) -PO4A_PARAMS := -M UTF-8 -L UTF-8 #master and localized encoding -PO4A_PARAMS += -k 0 # produce an output even if the translation is not complete -PO4A_PARAMS += -f texinfo # texinfo format +$(foreach texi,$(TRANSLATED_INFO),$(texi).tmp) &: $(DOC_PO_FILES) + -$(AM_V_PO4A)$(PO4A) --no-update $(srcdir)/po/doc/po4a.cfg # When a change to guix.texi occurs, it is not translated immediately. # Because @pxref and @xref commands are references to sections by name, they @@ -101,22 +107,25 @@ $(top_srcdir)/pre-inst-env $(GUILE) --no-auto-compile \ $@.tmp $< endef -$(srcdir)/%D%/guix.%.texi: po/doc/guix-manual.%.po $(srcdir)/%D%/contributing.%.texi guix/build/po.go - -$(AM_V_PO4A)$(PO4A_TRANSLATE) $(PO4A_PARAMS) -m "%D%/guix.texi" -p "$<" -l "$@.tmp" +$(srcdir)/%D%/guix.%.texi: po/doc/guix-manual.%.po \ + $(srcdir)/%D%/guix.%.texi.tmp \ + guix/build/po.go -sed -i "s|guix\.info|$$(basename "$@" | sed 's|texi$$|info|')|" "$@.tmp" -$(AM_V_POXREF)LC_ALL=en_US.UTF-8 $(xref_command) - -mv "$@.tmp" "$@" + -cp "$@.tmp" "$@" -$(srcdir)/%D%/guix-cookbook.%.texi: po/doc/guix-cookbook.%.po guix/build/po.go - -$(AM_V_PO4A)$(PO4A_TRANSLATE) $(PO4A_PARAMS) -m "%D%/guix-cookbook.texi" -p "$<" -l "$@.tmp" +$(srcdir)/%D%/guix-cookbook.%.texi: po/doc/guix-cookbook.%.po \ + $(srcdir)/%D%/guix-cookbook.%.texi.tmp \ + guix/build/po.go -sed -i "s|guix-cookbook\.info|$$(basename "$@" | sed 's|texi$$|info|')|" "$@.tmp" -$(AM_V_POXREF)LC_ALL=en_US.UTF-8 $(xref_command) - -mv "$@.tmp" "$@" + -cp "$@.tmp" "$@" -$(srcdir)/%D%/contributing.%.texi: po/doc/guix-manual.%.po guix/build/po.go - -$(AM_V_PO4A)$(PO4A_TRANSLATE) $(PO4A_PARAMS) -m "%D%/contributing.texi" -p "$<" -l "$@.tmp" +$(srcdir)/%D%/contributing.%.texi: po/doc/guix-manual.%.po \ + $(srcdir)/%D%/contributing.%.texi.tmp \ + guix/build/po.go -$(AM_V_POXREF)LC_ALL=en_US.UTF-8 $(xref_command) - -mv "$@.tmp" "$@" + -cp "$@.tmp" "$@" %D%/os-config-%.texi: gnu/system/examples/%.tmpl $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \ diff --git a/po/doc/local.mk b/po/doc/local.mk index 49258cbb97c..eacd7d8c922 100644 --- a/po/doc/local.mk +++ b/po/doc/local.mk @@ -1,6 +1,7 @@ # GNU Guix --- Functional package management for GNU # Copyright © 2018 Julien Lepiller # Copyright © 2021 Maxim Cournoyer +# Copyright © 2023 gemmaro # # This file is part of GNU Guix. # @@ -17,38 +18,28 @@ # You should have received a copy of the GNU General Public License # along with GNU Guix. If not, see . -DOC_PO_FILES = \ - %D%/guix-manual.de.po \ - %D%/guix-manual.es.po \ - %D%/guix-manual.fr.po \ - %D%/guix-manual.pt_BR.po \ - %D%/guix-manual.ru.po \ - %D%/guix-manual.zh_CN.po +DOC_POT_FILES = %D%/guix-manual.pot %D%/guix-cookbook.pot -DOC_COOKBOOK_PO_FILES = \ - %D%/guix-cookbook.de.po \ - %D%/guix-cookbook.fr.po \ - %D%/guix-cookbook.ko.po \ +DOC_PO_FILES = \ + %D%/guix-manual.de.po \ + %D%/guix-manual.es.po \ + %D%/guix-manual.fr.po \ + %D%/guix-manual.pt_BR.po \ + %D%/guix-manual.ru.po \ + %D%/guix-manual.zh_CN.po \ + %D%/guix-cookbook.de.po \ + %D%/guix-cookbook.fr.po \ + %D%/guix-cookbook.ko.po \ %D%/guix-cookbook.sk.po -EXTRA_DIST = \ - %D%/guix-manual.pot \ - %D%/guix-cookbook.pot \ - $(DOC_PO_FILES) \ - $(DOC_COOKBOOK_PO_FILES) +EXTRA_DIST = $(DOC_POT_FILES) $(DOC_PO_FILES) -POT_OPTIONS = \ - --package-name "guix manual" --package-version "$(VERSION)" \ - --copyright-holder "the authors of Guix (msgids)" \ - --msgid-bugs-address "bug-guix@gnu.org" +$(DOC_POT_FILES) &: $(srcdir)/doc/guix.texi \ + $(srcdir)/doc/guix-cookbook.texi \ + $(srcdir)/doc/contributing.texi + $(AM_V_PO4A)$(PO4A) --no-translations \ + --package-version "$(VERSION)" \ + %D%/po4a.cfg -%D%/%.pot: $(srcdir)/doc/%.texi - $(AM_V_PO4A)$(PO4A_UPDATEPO) -M UTF-8 -f texinfo -m "$<" \ - -p "$@" $(POT_OPTIONS) && \ - touch $@ - -%D%/guix-manual.pot: %D%/guix.pot %D%/contributing.pot - msgcat $^ > $@ - -doc-pot-update: %D%/guix-manual.pot %D%/guix-cookbook.pot +doc-pot-update: $(DOC_POT_FILES) .PHONY: doc-pot-update diff --git a/po/doc/po4a.cfg b/po/doc/po4a.cfg new file mode 100644 index 00000000000..27a7599d9aa --- /dev/null +++ b/po/doc/po4a.cfg @@ -0,0 +1,42 @@ +# GNU Guix --- Functional package management for GNU +# Copyright © 2023 gemmaro +# +# This file is part of GNU Guix. +# +# GNU Guix is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or (at +# your option) any later version. +# +# GNU Guix is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Guix. If not, see . + +# --keep 0: produce an output even if the translation is not complete +[options] --package-name "guix manual" \ + --copyright-holder "the authors of Guix (msgids)" \ + --msgid-bugs-address "bug-guix@gnu.org" \ + --keep 0 \ + --master-charset=UTF-8 \ + --localized-charset=UTF-8 \ + --destdir=doc + +[po4a_langs] de es fr pt_BR ru zh_CN ko sk + +[po4a_paths] po/doc/$master.pot $lang:po/doc/$master.$lang.po + +[type:texinfo] doc/guix-cookbook.texi \ + $lang:guix-cookbook.$lang.texi.tmp \ + pot=guix-cookbook + +[type:texinfo] doc/guix.texi \ + $lang:guix.$lang.texi.tmp \ + pot=guix-manual + +[type:texinfo] doc/contributing.texi \ + $lang:contributing.$lang.texi.tmp \ + pot=guix-manual