gnu: upower: Enable GObject introspection.
[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
87 (list
88 (search-patch "perl-gd-options-passthrough-and-fontconfig.patch")))))
89 (build-system perl-build-system)
90 (native-inputs
91 `(("perl-module-build" ,perl-module-build))) ;needs Module::Build >= 0.42
92 (inputs
93 `(("gd" ,gd)
94 ("zlib" ,zlib)
95 ("png" ,libpng)
96 ("ft" ,freetype)
97 ("jpeg" ,libjpeg)
98 ("fontconfig" ,fontconfig)))
99 (arguments
100 ;; We must use Build.PL for building because Makefile.PL fails to build
101 ;; the XS source.
102 `(#:module-build-flags (map (lambda (i)
103 (string-append "--lib_" i "_path="
104 (assoc-ref %build-inputs i)))
105 '("zlib" "png" "ft" "jpeg" "fontconfig"))
106 #:phases (alist-cons-after
107 'configure 'clear-autogenerated-files
108 (lambda _
109 ;; This file is autogenerated by its .PLS script at build
110 ;; time, but file creation fails because that file already
111 ;; exists in the distribution with non-writable
112 ;; permissions, so delete it first.
113 (delete-file "bdf_scripts/bdf2gdfont.pl"))
114 %standard-phases)))
115 (home-page "http://search.cpan.org/dist/GD")
116 (synopsis "Perl interface to the GD graphics library")
117 (description "GD.pm is an autoloadable interface module for libgd, a
118 popular library for creating and manipulating PNG files. With this library
119 you can create PNG images on the fly or modify existing files.")
120 (license (package-license perl))))
121
122 (define-public perl-gd-securityimage
123 (package
124 (name "perl-gd-securityimage")
125 (version "1.73")
126 (source
127 (origin
128 (method url-fetch)
129 (uri (string-append "mirror://cpan/authors/id/B/BU/BURAK/"
130 "GD-SecurityImage-" version ".tar.gz"))
131 (sha256
132 (base32
133 "1kaxs67rfd4w46lxgcg3pa05a596l0h1k8n4zk2gwrrar4022wpx"))))
134 (build-system perl-build-system)
135 (native-inputs
136 `(("perl-module-build" ,perl-module-build)))
137 (propagated-inputs
138 `(("perl-gd" ,perl-gd)
139 ("perl-image-magick" ,perl-image-magick)))
140 (home-page "http://search.cpan.org/dist/GD-SecurityImage")
141 (synopsis "Security image generator")
142 (description "This module provides a basic interface to create
143 security (captcha) images. The final output is the actual graphic data, the
144 mime type of the graphic, and the created random string. The module also has
145 some \"styles\" that are used to create the background (or foreground) of the
146 image.")
147 (license (package-license perl))))