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