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