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