From patchwork Tue Mar 2 13:40:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: M X-Patchwork-Id: 27410 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 7F2F127BC50; Tue, 2 Mar 2021 13:41:10 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id DEE3E27BC4F for ; Tue, 2 Mar 2021 13:41:09 +0000 (GMT) Received: from localhost ([::1]:57922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lH5Gv-0005k5-1S for patchwork@mira.cbaines.net; Tue, 02 Mar 2021 08:41:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51250) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lH5Go-0005jB-7A for guix-patches@gnu.org; Tue, 02 Mar 2021 08:41:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:40543) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lH5Gn-0003VH-WE for guix-patches@gnu.org; Tue, 02 Mar 2021 08:41:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lH5Gn-0000bW-UX for guix-patches@gnu.org; Tue, 02 Mar 2021 08:41:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#46872] [PATCH] doc: Define canned recipes for creating translated manuals. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 02 Mar 2021 13:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 46872 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 46872@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16146924422288 (code B ref -1); Tue, 02 Mar 2021 13:41:01 +0000 Received: (at submit) by debbugs.gnu.org; 2 Mar 2021 13:40:42 +0000 Received: from localhost ([127.0.0.1]:52089 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lH5GT-0000ap-Lq for submit@debbugs.gnu.org; Tue, 02 Mar 2021 08:40:42 -0500 Received: from lists.gnu.org ([209.51.188.17]:59514) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lH5GQ-0000ah-OH for submit@debbugs.gnu.org; Tue, 02 Mar 2021 08:40:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51160) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lH5GQ-0005iL-H6 for guix-patches@gnu.org; Tue, 02 Mar 2021 08:40:38 -0500 Received: from laurent.telenet-ops.be ([2a02:1800:110:4::f00:19]:60462) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lH5GL-0003N0-SJ for guix-patches@gnu.org; Tue, 02 Mar 2021 08:40:38 -0500 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by laurent.telenet-ops.be with bizsmtp id bRgU2400R0mfAB401RgUQn; Tue, 02 Mar 2021 14:40:29 +0100 Message-ID: From: Maxime Devos Date: Tue, 02 Mar 2021 14:40:20 +0100 User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1614692429; bh=R0yhp+9Oo3l3u2DdC31WwRnm2ZzlVbuvmcHWXZxavUY=; h=Subject:From:To:Date; b=arZ02Ma49V4axG8mNu1ESuBxrbu7Y9ugij8LjtB6FN4bivlN0MQU74G9eaQ2qe0JW x2BbOk4q/c471z9os3sFLl97Jgp3E1+LcJxkMXn51zg3FltqTxAxQ97jY/sJb7hQXf 0sIrkUqNDyRj2yBeGUxT+5lFJ4KM5Ud2Y2LmaoYlPSMLMxp5rhkSz8iUGJ4HKGhZyR wTkEJwfhfX+lgD+1nPbnkKkuzN7iWtm/gKuLtY+M0D9SRI1fm7j8HQ85sALU5M0LQH XrxaJxFn8rdLbYmNlPHgKR+sssXI5Ps7FA2FYm1BDp988d1MhaFk8A36tnwBgj2DQf JxGNqijJcYxww== Received-SPF: pass client-ip=2a02:1800:110:4::f00:19; envelope-from=maximedevos@telenet.be; helo=laurent.telenet-ops.be X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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" X-getmail-retrieved-from-mailbox: Patches Hi Guix, While looking at how to properly include the documentation in the makefile in , I noticed the build recipes for creating $MANUAL.%.texi and $CHAPTER.%.texi are duplicated (modulo $MANUAL and $CHAPTER). This patch should make defining new chapters and manuals in the makefile somewhat simpler and less prone to errors (e.g. avoid copy-paste + oops I forgot to change the .texinfo and .info file name). Greetings, Maxime. From 140504026807af6d4e94154b629edb6c7bdf3c27 Mon Sep 17 00:00:00 2001 From: Maxime Devos Date: Tue, 2 Mar 2021 14:13:59 +0100 Subject: [PATCH] doc: Define canned recipes for creating translated manuals. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is expected that at some point in the future, the manual's source will be split in several files per-chapter. Prevent the build recipes from diverging by defining and using two ‘canned recipes’ in the makefile for translating the manual and individual chapters. * doc/local.mk (guix.%.texi, guix-cookbook.%.texi): move recipe ... (translate_manual_command): ... to here. (contributing.%.texi): move recipe ... (translate_chapter_command): ... to here. --- doc/local.mk | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/doc/local.mk b/doc/local.mk index 97122c737d..fb1a6a2b37 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 Julien Lepiller +# Copyright © 2021 Maxime Devos # # This file is part of GNU Guix. # @@ -109,22 +110,33 @@ cat "$@.tmp" | egrep '@p?x?ref' -A1 | sed 'N;s|--\n||g;P;D' | sed 's|^| |g' | \ done endef -$(srcdir)/%D%/guix.%.texi: po/doc/guix-manual.%.po $(srcdir)/%D%/contributing.%.texi - -$(AM_V_PO4A)$(PO4A_TRANSLATE) $(PO4A_PARAMS) -m "%D%/guix.texi" -p "$<" -l "$@.tmp" - -sed -i "s|guix\.info|$$(basename "$@" | sed 's|texi$$|info|')|" "$@.tmp" +# This canned recipe translates is used in the rules below +# to translate a texinfo manual, using the translations +# in po/doc. The argument $(1) is the name of the untranslated +# manual, without a .texi extension or directory prefixes. +define translate_manual_command + -$(AM_V_PO4A)$(PO4A_TRANSLATE) $(PO4A_PARAMS) -m "%D%/$(1).texi" -p "$<" -l "$@.tmp" + -sed -i "s|$(1)\.info|$$(basename "$@" | sed 's|texi$$|info|')|" "$@.tmp" -$(AM_V_POXREF)$(xref_command) -mv "$@.tmp" "$@" +endef -$(srcdir)/%D%/guix-cookbook.%.texi: po/doc/guix-cookbook.%.po - -$(AM_V_PO4A)$(PO4A_TRANSLATE) $(PO4A_PARAMS) -m "%D%/guix-cookbook.texi" -p "$<" -l "$@.tmp" - -sed -i "s|guix-cookbook\.info|$$(basename "$@" | sed 's|texi$$|info|')|" "$@.tmp" +# Likewise, but for individual chapters (or sections), which do not have +# an info file name to modify. +define translate_chapter_command + -$(AM_V_PO4A)$(PO4A_TRANSLATE) $(PO4A_PARAMS) -m "%D%/$(1).texi" -p "$<" -l "$@.tmp" -$(AM_V_POXREF)$(xref_command) -mv "$@.tmp" "$@" +endef + +$(srcdir)/%D%/guix.%.texi: po/doc/guix-manual.%.po $(srcdir)/%D%/contributing.%.texi + $(call translate_manual_command,guix) + +$(srcdir)/%D%/guix-cookbook.%.texi: po/doc/guix-cookbook.%.po + $(call translate_manual_command,guix-cookbook) $(srcdir)/%D%/contributing.%.texi: po/doc/guix-manual.%.po - -$(AM_V_PO4A)$(PO4A_TRANSLATE) $(PO4A_PARAMS) -m "%D%/contributing.texi" -p "$<" -l "$@.tmp" - -$(AM_V_POXREF)$(xref_command) - -mv "$@.tmp" "$@" + $(call translate_chapter_command,contributing) %D%/os-config-%.texi: gnu/system/examples/%.tmpl $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \ -- 2.30.1