From patchwork Wed Apr 26 00:56:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 49524 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 B793427BBE2; Wed, 26 Apr 2023 02:16:23 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED 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 F34BE175BB for ; Wed, 26 Apr 2023 02:16:20 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prTlN-0003A0-De; Tue, 25 Apr 2023 21:16:05 -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 1prTlK-0002zE-RK for guix-patches@gnu.org; Tue, 25 Apr 2023 21:16:02 -0400 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 1prTlK-00050u-D4 for guix-patches@gnu.org; Tue, 25 Apr 2023 21:16:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1prTlJ-000247-Ql for guix-patches@gnu.org; Tue, 25 Apr 2023 21:16:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63081] [PATCH 1/8] gnu: docbook-xml: Fix installation paths. References: In-Reply-To: Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 26 Apr 2023 01:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63081 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63081@debbugs.gnu.org Cc: andreas@enge.fr, Bruno Victal , maxim.cournoyer@gmail.com Received: via spool by 63081-submit@debbugs.gnu.org id=B63081.16824717577929 (code B ref 63081); Wed, 26 Apr 2023 01:16:01 +0000 Received: (at 63081) by debbugs.gnu.org; 26 Apr 2023 01:15:57 +0000 Received: from localhost ([127.0.0.1]:53863 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prTlE-00023o-Ou for submit@debbugs.gnu.org; Tue, 25 Apr 2023 21:15:57 -0400 Received: from smtpmciv4.myservices.hosting ([185.26.107.240]:50846) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prTlB-00023e-Fp for 63081@debbugs.gnu.org; Tue, 25 Apr 2023 21:15:55 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv4.myservices.hosting (Postfix) with ESMTP id C5A1621EB1; Wed, 26 Apr 2023 03:15:51 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id BF25D80098; Wed, 26 Apr 2023 02:57:05 +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 jV6A8x5XKsNC; Wed, 26 Apr 2023 02:57:04 +0200 (CEST) Received: from guix-nuc.home.arpa (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 7D4B380097; Wed, 26 Apr 2023 02:57:04 +0200 (CEST) From: Bruno Victal Date: Wed, 26 Apr 2023 01:56:53 +0100 Message-Id: X-Mailer: git-send-email 2.39.2 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 Using xml/dtd/docbook as installation path had two problems: * The paths would conflict in profile, which made it impossible for two different docbook-xml packages to coexist within the XML_CATALOG_FILES variable. * It was technically incorrect since non-DTD schemas were also placed here. This commit makes docbook-xml use versioned paths instead. * gnu/packages/docbook.scm (docbook-xml-package, docbook-xml-4.x-package): New procedure. (docbook-xml): Make docbook-xml an alias for docbook-xml-5.1. (docbook-xml-5.1): New variable. (docbook-xml-4.5, docbook-xml-4.4, docbook-xml-4.3, docbook-xml-4.2) (docbook-xml-4.1.2): Refactor to use docbook-xml-4.x-package procedure. --- gnu/packages/docbook.scm | 265 ++++++++++++++++++++++++--------------- 1 file changed, 163 insertions(+), 102 deletions(-) base-commit: 8093c6ba21c51efe901ba98ce698c545bf13dcd0 diff --git a/gnu/packages/docbook.scm b/gnu/packages/docbook.scm index 070b957339..73a14855b9 100644 --- a/gnu/packages/docbook.scm +++ b/gnu/packages/docbook.scm @@ -50,17 +50,17 @@ (define-module (gnu packages docbook) #:use-module (guix build-system trivial) #:use-module (guix build-system python)) -(define-public docbook-xml +;; The fetch-plan, install-plan and phases for docbook-xml tend to vary +;; between releases therefore we use a “template” package for the +;; transformations that are common to these packages. +(define* (docbook-xml-package source version) + "Return a package for a docbook-xml package version @var{version} and +downloading from @var{source}, where @var{version} is a string and +@var{source} is a @code{} record." (package (name "docbook-xml") - (version "5.1") - (source (origin - (method url-fetch) - (uri (string-append "https://docbook.org/xml/" version - "/docbook-v" version "-os.zip")) - (sha256 - (base32 - "0zqy9prj9wam9dn7v3mgr7ld1axqxdhgrmv06dviwg00ahv43wxk")))) + (version version) + (source source) (build-system copy-build-system) (arguments (list @@ -71,23 +71,27 @@ (define-public docbook-xml #~(modify-phases %standard-phases (add-after 'unpack 'fix-permissions (lambda _ - ;; XXX: These files do not need 0755 permission. + ;; These files do not need 0755 permission. (for-each (cut chmod <> #o644) (find-files ".")))) (add-before 'install 'patch-catalog-xml (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-catalog-xml.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))))))) + (xslt-file #$(local-file + (search-auxiliary-file + "xml/patch-catalog-xml.xsl"))) + ;; Avoid profile conflicts by installing to a + ;; versioned path. + (dest-path + (format #f "~a/xml/docbook/~a" #$output #$version))) + (for-each + (lambda (catalog) + (let ((catalog* (string-append catalog ".new"))) + (invoke xsltproc "--nonet" "--novalid" "--noout" + "--stringparam" "prefix" dest-path + "--output" catalog* + xslt-file catalog) + (rename-file catalog* catalog))) + (find-files "." "catalog\\.xml$")))))))) (native-inputs (list libxslt unzip)) (home-page "https://docbook.org") (synopsis "DocBook XML DTDs for document authoring") @@ -97,95 +101,152 @@ (define-public docbook-xml by no means limited to these applications.) This package provides XML DTDs.") (license (license:x11-style "" "See file headers.")))) +(define-public docbook-xml-5.1 + (let* ((version "5.1") + (source (origin + (method url-fetch/zipbomb) + (uri (string-append "https://docbook.org/xml/" version + "/docbook-v" version "-os.zip")) + (sha256 + (base32 + "0zqy9prj9wam9dn7v3mgr7ld1axqxdhgrmv06dviwg00ahv43wxk")))) + (template (docbook-xml-package source version))) + (package + (inherit template) + (arguments + (let ((dest-dir (format #f "xml/docbook/~a/" version))) + (substitute-keyword-arguments (package-arguments template) + ;; XXX: A default value must be provided otherwise this + ;; substitution has no effect. + ((#:install-plan _ #f) + #~`(("schemas/" #$dest-dir))))))))) +;; XXX: docbook-xml-4.x versions use the same #:install-plan but since the +;; paths are versioned we can't use (inherit …). +(define* (docbook-xml-4.x-package source version) + "Return a template for a docbook-xml-4.x package version @var{version} and +downloading from @var{source}, where @var{version} is a string and +@var{source} is a @code{} record." + (let ((base-template (docbook-xml-package source version))) + (package + (inherit base-template) + (arguments + (let* ((dest-dir (format #f "xml/docbook/~a/" version))) + (substitute-keyword-arguments (package-arguments base-template) + ((#:phases phases) + ;; Some programs, such as kdoctools, instead of using + ;; XML_CATALOG_FILES, prefer to use cmake to locate + ;; the DTDs for docbook-xml-4.x packages but + ;; since there's no agreed standard as to where these files + ;; should be placed, in practice the .cmake files + ;; end up searching for paths that are distribution specific. + #~(modify-phases #$phases + (add-after 'install 'symlink-alternate-path + (lambda _ + ;; kdoctools searches under xml/dtd/docbook/ + ;; which is the convention used by Nix. + (mkdir-p (string-append #$output "/xml/dtd")) + (symlink (string-append #$output "/" #$dest-dir) + (string-append #$output "/xml/dtd/docbook")))))) + ((#:install-plan _ #f) + #~`(("./" #$dest-dir + #:exclude-regexp ("ChangeLog$" + "README$" + "docbook\\.cat$" + "\\.txt$")))))))))) + (define-public docbook-xml-4.5 - (package - (inherit docbook-xml) - (version "4.5") - (source (origin - (method url-fetch/zipbomb) - (uri (string-append "https://docbook.org/xml/" version - "/docbook-xml-" version ".zip")) - (sha256 - (base32 - "1d671lcjckjri28xfbf6dq7y3xnkppa910w1jin8rjc35dx06kjf")))))) + (let* ((version "4.5") + (source (origin + (method url-fetch/zipbomb) + (uri (string-append "https://docbook.org/xml/" version + "/docbook-xml-" version ".zip")) + (sha256 + (base32 + "1d671lcjckjri28xfbf6dq7y3xnkppa910w1jin8rjc35dx06kjf"))))) + (docbook-xml-4.x-package source version))) (define-public docbook-xml-4.4 - (package (inherit docbook-xml) - (version "4.4") - (source (origin - (method url-fetch/zipbomb) - (uri (string-append "https://docbook.org/xml/" version - "/docbook-xml-" version ".zip")) - (sha256 - (base32 - "141h4zsyc71sfi2zzd89v4bb4qqq9ca1ri9ix2als9f4i3mmkw82")))))) + (let* ((version "4.4") + (source (origin + (method url-fetch/zipbomb) + (uri (string-append "https://docbook.org/xml/" version + "/docbook-xml-" version ".zip")) + (sha256 + (base32 + "141h4zsyc71sfi2zzd89v4bb4qqq9ca1ri9ix2als9f4i3mmkw82"))))) + (docbook-xml-4.x-package source version))) (define-public docbook-xml-4.3 - (package (inherit docbook-xml) - (version "4.3") - (source (origin - (method url-fetch/zipbomb) - (uri (string-append "https://docbook.org/xml/" version - "/docbook-xml-" version ".zip")) - (sha256 - (base32 - "0r1l2if1z4wm2v664sqdizm4gak6db1kx9y50jq89m3gxaa8l1i3")))))) + (let* ((version "4.3") + (source (origin + (method url-fetch/zipbomb) + (uri (string-append "https://docbook.org/xml/" version + "/docbook-xml-" version ".zip")) + (sha256 + (base32 + "0r1l2if1z4wm2v664sqdizm4gak6db1kx9y50jq89m3gxaa8l1i3"))))) + (docbook-xml-4.x-package source version))) (define-public docbook-xml-4.2 - (package (inherit docbook-xml) - (version "4.2") - (source (origin - (method url-fetch/zipbomb) - (uri (string-append "https://docbook.org/xml/" version - "/docbook-xml-" version ".zip")) - (sha256 - (base32 - "18hgwvmywh6a5jh38szjmg3hg2r4v5lb6r3ydc3rd8cp9wg61i5c")))))) + (let* ((version "4.2") + (source (origin + (method url-fetch/zipbomb) + (uri (string-append "https://docbook.org/xml/" version + "/docbook-xml-" version ".zip")) + (sha256 + (base32 + "18hgwvmywh6a5jh38szjmg3hg2r4v5lb6r3ydc3rd8cp9wg61i5c"))))) + (docbook-xml-4.x-package source version))) (define-public docbook-xml-4.1.2 - (package - (inherit docbook-xml) - (version "4.1.2") - (source (origin - (method url-fetch/zipbomb) - (uri (string-append "https://docbook.org/xml/" version - "/docbkx412.zip")) - (sha256 - (base32 - "0wkp5rvnqj0ghxia0558mnn4c7s3n501j99q2isp3sp0ci069w1h")))) - (arguments - (substitute-keyword-arguments (package-arguments docbook-xml) - ((#:phases phases) - #~(modify-phases #$phases - (add-after 'unpack 'copy-catalog-file - ;; docbook-xml-4.1.2 is unique in the fact that it doesn't come - ;; with a catalog.xml file, requiring it to be generated by hand - ;; from the docbook.cat SGML catalog. We could automatically - ;; generate it here at the cost of enlarging the package - ;; definition with a rudimentary (PEG) parser for the SGML - ;; catalog but this is overkill since this file is unlikely to - ;; change, therefore we ship a pre-generated catalog.xml. - (lambda _ - (copy-file - #$(local-file - (search-auxiliary-file - "xml/docbook-xml/catalog-4.1.2.xml")) - "catalog.xml"))) - (add-after 'patch-catalog-xml 'add-rewrite-entries - (lambda* (#:key inputs #:allow-other-keys) - (let ((xmlcatalog (search-input-file inputs "/bin/xmlcatalog")) - (dtd-path (string-append #$output "/xml/dtd/docbook"))) - (for-each - (lambda (type) - (invoke xmlcatalog "--noout" - "--add" type - "http://www.oasis-open.org/docbook/xml/4.1.2/" - (string-append "file://" dtd-path "/") - "catalog.xml")) - (list "rewriteSystem" "rewriteURI"))))))))) - (native-inputs - (modify-inputs (package-native-inputs docbook-xml) - (prepend libxml2))))) + (let* ((version "4.1.2") + (source (origin + (method url-fetch/zipbomb) + (uri (string-append "https://docbook.org/xml/" version + "/docbkx412.zip")) + (sha256 + (base32 + "0wkp5rvnqj0ghxia0558mnn4c7s3n501j99q2isp3sp0ci069w1h")))) + (template (docbook-xml-4.x-package source version))) + (package + (inherit template) + (arguments + (substitute-keyword-arguments (package-arguments template) + ((#:phases phases) + #~(modify-phases #$phases + (add-after 'unpack 'copy-catalog-file + ;; docbook-xml-4.1.2 is unique in the fact that it doesn't come + ;; with a catalog.xml file, requiring it to be generated by hand + ;; from the docbook.cat SGML catalog. We could automatically + ;; generate it here at the cost of enlarging the package + ;; definition with a rudimentary (PEG) parser for the SGML + ;; catalog but this is overkill since this file is unlikely to + ;; change, therefore we ship a pre-generated catalog.xml. + (lambda _ + (copy-file + #$(local-file + (search-auxiliary-file + "xml/docbook-xml/catalog-4.1.2.xml")) + "catalog.xml"))) + (add-after 'patch-catalog-xml 'add-rewrite-entries + (lambda* (#:key inputs #:allow-other-keys) + (let ((xmlcatalog (search-input-file inputs + "/bin/xmlcatalog")) + (dtd-path (format #f "~a/xml/docbook/~a" + #$output #$version))) + (for-each + (lambda (type) + (invoke xmlcatalog "--noout" + "--add" type + "http://www.oasis-open.org/docbook/xml/4.1.2/" + (string-append "file://" dtd-path "/") + "catalog.xml")) + (list "rewriteSystem" "rewriteURI"))))))))) + (native-inputs + (modify-inputs (package-native-inputs template) + (prepend libxml2)))))) + +(define-public docbook-xml docbook-xml-5.1) ;;; There's an issue in docbook-xsl 1.79.2 that causes manpages to be ;;; generated incorrectly and embed raw nroff syntax such as '.PP' when there From patchwork Wed Apr 26 00:56: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: 49519 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 53B5427BBE2; Wed, 26 Apr 2023 01:58:17 +0100 (BST) 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=ham 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 32BBA27BBE9 for ; Wed, 26 Apr 2023 01:58:15 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prTTx-0006bp-En; Tue, 25 Apr 2023 20:58:06 -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 1prTTu-0006bM-KV for guix-patches@gnu.org; Tue, 25 Apr 2023 20:58:03 -0400 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 1prTTu-00013J-9c for guix-patches@gnu.org; Tue, 25 Apr 2023 20:58:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1prTTu-0001cw-1s for guix-patches@gnu.org; Tue, 25 Apr 2023 20:58:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63081] [PATCH 2/8] gnu: Add docbook-xml-5.0.1. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 26 Apr 2023 00:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63081 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63081@debbugs.gnu.org Cc: andreas@enge.fr, Bruno Victal , maxim.cournoyer@gmail.com Received: via spool by 63081-submit@debbugs.gnu.org id=B63081.16824706616152 (code B ref 63081); Wed, 26 Apr 2023 00:58:02 +0000 Received: (at 63081) by debbugs.gnu.org; 26 Apr 2023 00:57:41 +0000 Received: from localhost ([127.0.0.1]:53835 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prTTY-0001b5-JI for submit@debbugs.gnu.org; Tue, 25 Apr 2023 20:57:41 -0400 Received: from smtpmciv3.myservices.hosting ([185.26.107.239]:44464) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prTTX-0001av-DM for 63081@debbugs.gnu.org; Tue, 25 Apr 2023 20:57:39 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv3.myservices.hosting (Postfix) with ESMTP id 1E17821F7B; Wed, 26 Apr 2023 02:57:37 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id C698D8009F; Wed, 26 Apr 2023 02:57:37 +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 f1j47p9-UHi4; Wed, 26 Apr 2023 02:57:37 +0200 (CEST) Received: from guix-nuc.home.arpa (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 340E68009D; Wed, 26 Apr 2023 02:57:37 +0200 (CEST) From: Bruno Victal Date: Wed, 26 Apr 2023 01:56:54 +0100 Message-Id: X-Mailer: git-send-email 2.39.2 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 * gnu/packages/docbook.xml (docbook-xml-5.0.1): New variable. --- gnu/packages/docbook.scm | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/gnu/packages/docbook.scm b/gnu/packages/docbook.scm index 73a14855b9..79d5069fb0 100644 --- a/gnu/packages/docbook.scm +++ b/gnu/packages/docbook.scm @@ -120,6 +120,30 @@ (define-public docbook-xml-5.1 ;; substitution has no effect. ((#:install-plan _ #f) #~`(("schemas/" #$dest-dir))))))))) + +(define-public docbook-xml-5.0.1 + (let* ((version "5.0.1") + (source (origin + (method url-fetch) + (uri (string-append "https://docbook.org/xml/" version + "/docbook-" version ".zip")) + (sha256 + (base32 + "1iz3hq1lqgnshvlz4j9gvh4jy1ml74qf90vqf2ikbq0h4i2xzybs")))) + (template (docbook-xml-package source version))) + (package + (inherit template) + (arguments + (let ((dest-dir (format #f "xml/docbook/~a/" version))) + (substitute-keyword-arguments (package-arguments template) + ((#:install-plan _ #f) + #~`(("catalog.xml" #$dest-dir) + ("docbook.nvdl" #$dest-dir) + ("dtd" #$dest-dir) + ("rng" #$dest-dir) + ("sch" #$dest-dir) + ("xsd" #$dest-dir))))))))) + ;; XXX: docbook-xml-4.x versions use the same #:install-plan but since the ;; paths are versioned we can't use (inherit …). (define* (docbook-xml-4.x-package source version) From patchwork Wed Apr 26 00:56:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 49523 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 8318027BBE2; Wed, 26 Apr 2023 01:58:56 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED 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 771F7175BB for ; Wed, 26 Apr 2023 01:58:54 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prTTy-0006cm-OB; Tue, 25 Apr 2023 20:58:06 -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 1prTTw-0006bj-NL for guix-patches@gnu.org; Tue, 25 Apr 2023 20:58:05 -0400 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 1prTTu-00013O-J5 for guix-patches@gnu.org; Tue, 25 Apr 2023 20:58:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1prTTu-0001d3-Es for guix-patches@gnu.org; Tue, 25 Apr 2023 20:58:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63081] [PATCH 3/8] gnu: docbook-xsl: Refactor package. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 26 Apr 2023 00:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63081 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63081@debbugs.gnu.org Cc: andreas@enge.fr, Bruno Victal , maxim.cournoyer@gmail.com Received: via spool by 63081-submit@debbugs.gnu.org id=B63081.16824706646175 (code B ref 63081); Wed, 26 Apr 2023 00:58:02 +0000 Received: (at 63081) by debbugs.gnu.org; 26 Apr 2023 00:57:44 +0000 Received: from localhost ([127.0.0.1]:53839 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prTTc-0001bQ-5O for submit@debbugs.gnu.org; Tue, 25 Apr 2023 20:57:44 -0400 Received: from smtpm3.myservices.hosting ([185.26.105.234]:42738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prTTY-0001ax-0y for 63081@debbugs.gnu.org; Tue, 25 Apr 2023 20:57:40 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm3.myservices.hosting (Postfix) with ESMTP id A22E0216F3; Wed, 26 Apr 2023 02:57:38 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 547E4800A0; Wed, 26 Apr 2023 02:57:38 +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 xbl27_eFDydE; Wed, 26 Apr 2023 02:57:37 +0200 (CEST) Received: from guix-nuc.home.arpa (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 9DBC58009E; Wed, 26 Apr 2023 02:57:37 +0200 (CEST) From: Bruno Victal Date: Wed, 26 Apr 2023 01:56:55 +0100 Message-Id: X-Mailer: git-send-email 2.39.2 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 * gnu/packages/docbook.scm (docbook-xsl)[source]: Patch in snippet. [arguments]: Use sxml representation for xmlc file. Use xmlcatalog to manipulate catalog.xml instead of substitute*. Use #:install-plan instead of replacing 'install phase. [native-inputs]: Add docbook-xml-4.4 and libxml2, required for tests. --- gnu/packages/docbook.scm | 158 +++++++++++++++++++++++++-------------- 1 file changed, 102 insertions(+), 56 deletions(-) diff --git a/gnu/packages/docbook.scm b/gnu/packages/docbook.scm index 79d5069fb0..2fe0c2dbc5 100644 --- a/gnu/packages/docbook.scm +++ b/gnu/packages/docbook.scm @@ -290,9 +290,16 @@ (define-public docbook-xsl (url "https://github.com/docbook/xslt10-stylesheets") (commit commit))) (file-name (git-file-name name version)) - ;; Multiple .jar files are bundled with the sources. (modules '((guix build utils))) - (snippet '(for-each delete-file (find-files "." "\\.jar$"))) + (snippet + #~(begin + ;; Multiple .jar files are bundled with the sources. + (for-each delete-file + (find-files "." "\\.jar$")) + ;; Do not build webhelp files, as they require a Saxon from + ;; 2005, which is not packaged in Guix. + (substitute* "xsl/Makefile" + ((" webhelp") "")))) (sha256 (base32 "1bl8dwrcy7skrlh80fpsmiw045bv2j0aym231ikcv3hvm2pi98dj")))) @@ -300,67 +307,106 @@ (define-public docbook-xsl (arguments (list #:make-flags #~(list "XSLTENGINE=xsltproc") + #:modules '((guix build gnu-build-system) + (guix build utils) + (sxml simple)) #:phases - #~(modify-phases %standard-phases - (replace 'configure - (lambda _ - ;; The build systems insist on a ~/.xmlc, and it is simpler to - ;; create a dummy config file than to patch it into - ;; submission. - (setenv "HOME" "/tmp") - (call-with-output-file "/tmp/.xmlc" - (lambda (port) - (format port "\ - - - - - - - -\n"))) - (substitute* "xsl/Makefile" - ;; Do not build webhelp files, as they require a Saxon from - ;; 2005, which is not packaged in Guix. - ((" webhelp") "")))) - (add-before 'install 'generate-catalog.xml - (lambda* (#:key make-flags #:allow-other-keys) - (apply invoke "make" "-C" "xsl" "catalog.xml" make-flags))) + #~(let ((dest-path (format #f "~a/xml/xsl/~a-~a" + #$output #$name #$version))) + (modify-phases %standard-phases + (replace 'configure + (lambda _ + ;; The build systems insist on a ~/.xmlc, and it is simpler to + ;; create a dummy config file than to patch it into + ;; submission. + (setenv "HOME" "/tmp") + (call-with-output-file "/tmp/.xmlc" + (lambda (port) + (sxml->xml + '(*TOP* + (*PI* xml "version='1.0'") + (config + (java (@ (xml:id "bigmem")) + (java-options (@ (name "Xmx512m")))) + (xsltproc (@ (xml:id "xsltproc") + (exec "xsltproc"))) + (xmllint (@ (xml:id "xmllint") + (exec "xmllint"))))) + port))))) + (add-before 'install 'generate-catalog.xml + (lambda* (#:key make-flags #:allow-other-keys) + (apply invoke "make" "-C" "xsl" "catalog.xml" make-flags))) + (add-before 'install 'patch-catalog-xml + (lambda* (#:key inputs #:allow-other-keys) + (let ((xmlcatalog (search-input-file inputs + "/bin/xmlcatalog")) + (catalog-files (find-files "." "catalog\\.xml$")) + (store-uri (string-append "file://" dest-path "/"))) + (for-each + (lambda (catalog) + ;; Replace /snapshot/ reference with one based on + ;; BASE-VERSION. + (let ((versioned-uri + (format + #f "https://cdn.docbook.org/release/xsl/~a/" + #$base-version))) + (invoke xmlcatalog "--noout" + "--del" + "https://cdn.docbook.org/release/xsl/snapshot/" + catalog) + (for-each + (lambda (type) + (invoke xmlcatalog "--noout" + "--add" type + versioned-uri + store-uri + catalog)) + (list "rewriteSystem" "rewriteURI"))) + + ;; Patch /current/ references to point to /gnu/store/…. + (for-each + (lambda (type) + (invoke xmlcatalog "--noout" + "--add" type + "https://cdn.docbook.org/release/xsl/current/" + store-uri + catalog)) + (list "rewriteSystem" "rewriteURI")) + + ;; Re-add the no longer present compatibility entries for + ;; v.1.79.1 or earlier URIs. + (for-each + (lambda (type) + (invoke xmlcatalog "--noout" + "--add" type + "http://docbook.sourceforge.net/release/xsl/current/" + store-uri + catalog)) + (list "rewriteSystem" "rewriteURI"))) + catalog-files)))) (replace 'install (lambda _ - (let ((xml (string-append #$output "/xml/xsl/" - #$name "-" #$version)) - (select-rx (make-regexp + (let ((select-rx (make-regexp "(\\.xml$|\\.xsl$|\\.dtd$|\\.ent$)"))) ;; Install catalog. (chdir "xsl") - (install-file "catalog.xml" xml) - (install-file "VERSION.xsl" xml) - (substitute* (string-append xml "/catalog.xml") - ;; Re-add the no longer present compatibility entries. - ((".*.*" anchor) - (string-append "\ - - - \n" anchor)) - (("/snapshot/") - (string-append "/" #$base-version "/")) - (("rewritePrefix=\"./") - (string-append "rewritePrefix=\"file://" xml "/"))) + (install-file "catalog.xml" dest-path) + (install-file "VERSION.xsl" dest-path) ;; Install style sheets. - (for-each (lambda (dir) - (for-each (lambda (f) - (install-file - f (string-append xml "/" (dirname f)))) - (find-files dir select-rx))) - '("assembly" "common" "eclipse" "epub" "epub3" "fo" - "highlighting" "html" "htmlhelp" "javahelp" "lib" - "manpages" "params" "profiling" "roundtrip" - "template" "website" - "xhtml" "xhtml-1_1" "xhtml5")))))))) - (native-inputs (list libxml2 + (for-each + (lambda (dir) + (for-each (lambda (f) + (install-file + f + (string-append dest-path "/" (dirname f)))) + (find-files dir select-rx))) + '("assembly" "common" "eclipse" "epub" "epub3" "fo" + "highlighting" "html" "htmlhelp" "javahelp" "lib" + "manpages" "params" "profiling" "roundtrip" + "template" "website" + "xhtml" "xhtml-1_1" "xhtml5"))))))))) + (native-inputs (list docbook-xml-4.4 ; for tests + libxml2 libxslt perl perl-xml-xpath)) From patchwork Wed Apr 26 00:56:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 49518 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 F2FAA27BBEB; Wed, 26 Apr 2023 01:58:15 +0100 (BST) 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=ham 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 C8AE7175BB for ; Wed, 26 Apr 2023 01:58:14 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prTTz-0006d4-Ui; Tue, 25 Apr 2023 20:58:07 -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 1prTTx-0006c5-Iz for guix-patches@gnu.org; Tue, 25 Apr 2023 20:58:06 -0400 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 1prTTv-00013a-Dp for guix-patches@gnu.org; Tue, 25 Apr 2023 20:58:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1prTTv-0001dI-9L for guix-patches@gnu.org; Tue, 25 Apr 2023 20:58:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63081] [PATCH 4/8] gnu: docbook-xsl-1.79.1: Refactor package. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 26 Apr 2023 00:58:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63081 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63081@debbugs.gnu.org Cc: andreas@enge.fr, Bruno Victal , maxim.cournoyer@gmail.com Received: via spool by 63081-submit@debbugs.gnu.org id=B63081.16824706656195 (code B ref 63081); Wed, 26 Apr 2023 00:58:03 +0000 Received: (at 63081) by debbugs.gnu.org; 26 Apr 2023 00:57:45 +0000 Received: from localhost ([127.0.0.1]:53844 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prTTd-0001br-AL for submit@debbugs.gnu.org; Tue, 25 Apr 2023 20:57:45 -0400 Received: from smtpmciv3.myservices.hosting ([185.26.107.239]:44490) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prTTb-0001bO-MR for 63081@debbugs.gnu.org; Tue, 25 Apr 2023 20:57:44 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv3.myservices.hosting (Postfix) with ESMTP id 9861B21F7C; Wed, 26 Apr 2023 02:57:39 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id A0B488009F; Wed, 26 Apr 2023 02:57:38 +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 ar6cZsFqmR7u; Wed, 26 Apr 2023 02:57:38 +0200 (CEST) Received: from guix-nuc.home.arpa (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 1230F8009D; Wed, 26 Apr 2023 02:57:38 +0200 (CEST) From: Bruno Victal Date: Wed, 26 Apr 2023 01:56:56 +0100 Message-Id: X-Mailer: git-send-email 2.39.2 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 * gnu/packages/docbook.scm (docbook-xsl-1.79.1)[source]: Remove bundled binary files. [arguments]: Use #:install-plan. Patch catalog.xml using xmlcatalog. Add phase 'install-doc. [native-inputs]: Add libxml2. --- gnu/packages/docbook.scm | 94 ++++++++++++++++++++++++++-------------- 1 file changed, 61 insertions(+), 33 deletions(-) diff --git a/gnu/packages/docbook.scm b/gnu/packages/docbook.scm index 2fe0c2dbc5..b3e53557e8 100644 --- a/gnu/packages/docbook.scm +++ b/gnu/packages/docbook.scm @@ -430,44 +430,72 @@ (define-public docbook-xsl-1.79.1 name "-ns-" version ".tar.bz2")) (sha256 (base32 - "170ggf5dgjar65kkn5n33kvjr3pdinpj66nnxfx8b2avw0k91jin")))) + "170ggf5dgjar65kkn5n33kvjr3pdinpj66nnxfx8b2avw0k91jin")) + (modules '((guix build utils))) + ;; Bundled binary files. + (snippet + #~(delete-file-recursively "tools")))) (build-system copy-build-system) (outputs '("out" "doc")) (arguments (list + #:install-plan + (let ((target (format #f "xml/xsl/~a-~a/" name version)) + (select-rx '("\\.xml$" "\\.xsl$" "\\.dtd$" "\\.ent$"))) + #~`(#$@(map + (lambda (directory) + ;; XXX: When filters are used, the source basename + ;; isn't kept under the target path, append it again. + (let ((target* (string-append target directory))) + (list directory target* #:include-regexp select-rx))) + (list "assembly" "common" "eclipse" "epub" "epub3" "fo" + "highlighting" "html" "htmlhelp" "javahelp" "lib" + "manpages" "params" "profiling" "roundtrip" + "template" "website" + "xhtml" "xhtml-1_1" "xhtml5")) + ("catalog.xml" #$target) + ("VERSION.xsl" #$target))) #:phases - #~(modify-phases %standard-phases - ;; XXX: The copy-build-system doesn't seem to allow installing to a - ;; different output. - (replace 'install - (lambda _ - (let ((xml (string-append #$output "/xml/xsl/" #$name "-" #$version)) - (doc (string-append #$output:doc - "/share/doc/" #$name "-" #$version)) - (select-rx (make-regexp - "(\\.xml$|\\.xsl$|\\.dtd$|\\.ent$)"))) - ;; Install catalog. - (install-file "catalog.xml" xml) - (install-file "VERSION.xsl" xml) - (substitute* (string-append xml "/catalog.xml") - (("rewritePrefix=\"./") - (string-append "rewritePrefix=\"file://" xml "/"))) - ;; Install style sheets. - (for-each (lambda (dir) - (for-each (lambda (f) - (install-file - f (string-append xml "/" (dirname f)))) - (find-files dir select-rx))) - '("assembly" "common" "eclipse" "epub" "epub3" "fo" - "highlighting" "html" "htmlhelp" "javahelp" "lib" - "manpages" "params" "profiling" "roundtrip" - "template" "website" - "xhtml" "xhtml-1_1" "xhtml5")) - ;; Install documentation. - (install-file "NEWS" doc) - (install-file "RELEASE-NOTES.html" doc) - (copy-recursively "slides" doc) - (copy-recursively "webhelp" doc))))))) + #~(let ((dest-path (format #f "~a/xml/xsl/~a-~a" + #$output #$name #$version))) + (modify-phases %standard-phases + (add-before 'install 'patch-catalog-xml + (lambda* (#:key inputs #:allow-other-keys) + (let ((xmlcatalog (search-input-file inputs + "/bin/xmlcatalog")) + (catalog-files (find-files "." "catalog\\.xml$")) + (store-uri (string-append "file://" dest-path "/"))) + (for-each + (lambda (catalog) + (for-each + (lambda (type) + ;; Patch /current/ references to point to /gnu/store/…. + (invoke xmlcatalog "--noout" + "--add" type + "http://docbook.sourceforge.net/release/xsl-ns/current/" + store-uri + catalog) + ;; Patch versioned references to point to /gnu/store/…. + (invoke xmlcatalog "--noout" + "--add" type + (format + #f "http://docbook.sourceforge.net/release/xsl-ns/~a/" + #$version) + store-uri + catalog)) + (list "rewriteSystem" "rewriteURI"))) + catalog-files)))) + ;; XXX: The copy-build-system doesn't seem to allow installing to a + ;; different output. + (add-after 'install 'install-doc + (lambda _ + (let ((doc (format #f "~a/share/doc/~a-~a" + #$output:doc #$name #$version))) + (install-file "NEWS" doc) + (install-file "RELEASE-NOTES.html" doc) + (copy-recursively "slides" doc) + (copy-recursively "webhelp" doc)))))))) + (native-inputs (list libxml2)) (home-page "https://docbook.org") (synopsis "DocBook XSL namespaced style sheets for document authoring") (description "This package provides the @emph{namespaced} XSL style sheets From patchwork Wed Apr 26 00:56:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 49517 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 A070127BBE2; Wed, 26 Apr 2023 01:58:13 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED 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 092C4175BB for ; Wed, 26 Apr 2023 01:58:12 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prTU1-0006eD-0s; Tue, 25 Apr 2023 20:58:09 -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 1prTTy-0006cj-Iz for guix-patches@gnu.org; Tue, 25 Apr 2023 20:58:06 -0400 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 1prTTw-00014H-I1 for guix-patches@gnu.org; Tue, 25 Apr 2023 20:58:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1prTTw-0001de-D7 for guix-patches@gnu.org; Tue, 25 Apr 2023 20:58:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63081] [PATCH 5/8] gnu: docbook-utils: Refactor package. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 26 Apr 2023 00:58:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63081 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63081@debbugs.gnu.org Cc: andreas@enge.fr, Bruno Victal , maxim.cournoyer@gmail.com Received: via spool by 63081-submit@debbugs.gnu.org id=B63081.16824706766239 (code B ref 63081); Wed, 26 Apr 2023 00:58:04 +0000 Received: (at 63081) by debbugs.gnu.org; 26 Apr 2023 00:57:56 +0000 Received: from localhost ([127.0.0.1]:53852 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prTTn-0001cT-PQ for submit@debbugs.gnu.org; Tue, 25 Apr 2023 20:57:56 -0400 Received: from smtpmciv3.myservices.hosting ([185.26.107.239]:44526) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prTTj-0001cA-IZ for 63081@debbugs.gnu.org; Tue, 25 Apr 2023 20:57:52 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv3.myservices.hosting (Postfix) with ESMTP id ADA2A21F7E; Wed, 26 Apr 2023 02:57:42 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 43582800A1; Wed, 26 Apr 2023 02:57:39 +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 l13YvJuWA1Qx; Wed, 26 Apr 2023 02:57:38 +0200 (CEST) Received: from guix-nuc.home.arpa (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 7B3848009E; Wed, 26 Apr 2023 02:57:38 +0200 (CEST) From: Bruno Victal Date: Wed, 26 Apr 2023 01:56:57 +0100 Message-Id: <2b886bdc0bf4d36d565ac3702768dc0bb053f21c.1682470616.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.2 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 * gnu/packages/docbook.scm (docbook-utils)[description]: Fix description. [source]: Patch source in snippet. [arguments]: Remove. --- gnu/packages/docbook.scm | 96 ++++++++++++++++++++-------------------- 1 file changed, 49 insertions(+), 47 deletions(-) diff --git a/gnu/packages/docbook.scm b/gnu/packages/docbook.scm index b3e53557e8..d4441bacee 100644 --- a/gnu/packages/docbook.scm +++ b/gnu/packages/docbook.scm @@ -780,45 +780,40 @@ (define-public docbook-utils version ".orig.tar.gz")) (sha256 (base32 - "1scj5vgw1xz872pq54a89blcxqqm11p90yzv8a9mqq57x27apyj8")))) + "1scj5vgw1xz872pq54a89blcxqqm11p90yzv8a9mqq57x27apyj8")) + (modules '((guix build utils))) + (snippet + #~(begin + ;; Patch build system. + (substitute* (find-files "." "\\.in$") + ;; Do not hard-code SGML_CATALOG_FILES. + ((".*SGML_CATALOG_FILES=/etc/sgml/catalog.*") "") + ;; Use OpenSP and OpenJade. + (("\\bjade\\b") + "openjade") + (("\\bnsgmls\\b") + "onsgmls")) + + ;; Do not override the SGML_CATALOG_FILES environment + ;; variable. + (substitute* "bin/jw.in" + ((".*SGML_CATALOG_FILES=`find.*") + "") + (("SGML_CATALOG_FILES=`echo.*") + ":\n") + (("SGML_CATALOG_FILES=\"\"") + ":") + (("\\bwhich\\b") + "command -v")) + + ;; Locate lynx, links or w3m from the PATH, not from + ;; /usr/bin. + (substitute* "backends/txt" + (("CONVERT=/usr/bin/") + "CONVERT=") + (("\\[ -x /usr/bin/([^ ]+) \\]" _ command) + (format #f "command -v ~a > /dev/null" command))))))) (build-system gnu-build-system) - (arguments - `(#:phases (modify-phases %standard-phases - (add-after 'unpack 'patch-build-system - (lambda _ - (substitute* (find-files "." "\\.in$") - ;; Do not hard-code SGML_CATALOG_FILES. - ((".*SGML_CATALOG_FILES=/etc/sgml/catalog.*") "") - ;; Use OpenSP and OpenJade. - (("\\bjade\\b") - "openjade") - (("\\bnsgmls\\b") - "onsgmls")) - #t)) - (add-after 'unpack 'patch-jw.in - ;; Do not override the SGML_CATALOG_FILES environment - ;; variable. - (lambda _ - (substitute* "bin/jw.in" - ((".*SGML_CATALOG_FILES=`find.*") - "") - (("SGML_CATALOG_FILES=`echo.*") - ":\n") - (("SGML_CATALOG_FILES=\"\"") - ":") - (("\\bwhich\\b") - "command -v")) - #t)) - (add-after 'unpack 'patch-txt-backend - (lambda _ - ;; Locate lynx, links or w3m from the PATH, not from - ;; /usr/bin. - (substitute* "backends/txt" - (("CONVERT=/usr/bin/") - "CONVERT=") - (("\\[ -x /usr/bin/([^ ]+) \\]" dummy command) - (string-append "command -v " command " > /dev/null"))) - #t))))) ;; Propagated for convenience. All these tools are used at run time to ;; provide the complete functionality of the docbook-utils commands. (propagated-inputs @@ -839,15 +834,22 @@ (define-public docbook-utils Language (HTML), Rich Text Format (RTF), PostScript (PS), man, Portable Document Format (PDF), TeX, Texinfo or plain text (txt). It can be used more conveniently via the following wrappers: -@itemx docbook2dvi Convert a SGML DocBook file to the DVI format. -@itemx docbook2html Convert a SGML DocBook file to an HTML document. -@itemx docbook2man Convert a SGML DocBook file a man page. -@itemx docbook2pdf Convert a SGML DocBook file to a PDF document. -@itemx docbook2ps Convert a SGML DocBook file to a PS document. -@itemx docbook2rtf Convert a SGML DocBook file to a RTF document. -@itemx docbook2tex Convert a SGML DocBook file to a TeX document. -@itemx docbook2texi Convert a SGML DocBook file to a Texinfo document. -@itemx docbook2txt Convert a SGML DocBook file to a plain text document. +@table @command +@item docbook2dvi +Convert a SGML DocBook file to the DVI format. +@item docbook2html +Convert a SGML DocBook file to an HTML document. +@item docbook2man +Convert a SGML DocBook file a man page. +@item docbook2pdf +@itemx docbook2ps +@itemx docbook2rtf +@itemx docbook2tex +@itemx docbook2texi +Convert a SGML DocBook file to a PDF/PS/RTF/TeX document. +@item docbook2txt +Convert a SGML DocBook file to a plain text document. +@end table @item sgmldiff Detect the differences in markup between two SGML files. @end table") From patchwork Wed Apr 26 00:56:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 49521 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 D90D727BBE9; Wed, 26 Apr 2023 01:58:41 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED 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 22F3327BBE2 for ; Wed, 26 Apr 2023 01:58:40 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prTU0-0006dL-6f; Tue, 25 Apr 2023 20:58:08 -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 1prTTw-0006bk-OH for guix-patches@gnu.org; Tue, 25 Apr 2023 20:58:05 -0400 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 1prTTu-00013T-Vh for guix-patches@gnu.org; Tue, 25 Apr 2023 20:58:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1prTTu-0001dB-Rg for guix-patches@gnu.org; Tue, 25 Apr 2023 20:58:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63081] [PATCH 6/8] gnu: docbook: Refactor docbook-sgml packages. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 26 Apr 2023 00:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63081 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63081@debbugs.gnu.org Cc: andreas@enge.fr, Bruno Victal , maxim.cournoyer@gmail.com Received: via spool by 63081-submit@debbugs.gnu.org id=B63081.16824706656188 (code B ref 63081); Wed, 26 Apr 2023 00:58:02 +0000 Received: (at 63081) by debbugs.gnu.org; 26 Apr 2023 00:57:45 +0000 Received: from localhost ([127.0.0.1]:53842 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prTTc-0001bY-NE for submit@debbugs.gnu.org; Tue, 25 Apr 2023 20:57:45 -0400 Received: from smtpm4.myservices.hosting ([185.26.105.235]:46020) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prTTY-0001b4-UC for 63081@debbugs.gnu.org; Tue, 25 Apr 2023 20:57:41 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm4.myservices.hosting (Postfix) with ESMTP id D177B214A5; Wed, 26 Apr 2023 02:57:39 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 88D76800A0; Wed, 26 Apr 2023 02:57:39 +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 pT9nmvDw1gv0; Wed, 26 Apr 2023 02:57:39 +0200 (CEST) Received: from guix-nuc.home.arpa (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id E5CA88009D; Wed, 26 Apr 2023 02:57:38 +0200 (CEST) From: Bruno Victal Date: Wed, 26 Apr 2023 01:56:58 +0100 Message-Id: <26db108569ee144702131e5099081a6ece3978dc.1682470616.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.2 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 * gnu/packages/docbook.scm (docbook-sgml)[build-system]: Switch to copy-build-system. [arguments]: Replace #:builder with #:install-plan. Add phases 'fix-permission and 'patch-iso-entities. [sources]: Use url-fetch/zipbomb. (docbook-sgml-4.1, docbook-sgml-3.1)[sources]: Ditto. (iso-8879-entities)[source]: Ditto. [build-system]: Switch to copy-build-system. [native-inputs]: Restyle. --- gnu/packages/docbook.scm | 70 ++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 38 deletions(-) diff --git a/gnu/packages/docbook.scm b/gnu/packages/docbook.scm index d4441bacee..cc0a663f68 100644 --- a/gnu/packages/docbook.scm +++ b/gnu/packages/docbook.scm @@ -585,35 +585,39 @@ (define-public docbook-sgml-4.2 (name "docbook-sgml") (version "4.2") (source (origin - (method url-fetch) + (method url-fetch/zipbomb) (uri (string-append "https://www.oasis-open.org/docbook/sgml/4.2/docbook-" version ".zip")) (sha256 (base32 "1hrm4qmmzi285bkxkc74lxvjvw2gbl7ycbaxhv31h9rl9g4x5sv7")))) - (build-system trivial-build-system) + (build-system copy-build-system) (arguments - '(#:modules ((guix build utils)) - #:builder - (begin - (use-modules (guix build utils)) - (let ((source (assoc-ref %build-inputs "source")) - (iso-entities-dir (string-append - (assoc-ref %build-inputs "iso-8879-entities"))) - (unzip (string-append (assoc-ref %build-inputs "unzip") - "/bin/unzip")) - (dtd (string-append (assoc-ref %outputs "out") - "/sgml/dtd/docbook"))) - ;; Extract the sources. - (mkdir-p dtd) - (chdir dtd) - (invoke unzip source) - ;; Reference the ISO 8879 character entities. - ;; e.g. "iso-lat1.gml" --> "/ISOlat1" - (substitute* "docbook.cat" - (("\"iso-(.*)\\.gml\"" _ name) - (string-append "\"" iso-entities-dir "/ISO" name "\""))))))) + (list + #:modules '((guix build copy-build-system) + (guix build utils) + (srfi srfi-26)) + #:install-plan + #~`(("./" "sgml/dtd/docbook" + #:exclude-regexp ("catalog\\.xml$" + "ChangeLog$" + "README$" + "\\.txt$"))) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'fix-permissions + (lambda _ + (for-each (cut chmod <> #o644) (find-files ".")))) + (add-before 'install 'patch-iso-entities + (lambda* (#:key inputs #:allow-other-keys) + ;; Reference the ISO 8879 character entities. + ;; e.g. "iso-lat1.gml" --> "/ISOlat1" + (let ((iso-entities-dir + (assoc-ref %build-inputs "iso-8879-entities"))) + (substitute* "docbook.cat" + (("\"iso-(.*)\\.gml\"" _ name) + (string-append "\"" iso-entities-dir "/ISO" name "\""))))))))) (native-inputs (list unzip)) (inputs @@ -628,7 +632,7 @@ (define-public docbook-sgml-4.1 (inherit docbook-sgml-4.2) (version "4.1") (source (origin - (method url-fetch) + (method url-fetch/zipbomb) (uri (string-append "https://www.oasis-open.org/docbook/sgml/" version "/docbk41.zip")) (sha256 @@ -642,7 +646,7 @@ (define-public docbook-sgml-3.1 (inherit docbook-sgml) (version "3.1") (source (origin - (method url-fetch) + (method url-fetch/zipbomb) (uri (string-append "https://www.oasis-open.org/docbook/sgml/" version "/docbk31.zip")) (sha256 @@ -655,23 +659,13 @@ (define iso-8879-entities (name "iso-8879-entities") (version "0.0") ;no proper version (source (origin - (method url-fetch) - (uri "http://www.oasis-open.org/cover/ISOEnts.zip") + (method url-fetch/zipbomb) + (uri "https://www.oasis-open.org/cover/ISOEnts.zip") (sha256 (base32 "1clrkaqnvc1ja4lj8blr0rdlphngkcda3snm7b9jzvcn76d3br6w")))) - (build-system trivial-build-system) - (arguments - '(#:modules ((guix build utils)) - #:builder - (begin - (use-modules (guix build utils)) - (let ((source (assoc-ref %build-inputs "source")) - (unzip (string-append (assoc-ref %build-inputs "unzip") - "/bin/unzip")) - (out (string-append (assoc-ref %outputs "out")))) - (invoke unzip source "-d" out))))) - (native-inputs `(("unzip" ,unzip))) + (build-system copy-build-system) + (native-inputs (list unzip)) (home-page "https://www.oasis-open.org/") (synopsis "ISO 8879 character entities") (description "ISO 8879 character entities that are typically used in From patchwork Wed Apr 26 00:56:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 49522 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 BDF9127BBE9; Wed, 26 Apr 2023 01:58:48 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 9D972175BB for ; Wed, 26 Apr 2023 01:58:47 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prTU0-0006dn-Nm; Tue, 25 Apr 2023 20:58:08 -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 1prTTx-0006c6-JC for guix-patches@gnu.org; Tue, 25 Apr 2023 20:58:06 -0400 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 1prTTw-000148-6N for guix-patches@gnu.org; Tue, 25 Apr 2023 20:58:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1prTTw-0001dX-24 for guix-patches@gnu.org; Tue, 25 Apr 2023 20:58:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63081] [PATCH 7/8] gnu: docbook: Refactor dblatex packages. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 26 Apr 2023 00:58:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63081 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63081@debbugs.gnu.org Cc: andreas@enge.fr, Bruno Victal , maxim.cournoyer@gmail.com Received: via spool by 63081-submit@debbugs.gnu.org id=B63081.16824706756232 (code B ref 63081); Wed, 26 Apr 2023 00:58:04 +0000 Received: (at 63081) by debbugs.gnu.org; 26 Apr 2023 00:57:55 +0000 Received: from localhost ([127.0.0.1]:53850 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prTTn-0001cM-8u for submit@debbugs.gnu.org; Tue, 25 Apr 2023 20:57:55 -0400 Received: from smtpmciv3.myservices.hosting ([185.26.107.239]:44510) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prTTg-0001c1-40 for 63081@debbugs.gnu.org; Tue, 25 Apr 2023 20:57:48 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv3.myservices.hosting (Postfix) with ESMTP id 93AC521F7B; Wed, 26 Apr 2023 02:57:40 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 408C78009F; Wed, 26 Apr 2023 02:57:40 +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 t0p5z4E689IV; Wed, 26 Apr 2023 02:57:39 +0200 (CEST) Received: from guix-nuc.home.arpa (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 5C4128009E; Wed, 26 Apr 2023 02:57:39 +0200 (CEST) From: Bruno Victal Date: Wed, 26 Apr 2023 01:56:59 +0100 Message-Id: X-Mailer: git-send-email 2.39.2 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 * gnu/packages/docbook.scm (dblatex): Rewrite using G-Expressions. (dblatex/stable): Use modify-inputs. --- gnu/packages/docbook.scm | 114 ++++++++++++++++++++------------------- 1 file changed, 58 insertions(+), 56 deletions(-) diff --git a/gnu/packages/docbook.scm b/gnu/packages/docbook.scm index cc0a663f68..ced174b3b8 100644 --- a/gnu/packages/docbook.scm +++ b/gnu/packages/docbook.scm @@ -37,6 +37,7 @@ (define-module (gnu packages docbook) #:use-module (gnu packages python) #:use-module (gnu packages base) #:use-module (gnu packages web-browsers) + #:use-module (gnu packages xfig) #:use-module (gnu packages xml) #:use-module (guix gexp) #:use-module (guix utils) @@ -44,7 +45,6 @@ (define-module (gnu packages docbook) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) - #:use-module ((guix build utils) #:select (alist-replace)) #:use-module (guix build-system copy) #:use-module (guix build-system gnu) #:use-module (guix build-system trivial) @@ -685,62 +685,64 @@ (define-public dblatex (base32 "0yd09nypswy3q4scri1dg7dr99d7gd6r2dwx0xm81l9f4y32gs0n")))) (build-system python-build-system) - ;; TODO: Add xfig/transfig for fig2dev utility + (arguments + (list + ;; Using setuptools causes an invalid "package_base" path in + ;; out/bin/.dblatex-real due to a missing leading '/'. This is caused + ;; by dblatex's setup.py stripping the root path when creating the + ;; script. (dblatex's setup.py still uses distutils and thus has to + ;; create the script by itself. The feature for creating scripts is one + ;; of setuptools' features.) + ;; See this thread for details: + ;; https://lists.gnu.org/archive/html/guix-devel/2016-12/msg00030.html + #:use-setuptools? #f + #:tests? #f ;no 'test' command + #:phases + #~(modify-phases %standard-phases + (add-after 'wrap 'set-path + (lambda* (#:key inputs #:allow-other-keys) + (let ((path (map (lambda (x) + (string-append (assoc-ref inputs x) + "/bin")) + (list "libxslt" + "imagemagick" "inkscape" + "texlive-updmap.cfg")))) + ;; dblatex executes helper programs at runtime. + (wrap-program (string-append #$output "/bin/dblatex") + `("PATH" ":" prefix ,path)))))))) (inputs - `(("texlive" ,(texlive-updmap.cfg (list texlive-amsfonts - texlive-latex-anysize - texlive-latex-appendix - texlive-latex-bookmark - texlive-latex-changebar - texlive-latex-colortbl - texlive-latex-fancybox - texlive-fancyhdr - texlive-fancyvrb - texlive-latex-float - texlive-latex-footmisc - texlive-hyperref - texlive-latex-jknapltx - texlive-listings - texlive-latex-multirow - texlive-latex-overpic - texlive-pdfpages - texlive-refcount - texlive-subfigure - texlive-titlesec - texlive-wasysym + (list (texlive-updmap.cfg (list texlive-amsfonts + texlive-latex-anysize + texlive-latex-appendix + texlive-latex-bookmark + texlive-latex-changebar + texlive-latex-colortbl + texlive-latex-fancybox + texlive-fancyhdr + texlive-fancyvrb + texlive-latex-float + texlive-latex-footmisc + texlive-hyperref + texlive-latex-jknapltx + texlive-listings + texlive-latex-multirow + texlive-latex-overpic + texlive-pdfpages + texlive-refcount + texlive-subfigure + texlive-titlesec + texlive-wasysym - texlive-fonts-rsfs - texlive-stmaryrd + texlive-fonts-rsfs + texlive-stmaryrd - texlive-iftex))) - ("imagemagick" ,imagemagick) ;for convert - ("inkscape" ,inkscape/stable) ;for svg conversion - ("docbook" ,docbook-xml) - ("libxslt" ,libxslt))) ;for xsltproc - (arguments - `(;; Using setuptools causes an invalid "package_base" path in - ;; out/bin/.dblatex-real due to a missing leading '/'. This is caused - ;; by dblatex's setup.py stripping the root path when creating the - ;; script. (dblatex's setup.py still uses distutils and thus has to - ;; create the script by itself. The feature for creating scripts is one - ;; of setuptools' features.) - ;; See this thread for details: - ;; https://lists.gnu.org/archive/html/guix-devel/2016-12/msg00030.html - #:use-setuptools? #f - #:tests? #f ;no 'test' command - #:phases - (modify-phases %standard-phases - (add-after 'wrap 'set-path - (lambda* (#:key inputs outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - ;; dblatex executes helper programs at runtime. - (wrap-program (string-append out "/bin/dblatex") - `("PATH" ":" prefix - ,(map (lambda (input) - (string-append (assoc-ref inputs input) - "/bin")) - '("libxslt" "texlive" - "imagemagick" "inkscape")))))))))) + texlive-iftex)) + ;; FIXME: transfig is failing to build. + ;;transfig ;for fig2dev + imagemagick ;for convert + inkscape/stable ;for svg conversion + docbook-xml + libxslt)) ;for xsltproc (home-page "https://dblatex.sourceforge.net") (synopsis "DocBook to LaTeX Publishing") (description @@ -759,8 +761,8 @@ (define-public dblatex (define-public dblatex/stable (hidden-package (package/inherit dblatex - (inputs (alist-replace "imagemagick" `(,imagemagick/stable) - (package-inputs dblatex)))))) + (inputs (modify-inputs (package-inputs dblatex) + (replace "imagemagick" imagemagick/stable)))))) (define-public docbook-utils (package From patchwork Wed Apr 26 00:57:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 49520 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 E654127BBE2; Wed, 26 Apr 2023 01:58:29 +0100 (BST) 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 10751175BB for ; Wed, 26 Apr 2023 01:58:28 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prTTz-0006cz-Go; Tue, 25 Apr 2023 20:58:07 -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 1prTTx-0006cI-Jt for guix-patches@gnu.org; Tue, 25 Apr 2023 20:58:06 -0400 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 1prTTv-00013p-OP for guix-patches@gnu.org; Tue, 25 Apr 2023 20:58:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1prTTv-0001dP-KW for guix-patches@gnu.org; Tue, 25 Apr 2023 20:58:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63081] [PATCH 8/8] gnu: docbook-dsssl: Switch to copy-build-system. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 26 Apr 2023 00:58:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63081 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63081@debbugs.gnu.org Cc: andreas@enge.fr, Bruno Victal , maxim.cournoyer@gmail.com Received: via spool by 63081-submit@debbugs.gnu.org id=B63081.16824706756225 (code B ref 63081); Wed, 26 Apr 2023 00:58:03 +0000 Received: (at 63081) by debbugs.gnu.org; 26 Apr 2023 00:57:55 +0000 Received: from localhost ([127.0.0.1]:53848 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prTTm-0001cJ-St for submit@debbugs.gnu.org; Tue, 25 Apr 2023 20:57:55 -0400 Received: from smtpm4.myservices.hosting ([185.26.105.235]:46042) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prTTc-0001bR-Fk for 63081@debbugs.gnu.org; Tue, 25 Apr 2023 20:57:45 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm4.myservices.hosting (Postfix) with ESMTP id A6985214A6; Wed, 26 Apr 2023 02:57:40 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 5CD788009E; Wed, 26 Apr 2023 02:57:40 +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 oyTTnH552k6k; Wed, 26 Apr 2023 02:57:40 +0200 (CEST) Received: from guix-nuc.home.arpa (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id C531B8009D; Wed, 26 Apr 2023 02:57:39 +0200 (CEST) From: Bruno Victal Date: Wed, 26 Apr 2023 01:57:00 +0100 Message-Id: <10eb0782541de88bafd0dc1660ef43cc2220b7bf.1682470616.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.2 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 * gnu/packages/docbook.scm (docbook-dsssl)[build-system]: Switch to copy-build-system. [arguments]: Add phase to install documentation as separate output. (docbook-dsssl-doc)[build-system]: Switch to copy-build-system. [arguments]: Adapt to new build-system. --- gnu/packages/docbook.scm | 54 ++++++++++++++-------------------------- 1 file changed, 18 insertions(+), 36 deletions(-) diff --git a/gnu/packages/docbook.scm b/gnu/packages/docbook.scm index ced174b3b8..4a911bcec7 100644 --- a/gnu/packages/docbook.scm +++ b/gnu/packages/docbook.scm @@ -514,25 +514,22 @@ (define-public docbook-dsssl (sha256 (base32 "1g72y2yyc2k89kzs0lvrb9n7hjayw1hdskfpplpz97pf1c99wcig")))) - (build-system trivial-build-system) + (build-system copy-build-system) (outputs '("out" "doc")) (arguments - `(#:modules ((guix build utils)) - #:builder - (begin - (use-modules (guix build utils)) - (let ((source (assoc-ref %build-inputs "source")) - (dtd (string-append (assoc-ref %outputs "out") - "/sgml/dtd/docbook")) - (docbook-dsssl-doc (assoc-ref %build-inputs "docbook-dsssl-doc")) - (doc (assoc-ref %outputs "doc")) - (tar (assoc-ref %build-inputs "tar")) - (bzip2 (assoc-ref %build-inputs "bzip2"))) - (setenv "PATH" (string-append tar "/bin" ":" bzip2 "/bin")) - (mkdir-p dtd) - (invoke "tar" "-xf" source "-C" dtd) - ;; The doc output contains 1.4 MiB of HTML documentation. - (symlink docbook-dsssl-doc doc))))) + (list + #:install-plan + #~`(("./" "sgml/dtd/docbook/" + #:exclude ("doc" "docsrc"))) + #:phases + #~(modify-phases %standard-phases + ;; The doc output contains 1.4 MiB of HTML documentation. + (add-after 'install 'install-doc + (lambda* (#:key inputs #:allow-other-keys) + (mkdir-p (string-append #$output:doc "/share/doc")) + (symlink (assoc-ref inputs "docbook-dsssl-doc") + (format #f "~a/share/doc/~a-~a" + #$output:doc #$name #$version))))))) (inputs (list docbook-dsssl-doc)) (native-inputs @@ -555,26 +552,11 @@ (define docbook-dsssl-doc (sha256 (base32 "1plp5ngc96pbna4rwglp9glcadnirbm3hlcjb4gjvq1f8biic9lz")))) - (build-system trivial-build-system) + (build-system copy-build-system) (arguments - `(#:modules ((guix build utils)) - #:builder - (begin - (use-modules (guix build utils)) - (let ((source (assoc-ref %build-inputs "source")) - (docdir (string-append (assoc-ref %outputs "out") - "/share/doc/" "docbook-dsssl-" ,version)) - (tar (assoc-ref %build-inputs "tar")) - (bzip2 (assoc-ref %build-inputs "bzip2"))) - (setenv "PATH" (string-append tar "/bin" ":" bzip2 "/bin")) - (mkdir-p docdir) - ;; Extract the "doc" subdirectory. - (invoke "tar" "-xf" source "--strip-components=2" - "--no-same-owner" "-C" docdir - (string-append "docbook-dsssl-" ,version "/doc")))))) - (native-inputs - `(("bzip2" ,bzip2) - ("tar" ,tar))) + (list + #:install-plan + #~`(("doc/" #$(string-append "/share/doc/docbook-dsssl-" version))))) (home-page "https://docbook.org/") (synopsis "DocBook DSSSL style sheets documentation") (description "Documentation for the DocBook DSSSL style sheets.")