From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id wEXrGDkhIGXm5gAA9RJhRA:P1 (envelope-from ) for ; Fri, 06 Oct 2023 17:01:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id wEXrGDkhIGXm5gAA9RJhRA (envelope-from ) for ; Fri, 06 Oct 2023 17:01:13 +0200 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 E79F04D00F for ; Fri, 6 Oct 2023 17:01:12 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=none; 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"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1696604473; 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: content-transfer-encoding:content-transfer-encoding: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=kExi6hKYmf0IPJhIoXH/8+znVFsk63NMZkq3jmN4Q8A=; b=WWhZ/yCxrX6aRnQZp1ddc+w2mNOZjB33BXql4MOd+Qm5Ft2Wo8gdr1ry/3GnixhcmPQnqp ADGgA9dHCBlN2ARqfv2+tzb8LdjTIuq9Wh9QyfbH5fr/4P9h9eVWmV1O1rvq+FykhPSD1B QzUEFs2M+6lw9dBAvjTS2s2A4gsZeWyE2wiQPA7CnXhucF6XKsz1JmM8PjJcK2Akb3RU9+ FXIr9f7ZxOmOXAaFC/2r9h8Y7E9OJYbgplKZiwluTthyaDE2sfnJDKePOs/WrOA4X/nuMw 0BEVwt6qRm8RyOhIet49lWqtWt0ep7hCel8H2BCDJPHo+MFoOGxPH1w27oT8Yw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1696604473; a=rsa-sha256; cv=none; b=pjduNIYughuq+eLTOP87MULG70oHpMBoCB9Ko5WPl9xVtx9BOm+jS8ZU8nGGJPdmg4S7Wj R+EkqPpOZiNUPxDy+4ebO/tSTnsEhytVc036jdur1CZLRPNHmstD1ixDbOi7KuIokkS97V 0yRrPkcmDGtk2nFe3BMTgj7JUA3lnwy1BJfaDnoFmn7IqpEVYmGW8Mn0Sr5Joj8SxmS6jt diTj/qCwTOdwpL+Cv/h9eSocFP8n8PNRrRfu2QBt3sNuX7xR9R6E7VxK9FKqeDOM6yOskA i7EevvulMxRq1TuR8MzaaV100qIKfaGFD4+njOqobdAB7plWl3AnfglcC9cyag== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; 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"; dmarc=none Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qomJx-0001Pm-J6; Fri, 06 Oct 2023 11:00:53 -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 1qomJo-0001MX-Cz for guix-patches@gnu.org; Fri, 06 Oct 2023 11:00:44 -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 1qomJn-0002Hh-Gj for guix-patches@gnu.org; Fri, 06 Oct 2023 11:00:44 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qomK5-0001bn-VE for guix-patches@gnu.org; Fri, 06 Oct 2023 11:01:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#65479] [PATCH core-updates 17/61] gnu: Add docbook-mathml-1.0. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 06 Oct 2023 15:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65479 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxim Cournoyer Cc: 65479@debbugs.gnu.org Received: via spool by 65479-submit@debbugs.gnu.org id=B65479.16966044066042 (code B ref 65479); Fri, 06 Oct 2023 15:01:01 +0000 Received: (at 65479) by debbugs.gnu.org; 6 Oct 2023 15:00:06 +0000 Received: from localhost ([127.0.0.1]:52388 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qomJC-0001ZO-0p for submit@debbugs.gnu.org; Fri, 06 Oct 2023 11:00:06 -0400 Received: from smtpm3.myservices.hosting ([185.26.105.234]:45140) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qomJ9-0001Yu-5o for 65479@debbugs.gnu.org; Fri, 06 Oct 2023 11:00:04 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm3.myservices.hosting (Postfix) with ESMTP id 07D362108A; Fri, 6 Oct 2023 16:59:41 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 5CE538009E; Fri, 6 Oct 2023 16:59:35 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id fYBZiHawDO7O; Fri, 6 Oct 2023 16:59:34 +0200 (CEST) Received: from [192.168.1.116] (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id A16D48009D; Fri, 6 Oct 2023 16:59:29 +0200 (CEST) Message-ID: <996765ea-6f86-441f-bb9e-710fc1c70f9e@makinata.eu> Date: Fri, 6 Oct 2023 15:59:21 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US References: <3971596b65c5520b349e80cff4e07f67a840131b.1692830149.git.mirai@makinata.eu> <87wmw0linu.fsf@gmail.com> From: Bruno Victal In-Reply-To: <87wmw0linu.fsf@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: -6.23 X-Migadu-Spam-Score: -6.23 X-Migadu-Scanner: mx1.migadu.com X-Migadu-Queue-Id: E79F04D00F X-TUID: 9JdiafQ+91bJ On 2023-10-06 01:05, Maxim Cournoyer wrote: >> + (add-before 'install 'generate-catalog.xml >> + (lambda _ >> + (let ((store-uri (string-append "file://" >> + #$output "/" >> + #$target "dbmathml.dtd"))) >> + (call-with-output-file "catalog.xml" >> + (lambda (port) >> + (sxml->xml >> + `(*TOP* >> + (*PI* xml "version='1.0'") >> + (catalog (@ (xmlns "urn:oasis:names:tc:entity:xmlns:xml:catalog")) >> + (public (@ (publicId "-//OASIS//DTD DocBook MathML Module V1.0//EN") >> + (uri ,store-uri))) > > These lines are > 80 chars. You could bind the public ID and namespace > as variables to keep these lines shorter. Would it perhaps be better to define the SXML catalog instead as a separate procedure/phase and invoke it instead? i.e. --8<---------------cut here---------------start------------->8--- ;; Decouple catalog (define make-dbmath-catalog-sxml #~(lambda* (#:key outputs #:allow-other-keys) (let* ((…something along the lines of (assoc-ref output "out") or (search-input-files outputs "dbmath.dtd")) (uri (string-append "file:/" …))) … SXML representation of catalog…)) (define-public … (add-before 'install 'generate-catalog.xml (lambda* (#:key outputs #:allow-other-keys) (call-with-output-file "catalog.xml" (lambda (port) (sxml->xml (#$make-dbmath-catalog-sxml outputs))))))) ;; alternatively, if this is valid… (define-public (define make-dbmath-catalog-sxml …) (package … (add-before 'install 'generate-catalog.xml (lambda* (#:key outputs #:allow-other-keys) (call-with-output-file "catalog.xml" (lambda (port) (sxml->xml (#$make-dbmath-catalog-sxml outputs))))))) --8<---------------cut here---------------end--------------->8--- Alternatively we could do as you suggest though I think the only thing that's tenable to bind is the namespace. In general, binding public IDs (and other kinds of ID) in XML Catalogs will quickly yield a rabbit hole of bindings: --8<---------------cut here---------------start------------->8--- (let ((namespace …) (public-id-for-entry-X …) (public-id-for-entry-Y …) … … (public-id-for-entry-γ …) …)) --8<---------------cut here---------------end--------------->8--- (can you picture what the SXML representations would look like for something like [1] and [2]?) Note¹: Though it's tempting to use string manipulation to make some sort of parameterizable routine that can `map' and generate the full URIs using only “version” parameters and perhaps other datums I'm skeptical this is even a good idea. The XML Catalog spec says that the URIs do not have to be resolvable or have any specific meaning other than serve as a identifier for some resource. (it could be something totally crazy, as long the document author and tools understand that it represents some kind of external “thing”) > There shouldn't be a trailing '.' in synopses. 'guix lint' should say so. Nice catch! I don't usually run `guix lint' as sometimes it can reindent things with a worse result. I wonder if there's a way to control this behavior. [1]: [2]: ¹ PS: Not really relevant for this series though this question will be important when packaging the namespace-less variant of docbook-xsl and generating proper catalogs for both docbook-xsl and docbook-xsl-nons. -- Furthermore, I consider that nonfree software must be eradicated. Cheers, Bruno.