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>
6 ;;; This file is part of GNU Guix.
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21 (define-module (gnu packages imagemagick)
22 #:use-module (guix packages)
23 #:use-module (guix build-system gnu)
24 #:use-module (guix build-system perl)
25 #:use-module (guix download)
26 #:use-module (guix utils)
27 #:use-module ((guix licenses) #:prefix license:)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages algebra)
30 #:use-module (gnu packages compression)
31 #:use-module (gnu packages fontutils)
32 #:use-module (gnu packages ghostscript)
33 #:use-module (gnu packages graphviz)
34 #:use-module (gnu packages gtk)
35 #:use-module (gnu packages image)
36 #:use-module (gnu packages pkg-config)
37 #:use-module (gnu packages xml)
38 #:use-module (gnu packages xorg))
40 (define-public imagemagick
46 (uri (string-append "mirror://imagemagick/ImageMagick-"
50 "159afhqrj22jlz745ccbgnkdiwvn8pjcc96jic0iv9ms7gqxwln5"))
51 (patches (search-patches "imagemagick-test-segv.patch"))))
52 (build-system gnu-build-system)
54 `(#:configure-flags '("--with-frozenpaths")
55 #:phases (modify-phases %standard-phases
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:]]*=.*$")
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 = "
71 ,name "-" ,version "\n"))))))
73 'configure 'strip-configure-xml
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
82 ;; TODO: Add Jasper etc.
83 (inputs `(("fftw" ,fftw)
84 ("graphviz" ,graphviz)
85 ("ghostscript" ,ghostscript)
94 ("freetype" ,freetype)
97 (native-inputs `(("pkg-config" ,pkg-config)))
99 "doc")) ; 26 MiB of HTML documentation
100 (home-page "http://www.imagemagick.org/")
101 (synopsis "Create, edit, compose, or convert bitmap images")
103 "ImageMagick® is a software suite to create, edit, compose, or convert
104 bitmap images. It can read and write images in a variety of formats (over 100)
105 including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG,
106 and TIFF. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and
107 transform images, adjust image colors, apply various special effects, or draw
108 text, lines, polygons, ellipses and Bézier curves.")
109 (license (license:fsf-free "http://www.imagemagick.org/script/license.php"))))
111 (define-public perl-image-magick
113 (name "perl-image-magick")
118 (uri (string-append "mirror://cpan/authors/id/J/JC/JCRISTY/"
119 "PerlMagick-" version "-1.tar.gz"))
122 "0n9afy1z5bhf9phrbahnkwhgcmijn8jggpbzwrivw1zhliliiy68"))))
123 (build-system perl-build-system)
124 (native-inputs `(("pkg-config" ,pkg-config)))
125 (inputs `(("imagemagick" ,imagemagick)))
128 (modify-phases %standard-phases
130 'configure 'image-magick-flags
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")))))
139 'check 'skip-mpeg-tests
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,
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
149 writing of a large number of image file formats using the ImageMagick library.
150 Use it to create, edit, compose, or convert bitmap images from within a Perl
153 (license (package-license imagemagick))))
155 (define-public graphicsmagick
157 (name "graphicsmagick")
161 (uri (string-append "ftp://ftp.graphicsmagick.org/pub/"
162 "GraphicsMagick/" (version-major+minor version)
163 "/GraphicsMagick-" version ".tar.xz"))
166 "03g6l2h8cmf231y1vma0z7x85070jm1ysgs9ppqcd3jj56jka9gx"))))
167 (build-system gnu-build-system)
170 (list "--with-frozenpaths"
171 "--enable-shared=yes"
173 (string-append "--with-gs-font-dir="
174 (assoc-ref %build-inputs "gs-fonts")
175 "/share/fonts/type1/ghostscript"))))
177 `(("graphviz" ,graphviz)
178 ("ghostscript" ,ghostscript)
179 ("gs-fonts" ,gs-fonts)
186 ("freetype" ,freetype)
191 `(("pkg-config" ,pkg-config)))
192 (outputs '("out" ; 13 MiB
194 (home-page "http://www.graphicsmagick.org")
195 (synopsis "Create, edit, compose, or convert bitmap images")
197 "GraphicsMagick provides a comprehensive collection of utilities,
198 programming interfaces, and GUIs, to support file format conversion, image
199 processing, and 2D vector rendering.")
200 (license license:expat)))