From patchwork Mon Jan 23 03:32:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 46357 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 CD4B627BBEB; Mon, 23 Jan 2023 03:41:26 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED,URIBL_SBL_A 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 8984D27BBE9 for ; Mon, 23 Jan 2023 03:41:23 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJnhn-0007mU-Op; Sun, 22 Jan 2023 22:41:11 -0500 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 1pJnhk-0007l6-PG for guix-patches@gnu.org; Sun, 22 Jan 2023 22:41:10 -0500 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 1pJnhf-0001HK-EJ for guix-patches@gnu.org; Sun, 22 Jan 2023 22:41:08 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pJnhe-0005H2-Ad for guix-patches@gnu.org; Sun, 22 Jan 2023 22:41:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61015] [PATCH core-updates 8/9] gnu: docbook-xml: Use XSLT to patch catalog.xml. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 23 Jan 2023 03:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61015 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61015@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 61015-submit@debbugs.gnu.org id=B61015.167444522220217 (code B ref 61015); Mon, 23 Jan 2023 03:41:02 +0000 Received: (at 61015) by debbugs.gnu.org; 23 Jan 2023 03:40:22 +0000 Received: from localhost ([127.0.0.1]:52971 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJnh0-0005Fy-7T for submit@debbugs.gnu.org; Sun, 22 Jan 2023 22:40:22 -0500 Received: from smtpmciv8.myservices.hosting ([185.26.106.203]:52420) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJngx-0005Fp-TJ for 61015@debbugs.gnu.org; Sun, 22 Jan 2023 22:40:21 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.172]) by smtpmciv8.myservices.hosting (Postfix) with ESMTP id 1C31620C76 for <61015@debbugs.gnu.org>; Mon, 23 Jan 2023 04:40:18 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id C96EB80096; Mon, 23 Jan 2023 04:40:18 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-1.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id ENDR8Twd3R_e; Mon, 23 Jan 2023 04:40:18 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-118-236.dsl.telepac.pt [85.242.118.236]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 9D53D80093; Mon, 23 Jan 2023 04:40:17 +0100 (CET) From: Bruno Victal Date: Mon, 23 Jan 2023 03:32:54 +0000 Message-Id: <6c949db09590acc43d9af65726a9471240fc0bce.1674443296.git.mirai@makinata.eu> X-Mailer: git-send-email 2.38.1 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 (sxml transforms) are unsuited here due to guile-bug #20339. * gnu/packages/aux-files/xml/patch-uri.xsl: New file. * gnu/packages/docbook.scm (docbook-xml-5) [native-inputs]: Add libxslt. [arguments]: Patch catalog.xml using XSLT. --- gnu/packages/aux-files/xml/patch-uri.xsl | 24 ++++++++++++++++++++++++ gnu/packages/docbook.scm | 13 ++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/aux-files/xml/patch-uri.xsl diff --git a/gnu/packages/aux-files/xml/patch-uri.xsl b/gnu/packages/aux-files/xml/patch-uri.xsl new file mode 100644 index 0000000000..947517476d --- /dev/null +++ b/gnu/packages/aux-files/xml/patch-uri.xsl @@ -0,0 +1,24 @@ + + + + + / + + + + + + + + + + + + + + diff --git a/gnu/packages/docbook.scm b/gnu/packages/docbook.scm index b1743baf5e..ce0b823e3a 100644 --- a/gnu/packages/docbook.scm +++ b/gnu/packages/docbook.scm @@ -8,6 +8,7 @@ ;;; Copyright © 2021 Mark H Weaver ;;; Copyright © 2021 Efraim Flashner ;;; Copyright © 2021 Andrew Whatson +;;; Copyright © 2023 Bruno Victal ;;; ;;; This file is part of GNU Guix. ;;; @@ -71,11 +72,21 @@ (define-public docbook-xml-5 (lambda _ ;; XXX: These files do not need 0755 permission. (for-each (cut chmod <> #o644) (find-files ".")))) + (add-before 'install 'patch-uri + (lambda* (#:key inputs #:allow-other-keys) + (let ((xsltproc (search-input-file inputs "/bin/xsltproc")) + (dtd-path (string-append #$output "/xml/dtd/docbook"))) + (invoke xsltproc "--nonet" "--noout" + "--stringparam" "prefix" dtd-path + "--output" "catalog.xml.new" + #$(local-file (search-auxiliary-file "xml/patch-uri.xsl")) + "catalog.xml") + (rename-file "catalog.xml.new" "catalog.xml")))) (replace 'install (lambda _ (let ((dtd-path (string-append #$output "/xml/dtd/docbook"))) (copy-recursively "." dtd-path))))))) - (native-inputs (list unzip)) + (native-inputs (list libxslt unzip)) (home-page "https://docbook.org") (synopsis "DocBook XML DTDs for document authoring") (description