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