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