From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id kJ9II2TToma2HAAAe85BDQ:P1 (envelope-from ) for ; Thu, 25 Jul 2024 22:36:20 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id kJ9II2TToma2HAAAe85BDQ (envelope-from ) for ; Fri, 26 Jul 2024 00:36:20 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=aVvqqbcP; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1721946980; 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: dkim-signature; bh=HCv3jxnrH2oFNsuC6b3f5d9xVqwM1buc9p9ZX6mmkns=; b=HQGh3Xmabo/gzSNg5o5JPGBMdVEOqSyKiGBax+E+vb9+PQ7MTERpCgiCCkhhtnXWLw2w5t uzfpEBHXB6NEzvmjlNsxfR5zEOUgGElP2VGj0oePVyMEsPJBug1+mV/LF/iyP3BrNMEKGn WrhNTZQPoUy3uFXLmY3CMCqEh7kA6wMRl1aFVm5q2TxeeDdKGR8NrJjpejV0vUIoeQgZL7 YE9e4bXEY18cKQ815IKRrrSiC2NuaMFWX9N1QYnu53Nan81ittgoNSdLbCLZll9PY6WNjW qrmrXkWAOTfox6pIiyMyYLPU9K1f1qO0d1SKDL4mmdX409NTohrxGkCiPYCGOg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=aVvqqbcP; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1721946980; a=rsa-sha256; cv=none; b=Asi5lyt9WgI6k9YoKmVo74oSHZ4h8kMUsi9N5/tWnLh8VZ6jIVJfnLGre/Aa2M6X8m3fCs v4SzcWKmabF1v/SyIjz1RUDcGJtVlFIkexKiBmg+aeAPwfJgjv9LylPmxhrNTgPNUmfaIq CisrLeouCOY4FM5QbeM+1/6Ew0tSo1mPLSwMC6a6N1bzb2Z+8HOsNgKF2g0+2TxlFx7dU1 P1z+N/UaK6d5s5IweFjCfipe8k2a/0tnhUlOZMVWlEqX5ELEM/RWdeR2iYkxS6PvKKUWca yD3tkE2d6p9VDXLS0JnlFNOdWk5o6TkA4Uhed8JN0YggkFBJ1RCakKOaYt9MhQ== 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 3D6FD6B0E7 for ; Fri, 26 Jul 2024 00:36:19 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sX743-0007da-R7; Thu, 25 Jul 2024 18:35:59 -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 1sX740-0007cu-LD for bug-guix@gnu.org; Thu, 25 Jul 2024 18:35:57 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sX73y-0004g5-Ij for bug-guix@gnu.org; Thu, 25 Jul 2024 18:35:54 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sX746-0004fJ-9Y for bug-guix@gnu.org; Thu, 25 Jul 2024 18:36:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#72257: Non-English manuals for 1.4.0 are unavailable Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 25 Jul 2024 22:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72257 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: "pelzflorian (Florian Pelz)" Cc: 72257@debbugs.gnu.org, Julien Lepiller Received: via spool by 72257-submit@debbugs.gnu.org id=B72257.172194691317849 (code B ref 72257); Thu, 25 Jul 2024 22:36:02 +0000 Received: (at 72257) by debbugs.gnu.org; 25 Jul 2024 22:35:13 +0000 Received: from localhost ([127.0.0.1]:37984 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sX73J-0004do-0a for submit@debbugs.gnu.org; Thu, 25 Jul 2024 18:35:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34258) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sX73G-0004dW-SV for 72257@debbugs.gnu.org; Thu, 25 Jul 2024 18:35:11 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sX70v-00037L-8S; Thu, 25 Jul 2024 18:32:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=HCv3jxnrH2oFNsuC6b3f5d9xVqwM1buc9p9ZX6mmkns=; b=aVvqqbcP5Ykbud7P2xhr oczvorSDx4Z7+/YboV/njZUIlS3W1J8Y+HwkK/40cY35CkZrhboJ0weGeV4UAIXODtZLhlbhJPrMz /Bb0WigFIQ2ZXoIh7RxIlsK1X3W1mgwcrlo6XyLN3I8NjwNyC0LciubLZ/y1Vqdtbx9U+wgnt5kR+ xarBHNf8jayp2hE1Ui2wx0SSnTqNYDZM1e/uJjOsjpuxl3SqBnVOgqzqFTJcXCq5XKKJaGcRbNp45 /Aa3+vqWys2f4Txlk7oUzhmNPQfIgbsMhNqhb9CqlukuMRDYViLEkQ/e1yMH1Kfz5Djl1eAYKRbA5 SXGYwIq5UqMnYQ==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= In-Reply-To: <877cdbaur6.fsf@pelzflorian.de> (pelzflorian@pelzflorian.de's message of "Wed, 24 Jul 2024 13:34:37 +0200") References: <877cdcgopp.fsf@inria.fr> <87plr4f86g.fsf@gnu.org> <871q3jrtq8.fsf@pelzflorian.de> <877cdbaur6.fsf@pelzflorian.de> Date: Fri, 26 Jul 2024 00:32:41 +0200 Message-ID: <87r0bhcdbq.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: 3D6FD6B0E7 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -6.32 X-Spam-Score: -6.32 X-TUID: GBZomp3bEP2x --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, "pelzflorian (Florian Pelz)" skribis: > "pelzflorian (Florian Pelz)" writes: >> The old manual as referred to in maintenance.git in >> hydra/modules/sysadmin/web.scm was expected to build with the >> guix/self.scm of old guix.git; it should not try to use po4a.cfg. > > The issue seems to be, maintenance.git in hydra/modules/sysadmin/web.scm > uses old guix 1.4.0=E2=80=99s doc/build.scm, but it imports the (guix sel= f) > module by @@ from the new guix, which expects po4a.cfg. > > Can we make it @@ the modules from old guix 1.4.0? Alternatively, could we use (@ (guix self) translate-texi-manuals) as it existed in Guix commit 5f86eebd240958001ab4f178005f355d24d9b7f1 by simply copying it to =E2=80=98doc/build.scm=E2=80=99 on the =E2=80=98versio= n-1.4.0=E2=80=99 branch? That seems simpler and more orthogonal to me than special-casing (sysadmin web). Patch below. WDYT? Ludo=E2=80=99. PS: I=E2=80=99ll be away from keyboard in the coming days so feel free to p= ush to =E2=80=98version-1.4.0=E2=80=99 if it looks good to you. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable diff --git a/doc/build.scm b/doc/build.scm index 0a5bddbcb6..345909bd57 100644 --- a/doc/build.scm +++ b/doc/build.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright =C2=A9 2019-2023 Ludovic Court=C3=A8s +;;; Copyright =C2=A9 2019-2024 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2020 Bj=C3=B6rn H=C3=B6fling ;;; Copyright =C2=A9 2022 Maxim Cournoyer ;;; @@ -34,6 +34,7 @@ (guix profiles) (guix utils) (git) + (gnu packages) (gnu packages base) (gnu packages compression) (gnu packages gawk) @@ -52,8 +53,116 @@ (define file-append* (@@ (guix self) file-append*)) =20 -(define translated-texi-manuals - (@@ (guix self) translate-texi-manuals)) +(define (translated-texi-manuals source) + "Return the translated texinfo manuals built from SOURCE." + (define po4a + (specification->package "po4a")) + + (define gettext-minimal + (specification->package "gettext-minimal")) + + (define documentation + (file-append* source "doc")) + + (define documentation-po + (file-append* source "po/doc")) + + (define build + (with-imported-modules '((guix build utils) (guix build po)) + #~(begin + (use-modules (guix build utils) (guix build po) + (ice-9 match) (ice-9 regex) (ice-9 textual-ports) + (ice-9 vlist) (ice-9 threads) + (srfi srfi-1)) + + (define (translate-tmp-texi po source output) + "Translate Texinfo file SOURCE using messages from PO, and wri= te +the result to OUTPUT." + (invoke #+(file-append po4a "/bin/po4a-translate") + "-M" "UTF-8" "-L" "UTF-8" "-k" "0" "-f" "texinfo" + "-m" source "-p" po "-l" output)) + + (define (canonicalize-whitespace str) + ;; Change whitespace (newlines, etc.) in STR to #\space. + (string-map (lambda (chr) + (if (char-set-contains? char-set:whitespace chr) + #\space + chr)) + str)) + + (define* (translate-texi prefix po lang + #:key (extras '())) + "Translate the manual for one language LANG using the PO file. +PREFIX must be the prefix of the manual, 'guix' or 'guix-cookbook'. EXTRA= S is +a list of extra files, such as '(\"contributing\")." + (for-each (lambda (file) + (translate-tmp-texi po (string-append file ".texi") + (string-append file "." lang + ".texi.tmp"))) + (cons prefix extras)) + + (for-each (lambda (file) + (let* ((texi (string-append file "." lang ".texi")) + (tmp (string-append texi ".tmp"))) + (copy-file tmp texi) + (translate-cross-references texi po))) + (cons prefix extras))) + + (define (available-translations directory domain) + ;; Return the list of available translations under DIRECTORY f= or + ;; DOMAIN, a gettext domain such as "guix-manual". The result= is + ;; a list of language/PO file pairs. + (filter-map (lambda (po) + (let ((base (basename po))) + (and (string-prefix? (string-append domain ".") + base) + (match (string-split base #\.) + ((_ ... lang "po") + (cons lang po)))))) + (find-files directory + "\\.[a-z]{2}(_[A-Z]{2})?\\.po$"))) + + (define parallel-jobs + ;; Limit thread creation by 'n-par-for-each', mostly to put an + ;; upper bound on memory usage. + (min (parallel-job-count) 4)) + + (mkdir #$output) + (copy-recursively #$documentation "." + #:log (%make-void-port "w")) + + (for-each + (lambda (file) + (copy-file file (basename file))) + (find-files #$documentation-po ".*.po$")) + + (setenv "GUIX_LOCPATH" + #+(file-append glibc-utf8-locales "/lib/locale")) + (setenv "PATH" #+(file-append gettext-minimal "/bin")) + (setenv "LC_ALL" "en_US.UTF-8") + (setlocale LC_ALL "en_US.UTF-8") + + (n-par-for-each parallel-jobs + (match-lambda + ((language . po) + (translate-texi "guix" po language + #:extras '("contributing")))) + (available-translations "." "guix-manual")) + + (n-par-for-each parallel-jobs + (match-lambda + ((language . po) + (translate-texi "guix-cookbook" po language))) + (available-translations "." "guix-cookbook")) + + (for-each (lambda (file) + (install-file file #$output)) + (append + (find-files "." "contributing\\..*\\.texi$") + (find-files "." "guix\\..*\\.texi$") + (find-files "." "guix-cookbook\\..*\\.texi$")))))) + + (computed-file "guix-translated-texinfo" build)) =20 (define info-manual (@@ (guix self) info-manual)) --=-=-=--