From patchwork Sun Sep 24 15:30:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 54271 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 6061F27BBEC; Sun, 24 Sep 2023 16:32:04 +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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 842D527BBE2 for ; Sun, 24 Sep 2023 16:32:02 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkR5O-0003Jq-2a; Sun, 24 Sep 2023 11:31:54 -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 1qkR5N-0003Jf-4q for guix-patches@gnu.org; Sun, 24 Sep 2023 11:31:53 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qkR5M-00056f-TP for guix-patches@gnu.org; Sun, 24 Sep 2023 11:31:52 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qkR5W-0004nG-Kn; Sun, 24 Sep 2023 11:32:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#65873] [PATCH v2 2/3] gnu: Add fig2dev. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: andreas@enge.fr, rekado@elephly.net, guix-patches@gnu.org Resent-Date: Sun, 24 Sep 2023 15:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65873 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 65873@debbugs.gnu.org Cc: Bruno Victal , Andreas Enge , Ricardo Wurmus X-Debbugs-Original-Xcc: Andreas Enge , Ricardo Wurmus Received: via spool by 65873-submit@debbugs.gnu.org id=B65873.169556947018337 (code B ref 65873); Sun, 24 Sep 2023 15:32:02 +0000 Received: (at 65873) by debbugs.gnu.org; 24 Sep 2023 15:31:10 +0000 Received: from localhost ([127.0.0.1]:43433 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkR4f-0004lg-Hj for submit@debbugs.gnu.org; Sun, 24 Sep 2023 11:31:10 -0400 Received: from smtpm4.myservices.hosting ([185.26.105.235]:54918) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkR4c-0004lW-GT for 65873@debbugs.gnu.org; Sun, 24 Sep 2023 11:31:07 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm4.myservices.hosting (Postfix) with ESMTP id 0B4EC20D0E for <65873@debbugs.gnu.org>; Sun, 24 Sep 2023 17:30:53 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 56A1F8009A; Sun, 24 Sep 2023 17:30:53 +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 seLksk3__z76; Sun, 24 Sep 2023 17:30:52 +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 477D180095; Sun, 24 Sep 2023 17:30:52 +0200 (CEST) From: Bruno Victal Date: Sun, 24 Sep 2023 16:30:26 +0100 Message-ID: X-Mailer: git-send-email 2.41.0 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 The source used by the transfig package is outdated and its development was moved into the repository used by fig2dev though the utility `transfig' is considered obsolete and not built by default in the fig2dev package. In practice this isn't a problem since the user is generally after the `fig2dev' utility which was also provided in the (now obsolete) transfig package. Note texlive-latex-make: Description upstreamed with 1dcc04aaa860b123924ae83fc30a47d6f7179f7a. [1] [1]: * gnu/packages/xfig.scm: Import all of (guix licenses). (xfig)[license]: Adjust accordingly. (fig2dev): New variable. (transfig): Remove & mark as deprecated package with fig2dev as its replacement. * gnu/packages/patches/transfig-gcc10-fno-common.patch: Remove. * gnu/local.mk: Unregister it. * gnu/packages/docbook.scm (dblatex): Update comment. * gnu/packages/tex.scm (texlive-latex-make)[description]: Update description. --- gnu/local.mk | 1 - gnu/packages/docbook.scm | 2 +- .../patches/transfig-gcc10-fno-common.patch | 33 ---- gnu/packages/tex.scm | 2 +- gnu/packages/xfig.scm | 146 ++++++++---------- 5 files changed, 65 insertions(+), 119 deletions(-) delete mode 100644 gnu/packages/patches/transfig-gcc10-fno-common.patch diff --git a/gnu/local.mk b/gnu/local.mk index ee9a509f1b..d26720640e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -2026,7 +2026,6 @@ dist_patch_DATA = \ %D%/packages/patches/tootle-glib-object-naming.patch \ %D%/packages/patches/tootle-reason-phrase.patch \ %D%/packages/patches/transcode-ffmpeg.patch \ - %D%/packages/patches/transfig-gcc10-fno-common.patch \ %D%/packages/patches/trytond-add-egg-modules-to-path.patch \ %D%/packages/patches/trytond-add-guix_trytond_path.patch \ %D%/packages/patches/ttf2eot-cstddef.patch \ diff --git a/gnu/packages/docbook.scm b/gnu/packages/docbook.scm index ff6d32b168..c47d3db2c0 100644 --- a/gnu/packages/docbook.scm +++ b/gnu/packages/docbook.scm @@ -532,7 +532,7 @@ (define-public dblatex (base32 "0yd09nypswy3q4scri1dg7dr99d7gd6r2dwx0xm81l9f4y32gs0n")))) (build-system python-build-system) - ;; TODO: Add xfig/transfig for fig2dev utility + ;; TODO: Add fig2dev for fig2dev utility. (inputs `(("texlive" ,(texlive-updmap.cfg (list texlive-anysize texlive-appendix diff --git a/gnu/packages/patches/transfig-gcc10-fno-common.patch b/gnu/packages/patches/transfig-gcc10-fno-common.patch deleted file mode 100644 index ebe9236533..0000000000 --- a/gnu/packages/patches/transfig-gcc10-fno-common.patch +++ /dev/null @@ -1,33 +0,0 @@ -Fixes "multiple definition" errors when building with GCC 10+. - -Based on . ---- a/fig2dev/dev/gensvg.c 2010-07-01 22:41:16.000000000 +0200 -+++ b/fig2dev/dev/gensvg.c 2022-02-27 20:02:33.379945500 +0100 -@@ -230,10 +230,12 @@ - }; - - /* arrowhead arrays */ --Point points[50], fillpoints[50], clippoints[50]; --int npoints, nfillpoints, nclippoints; --int arrowx1, arrowy1; /* first point of object */ --int arrowx2, arrowy2; /* second point of object */ -+Point fillpoints[50]; -+int nfillpoints; -+extern Point points[50], clippoints[50]; -+extern int npoints, nclippoints; -+extern int arrowx1, arrowy1; /* first point of object */ -+extern int arrowx2, arrowy2; /* second point of object */ - - static int tileno=0; /* number of current tile */ - ---- a/fig2dev/fig2dev.h 2010-03-16 19:53:20.000000000 +0100 -+++ b/fig2dev/fig2dev.h 2022-02-27 19:56:06.072253991 +0100 -@@ -126,7 +126,7 @@ - extern char *prog, *from, *to; - extern char *name; - extern double font_size; --Boolean correct_font_size; /* use correct font size */ -+extern Boolean correct_font_size; /* use correct font size */ - extern double mag, fontmag; - extern FILE *tfp; - diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm index bd02190a51..b5da339353 100644 --- a/gnu/packages/tex.scm +++ b/gnu/packages/tex.scm @@ -40434,7 +40434,7 @@ (define-public texlive-latex-make @item @file{figlatex.sty}: a LaTeX package to easily insert Xfig figures. It can interact with LaTeX.mk so that the latter automatically invokes -@command{transfig} if needed. +@command{fig2dev} if needed. @end itemize") (license license:gpl3+))) diff --git a/gnu/packages/xfig.scm b/gnu/packages/xfig.scm index f68ddb01f9..a9a86fc2ed 100644 --- a/gnu/packages/xfig.scm +++ b/gnu/packages/xfig.scm @@ -23,7 +23,7 @@ (define-module (gnu packages xfig) #:use-module (guix packages) - #:use-module ((guix licenses) #:select (bsd-2)) + #:use-module ((guix licenses) #:prefix license:) #:use-module (guix download) #:use-module (guix gexp) #:use-module (guix build-system gnu) @@ -32,8 +32,69 @@ (define-module (gnu packages xfig) #:use-module (gnu packages ghostscript) #:use-module (gnu packages xorg) #:use-module (gnu packages image) + #:use-module (gnu packages ghostscript) + #:use-module (gnu packages imagemagick) + #:use-module (gnu packages netpbm) #:use-module (gnu packages compression)) +(define-public fig2dev + (package + (name "fig2dev") + (version "3.2.9") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://sourceforge/mcj/" + name "-" version ".tar.xz")) + (sha256 + (base32 + "1cch429zbmrg2zy1mkx9xwnpvkjhmlw40c88bvi2virws744dqhm")))) + (build-system gnu-build-system) + (arguments + (list + #:modules '((guix build gnu-build-system) + (guix build utils) + (srfi srfi-26)) + #:phases + #~(modify-phases %standard-phases + (add-after 'install 'wrap-program + (lambda* (#:key inputs #:allow-other-keys) + (let ((programs + (find-files (string-append #$output "/bin"))) + (path + (search-path-as-list + '("bin") + (map (cut assoc-ref inputs <>) + (list "ghostscript" "imagemagick"))))) + (for-each (lambda (program) + (wrap-program program + `("PATH" ":" prefix ,path))) + programs))))))) + (inputs + (list libpng zlib + ;; Quoth INSTALL: + ;; “To run fig2dev, the packages + ;; ghostscript, and one out of + ;; netpbm | ImageMagick | GraphicsMagick + ;; are needed to produce various bitmap output formats, or process + ;; fig files with embedded images.” + ghostscript + imagemagick)) + (native-inputs + ;; XXX: Tests fail if netpbm is absent. + (list netpbm)) + (home-page "https://sourceforge.net/projects/mcj") + (synopsis "Translate Fig to other graphic description formats") + (description "Fig2dev is a set of tools for creating TeX documents with +graphics which are portable, in the sense that they can be printed in a wide +variety of environments.") + (license + (license:non-copyleft "file://Makefile.am" + "See .")))) + +(define-public transfig + (deprecated-package "transfig" fig2dev)) + (define-public xfig (package (name "xfig") @@ -71,85 +132,4 @@ (define-public xfig such as GIF, JPEG, EPSF (PostScript), etc. Those objects can be created, deleted, moved or modified. Attributes such as colors or line styles can be selected in various ways. For text, 35 fonts are available.") - (license bsd-2))) - -(define-public transfig - (package - (name "transfig") - (version "3.2.5e") - (source - (origin - (method url-fetch) - (uri (string-append "mirror://sourceforge/mcj/mcj-source/transfig." - version ".tar.gz")) - (sha256 - (base32 - "0i3p7qmg2w8qrad3pn42b0miwarql7yy0gpd49b1bpal6bqsiicf")) - (patches - (search-patches - "transfig-gcc10-fno-common.patch")))) ; fix GCC10 build - (build-system gnu-build-system) - (native-inputs - (list imake makedepend)) - (inputs - `(("xfig" ,xfig) - ("libjpeg" ,libjpeg-turbo) - ("libpng" ,libpng) - ("libxpm" ,libxpm) - ("libx11" ,libx11) - ("zlib" ,zlib))) - (arguments - `(#:tests? #f - #:phases - (modify-phases %standard-phases - (replace 'configure - (lambda* (#:key inputs outputs #:allow-other-keys) - (let ((imake (assoc-ref inputs "imake")) - (out (assoc-ref outputs "out"))) - (substitute* '("fig2dev/Imakefile" - "transfig/Imakefile") - (("XCOMM (BINDIR = )[[:graph:]]*" _ front) - (string-append front out "/bin")) - (("XCOMM USEINLINE") "USEINLINE") - ;; The variable name is deceptive. The directory is used as an - ;; installation path for bitmaps. - (("(XFIGLIBDIR =[[:blank:]]*)[[:graph:]]*" _ front) - (string-append front out "/lib")) - (("(XPMLIBDIR = )[[:graph:]]*" _ front) - (string-append front (assoc-ref inputs "libxpm") "/lib")) - (("(XPMINC = -I)[[:graph:]]*" _ front) - (string-append front (assoc-ref inputs "libxpm") "/include/X11")) - (("/usr/local/lib/fig2dev") (string-append out "/lib"))) - ;; The -a argument is required in order to pick up the correct paths - ;; to several X header files. - (invoke "xmkmf" "-a") - (substitute* '("Makefile" - "fig2dev/Makefile" - "fig2dev/dev/Makefile" - "transfig/Makefile") - ;; These imake variables somehow remain undefined - (("DefaultGcc2[[:graph:]]*Opt") "-O2") - ;; Reset a few variable defaults that are set in imake templates - ((imake) out) - (("(MANPATH = )[[:graph:]]*" _ front) - (string-append front out "/share/man")) - (("(CONFDIR = )([[:graph:]]*)" _ front default) - (string-append front out default)) - ;; The "l" option was silently ignored until binutils 2.36, - ;; where it got a different purpose. So remove it to avoid - ;; "ar: libdeps specified more than once". - (("((AR|MODAR) = ar )clq" _ front) - (string-append front "cq"))) - #t))) - (add-after 'install 'install/doc - (lambda _ - (invoke "make" "install.man")))))) - (home-page "https://mcj.sourceforge.net/") - (synopsis "Create portable LaTeX figures") - (description - "Transfig creates a makefile to translate figures described in Fig code -or PIC into a specified LaTeX graphics language. PIC files are identified by -the suffix \".pic\"; Fig files can be specified either with or without the -suffix \".fig\". Transfig also creates a TeX macro file appropriate to the -target language.") - (license bsd-2))) + (license license:bsd-2)))