From patchwork Fri Aug 20 12:09:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Whatson X-Patchwork-Id: 32195 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 1EF5127BC6B; Fri, 20 Aug 2021 13:10:15 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 935B727BC85 for ; Fri, 20 Aug 2021 13:10:12 +0100 (BST) Received: from localhost ([::1]:51890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mH3Lf-0000UX-Cb for patchwork@mira.cbaines.net; Fri, 20 Aug 2021 08:10:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37840) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mH3LX-0000U0-2S for guix-patches@gnu.org; Fri, 20 Aug 2021 08:10:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49794) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mH3LW-0000y7-Rr for guix-patches@gnu.org; Fri, 20 Aug 2021 08:10:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mH3LW-0001QR-NC for guix-patches@gnu.org; Fri, 20 Aug 2021 08:10:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50131] [PATCH 2/3] gnu: Add docbook2x. Resent-From: Andrew Whatson Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 20 Aug 2021 12:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50131 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50131@debbugs.gnu.org Cc: Andrew Whatson Received: via spool by 50131-submit@debbugs.gnu.org id=B50131.16294613715409 (code B ref 50131); Fri, 20 Aug 2021 12:10:02 +0000 Received: (at 50131) by debbugs.gnu.org; 20 Aug 2021 12:09:31 +0000 Received: from localhost ([127.0.0.1]:33103 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mH3L1-0001PB-0g for submit@debbugs.gnu.org; Fri, 20 Aug 2021 08:09:31 -0400 Received: from mail-pg1-f170.google.com ([209.85.215.170]:38725) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mH3Ky-0001Ou-U0 for 50131@debbugs.gnu.org; Fri, 20 Aug 2021 08:09:29 -0400 Received: by mail-pg1-f170.google.com with SMTP id w8so8951671pgf.5 for <50131@debbugs.gnu.org>; Fri, 20 Aug 2021 05:09:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2lRAla9BPXv1ykQx7fftYWM3SfqBPYvZrx2fWuURDck=; b=FRgJklUIutW8K4FeiAOxB+WZj8JIoqH5adSNTPZDjmEKPAwOb48D2ZZPn3gsFvhL7q vqhQQHY9YJpaUJdwgpHEpAFfTadyydPA3ReObXbUIhHmFedk2LNBMdxnm1VdxJMFBmiM ZQVFEoXHNzB0uMcSCpSIOT4WhkvP9JXoqqXVhm18vIVQm3uS3SzPDWwqcv6hpC5EuJeZ FunrlHSKBKARIEtKANB29HPzDqMUGm3HdUhfJaMYs2ylYq2GfHxMfrh1xWKkPvEUnkAA QIpSvOJVAU89zh0XaUjS9/3dtFmnbg+xdb8BgPsaVRnxvGufZGKzlgV7UXBX+kzIRWzq N+tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2lRAla9BPXv1ykQx7fftYWM3SfqBPYvZrx2fWuURDck=; b=THaB9tkHnQFXqoWwf+brciEMvGZ3putCNiq4cW2aKma6tqgIRRaZs5K8PtVeYZZjk6 HDxgbrv/nP2C3GBB6EYkM4Eoa3vbZ+zcgunoXYddJ5Lpm0TNLdK5bV/xfzUZI/XWYQRl cNbXNWJjgpTwuKilrTOgPEWkqlBTM1XrmhsHR3G1Dv2Z/+7oEcKeEcJvIoT6fG/3/klj 6mMxyxxge7NEz7s+C3I5CMXXLmsXuq8ZvSxofwNlykwsezUaCuhPXvaeEpS64l+egBhy HwkxB0QFkYAuCydxWAxz5EMFAXDZTM1lWcQYoF6YDBUHVOLVcqrcxEvAVtatLugwcoOT /8WA== X-Gm-Message-State: AOAM531hMkO5chrt1Qc5NWPcCFpHwylYx0QO0sXqVZm3QIZ6o0CeAM+A b0HbOxDuF68aEq2wdRHsJ4fVGeb2yDU= X-Google-Smtp-Source: ABdhPJz8Y3rEMNDAM9wgREb2ujXBF4AIffMPJCnha2/Q5wIBEs8GW8PnpmIENuRq8uGek6G2FtcPrA== X-Received: by 2002:a65:6494:: with SMTP id e20mr18803474pgv.101.1629461363177; Fri, 20 Aug 2021 05:09:23 -0700 (PDT) Received: from muon.fritz.box (220-235-208-141.tpgi.com.au. [220.235.208.141]) by smtp.gmail.com with ESMTPSA id gb17sm5543112pjb.26.2021.08.20.05.09.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Aug 2021 05:09:22 -0700 (PDT) From: Andrew Whatson Date: Fri, 20 Aug 2021 22:09:06 +1000 Message-Id: <20210820120907.83191-2-whatson@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210820120907.83191-1-whatson@gmail.com> References: <20210820120907.83191-1-whatson@gmail.com> 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" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/docbook.scm (docbook2x): New variable. --- gnu/packages/docbook.scm | 87 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/gnu/packages/docbook.scm b/gnu/packages/docbook.scm index 6a69f8cf89..fdc432eb20 100644 --- a/gnu/packages/docbook.scm +++ b/gnu/packages/docbook.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2020 Marius Bakke ;;; Copyright © 2021 Maxim Cournoyer ;;; Copyright © 2021 Mark H Weaver +;;; Copyright © 2021 Andrew Whatson ;;; ;;; This file is part of GNU Guix. ;;; @@ -24,10 +25,13 @@ (define-module (gnu packages docbook) #:use-module (gnu packages) + #:use-module (gnu packages bash) #:use-module (gnu packages compression) #:use-module (gnu packages imagemagick) #:use-module (gnu packages inkscape) #:use-module (gnu packages tex) + #:use-module (gnu packages texinfo) + #:use-module (gnu packages perl) #:use-module (gnu packages python) #:use-module (gnu packages base) #:use-module (gnu packages xml) @@ -35,6 +39,7 @@ #:use-module (guix packages) #:use-module (guix download) #:use-module ((guix build utils) #:select (alist-replace)) + #:use-module (guix build-system gnu) #:use-module (guix build-system trivial) #:use-module (guix build-system python)) @@ -473,3 +478,85 @@ DB2LaTeX.") (package/inherit dblatex (inputs (alist-replace "imagemagick" `(,imagemagick/stable) (package-inputs dblatex)))))) + +(define-public docbook2x + (package + (name "docbook2x") + (version "0.8.8") + (source (origin + (method url-fetch) + (uri (string-append "mirror://sourceforge/docbook2x/docbook2x/" + version "/docbook2X-" version ".tar.gz")) + (sha256 + (base32 + "0ifwzk99rzjws0ixzimbvs83x6cxqk1xzmg84wa1p7bs6rypaxs0")))) + (build-system gnu-build-system) + (inputs + `(("bash-minimal" ,bash-minimal) + ("docbook-xml" ,docbook-xml) + ("perl" ,perl) + ("perl-xml-namespacesupport" ,perl-xml-namespacesupport) + ("perl-xml-parser" ,perl-xml-parser) + ("perl-xml-sax" ,perl-xml-sax) + ("perl-xml-sax-base" ,perl-xml-sax-base) + ("texinfo" ,texinfo) + ("xsltproc" ,libxslt))) + (arguments + `(#:configure-flags + (list (string-append "--prefix=" (assoc-ref %outputs "out"))) + #:phases + (modify-phases %standard-phases + (add-after 'configure 'patch-sources + (lambda* (#:key inputs outputs #:allow-other-keys) + ;; Fix failed substitution in config.pl + (substitute* "perl/config.pl" + (("\\$\\{prefix\\}") + (assoc-ref outputs "out"))) + ;; Fix a failing test (maybe it worked with old texinfo?) + (substitute* "test/complete-manuals/at1.xml" + (("") + "")) + ;; Patch all the tests use DocBook 4.5 + (substitute* (find-files "test" "\\.xml$") + (("\"-//OASIS//DTD DocBook XML V4\\..+//EN\"") + "\"-//OASIS//DTD DocBook XML V4.5//EN\"") + (("\"http://www\\.oasis-open\\.org/docbook/xml/4\\..+/docbookx.dtd\"") + "\"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd\"")) + ;; Set XML catalogs for tests to pass + (setenv "XML_CATALOG_FILES" + (string-append (assoc-ref inputs "docbook-xml") + "/xml/dtd/docbook/catalog.xml")))) + (add-after 'install 'wrap-programs + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (programs + (map (lambda (p) + (string-append out "/bin/" p)) + '("db2x_manxml" "db2x_texixml" "db2x_xsltproc" + "docbook2man" "docbook2texi"))) + (perl5lib + (map (lambda (i) + (string-append (assoc-ref inputs i) + "/lib/perl5/site_perl")) + '("perl-xml-namespacesupport" + "perl-xml-parser" + "perl-xml-sax" + "perl-xml-sax-base"))) + (xml-catalog-files + (list (string-append (assoc-ref inputs "docbook-xml") + "/xml/dtd/docbook/catalog.xml")))) + (map (lambda (program) + (wrap-program program + `("PERL5LIB" ":" prefix + ,perl5lib) + `("XML_CATALOG_FILES" " " prefix + ,xml-catalog-files))) + programs))))))) + (home-page "http://docbook2x.sourceforge.net") + (synopsis "Convert DocBook to man page and Texinfo format") + (description + "docbook2X is a software package that converts DocBook documents into the +traditional Unix man page format and the GNU Texinfo format. Notable features +include table support for man pages, internationalization support, and easy +customization of the output using XSLT.") + (license license:expat)))