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