imagemagick.scm 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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 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. (define-module (gnu packages imagemagick)
  26. #:use-module (guix packages)
  27. #:use-module (guix build-system gnu)
  28. #:use-module (guix build-system perl)
  29. #:use-module (guix download)
  30. #:use-module (guix utils)
  31. #:use-module ((guix licenses) #:prefix license:)
  32. #:use-module (gnu packages)
  33. #:use-module (gnu packages algebra)
  34. #:use-module (gnu packages compression)
  35. #:use-module (gnu packages fontutils)
  36. #:use-module (gnu packages ghostscript)
  37. #:use-module (gnu packages graphviz)
  38. #:use-module (gnu packages gtk)
  39. #:use-module (gnu packages image)
  40. #:use-module (gnu packages pkg-config)
  41. #:use-module (gnu packages xml)
  42. #:use-module (gnu packages xorg))
  43. (define-public imagemagick
  44. (package
  45. (name "imagemagick")
  46. ;; The 7 release series has an incompatible API, while the 6 series is still
  47. ;; maintained. Don't update to 7 until we've made sure that the ImageMagick
  48. ;; users are ready for the 7-series API.
  49. (version "6.9.10-16")
  50. (source (origin
  51. (method url-fetch)
  52. (uri (string-append "mirror://imagemagick/ImageMagick-"
  53. version ".tar.xz"))
  54. (sha256
  55. (base32
  56. "1ylbv69r8l3d4za4i8q41cs6lq06mnhiq4qm03rvs3vp3gyp1m9x"))))
  57. (build-system gnu-build-system)
  58. (arguments
  59. `(#:configure-flags '("--with-frozenpaths" "--without-gcc-arch")
  60. ;; FIXME: The test suite succeeded before version 6.9.6-2.
  61. ;; Try enabling it again with newer releases.
  62. #:tests? #f
  63. #:phases (modify-phases %standard-phases
  64. (add-before
  65. 'build 'pre-build
  66. (lambda* (#:key outputs #:allow-other-keys)
  67. (substitute* "Makefile"
  68. ;; Clear the `LIBRARY_PATH' setting, which otherwise
  69. ;; interferes with our own use.
  70. (("^LIBRARY_PATH[[:blank:]]*=.*$")
  71. "")
  72. ;; Since the Makefile overrides $docdir, modify it to
  73. ;; refer to what we want.
  74. (("^DOCUMENTATION_PATH[[:blank:]]*=.*$")
  75. (let ((doc (assoc-ref outputs "doc")))
  76. (string-append "DOCUMENTATION_PATH = "
  77. doc "/share/doc/"
  78. ,name "-" ,version "\n"))))
  79. #t))
  80. (add-before
  81. 'configure 'strip-configure-xml
  82. (lambda _
  83. (substitute* "config/configure.xml.in"
  84. ;; Do not record 'configure' arguments in the
  85. ;; configure.xml file that gets installed: That would
  86. ;; include --docdir, and thus retain a reference to the
  87. ;; 'doc' output.
  88. (("@CONFIGURE_ARGS@")
  89. "not recorded"))
  90. #t)))))
  91. ;; TODO: Add Jasper etc.
  92. (inputs `(("fftw" ,fftw)
  93. ("graphviz" ,graphviz)
  94. ("ghostscript" ,ghostscript)
  95. ("lcms" ,lcms)
  96. ("libx11" ,libx11)
  97. ("zlib" ,zlib)
  98. ("libxml2" ,libxml2)
  99. ("libtiff" ,libtiff)
  100. ("libpng" ,libpng)
  101. ("libjpeg" ,libjpeg)
  102. ("pango" ,pango)
  103. ("freetype" ,freetype)
  104. ("bzip2" ,bzip2)
  105. ("xz" ,xz)))
  106. (native-inputs `(("pkg-config" ,pkg-config)))
  107. (outputs '("out"
  108. "doc")) ; 26 MiB of HTML documentation
  109. (home-page "https://www.imagemagick.org/")
  110. (synopsis "Create, edit, compose, or convert bitmap images")
  111. (description
  112. "ImageMagick is a software suite to create, edit, compose, or convert
  113. bitmap images. It can read and write images in a variety of formats (over 100)
  114. including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG,
  115. and TIFF. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and
  116. transform images, adjust image colors, apply various special effects, or draw
  117. text, lines, polygons, ellipses and Bézier curves.")
  118. (license (license:fsf-free "http://www.imagemagick.org/script/license.php"))))
  119. (define-public perl-image-magick
  120. (package
  121. (name "perl-image-magick")
  122. (version "6.89")
  123. (source
  124. (origin
  125. (method url-fetch)
  126. (uri (string-append "mirror://cpan/authors/id/J/JC/JCRISTY/"
  127. "PerlMagick-" version "-1.tar.gz"))
  128. (sha256
  129. (base32
  130. "0n9afy1z5bhf9phrbahnkwhgcmijn8jggpbzwrivw1zhliliiy68"))))
  131. (build-system perl-build-system)
  132. (native-inputs `(("pkg-config" ,pkg-config)))
  133. (inputs `(("imagemagick" ,imagemagick)))
  134. (arguments
  135. `(#:tests? #f ;;Failed 2/23 test programs. 2/353 subtests failed.
  136. #:phases
  137. (modify-phases %standard-phases
  138. (add-before
  139. 'configure 'image-magick-flags
  140. (lambda* (#:key inputs #:allow-other-keys)
  141. (let ((im (assoc-ref inputs "imagemagick")))
  142. (substitute* "Makefile.PL"
  143. (("my \\$INC_magick = .*")
  144. "my $INC_magick = `pkg-config --cflags ImageMagick`;\n")
  145. (("my \\$LIBS_magick = .*")
  146. "my $LIBS_magick = `pkg-config --libs ImageMagick`;\n"))
  147. #t)))
  148. (add-before
  149. 'check 'skip-mpeg-tests
  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. #t)))))
  157. (home-page "https://metacpan.org/release/PerlMagick")
  158. (synopsis "Perl interface to ImageMagick")
  159. (description "This Perl extension allows the reading, manipulation and
  160. writing of a large number of image file formats using the ImageMagick library.
  161. Use it to create, edit, compose, or convert bitmap images from within a Perl
  162. script.")
  163. ;; See Magick.pm
  164. (license (package-license imagemagick))))
  165. (define-public graphicsmagick
  166. (package
  167. (name "graphicsmagick")
  168. (version "1.3.30")
  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
  180. "1warar0731xf94r4bn5x1km85rjabl4iq8r0dk3ywmczap3farfr"))))
  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,
  214. programming interfaces, and GUIs, to support file format conversion, image
  215. processing, and 2D vector rendering.")
  216. (license license:expat)))