Commit | Line | Data |
---|---|---|
7fa37abc | 1 | ;;; GNU Guix --- Functional package management for GNU |
0f4139e9 | 2 | ;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org> |
b56a918f | 3 | ;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org> |
7fa37abc LC |
4 | ;;; |
5 | ;;; This file is part of GNU Guix. | |
6 | ;;; | |
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. | |
11 | ;;; | |
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. | |
16 | ;;; | |
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/>. | |
19 | ||
20 | (define-module (gnu packages imagemagick) | |
21 | #:use-module (guix packages) | |
22 | #:use-module (guix build-system gnu) | |
b56a918f | 23 | #:use-module (guix build-system perl) |
7fa37abc LC |
24 | #:use-module (guix download) |
25 | #:use-module ((guix licenses) #:select (fsf-free)) | |
9b937137 | 26 | #:use-module (gnu packages algebra) |
7fa37abc | 27 | #:use-module (gnu packages compression) |
9b937137 AE |
28 | #:use-module (gnu packages fontutils) |
29 | #:use-module (gnu packages ghostscript) | |
7fa37abc | 30 | #:use-module (gnu packages graphviz) |
7fa37abc | 31 | #:use-module (gnu packages gtk) |
e55354b8 | 32 | #:use-module (gnu packages image) |
9b937137 AE |
33 | #:use-module (gnu packages pkg-config) |
34 | #:use-module (gnu packages xml) | |
35 | #:use-module (gnu packages xorg)) | |
7fa37abc LC |
36 | |
37 | (define-public imagemagick | |
38 | (package | |
39 | (name "imagemagick") | |
717ccec8 | 40 | (version "6.9.0-4") |
7fa37abc LC |
41 | (source (origin |
42 | (method url-fetch) | |
43 | (uri (string-append "mirror://imagemagick/ImageMagick-" | |
44 | version ".tar.xz")) | |
45 | (sha256 | |
46 | (base32 | |
717ccec8 | 47 | "0ms9lxrm3hvgghv8k7rj6kvk40xkc6lgr41xyaxz7lyf3l4ahslr")))) |
7fa37abc LC |
48 | (build-system gnu-build-system) |
49 | (arguments | |
50 | `(#:phases (alist-cons-before | |
51 | 'build 'pre-build | |
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:]]*=.*$") | |
57 | "") | |
58 | ||
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 = " | |
64 | doc "/share/doc/" | |
65 | ,name "-" ,version "\n"))))) | |
66 | %standard-phases))) | |
9b937137 AE |
67 | ;; TODO: Add Jasper etc. |
68 | (inputs `(("fftw" ,fftw) | |
69 | ("graphviz" ,graphviz) | |
7fa37abc | 70 | ("ghostscript" ,ghostscript) |
9b937137 | 71 | ("lcms" ,lcms) |
7fa37abc LC |
72 | ("libx11" ,libx11) |
73 | ("zlib" ,zlib) | |
74 | ("libxml2" ,libxml2) | |
75 | ("libtiff" ,libtiff) | |
76 | ("libpng" ,libpng) | |
77 | ("libjpeg" ,libjpeg-8) | |
78 | ("pango" ,pango) | |
79 | ("freetype" ,freetype) | |
80 | ("bzip2" ,bzip2) | |
c4c4cc05 JD |
81 | ("xz" ,xz))) |
82 | (native-inputs `(("pkg-config" ,pkg-config))) | |
7fa37abc LC |
83 | (outputs '("out" |
84 | "doc")) ; 26 MiB of HTML documentation | |
85 | (home-page "http://www.imagemagick.org/") | |
86 | (synopsis "Create, edit, compose, or convert bitmap images") | |
87 | (description | |
88 | "ImageMagick® is a software suite to create, edit, compose, or convert | |
35b9e423 | 89 | bitmap images. It can read and write images in a variety of formats (over 100) |
7fa37abc | 90 | including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG, |
35b9e423 | 91 | and TIFF. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and |
7fa37abc LC |
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")))) | |
b56a918f EB |
95 | |
96 | (define-public perl-image-magick | |
97 | (package | |
98 | (name "perl-image-magick") | |
99 | (version "6.89") | |
100 | (source | |
101 | (origin | |
102 | (method url-fetch) | |
103 | (uri (string-append "mirror://cpan/authors/id/J/JC/JCRISTY/" | |
104 | "PerlMagick-" version "-1.tar.gz")) | |
105 | (sha256 | |
106 | (base32 | |
107 | "0n9afy1z5bhf9phrbahnkwhgcmijn8jggpbzwrivw1zhliliiy68")))) | |
108 | (build-system perl-build-system) | |
109 | (native-inputs `(("pkg-config" ,pkg-config))) | |
110 | (inputs `(("imagemagick" ,imagemagick))) | |
111 | (arguments | |
112 | `(#:phases | |
113 | (modify-phases %standard-phases | |
114 | (add-before | |
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"))))) | |
123 | (add-before | |
124 | check skip-mpeg-tests | |
125 | (lambda _ | |
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, | |
129 | ;; so skip for now. | |
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 | |
136 | script.") | |
137 | ;; See Magick.pm | |
138 | (license (package-license imagemagick)))) |