projects/guix·blob python-team · refs

272 lines · 10.9 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <[email protected]>
3;;; Copyright © 2015 Eric Bavier <[email protected]>
4;;; Copyright © 2015 Ricardo Wurmus <[email protected]>
5;;; Copyright © 2016 Leo Famulari <[email protected]>
6;;; Copyright © 2016, 2021 Mark H Weaver <[email protected]>
7;;; Copyright © 2017, 2024 Efraim Flashner <[email protected]>
8;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <[email protected]>
9;;; Copyright © 2018 Alex Vong <[email protected]>
10;;; Copyright © 2020 Marius Bakke <[email protected]>
11;;; Copyright © 2020 Vinicius Monego <[email protected]>
12;;;
13;;; This file is part of GNU Guix.
14;;;
15;;; GNU Guix is free software; you can redistribute it and/or modify it
16;;; under the terms of the GNU General Public License as published by
17;;; the Free Software Foundation; either version 3 of the License, or (at
18;;; your option) any later version.
19;;;
20;;; GNU Guix is distributed in the hope that it will be useful, but
21;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23;;; GNU General Public License for more details.
24;;;
25;;; You should have received a copy of the GNU General Public License
26;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27
28(define-module (gnu packages imagemagick)
29 #:use-module (guix packages)
30 #:use-module (guix gexp)
31 #:use-module (guix build-system gnu)
32 #:use-module (guix build-system perl)
33 #:use-module (guix download)
34 #:use-module (guix utils)
35 #:use-module ((guix licenses) #:prefix license:)
36 #:use-module (gnu packages)
37 #:use-module (gnu packages algebra)
38 #:use-module (gnu packages compression)
39 #:use-module (gnu packages fontutils)
40 #:use-module (gnu packages ghostscript)
41 #:use-module (gnu packages graphviz)
42 #:use-module (gnu packages gtk)
43 #:use-module (gnu packages image)
44 #:use-module (gnu packages pkg-config)
45 #:use-module (gnu packages xml)
46 #:use-module (gnu packages xorg)
47 #:use-module (srfi srfi-1))
48
49;; This is a variant of the 'imagemagick' package that is not updated often.
50;; It is intended to be used as a native-input at build-time only, e.g. by
51;; 'gtk-doc' (via 'dblatex') for generating package documentation. This
52;; allows the main 'imagemagick' package to be freely updated on the 'master'
53;; branch without triggering an excessive number of rebuilds.
54;;
55;; Normally the grafts mechanism would be used, but there are often
56;; difficulties grafting imagemagick, e.g. because upstream changes the ABI
57;; between micro version updates. Also, the overwhelming majority of
58;; dependencies on imagemagick are via 'gtk-doc' in 'native-inputs', where
59;; grafting is ineffective. See:
60;; <https://lists.gnu.org/archive/html/guix-devel/2021-03/msg00381.html>.
61(define-public imagemagick/stable
62 (hidden-package
63 (package
64 (name "imagemagick")
65 ;; The 7 release series has an incompatible API, while the 6 series is still
66 ;; maintained. Don't update to 7 until we've made sure that the ImageMagick
67 ;; users are ready for the 7-series API.
68 (version "6.9.13-5")
69 (source (origin
70 (method url-fetch)
71 (uri (string-append "mirror://imagemagick/ImageMagick-"
72 version ".tar.xz"))
73 (sha256
74 (base32
75 "1j1chkw33vjc37509vdwss28qywfvckvs73pvscldj8d0wnwypa8"))))
76 (build-system gnu-build-system)
77 (arguments
78 (list
79 #:configure-flags
80 #~(list "--with-frozenpaths"
81 "--without-gcc-arch"
82 (string-append "--with-gs-font-dir="
83 (search-input-directory %build-inputs
84 "share/fonts/type1"))
85 ;; No documentation in the stable version.
86 "--disable-docs"
87 ;; Do not embed the build date in binaries.
88 "--enable-reproducible-build")
89 #:phases
90 #~(modify-phases %standard-phases
91 (add-before 'build 'pre-build
92 (lambda _
93 (substitute* "Makefile"
94 ;; Clear the `LIBRARY_PATH' setting, which otherwise
95 ;; interferes with our own use.
96 (("^LIBRARY_PATH[[:blank:]]*=.*$") ""))))
97 (add-before 'configure 'strip-configure-xml
98 (lambda _
99 (substitute* "config/configure.xml.in"
100 ;; Do not record 'configure' arguments in the
101 ;; configure.xml file that gets installed: That would
102 ;; include --docdir, and thus retain a reference to the
103 ;; 'doc' output.
104 (("@CONFIGURE_ARGS@")
105 "not recorded")))))))
106 ;; TODO: Add Jasper etc.
107 (inputs
108 (list bzip2
109 fftw
110 freetype
111 ghostscript
112 graphviz
113 lcms
114 libjpeg-turbo
115 libpng
116 libtiff
117 libwebp
118 libx11
119 libxml2
120 pango
121 xz
122 zlib
123 zstd))
124 (native-inputs
125 (list font-ghostscript
126 pkg-config))
127 (home-page "https://www.imagemagick.org/")
128 (synopsis "Create, edit, compose, or convert bitmap images")
129 (description
130 "ImageMagick is a software suite to create, edit, compose, or convert
131bitmap images. It can read and write images in a variety of formats (over 100)
132including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG,
133and TIFF. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and
134transform images, adjust image colors, apply various special effects, or draw
135text, lines, polygons, ellipses and Bézier curves.")
136 (license (license:fsf-free "http://www.imagemagick.org/script/license.php")))))
137
138(define-public imagemagick
139 (package
140 (inherit imagemagick/stable)
141 (outputs '("out" "doc")) ; 11 MiB of HTML documentation
142 (properties (alist-delete 'hidden? (package-properties imagemagick/stable)))
143 ;; The 7 release series has an incompatible API, while the 6 series is still
144 ;; maintained. Don't update to 7 until we've made sure that the ImageMagick
145 ;; users are ready for the 7-series API.
146 (version "6.9.13-5")
147 (source (origin
148 (method url-fetch)
149 (uri (string-append "mirror://imagemagick/ImageMagick-"
150 version ".tar.xz"))
151 (sha256
152 (base32
153 "1j1chkw33vjc37509vdwss28qywfvckvs73pvscldj8d0wnwypa8"))))
154 (arguments
155 (substitute-keyword-arguments (package-arguments imagemagick/stable)
156 ((#:configure-flags flags #~'())
157 #~(delete "--disable-docs" #$flags))
158 ((#:phases phases #~'%standard-phases)
159 #~(modify-phases #$phases
160 (add-before 'build 'set-doc-directory
161 (lambda _
162 (substitute* "Makefile"
163 ;; Since the Makefile overrides $docdir, modify it to
164 ;; refer to what we want.
165 (("^DOCUMENTATION_PATH[[:blank:]]*=.*$")
166 (string-append "DOCUMENTATION_PATH = "
167 #$output:doc "/share/doc/"
168 #$(package-name this-package) "-"
169 #$(package-version this-package) "\n")))))))))))
170
171(define-public perl-image-magick
172 (package
173 (name "perl-image-magick")
174 (version "6.89")
175 (source
176 (origin
177 (method url-fetch)
178 (uri (string-append "mirror://cpan/authors/id/J/JC/JCRISTY/"
179 "PerlMagick-" version "-1.tar.gz"))
180 (sha256
181 (base32
182 "0n9afy1z5bhf9phrbahnkwhgcmijn8jggpbzwrivw1zhliliiy68"))))
183 (build-system perl-build-system)
184 (native-inputs (list pkg-config))
185 (inputs (list imagemagick))
186 (arguments
187 `(#:tests? #f ;;Failed 2/23 test programs. 2/353 subtests failed.
188 #:phases
189 (modify-phases %standard-phases
190 (add-before
191 'configure 'image-magick-flags
192 (lambda* (#:key inputs #:allow-other-keys)
193 (let ((im (assoc-ref inputs "imagemagick")))
194 (substitute* "Makefile.PL"
195 (("my \\$INC_magick = .*")
196 "my $INC_magick = `pkg-config --cflags ImageMagick`;\n")
197 (("my \\$LIBS_magick = .*")
198 "my $LIBS_magick = `pkg-config --libs ImageMagick`;\n"))
199 #t)))
200 (add-before
201 'check 'skip-mpeg-tests
202 (lambda _
203 ;; TODO: MPEG tests fail even though our imagemagick supports
204 ;; MPEG. Has been reported elsewhere,
205 ;; http://www.imagemagick.org/discourse-server/viewtopic.php?f=7&t=25036,
206 ;; so skip for now.
207 (delete-file "t/mpeg/read.t")
208 #t)))))
209 (home-page "https://metacpan.org/release/PerlMagick")
210 (synopsis "Perl interface to ImageMagick")
211 (description "This Perl extension allows the reading, manipulation and
212writing of a large number of image file formats using the ImageMagick library.
213Use it to create, edit, compose, or convert bitmap images from within a Perl
214script.")
215 ;; See Magick.pm
216 (license (package-license imagemagick))))
217
218(define-public graphicsmagick
219 (package
220 (name "graphicsmagick")
221 (version "1.3.40")
222 (source
223 (origin
224 (method url-fetch)
225 (uri
226 (list
227 (string-append "mirror://sourceforge/graphicsmagick/graphicsmagick"
228 "/" version "/GraphicsMagick-" version ".tar.xz")
229 (string-append "ftp://ftp.graphicsmagick.org/pub/"
230 "GraphicsMagick/" (version-major+minor version)
231 "/GraphicsMagick-" version ".tar.xz")))
232 (sha256
233 (base32
234 "0ikpza74p00hrs4z2cgykf7vhlqnzzkhaidjlcjppiw99sfimp4p"))))
235 (build-system gnu-build-system)
236 (arguments
237 (list
238 #:configure-flags
239 #~(list "--with-frozenpaths"
240 "--enable-shared=yes"
241 "--with-x=yes"
242 "--with-quantum-depth=16" ;required by Octave
243 "--enable-quantum-library-names"
244 (string-append "--with-gs-font-dir="
245 (search-input-directory
246 %build-inputs "share/fonts/type1/ghostscript")))))
247 (inputs
248 (list bzip2
249 font-ghostscript
250 freetype
251 ghostscript
252 graphviz
253 lcms
254 libjpeg-turbo
255 libpng
256 libtiff
257 libwebp
258 libxml2
259 libx11
260 xz
261 zlib))
262 (native-inputs
263 (list pkg-config))
264 (outputs '("out" ; 13 MiB
265 "doc")) ; ~7 MiB
266 (home-page "http://www.graphicsmagick.org")
267 (synopsis "Create, edit, compose, or convert bitmap images")
268 (description
269 "GraphicsMagick provides a comprehensive collection of utilities,
270programming interfaces, and GUIs, to support file format conversion, image
271processing, and 2D vector rendering.")
272 (license license:expat)))