From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id ABUvAmfA6WFegAAAgWs5BA (envelope-from ) for ; Thu, 20 Jan 2022 21:04:55 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id qHOtNmbA6WGGGAEAG6o9tA (envelope-from ) for ; Thu, 20 Jan 2022 21:04:54 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4294AB153 for ; Thu, 20 Jan 2022 21:04:54 +0100 (CET) Received: from localhost ([::1]:49852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nAdfx-0000M8-Ac for larch@yhetil.org; Thu, 20 Jan 2022 15:04:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34648) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAY4g-00057Q-GT for guix-patches@gnu.org; Thu, 20 Jan 2022 09:06:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:35772) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nAY4g-00079G-0V for guix-patches@gnu.org; Thu, 20 Jan 2022 09:06:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nAY4f-0004mY-Nx for guix-patches@gnu.org; Thu, 20 Jan 2022 09:06:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#46872] [PATCH] doc: Define canned recipes for creating translated manuals. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 20 Jan 2022 14:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46872 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: 46872@debbugs.gnu.org Received: via spool by 46872-submit@debbugs.gnu.org id=B46872.164268752918344 (code B ref 46872); Thu, 20 Jan 2022 14:06:01 +0000 Received: (at 46872) by debbugs.gnu.org; 20 Jan 2022 14:05:29 +0000 Received: from localhost ([127.0.0.1]:56908 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nAY46-0004lh-76 for submit@debbugs.gnu.org; Thu, 20 Jan 2022 09:05:29 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:49766) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nAY41-0004lO-3L for 46872@debbugs.gnu.org; Thu, 20 Jan 2022 09:05:25 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 720838D4; Thu, 20 Jan 2022 15:05:14 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eUArt3a5I9CR; Thu, 20 Jan 2022 15:05:13 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id B8F3A224; Thu, 20 Jan 2022 15:05:12 +0100 (CET) From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: Date: Thu, 20 Jan 2022 15:05:12 +0100 In-Reply-To: (Maxime Devos's message of "Tue, 02 Mar 2021 14:40:20 +0100") Message-ID: <874k5y8puv.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spamd-Bar: / X-Rspamd-Server: hera X-Rspamd-Queue-Id: 720838D4 X-Spamd-Result: default: False [-0.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/mixed,text/plain,text/x-patch]; RCPT_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1642709094; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post; bh=3SU6TAa2jmkvlavQN4s/TphHwxv9OtNke+JG+lIecfE=; b=ld6JRX4ajEb1Hqwlx7/f6xcR4R76yBMg9L8stE22ceHyzoQrG+ImF5gS9ADFrh8pg8UDeZ AoaI2QimaRQtk5HGlo7RPhTHbcbay1zZgyacBHSk+WaRkQFrMzr73ndXUPdyhzHk2rU9Ns xWB/YXcML77xlYIVmQ3+kih3etLqAya4czcC6/1CkUlcjxuFNcMRExsGGlu1Keun1i4w82 wewFPP0D+ZDvXgg8A5jl+HPOghS1/999OU4l6CuXZPmjJH7D4dznBFKnSRYuFcx+WJvNSW b79aB2G6Bb91TJLSvrzd638Ez/ZnoSWdLRLLmPpu4E8Fdz6idp30cPYCvq5s7A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1642709094; a=rsa-sha256; cv=none; b=cfWFgRZhuxA8YxNuuN5ec1Uid6CkiyZBo4HLmr9HachApiN7uW0yeSEw9V1TKDr3jbY7VY R9kscF/6U+9uB/kO6TaZB0oIPkueBbcxGJCNdbPMSF8NsjOGcWwKU3W9AcnrWB7fdo8yhG p/RotJzD/CFXPJZOjE07uyfSEUMex2PCh1lVOoWu/qInrxGm5t/SkGrPqCMpZzUaCsxwh3 TyoDIwbfm0D4F/kV34EJDg+lZBTf5yu3IKwqEsXks4KO6NN8IEOk3MMBWBSyAlAwLwhZNQ 0lakyRA8k5anwrrJooIoblMTHPT22QE0QHTXRFMo7DQRwgm38Y83Yse49HPMMg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.62 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 4294AB153 X-Spam-Score: -2.62 X-Migadu-Scanner: scn1.migadu.com X-TUID: snXkKASx+ZtR --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Maxime, Maxime Devos skribis: > 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 manua= ls. > MIME-Version: 1.0 > Content-Type: text/plain; charset=3DUTF-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 > =E2=80=98canned recipes=E2=80=99 in the makefile for translating the manu= al > 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. This had fallen through the cracks. I updated it so it applies on current master (see below). However, it doesn=E2=80=99t work as expected: --8<---------------cut here---------------start------------->8--- $ rm -f doc/contributing.fr.texi $ make doc/contributing.fr.texi make: 'doc/contributing.fr.texi' is up to date. $ ls -l doc/contributing.fr.texi ls: ne eblas atingi 'doc/contributing.fr.texi': Dosiero a=C5=AD dosierujo n= e ekzistas --8<---------------cut here---------------end--------------->8--- If I inline the expansion of =E2=80=98translate_chapter_command=E2=80=99, e= verything works as expected. My GNU Make is rusty and fuzzy, but I wonder if we can expand text that includes tabs. I vaguely remember that I=E2=80=99d usually define functions that would expand the whole text: target/prerequisites + commands. WDYT? Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable diff --git a/doc/local.mk b/doc/local.mk index 9619971296..627d27a5ef 100644 --- a/doc/local.mk +++ b/doc/local.mk @@ -5,6 +5,7 @@ # Copyright =C2=A9 2016 Taylan Ulrich Bay=C4=B1rl=C4=B1/Kammer # Copyright =C2=A9 2016, 2018 Mathieu Lirzin # Copyright =C2=A9 2018, 2021 Julien Lepiller +# Copyright =C2=A9 2021 Maxime Devos # # This file is part of GNU Guix. # @@ -111,22 +112,33 @@ $(top_srcdir)/pre-inst-env $(GUILE) --no-auto-compile= \ $@.tmp $< endef =20 +# This canned recipe is used in the rules below to translate a Texinfo man= ual +# 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)LC_ALL=3Den_US.UTF-8 $(xref_command) + -mv "$@.tmp" "$@" +endef + +# 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)LC_ALL=3Den_US.UTF-8 $(xref_command) + -mv "$@.tmp" "$@" +endef + + $(srcdir)/%D%/guix.%.texi: po/doc/guix-manual.%.po $(srcdir)/%D%/contribut= ing.%.texi guix/build/po.go - -$(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" - -$(AM_V_POXREF)LC_ALL=3Den_US.UTF-8 $(xref_command) - -mv "$@.tmp" "$@" + $(call translate_manual_command,guix) =20 $(srcdir)/%D%/guix-cookbook.%.texi: po/doc/guix-cookbook.%.po guix/build/p= o.go - -$(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" - -$(AM_V_POXREF)LC_ALL=3Den_US.UTF-8 $(xref_command) - -mv "$@.tmp" "$@" + $(call translate_manual_command,guix-cookbook) =20 $(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" - -$(AM_V_POXREF)LC_ALL=3Den_US.UTF-8 $(xref_command) - -mv "$@.tmp" "$@" + $(call translate_manual_chapter,contributing) =20 %D%/os-config-%.texi: gnu/system/examples/%.tmpl $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \ --=-=-=--