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