1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
3 ;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch>
4 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;; This file is part of GNU Guix.
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21 (define-module (gnu packages xfig)
22 #:use-module (guix packages)
23 #:use-module ((guix licenses) #:select (bsd-2))
24 #:use-module (guix download)
25 #:use-module (guix build-system gnu)
26 #:use-module (gnu packages)
27 #:use-module (gnu packages freedesktop)
28 #:use-module (gnu packages xorg)
29 #:use-module (gnu packages image)
30 #:use-module (gnu packages compression))
39 (uri (string-append "mirror://sourceforge/mcj/"
40 name "-" version ".tar.xz"))
43 "096zgp0bqnxhgxbrv2jjylrjz3pr4da0xxznlk2z7ffxr5pri2fa"))))
44 (build-system gnu-build-system)
47 `(("desktop-file-utils" ,desktop-file-utils)))
49 `(("libxaw3d" ,libxaw3d)
57 (modify-phases %standard-phases
58 (add-before 'install 'strip-bogus-exec-prefix
59 (lambda* (#:key outputs #:allow-other-keys)
60 (substitute* "xfig.desktop"
61 ;; The patch-dot-desktop-files phase requires a relative name.
62 (("Exec=/usr/bin/xfig") "Exec=xfig"))
64 (home-page "http://mcj.sourceforge.net/")
65 (synopsis "Interactive drawing tool")
67 "Xfig is an interactive drawing tool which runs under X Window System.
68 In xfig, figures may be drawn using objects such as circles, boxes, lines,
69 spline curves, text, etc. It is also possible to import images in formats
70 such as GIF, JPEG, EPSF (PostScript), etc. Those objects can be created,
71 deleted, moved or modified. Attributes such as colors or line styles can be
72 selected in various ways. For text, 35 fonts are available.")
75 (define-public transfig
82 (uri (string-append "mirror://sourceforge/mcj/mcj-source/transfig."
86 "0i3p7qmg2w8qrad3pn42b0miwarql7yy0gpd49b1bpal6bqsiicf"))))
87 (build-system gnu-build-system)
90 ("makedepend" ,makedepend)))
101 (modify-phases %standard-phases
103 (lambda* (#:key inputs outputs #:allow-other-keys)
104 (let ((imake (assoc-ref inputs "imake"))
105 (out (assoc-ref outputs "out")))
106 (substitute* '("fig2dev/Imakefile"
107 "transfig/Imakefile")
108 (("XCOMM (BINDIR = )[[:graph:]]*" _ front)
109 (string-append front out "/bin"))
110 (("XCOMM USEINLINE") "USEINLINE")
111 ;; The variable name is deceptive. The directory is used as an
112 ;; installation path for bitmaps.
113 (("(XFIGLIBDIR =[[:blank:]]*)[[:graph:]]*" _ front)
114 (string-append front out "/lib"))
115 (("(XPMLIBDIR = )[[:graph:]]*" _ front)
116 (string-append front (assoc-ref inputs "libxpm") "/lib"))
117 (("(XPMINC = -I)[[:graph:]]*" _ front)
118 (string-append front (assoc-ref inputs "libxpm") "/include/X11"))
119 (("/usr/local/lib/fig2dev") (string-append out "/lib")))
120 ;; The -a argument is required in order to pick up the correct paths
121 ;; to several X header files.
122 (invoke "xmkmf" "-a")
123 (substitute* '("Makefile"
126 ;; These imake variables somehow remain undefined
127 (("DefaultGcc2[[:graph:]]*Opt") "-O2")
128 ;; Reset a few variable defaults that are set in imake templates
130 (("(MANPATH = )[[:graph:]]*" _ front)
131 (string-append front out "/share/man"))
132 (("(CONFDIR = )([[:graph:]]*)" _ front default)
133 (string-append front out default)))
135 (add-after 'install 'install/doc
137 (invoke "make" "install.man"))))))
138 (home-page "http://mcj.sourceforge.net/")
139 (synopsis "Create portable LaTeX figures")
141 "Transfig creates a makefile to translate figures described in Fig code
142 or PIC into a specified LaTeX graphics language. PIC files are identified by
143 the suffix \".pic\"; Fig files can be specified either with or without the
144 suffix \".fig\". Transfig also creates a TeX macro file appropriate to the