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