gnu: python-unidecode: Fix typo in description.
[jackhill/guix/guix.git] / gnu / packages / imagemagick.scm
CommitLineData
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>
1cc21385 6;;; Copyright © 2016 Mark H Weaver <mhw@netris.org>
0ff44ba4 7;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
7fa37abc
LC
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 imagemagick)
25 #:use-module (guix packages)
26 #:use-module (guix build-system gnu)
b56a918f 27 #:use-module (guix build-system perl)
7fa37abc 28 #:use-module (guix download)
ac838d0f 29 #:use-module (guix utils)
bf50f7b5 30 #:use-module ((guix licenses) #:prefix license:)
2ed74cea 31 #:use-module (gnu packages)
9b937137 32 #:use-module (gnu packages algebra)
7fa37abc 33 #:use-module (gnu packages compression)
9b937137
AE
34 #:use-module (gnu packages fontutils)
35 #:use-module (gnu packages ghostscript)
7fa37abc 36 #:use-module (gnu packages graphviz)
7fa37abc 37 #:use-module (gnu packages gtk)
e55354b8 38 #:use-module (gnu packages image)
9b937137
AE
39 #:use-module (gnu packages pkg-config)
40 #:use-module (gnu packages xml)
41 #:use-module (gnu packages xorg))
7fa37abc
LC
42
43(define-public imagemagick
44 (package
45 (name "imagemagick")
5ba5b4b2
LF
46 ;; The 7 release series has an incompatible API, while the 6 series is still
47 ;; maintained. Don't update to 7 until we've made sure that the ImageMagick
48 ;; users are ready for the 7-series API.
790ba6d3 49 (version "6.9.9-12")
7fa37abc
LC
50 (source (origin
51 (method url-fetch)
52 (uri (string-append "mirror://imagemagick/ImageMagick-"
53 version ".tar.xz"))
54 (sha256
55 (base32
790ba6d3 56 "10k63nb1wi5fq1xg1wkjfw7ph46ysy8rndgp18knj2zr06zjjrc5"))))
7fa37abc
LC
57 (build-system gnu-build-system)
58 (arguments
00831624 59 `(#:configure-flags '("--with-frozenpaths" "--without-gcc-arch")
e98e9f4e
MW
60 ;; FIXME: The test suite succeeded before version 6.9.6-2.
61 ;; Try enabling it again with newer releases.
62 #:tests? #f
3cbf1204 63 #:phases (modify-phases %standard-phases
790c3717
LC
64 (add-before
65 'build 'pre-build
66 (lambda* (#:key outputs #:allow-other-keys)
67 (substitute* "Makefile"
68 ;; Clear the `LIBRARY_PATH' setting, which otherwise
69 ;; interferes with our own use.
70 (("^LIBRARY_PATH[[:blank:]]*=.*$")
71 "")
7fa37abc 72
790c3717
LC
73 ;; Since the Makefile overrides $docdir, modify it to
74 ;; refer to what we want.
75 (("^DOCUMENTATION_PATH[[:blank:]]*=.*$")
76 (let ((doc (assoc-ref outputs "doc")))
77 (string-append "DOCUMENTATION_PATH = "
78 doc "/share/doc/"
79 ,name "-" ,version "\n"))))))
80 (add-before
81 'configure 'strip-configure-xml
82 (lambda _
83 (substitute* "config/configure.xml.in"
84 ;; Do not record 'configure' arguments in the
85 ;; configure.xml file that gets installed: That would
86 ;; include --docdir, and thus retain a reference to the
87 ;; 'doc' output.
88 (("@CONFIGURE_ARGS@")
89 "not recorded")))))))
9b937137
AE
90 ;; TODO: Add Jasper etc.
91 (inputs `(("fftw" ,fftw)
92 ("graphviz" ,graphviz)
7fa37abc 93 ("ghostscript" ,ghostscript)
9b937137 94 ("lcms" ,lcms)
7fa37abc
LC
95 ("libx11" ,libx11)
96 ("zlib" ,zlib)
97 ("libxml2" ,libxml2)
98 ("libtiff" ,libtiff)
99 ("libpng" ,libpng)
2ed74cea 100 ("libjpeg" ,libjpeg)
7fa37abc
LC
101 ("pango" ,pango)
102 ("freetype" ,freetype)
103 ("bzip2" ,bzip2)
c4c4cc05
JD
104 ("xz" ,xz)))
105 (native-inputs `(("pkg-config" ,pkg-config)))
7fa37abc
LC
106 (outputs '("out"
107 "doc")) ; 26 MiB of HTML documentation
108 (home-page "http://www.imagemagick.org/")
109 (synopsis "Create, edit, compose, or convert bitmap images")
110 (description
c598e35c 111 "ImageMagick is a software suite to create, edit, compose, or convert
35b9e423 112bitmap images. It can read and write images in a variety of formats (over 100)
7fa37abc 113including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG,
35b9e423 114and TIFF. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and
7fa37abc
LC
115transform images, adjust image colors, apply various special effects, or draw
116text, lines, polygons, ellipses and Bézier curves.")
bf50f7b5 117 (license (license:fsf-free "http://www.imagemagick.org/script/license.php"))))
b56a918f
EB
118
119(define-public perl-image-magick
120 (package
121 (name "perl-image-magick")
122 (version "6.89")
123 (source
124 (origin
125 (method url-fetch)
126 (uri (string-append "mirror://cpan/authors/id/J/JC/JCRISTY/"
127 "PerlMagick-" version "-1.tar.gz"))
128 (sha256
129 (base32
130 "0n9afy1z5bhf9phrbahnkwhgcmijn8jggpbzwrivw1zhliliiy68"))))
131 (build-system perl-build-system)
132 (native-inputs `(("pkg-config" ,pkg-config)))
133 (inputs `(("imagemagick" ,imagemagick)))
134 (arguments
49735d8d
JN
135 `(#:tests? #f ;;Failed 2/23 test programs. 2/353 subtests failed.
136 #:phases
b56a918f
EB
137 (modify-phases %standard-phases
138 (add-before
3a4de6b2 139 'configure 'image-magick-flags
b56a918f
EB
140 (lambda* (#:key inputs #:allow-other-keys)
141 (let ((im (assoc-ref inputs "imagemagick")))
142 (substitute* "Makefile.PL"
143 (("my \\$INC_magick = .*")
144 "my $INC_magick = `pkg-config --cflags ImageMagick`;\n")
145 (("my \\$LIBS_magick = .*")
146 "my $LIBS_magick = `pkg-config --libs ImageMagick`;\n")))))
147 (add-before
3a4de6b2 148 'check 'skip-mpeg-tests
b56a918f
EB
149 (lambda _
150 ;; TODO: MPEG tests fail even though our imagemagick supports
151 ;; MPEG. Has been reported elsewhere,
152 ;; http://www.imagemagick.org/discourse-server/viewtopic.php?f=7&t=25036,
153 ;; so skip for now.
154 (delete-file "t/mpeg/read.t"))))))
155 (home-page "http://search.cpan.org/dist/PerlMagick")
156 (synopsis "Perl interface to ImageMagick")
157 (description "This Perl extension allows the reading, manipulation and
158writing of a large number of image file formats using the ImageMagick library.
159Use it to create, edit, compose, or convert bitmap images from within a Perl
160script.")
161 ;; See Magick.pm
162 (license (package-license imagemagick))))
ac838d0f
RW
163
164(define-public graphicsmagick
6d5deda1
LF
165 (package
166 (name "graphicsmagick")
167 (version "1.3.26")
168 (source (origin
169 (method url-fetch)
170 (uri
171 (list
172 (string-append "mirror://sourceforge/" name "/" name
173 "/" version "/GraphicsMagick-" version ".tar.xz")
174 (string-append "ftp://ftp.graphicsmagick.org/pub/"
175 "GraphicsMagick/" (version-major+minor version)
176 "/GraphicsMagick-" version ".tar.xz")))
177 (sha256
178 (base32
6d7d9d95
KK
179 "122zgs96dqrys62mnh8x5yvfff6km4d3yrnvaxzg3mg5sprib87v"))
180 (patches
db7f7eb8
KK
181 (search-patches "graphicsmagick-CVE-2017-11403+CVE-2017-14103.patch"
182 "graphicsmagick-CVE-2017-12935.patch"
6d7d9d95 183 "graphicsmagick-CVE-2017-12936.patch"
0ff44ba4
EF
184 "graphicsmagick-CVE-2017-12937.patch"
185 "graphicsmagick-CVE-2017-13775.patch"
2cc752c0 186 "graphicsmagick-CVE-2017-13776+CVE-2017-13777.patch"
224bb4b6
EF
187 "graphicsmagick-CVE-2017-14042.patch"
188 "graphicsmagick-CVE-2017-14165.patch"))))
6d5deda1
LF
189 (build-system gnu-build-system)
190 (arguments
191 `(#:configure-flags
192 (list "--with-frozenpaths"
193 "--enable-shared=yes"
194 "--with-x=yes"
195 "--with-quantum-depth=16" ; required by Octave
196 "--enable-quantum-library-names"
197 (string-append "--with-gs-font-dir="
198 (assoc-ref %build-inputs "gs-fonts")
199 "/share/fonts/type1/ghostscript"))))
200 (inputs
201 `(("graphviz" ,graphviz)
202 ("ghostscript" ,ghostscript)
203 ("gs-fonts" ,gs-fonts)
204 ("lcms" ,lcms)
205 ("libx11" ,libx11)
206 ("libxml2" ,libxml2)
207 ("libtiff" ,libtiff)
208 ("libpng" ,libpng)
209 ("libjpeg" ,libjpeg)
210 ("freetype" ,freetype)
211 ("bzip2" ,bzip2)
212 ("xz" ,xz)
213 ("zlib" ,zlib)))
214 (native-inputs
215 `(("pkg-config" ,pkg-config)))
216 (outputs '("out" ; 13 MiB
217 "doc")) ; ~7 MiB
218 (home-page "http://www.graphicsmagick.org")
219 (synopsis "Create, edit, compose, or convert bitmap images")
220 (description
221 "GraphicsMagick provides a comprehensive collection of utilities,
ac838d0f
RW
222programming interfaces, and GUIs, to support file format conversion, image
223processing, and 2D vector rendering.")
6d5deda1 224 (license license:expat)))