gnu: Enable tests for ruby-multi-json.
[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 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
9 ;;;
10 ;;; This file is part of GNU Guix.
11 ;;;
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
16 ;;;
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
21 ;;;
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24
25 (define-module (gnu packages imagemagick)
26 #:use-module (guix packages)
27 #:use-module (guix build-system gnu)
28 #:use-module (guix build-system perl)
29 #:use-module (guix download)
30 #:use-module (guix utils)
31 #:use-module ((guix licenses) #:prefix license:)
32 #:use-module (gnu packages)
33 #:use-module (gnu packages algebra)
34 #:use-module (gnu packages compression)
35 #:use-module (gnu packages fontutils)
36 #:use-module (gnu packages ghostscript)
37 #:use-module (gnu packages graphviz)
38 #:use-module (gnu packages gtk)
39 #:use-module (gnu packages image)
40 #:use-module (gnu packages pkg-config)
41 #:use-module (gnu packages xml)
42 #:use-module (gnu packages xorg))
43
44 (define-public imagemagick
45 (package
46 (name "imagemagick")
47 ;; The 7 release series has an incompatible API, while the 6 series is still
48 ;; maintained. Don't update to 7 until we've made sure that the ImageMagick
49 ;; users are ready for the 7-series API.
50 (version "6.9.10-10")
51 (source (origin
52 (method url-fetch)
53 (uri (string-append "mirror://imagemagick/ImageMagick-"
54 version ".tar.xz"))
55 (sha256
56 (base32
57 "0b0wwxm6mgaxq0i0hazxcpbk7xd5j1329r1vk9h07iz4v3k8i57h"))))
58 (build-system gnu-build-system)
59 (arguments
60 `(#:configure-flags '("--with-frozenpaths" "--without-gcc-arch")
61 ;; FIXME: The test suite succeeded before version 6.9.6-2.
62 ;; Try enabling it again with newer releases.
63 #:tests? #f
64 #:phases (modify-phases %standard-phases
65 (add-before
66 'build 'pre-build
67 (lambda* (#:key outputs #:allow-other-keys)
68 (substitute* "Makefile"
69 ;; Clear the `LIBRARY_PATH' setting, which otherwise
70 ;; interferes with our own use.
71 (("^LIBRARY_PATH[[:blank:]]*=.*$")
72 "")
73
74 ;; Since the Makefile overrides $docdir, modify it to
75 ;; refer to what we want.
76 (("^DOCUMENTATION_PATH[[:blank:]]*=.*$")
77 (let ((doc (assoc-ref outputs "doc")))
78 (string-append "DOCUMENTATION_PATH = "
79 doc "/share/doc/"
80 ,name "-" ,version "\n"))))
81 #t))
82 (add-before
83 'configure 'strip-configure-xml
84 (lambda _
85 (substitute* "config/configure.xml.in"
86 ;; Do not record 'configure' arguments in the
87 ;; configure.xml file that gets installed: That would
88 ;; include --docdir, and thus retain a reference to the
89 ;; 'doc' output.
90 (("@CONFIGURE_ARGS@")
91 "not recorded"))
92 #t)))))
93 ;; TODO: Add Jasper etc.
94 (inputs `(("fftw" ,fftw)
95 ("graphviz" ,graphviz)
96 ("ghostscript" ,ghostscript)
97 ("lcms" ,lcms)
98 ("libx11" ,libx11)
99 ("zlib" ,zlib)
100 ("libxml2" ,libxml2)
101 ("libtiff" ,libtiff)
102 ("libpng" ,libpng)
103 ("libjpeg" ,libjpeg)
104 ("pango" ,pango)
105 ("freetype" ,freetype)
106 ("bzip2" ,bzip2)
107 ("xz" ,xz)))
108 (native-inputs `(("pkg-config" ,pkg-config)))
109 (outputs '("out"
110 "doc")) ; 26 MiB of HTML documentation
111 (home-page "https://www.imagemagick.org/")
112 (synopsis "Create, edit, compose, or convert bitmap images")
113 (description
114 "ImageMagick is a software suite to create, edit, compose, or convert
115 bitmap images. It can read and write images in a variety of formats (over 100)
116 including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG,
117 and TIFF. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and
118 transform images, adjust image colors, apply various special effects, or draw
119 text, lines, polygons, ellipses and Bézier curves.")
120 (license (license:fsf-free "http://www.imagemagick.org/script/license.php"))))
121
122 (define-public perl-image-magick
123 (package
124 (name "perl-image-magick")
125 (version "6.89")
126 (source
127 (origin
128 (method url-fetch)
129 (uri (string-append "mirror://cpan/authors/id/J/JC/JCRISTY/"
130 "PerlMagick-" version "-1.tar.gz"))
131 (sha256
132 (base32
133 "0n9afy1z5bhf9phrbahnkwhgcmijn8jggpbzwrivw1zhliliiy68"))))
134 (build-system perl-build-system)
135 (native-inputs `(("pkg-config" ,pkg-config)))
136 (inputs `(("imagemagick" ,imagemagick)))
137 (arguments
138 `(#:tests? #f ;;Failed 2/23 test programs. 2/353 subtests failed.
139 #:phases
140 (modify-phases %standard-phases
141 (add-before
142 'configure 'image-magick-flags
143 (lambda* (#:key inputs #:allow-other-keys)
144 (let ((im (assoc-ref inputs "imagemagick")))
145 (substitute* "Makefile.PL"
146 (("my \\$INC_magick = .*")
147 "my $INC_magick = `pkg-config --cflags ImageMagick`;\n")
148 (("my \\$LIBS_magick = .*")
149 "my $LIBS_magick = `pkg-config --libs ImageMagick`;\n"))
150 #t)))
151 (add-before
152 'check 'skip-mpeg-tests
153 (lambda _
154 ;; TODO: MPEG tests fail even though our imagemagick supports
155 ;; MPEG. Has been reported elsewhere,
156 ;; http://www.imagemagick.org/discourse-server/viewtopic.php?f=7&t=25036,
157 ;; so skip for now.
158 (delete-file "t/mpeg/read.t")
159 #t)))))
160 (home-page "https://metacpan.org/release/PerlMagick")
161 (synopsis "Perl interface to ImageMagick")
162 (description "This Perl extension allows the reading, manipulation and
163 writing of a large number of image file formats using the ImageMagick library.
164 Use it to create, edit, compose, or convert bitmap images from within a Perl
165 script.")
166 ;; See Magick.pm
167 (license (package-license imagemagick))))
168
169 (define-public graphicsmagick
170 (package
171 (name "graphicsmagick")
172 (version "1.3.30")
173 (source (origin
174 (method url-fetch)
175 (uri
176 (list
177 (string-append "mirror://sourceforge/" name "/" name
178 "/" version "/GraphicsMagick-" version ".tar.xz")
179 (string-append "ftp://ftp.graphicsmagick.org/pub/"
180 "GraphicsMagick/" (version-major+minor version)
181 "/GraphicsMagick-" version ".tar.xz")))
182 (sha256
183 (base32
184 "1warar0731xf94r4bn5x1km85rjabl4iq8r0dk3ywmczap3farfr"))))
185 (build-system gnu-build-system)
186 (arguments
187 `(#:configure-flags
188 (list "--with-frozenpaths"
189 "--enable-shared=yes"
190 "--with-x=yes"
191 "--with-quantum-depth=16" ; required by Octave
192 "--enable-quantum-library-names"
193 (string-append "--with-gs-font-dir="
194 (assoc-ref %build-inputs "gs-fonts")
195 "/share/fonts/type1/ghostscript"))))
196 (inputs
197 `(("graphviz" ,graphviz)
198 ("ghostscript" ,ghostscript)
199 ("gs-fonts" ,gs-fonts)
200 ("lcms" ,lcms)
201 ("libx11" ,libx11)
202 ("libxml2" ,libxml2)
203 ("libtiff" ,libtiff)
204 ("libpng" ,libpng)
205 ("libjpeg" ,libjpeg)
206 ("freetype" ,freetype)
207 ("bzip2" ,bzip2)
208 ("xz" ,xz)
209 ("zlib" ,zlib)))
210 (native-inputs
211 `(("pkg-config" ,pkg-config)))
212 (outputs '("out" ; 13 MiB
213 "doc")) ; ~7 MiB
214 (home-page "http://www.graphicsmagick.org")
215 (synopsis "Create, edit, compose, or convert bitmap images")
216 (description
217 "GraphicsMagick provides a comprehensive collection of utilities,
218 programming interfaces, and GUIs, to support file format conversion, image
219 processing, and 2D vector rendering.")
220 (license license:expat)))