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