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>
5 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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 algebra)
27 #:use-module (gnu packages compression)
28 #:use-module (gnu packages fontutils)
29 #:use-module (gnu packages ghostscript)
30 #:use-module (gnu packages graphviz)
31 #:use-module (gnu packages gtk)
32 #:use-module (gnu packages image)
33 #:use-module (gnu packages pkg-config)
34 #:use-module (gnu packages xml)
35 #:use-module (gnu packages xorg))
37 (define-public imagemagick
43 (uri (string-append "mirror://imagemagick/ImageMagick-"
47 "18wbsjfccxlgsdsd6h9wvhcjrsglyi086jk4bk029ik07rh81laz"))))
48 (build-system gnu-build-system)
50 `(#:phases (alist-cons-before
52 (lambda* (#:key outputs #:allow-other-keys)
53 (substitute* "Makefile"
54 ;; Clear the `LIBRARY_PATH' setting, which otherwise
55 ;; interferes with our own use.
56 (("^LIBRARY_PATH[[:blank:]]*=.*$")
59 ;; Since the Makefile overrides $docdir, modify it to
60 ;; refer to what we want.
61 (("^DOCUMENTATION_PATH[[:blank:]]*=.*$")
62 (let ((doc (assoc-ref outputs "doc")))
63 (string-append "DOCUMENTATION_PATH = "
65 ,name "-" ,version "\n")))))
67 ;; TODO: Add Jasper etc.
68 (inputs `(("fftw" ,fftw)
69 ("graphviz" ,graphviz)
70 ("ghostscript" ,ghostscript)
77 ("libjpeg" ,libjpeg-8)
79 ("freetype" ,freetype)
82 (native-inputs `(("pkg-config" ,pkg-config)))
84 "doc")) ; 26 MiB of HTML documentation
85 (home-page "http://www.imagemagick.org/")
86 (synopsis "Create, edit, compose, or convert bitmap images")
88 "ImageMagick® is a software suite to create, edit, compose, or convert
89 bitmap images. It can read and write images in a variety of formats (over 100)
90 including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG,
91 and TIFF. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and
92 transform images, adjust image colors, apply various special effects, or draw
93 text, lines, polygons, ellipses and Bézier curves.")
94 (license (fsf-free "http://www.imagemagick.org/script/license.php"))))
96 (define-public perl-image-magick
98 (name "perl-image-magick")
103 (uri (string-append "mirror://cpan/authors/id/J/JC/JCRISTY/"
104 "PerlMagick-" version "-1.tar.gz"))
107 "0n9afy1z5bhf9phrbahnkwhgcmijn8jggpbzwrivw1zhliliiy68"))))
108 (build-system perl-build-system)
109 (native-inputs `(("pkg-config" ,pkg-config)))
110 (inputs `(("imagemagick" ,imagemagick)))
113 (modify-phases %standard-phases
115 'configure 'image-magick-flags
116 (lambda* (#:key inputs #:allow-other-keys)
117 (let ((im (assoc-ref inputs "imagemagick")))
118 (substitute* "Makefile.PL"
119 (("my \\$INC_magick = .*")
120 "my $INC_magick = `pkg-config --cflags ImageMagick`;\n")
121 (("my \\$LIBS_magick = .*")
122 "my $LIBS_magick = `pkg-config --libs ImageMagick`;\n")))))
124 'check 'skip-mpeg-tests
126 ;; TODO: MPEG tests fail even though our imagemagick supports
127 ;; MPEG. Has been reported elsewhere,
128 ;; http://www.imagemagick.org/discourse-server/viewtopic.php?f=7&t=25036,
130 (delete-file "t/mpeg/read.t"))))))
131 (home-page "http://search.cpan.org/dist/PerlMagick")
132 (synopsis "Perl interface to ImageMagick")
133 (description "This Perl extension allows the reading, manipulation and
134 writing of a large number of image file formats using the ImageMagick library.
135 Use it to create, edit, compose, or convert bitmap images from within a Perl
138 (license (package-license imagemagick))))