gnu: nftables: Update to 0.8.
[jackhill/guix/guix.git] / gnu / packages / imagemagick.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
4 ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
6 ;;; Copyright © 2016 Mark H Weaver <mhw@netris.org>
7 ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
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)
27 #:use-module (guix build-system perl)
28 #:use-module (guix download)
29 #:use-module (guix utils)
30 #:use-module ((guix licenses) #:prefix license:)
31 #:use-module (gnu packages)
32 #:use-module (gnu packages algebra)
33 #:use-module (gnu packages compression)
34 #:use-module (gnu packages fontutils)
35 #:use-module (gnu packages ghostscript)
36 #:use-module (gnu packages graphviz)
37 #:use-module (gnu packages gtk)
38 #:use-module (gnu packages image)
39 #:use-module (gnu packages pkg-config)
40 #:use-module (gnu packages xml)
41 #:use-module (gnu packages xorg))
42
43 (define-public imagemagick
44 (package
45 (name "imagemagick")
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.
49 (version "6.9.9-23")
50 (source (origin
51 (method url-fetch)
52 (uri (string-append "mirror://imagemagick/ImageMagick-"
53 version ".tar.xz"))
54 (sha256
55 (base32
56 "0cd6zcbcfvznf0i3q4xz1c4wm4cfplg4zc466lvlb1w8qbn25948"))))
57 (build-system gnu-build-system)
58 (arguments
59 `(#:configure-flags '("--with-frozenpaths" "--without-gcc-arch")
60 ;; FIXME: The test suite succeeded before version 6.9.6-2.
61 ;; Try enabling it again with newer releases.
62 #:tests? #f
63 #:phases (modify-phases %standard-phases
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 "")
72
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")))))))
90 ;; TODO: Add Jasper etc.
91 (inputs `(("fftw" ,fftw)
92 ("graphviz" ,graphviz)
93 ("ghostscript" ,ghostscript)
94 ("lcms" ,lcms)
95 ("libx11" ,libx11)
96 ("zlib" ,zlib)
97 ("libxml2" ,libxml2)
98 ("libtiff" ,libtiff)
99 ("libpng" ,libpng)
100 ("libjpeg" ,libjpeg)
101 ("pango" ,pango)
102 ("freetype" ,freetype)
103 ("bzip2" ,bzip2)
104 ("xz" ,xz)))
105 (native-inputs `(("pkg-config" ,pkg-config)))
106 (outputs '("out"
107 "doc")) ; 26 MiB of HTML documentation
108 (home-page "https://www.imagemagick.org/")
109 (synopsis "Create, edit, compose, or convert bitmap images")
110 (description
111 "ImageMagick is a software suite to create, edit, compose, or convert
112 bitmap images. It can read and write images in a variety of formats (over 100)
113 including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG,
114 and TIFF. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and
115 transform images, adjust image colors, apply various special effects, or draw
116 text, lines, polygons, ellipses and Bézier curves.")
117 (license (license:fsf-free "http://www.imagemagick.org/script/license.php"))))
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
135 `(#:tests? #f ;;Failed 2/23 test programs. 2/353 subtests failed.
136 #:phases
137 (modify-phases %standard-phases
138 (add-before
139 'configure 'image-magick-flags
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
148 'check 'skip-mpeg-tests
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
158 writing of a large number of image file formats using the ImageMagick library.
159 Use it to create, edit, compose, or convert bitmap images from within a Perl
160 script.")
161 ;; See Magick.pm
162 (license (package-license imagemagick))))
163
164 (define-public graphicsmagick
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
179 "122zgs96dqrys62mnh8x5yvfff6km4d3yrnvaxzg3mg5sprib87v"))
180 (patches
181 (search-patches "graphicsmagick-CVE-2017-11403+CVE-2017-14103.patch"
182 "graphicsmagick-CVE-2017-12935.patch"
183 "graphicsmagick-CVE-2017-12936.patch"
184 "graphicsmagick-CVE-2017-12937.patch"
185 "graphicsmagick-CVE-2017-13775.patch"
186 "graphicsmagick-CVE-2017-13776+CVE-2017-13777.patch"
187 "graphicsmagick-CVE-2017-14042.patch"
188 "graphicsmagick-CVE-2017-14165.patch"
189 "graphicsmagick-CVE-2017-14649.patch"))))
190 (build-system gnu-build-system)
191 (arguments
192 `(#:configure-flags
193 (list "--with-frozenpaths"
194 "--enable-shared=yes"
195 "--with-x=yes"
196 "--with-quantum-depth=16" ; required by Octave
197 "--enable-quantum-library-names"
198 (string-append "--with-gs-font-dir="
199 (assoc-ref %build-inputs "gs-fonts")
200 "/share/fonts/type1/ghostscript"))))
201 (inputs
202 `(("graphviz" ,graphviz)
203 ("ghostscript" ,ghostscript)
204 ("gs-fonts" ,gs-fonts)
205 ("lcms" ,lcms)
206 ("libx11" ,libx11)
207 ("libxml2" ,libxml2)
208 ("libtiff" ,libtiff)
209 ("libpng" ,libpng)
210 ("libjpeg" ,libjpeg)
211 ("freetype" ,freetype)
212 ("bzip2" ,bzip2)
213 ("xz" ,xz)
214 ("zlib" ,zlib)))
215 (native-inputs
216 `(("pkg-config" ,pkg-config)))
217 (outputs '("out" ; 13 MiB
218 "doc")) ; ~7 MiB
219 (home-page "http://www.graphicsmagick.org")
220 (synopsis "Create, edit, compose, or convert bitmap images")
221 (description
222 "GraphicsMagick provides a comprehensive collection of utilities,
223 programming interfaces, and GUIs, to support file format conversion, image
224 processing, and 2D vector rendering.")
225 (license license:expat)))