| 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 | ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il> |
| 8 | ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr> |
| 9 | ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com> |
| 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) |
| 29 | #:use-module (guix build-system perl) |
| 30 | #:use-module (guix download) |
| 31 | #:use-module (guix utils) |
| 32 | #:use-module ((guix licenses) #:prefix license:) |
| 33 | #:use-module (gnu packages) |
| 34 | #:use-module (gnu packages algebra) |
| 35 | #:use-module (gnu packages compression) |
| 36 | #:use-module (gnu packages fontutils) |
| 37 | #:use-module (gnu packages ghostscript) |
| 38 | #:use-module (gnu packages graphviz) |
| 39 | #:use-module (gnu packages gtk) |
| 40 | #:use-module (gnu packages image) |
| 41 | #:use-module (gnu packages pkg-config) |
| 42 | #:use-module (gnu packages xml) |
| 43 | #:use-module (gnu packages xorg)) |
| 44 | |
| 45 | (define-public imagemagick |
| 46 | (package |
| 47 | (name "imagemagick") |
| 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. |
| 51 | (version "6.9.11-11") |
| 52 | (source (origin |
| 53 | (method url-fetch) |
| 54 | (uri (string-append "mirror://imagemagick/ImageMagick-" |
| 55 | version ".tar.xz")) |
| 56 | (sha256 |
| 57 | (base32 |
| 58 | "1b67rrppvm04aqr76qky5h2a0j2d161h8kwa04fv611w5xwandr2")))) |
| 59 | (build-system gnu-build-system) |
| 60 | (arguments |
| 61 | `(#:configure-flags '("--with-frozenpaths" "--without-gcc-arch" |
| 62 | |
| 63 | ;; Do not embed the build date in binaries. |
| 64 | "--enable-reproducible-build") |
| 65 | |
| 66 | ;; FIXME: The test suite succeeded before version 6.9.6-2. |
| 67 | ;; Try enabling it again with newer releases. |
| 68 | #:tests? #f |
| 69 | #:phases (modify-phases %standard-phases |
| 70 | (add-before |
| 71 | 'build 'pre-build |
| 72 | (lambda* (#:key outputs #:allow-other-keys) |
| 73 | (substitute* "Makefile" |
| 74 | ;; Clear the `LIBRARY_PATH' setting, which otherwise |
| 75 | ;; interferes with our own use. |
| 76 | (("^LIBRARY_PATH[[:blank:]]*=.*$") |
| 77 | "") |
| 78 | |
| 79 | ;; Since the Makefile overrides $docdir, modify it to |
| 80 | ;; refer to what we want. |
| 81 | (("^DOCUMENTATION_PATH[[:blank:]]*=.*$") |
| 82 | (let ((doc (assoc-ref outputs "doc"))) |
| 83 | (string-append "DOCUMENTATION_PATH = " |
| 84 | doc "/share/doc/" |
| 85 | ,name "-" ,version "\n")))) |
| 86 | #t)) |
| 87 | (add-before |
| 88 | 'configure 'strip-configure-xml |
| 89 | (lambda _ |
| 90 | (substitute* "config/configure.xml.in" |
| 91 | ;; Do not record 'configure' arguments in the |
| 92 | ;; configure.xml file that gets installed: That would |
| 93 | ;; include --docdir, and thus retain a reference to the |
| 94 | ;; 'doc' output. |
| 95 | (("@CONFIGURE_ARGS@") |
| 96 | "not recorded")) |
| 97 | #t))))) |
| 98 | ;; TODO: Add Jasper etc. |
| 99 | (inputs `(("fftw" ,fftw) |
| 100 | ("graphviz" ,graphviz) |
| 101 | ("ghostscript" ,ghostscript) |
| 102 | ("lcms" ,lcms) |
| 103 | ("libx11" ,libx11) |
| 104 | ("zlib" ,zlib) |
| 105 | ("libxml2" ,libxml2) |
| 106 | ("libtiff" ,libtiff) |
| 107 | ("libpng" ,libpng) |
| 108 | ("libjpeg" ,libjpeg-turbo) |
| 109 | ("pango" ,pango) |
| 110 | ("freetype" ,freetype) |
| 111 | ("bzip2" ,bzip2) |
| 112 | ("xz" ,xz))) |
| 113 | (native-inputs `(("pkg-config" ,pkg-config))) |
| 114 | (outputs '("out" |
| 115 | "doc")) ; 26 MiB of HTML documentation |
| 116 | (home-page "https://www.imagemagick.org/") |
| 117 | (synopsis "Create, edit, compose, or convert bitmap images") |
| 118 | (description |
| 119 | "ImageMagick is a software suite to create, edit, compose, or convert |
| 120 | bitmap images. It can read and write images in a variety of formats (over 100) |
| 121 | including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG, |
| 122 | and TIFF. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and |
| 123 | transform images, adjust image colors, apply various special effects, or draw |
| 124 | text, lines, polygons, ellipses and Bézier curves.") |
| 125 | (license (license:fsf-free "http://www.imagemagick.org/script/license.php")))) |
| 126 | |
| 127 | (define-public perl-image-magick |
| 128 | (package |
| 129 | (name "perl-image-magick") |
| 130 | (version "6.89") |
| 131 | (source |
| 132 | (origin |
| 133 | (method url-fetch) |
| 134 | (uri (string-append "mirror://cpan/authors/id/J/JC/JCRISTY/" |
| 135 | "PerlMagick-" version "-1.tar.gz")) |
| 136 | (sha256 |
| 137 | (base32 |
| 138 | "0n9afy1z5bhf9phrbahnkwhgcmijn8jggpbzwrivw1zhliliiy68")))) |
| 139 | (build-system perl-build-system) |
| 140 | (native-inputs `(("pkg-config" ,pkg-config))) |
| 141 | (inputs `(("imagemagick" ,imagemagick))) |
| 142 | (arguments |
| 143 | `(#:tests? #f ;;Failed 2/23 test programs. 2/353 subtests failed. |
| 144 | #:phases |
| 145 | (modify-phases %standard-phases |
| 146 | (add-before |
| 147 | 'configure 'image-magick-flags |
| 148 | (lambda* (#:key inputs #:allow-other-keys) |
| 149 | (let ((im (assoc-ref inputs "imagemagick"))) |
| 150 | (substitute* "Makefile.PL" |
| 151 | (("my \\$INC_magick = .*") |
| 152 | "my $INC_magick = `pkg-config --cflags ImageMagick`;\n") |
| 153 | (("my \\$LIBS_magick = .*") |
| 154 | "my $LIBS_magick = `pkg-config --libs ImageMagick`;\n")) |
| 155 | #t))) |
| 156 | (add-before |
| 157 | 'check 'skip-mpeg-tests |
| 158 | (lambda _ |
| 159 | ;; TODO: MPEG tests fail even though our imagemagick supports |
| 160 | ;; MPEG. Has been reported elsewhere, |
| 161 | ;; http://www.imagemagick.org/discourse-server/viewtopic.php?f=7&t=25036, |
| 162 | ;; so skip for now. |
| 163 | (delete-file "t/mpeg/read.t") |
| 164 | #t))))) |
| 165 | (home-page "https://metacpan.org/release/PerlMagick") |
| 166 | (synopsis "Perl interface to ImageMagick") |
| 167 | (description "This Perl extension allows the reading, manipulation and |
| 168 | writing of a large number of image file formats using the ImageMagick library. |
| 169 | Use it to create, edit, compose, or convert bitmap images from within a Perl |
| 170 | script.") |
| 171 | ;; See Magick.pm |
| 172 | (license (package-license imagemagick)))) |
| 173 | |
| 174 | (define-public graphicsmagick |
| 175 | (package |
| 176 | (name "graphicsmagick") |
| 177 | (version "1.3.35") |
| 178 | (source |
| 179 | (origin |
| 180 | (method url-fetch) |
| 181 | (uri |
| 182 | (list |
| 183 | (string-append "mirror://sourceforge/graphicsmagick/graphicsmagick" |
| 184 | "/" version "/GraphicsMagick-" version ".tar.xz") |
| 185 | (string-append "ftp://ftp.graphicsmagick.org/pub/" |
| 186 | "GraphicsMagick/" (version-major+minor version) |
| 187 | "/GraphicsMagick-" version ".tar.xz"))) |
| 188 | (sha256 |
| 189 | (base32 |
| 190 | "0l024l4hawm9s3jqrgi2j0lxgm61dqh8sgkj1017ma7y11hqv2hq")))) |
| 191 | (build-system gnu-build-system) |
| 192 | (arguments |
| 193 | `(#:configure-flags |
| 194 | (list "--with-frozenpaths" |
| 195 | "--enable-shared=yes" |
| 196 | "--with-x=yes" |
| 197 | "--with-quantum-depth=16" ; required by Octave |
| 198 | "--enable-quantum-library-names" |
| 199 | (string-append "--with-gs-font-dir=" |
| 200 | (assoc-ref %build-inputs "gs-fonts") |
| 201 | "/share/fonts/type1/ghostscript")))) |
| 202 | (inputs |
| 203 | `(("graphviz" ,graphviz) |
| 204 | ("ghostscript" ,ghostscript) |
| 205 | ("gs-fonts" ,gs-fonts) |
| 206 | ("lcms" ,lcms) |
| 207 | ("libx11" ,libx11) |
| 208 | ("libxml2" ,libxml2) |
| 209 | ("libtiff" ,libtiff) |
| 210 | ("libpng" ,libpng) |
| 211 | ("libjpeg" ,libjpeg-turbo) |
| 212 | ("freetype" ,freetype) |
| 213 | ("bzip2" ,bzip2) |
| 214 | ("xz" ,xz) |
| 215 | ("zlib" ,zlib))) |
| 216 | (native-inputs |
| 217 | `(("pkg-config" ,pkg-config))) |
| 218 | (outputs '("out" ; 13 MiB |
| 219 | "doc")) ; ~7 MiB |
| 220 | (home-page "http://www.graphicsmagick.org") |
| 221 | (synopsis "Create, edit, compose, or convert bitmap images") |
| 222 | (description |
| 223 | "GraphicsMagick provides a comprehensive collection of utilities, |
| 224 | programming interfaces, and GUIs, to support file format conversion, image |
| 225 | processing, and 2D vector rendering.") |
| 226 | (license license:expat))) |