gnu: ruby-shoulda-matchers: Update to 3.1.1.
[jackhill/guix/guix.git] / gnu / packages / gd.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2016 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
5 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
6 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
13 ;;;
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
18 ;;;
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22 (define-module (gnu packages gd)
23 #:use-module (guix packages)
24 #:use-module (guix build-system gnu)
25 #:use-module (guix build-system perl)
26 #:use-module (guix download)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages perl)
29 #:use-module (gnu packages image)
30 #:use-module (gnu packages imagemagick)
31 #:use-module (gnu packages fontutils)
32 #:use-module (gnu packages compression)
33 #:use-module (gnu packages pkg-config)
34 #:use-module ((guix licenses) #:select (non-copyleft)))
35
36 (define-public gd
37 (package
38 (name "gd")
39
40 ;; Note: With libgd.org now pointing to bitbucket.org, genuine old
41 ;; tarballs are no longer available. Notably, versions 2.0.x are
42 ;; missing.
43 (version "2.1.1")
44
45 (source (origin
46 (method url-fetch)
47 (uri (string-append
48 "https://bitbucket.org/libgd/gd-libgd/downloads/"
49 "libgd-" version ".tar.xz"))
50 (sha256
51 (base32
52 "11djy9flzxczphigqgp7fbbblbq35gqwwhn9xfcckawlapa1xnls"))
53 (patches (search-patches "gd-CVE-2016-3074.patch"))))
54 (build-system gnu-build-system)
55 (native-inputs
56 `(("pkg-config" ,pkg-config)))
57 (inputs
58 `(("freetype" ,freetype)
59 ("libpng" ,libpng)
60 ("zlib" ,zlib)))
61 (propagated-inputs
62 `(("fontconfig" ,fontconfig)
63 ("libjpeg" ,libjpeg)))
64 (home-page "http://www.libgd.org/")
65 (synopsis "Library for the dynamic creation of images by programmers")
66 (description
67 "GD is a library for the dynamic creation of images by programmers. GD
68 is written in C, and \"wrappers\" are available for Perl, PHP and other
69 languages. GD creates PNG, JPEG, GIF, WebP, XPM, BMP images, among other
70 formats. GD is commonly used to generate charts, graphics, thumbnails, and
71 most anything else, on the fly. While not restricted to use on the web, the
72 most common applications of GD involve website development.")
73 (license (non-copyleft "file://COPYING"
74 "See COPYING file in the distribution."))
75 (properties '((cpe-name . "libgd")))))
76
77 (define-public perl-gd
78 (package
79 (name "perl-gd")
80 (version "2.56")
81 (source
82 (origin
83 (method url-fetch)
84 (uri (string-append "mirror://cpan/authors/id/L/LD/LDS/"
85 "GD-" version ".tar.gz"))
86 (sha256
87 (base32
88 "1ya8f9hpiax8j29vwaiwlvvgah0vkyvpzva28r8231nyk0f3s40z"))
89 (patches (search-patches
90 "perl-gd-options-passthrough-and-fontconfig.patch"))))
91 (build-system perl-build-system)
92 (native-inputs
93 `(("perl-module-build" ,perl-module-build))) ;needs Module::Build >= 0.42
94 (inputs
95 `(("gd" ,gd)
96 ("zlib" ,zlib)
97 ("png" ,libpng)
98 ("ft" ,freetype)
99 ("jpeg" ,libjpeg)
100 ("fontconfig" ,fontconfig)))
101 (arguments
102 ;; We must use Build.PL for building because Makefile.PL fails to build
103 ;; the XS source.
104 `(#:module-build-flags (map (lambda (i)
105 (string-append "--lib_" i "_path="
106 (assoc-ref %build-inputs i)))
107 '("zlib" "png" "ft" "jpeg" "fontconfig"))
108 #:phases (alist-cons-after
109 'configure 'clear-autogenerated-files
110 (lambda _
111 ;; This file is autogenerated by its .PLS script at build
112 ;; time, but file creation fails because that file already
113 ;; exists in the distribution with non-writable
114 ;; permissions, so delete it first.
115 (delete-file "bdf_scripts/bdf2gdfont.pl"))
116 %standard-phases)))
117 (home-page "http://search.cpan.org/dist/GD")
118 (synopsis "Perl interface to the GD graphics library")
119 (description "GD.pm is an autoloadable interface module for libgd, a
120 popular library for creating and manipulating PNG files. With this library
121 you can create PNG images on the fly or modify existing files.")
122 (license (package-license perl))))
123
124 (define-public perl-gd-securityimage
125 (package
126 (name "perl-gd-securityimage")
127 (version "1.73")
128 (source
129 (origin
130 (method url-fetch)
131 (uri (string-append "mirror://cpan/authors/id/B/BU/BURAK/"
132 "GD-SecurityImage-" version ".tar.gz"))
133 (sha256
134 (base32
135 "1kaxs67rfd4w46lxgcg3pa05a596l0h1k8n4zk2gwrrar4022wpx"))))
136 (build-system perl-build-system)
137 (native-inputs
138 `(("perl-module-build" ,perl-module-build)))
139 (propagated-inputs
140 `(("perl-gd" ,perl-gd)
141 ("perl-image-magick" ,perl-image-magick)))
142 (home-page "http://search.cpan.org/dist/GD-SecurityImage")
143 (synopsis "Security image generator")
144 (description "This module provides a basic interface to create
145 security (captcha) images. The final output is the actual graphic data, the
146 mime type of the graphic, and the created random string. The module also has
147 some \"styles\" that are used to create the background (or foreground) of the
148 image.")
149 (license (package-license perl))))