projects/guix·blob java-team · refs

169 lines · 6.6 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2014 Eric Bavier <[email protected]>
3;;; Copyright © 2014 Federico Beffa <[email protected]>
4;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <[email protected]>
5;;; Copyright © 2021 Efraim Flashner <[email protected]>
6;;; Copyright © 2022 Ivan Vilata i Balaguer <[email protected]>
7;;; Copyright © 2023 Bruno Victal <[email protected]>
8;;;
9;;; This file is part of GNU Guix.
10;;;
11;;; GNU Guix is free software; you can redistribute it and/or modify it
12;;; under the terms of the GNU General Public License as published by
13;;; the Free Software Foundation; either version 3 of the License, or (at
14;;; your option) any later version.
15;;;
16;;; GNU Guix is distributed in the hope that it will be useful, but
17;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;;; GNU General Public License for more details.
20;;;
21;;; You should have received a copy of the GNU General Public License
22;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24(define-module (gnu packages xfig)
25 #:use-module (guix packages)
26 #:use-module ((guix licenses) #:prefix license:)
27 #:use-module (guix download)
28 #:use-module (guix gexp)
29 #:use-module (guix build-system gnu)
30 #:use-module (gnu packages)
31 #:use-module (gnu packages autotools)
32 #:use-module (gnu packages freedesktop)
33 #:use-module (gnu packages ghostscript)
34 #:use-module (gnu packages xorg)
35 #:use-module (gnu packages pkg-config)
36 #:use-module (gnu packages image)
37 #:use-module (gnu packages ghostscript)
38 #:use-module (gnu packages imagemagick)
39 #:use-module (gnu packages netpbm)
40 #:use-module (gnu packages compression))
41
42(define-public fig2dev
43 (package
44 (name "fig2dev")
45 (version "3.2.9")
46 (source
47 (origin
48 (method url-fetch)
49 (uri (string-append "mirror://sourceforge/mcj/"
50 name "-" version ".tar.xz"))
51 (sha256
52 (base32
53 "1cch429zbmrg2zy1mkx9xwnpvkjhmlw40c88bvi2virws744dqhm"))))
54 (build-system gnu-build-system)
55 (arguments
56 (list
57 #:modules '((guix build gnu-build-system)
58 (guix build utils)
59 (srfi srfi-26))
60 #:phases
61 #~(modify-phases %standard-phases
62 (add-after 'install 'wrap-program
63 (lambda* (#:key inputs #:allow-other-keys)
64 (let ((programs
65 (find-files (string-append #$output "/bin")))
66 (path
67 (search-path-as-list
68 '("bin")
69 (map (cut assoc-ref inputs <>)
70 (list "ghostscript" "imagemagick")))))
71 (for-each (lambda (program)
72 (wrap-program program
73 `("PATH" ":" prefix ,path)))
74 programs)))))))
75 (inputs
76 (list libpng zlib
77 ;; Quoth INSTALL:
78 ;; “To run fig2dev, the packages
79 ;; ghostscript, and one out of
80 ;; netpbm | ImageMagick | GraphicsMagick
81 ;; are needed to produce various bitmap output formats, or process
82 ;; fig files with embedded images.”
83 ghostscript
84 imagemagick))
85 (native-inputs
86 ;; XXX: Tests fail if netpbm is absent.
87 (list netpbm))
88 (home-page "https://sourceforge.net/projects/mcj")
89 (synopsis "Translate Fig to other graphic description formats")
90 (description "Fig2dev is a set of tools for creating TeX documents with
91graphics which are portable, in the sense that they can be printed in a wide
92variety of environments.")
93 (license
94 (license:non-copyleft "file://Makefile.am"
95 "See <https://spdx.org/licenses/Xfig.html>."))))
96
97(define-public xfig
98 (package
99 (name "xfig")
100 (version "3.2.9")
101 (source
102 (origin
103 (method url-fetch)
104 (uri (string-append "mirror://sourceforge/mcj/"
105 name "-" version ".tar.xz"))
106 (sha256
107 (base32
108 "1xy2zqbd1wn2fij95kgnj39850r7xk74kvx7kp0dxhmvs429vv8k"))
109 ;; TODO: Remove these patches and snippet when updating,
110 ;; upstreamed since commit `84375ac05e923b46bbacc8b336b0dfbe29497b6b'.
111 (patches
112 (search-patches "xfig-Enable-error-message-for-missing-libraries.patch"
113 "xfig-Use-pkg-config-to-set-fontconfig-CFLAGS-and-LIBS.patch"
114 "xfig-Fix-double-free-when-requesting-MediaBox.patch"))
115 (modules '((guix build utils)))
116 (snippet
117 ;; The patch-dot-desktop-files phase requires a relative name.
118 #~(begin
119 (substitute* "xfig.desktop"
120 (("^(Exec=)/usr/bin/" _ key) key))
121 ;; This forces autoreconf to be invoked, needed for patches
122 ;; to be effective.
123 (delete-file "configure")))))
124 (build-system gnu-build-system)
125 (arguments
126 (list
127 #:modules '((guix build gnu-build-system)
128 (guix build utils)
129 (srfi srfi-26))
130 #:phases
131 #~(modify-phases %standard-phases
132 (add-after 'install 'wrap-program
133 (lambda* (#:key inputs #:allow-other-keys)
134 (let ((path
135 (search-path-as-list
136 '("bin")
137 (map (cut assoc-ref inputs <>)
138 (list "ghostscript" "fig2dev")))))
139 (wrap-program (string-append #$output "/bin/xfig")
140 `("PATH" ":" prefix ,path))))))))
141 (native-inputs
142 (list pkg-config
143 ;; TODO: Remove the import on (gnu packages autotools)
144 ;; and related packages in the next update.
145 autoconf automake libtool
146 ;; For tests.
147 desktop-file-utils))
148 (inputs
149 (list ghostscript
150 fig2dev
151 libxaw3d
152 libjpeg-turbo
153 libpng
154 libxpm
155 libx11
156 libxft
157 libxt))
158 (home-page "https://mcj.sourceforge.net/")
159 (synopsis "Interactive drawing tool")
160 (description
161 "Xfig is an interactive drawing tool which runs under X Window System.
162In xfig, figures may be drawn using objects such as circles, boxes, lines,
163spline curves, text, etc. It is also possible to import images in formats
164such as GIF, JPEG, EPSF (PostScript), etc. Those objects can be created,
165deleted, moved or modified. Attributes such as colors or line styles can be
166selected in various ways. For text, 35 fonts are available.")
167 (license
168 (license:non-copyleft "file://Makefile.am"
169 "See <https://spdx.org/licenses/Xfig.html>."))))