gnu: emacs-guix: Update to 0.3.1.
[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>
7fa37abc
LC
7;;;
8;;; This file is part of GNU Guix.
9;;;
10;;; GNU Guix is free software; you can redistribute it and/or modify it
11;;; under the terms of the GNU General Public License as published by
12;;; the Free Software Foundation; either version 3 of the License, or (at
13;;; your option) any later version.
14;;;
15;;; GNU Guix is distributed in the hope that it will be useful, but
16;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;;; GNU General Public License for more details.
19;;;
20;;; You should have received a copy of the GNU General Public License
21;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23(define-module (gnu packages imagemagick)
24 #:use-module (guix packages)
25 #:use-module (guix build-system gnu)
b56a918f 26 #:use-module (guix build-system perl)
7fa37abc 27 #:use-module (guix download)
1cc21385 28 #:use-module (guix hg-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.
14dbab42 49 (version "6.9.8-4")
7fa37abc
LC
50 (source (origin
51 (method url-fetch)
52 (uri (string-append "mirror://imagemagick/ImageMagick-"
53 version ".tar.xz"))
54 (sha256
55 (base32
14dbab42 56 "04fb0x8zc9z11127wsnxlzg0jcgs4xwlx8fxy4jac2y3mmmlzhm6"))))
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
428af2c6 165 (let ((changeset "6156b4c2992d855ece6079653b3b93c3229fc4b8") ; fix CVE-2017-6335
4fb9c83c 166 (revision "2"))
1cc21385
MW
167 (package
168 (name "graphicsmagick")
4fb9c83c
MB
169 (version (string-append "1.3.25-" revision "."
170 (string-take changeset 7)))
1cc21385
MW
171 (source (origin
172 (method hg-fetch)
173 (uri (hg-reference
174 (url "http://hg.code.sf.net/p/graphicsmagick/code")
175 (changeset changeset)))
176 (file-name (string-append name "-" version "-checkout"))
177 ;;(method url-fetch)
178 ;;(uri (string-append "ftp://ftp.graphicsmagick.org/pub/"
179 ;; "GraphicsMagick/" (version-major+minor version)
180 ;; "/GraphicsMagick-" version ".tar.xz"))
181 (sha256
182 (base32
4fb9c83c 183 "08yfsn8mrqkwpax43vv1crfr55rcf004wwpzsinr5c6m0asqr08b"))))
1cc21385
MW
184 (build-system gnu-build-system)
185 (arguments
186 `(#:configure-flags
187 (list "--with-frozenpaths"
188 "--enable-shared=yes"
189 "--with-x=yes"
d9e94c61
AI
190 "--with-quantum-depth=16" ; required by Octave
191 "--enable-quantum-library-names"
1cc21385
MW
192 (string-append "--with-gs-font-dir="
193 (assoc-ref %build-inputs "gs-fonts")
194 "/share/fonts/type1/ghostscript"))))
195 (inputs
196 `(("graphviz" ,graphviz)
197 ("ghostscript" ,ghostscript)
198 ("gs-fonts" ,gs-fonts)
199 ("lcms" ,lcms)
200 ("libx11" ,libx11)
201 ("libxml2" ,libxml2)
202 ("libtiff" ,libtiff)
203 ("libpng" ,libpng)
204 ("libjpeg" ,libjpeg)
205 ("freetype" ,freetype)
206 ("bzip2" ,bzip2)
207 ("xz" ,xz)
208 ("zlib" ,zlib)))
209 (native-inputs
210 `(("pkg-config" ,pkg-config)))
211 (outputs '("out" ; 13 MiB
212 "doc")) ; ~7 MiB
213 (home-page "http://www.graphicsmagick.org")
214 (synopsis "Create, edit, compose, or convert bitmap images")
215 (description
216 "GraphicsMagick provides a comprehensive collection of utilities,
ac838d0f
RW
217programming interfaces, and GUIs, to support file format conversion, image
218processing, and 2D vector rendering.")
1cc21385 219 (license license:expat))))