gnu: slepc: Set origin file-name.
[jackhill/guix/guix.git] / gnu / packages / gd.scm
CommitLineData
d517142b
LC
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
b01a0ba8 3;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
f7ee7a9b 4;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
d517142b
LC
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)
f7ee7a9b 24 #:use-module (guix build-system perl)
d517142b 25 #:use-module (guix download)
fdbd19ea 26 #:use-module (gnu packages)
f7ee7a9b 27 #:use-module (gnu packages perl)
e55354b8 28 #:use-module (gnu packages image)
d8ae0acc 29 #:use-module (gnu packages imagemagick)
d517142b
LC
30 #:use-module (gnu packages fontutils)
31 #:use-module (gnu packages compression)
b01a0ba8 32 #:use-module (gnu packages pkg-config)
166191b3 33 #:use-module ((guix licenses) #:select (non-copyleft)))
d517142b
LC
34
35(define-public gd
36 (package
37 (name "gd")
38
39 ;; Note: With libgd.org now pointing to bitbucket.org, genuine old
b01a0ba8 40 ;; tarballs are no longer available. Notably, versions 2.0.x are
d517142b 41 ;; missing.
b01a0ba8 42 (version "2.1.1")
d517142b
LC
43
44 (source (origin
45 (method url-fetch)
b01a0ba8
MW
46 (uri (string-append
47 "https://bitbucket.org/libgd/gd-libgd/downloads/"
48 "libgd-" version ".tar.xz"))
d517142b
LC
49 (sha256
50 (base32
b01a0ba8 51 "11djy9flzxczphigqgp7fbbblbq35gqwwhn9xfcckawlapa1xnls"))))
d517142b 52 (build-system gnu-build-system)
b01a0ba8
MW
53 (native-inputs
54 `(("pkg-config" ,pkg-config)))
d517142b
LC
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
66is written in C, and \"wrappers\" are available for Perl, PHP and other
67languages. GD creates PNG, JPEG, GIF, WebP, XPM, BMP images, among other
68formats. GD is commonly used to generate charts, graphics, thumbnails, and
69most anything else, on the fly. While not restricted to use on the web, the
70most common applications of GD involve website development.")
166191b3 71 (license (non-copyleft "file://COPYING"
d517142b 72 "See COPYING file in the distribution."))))
f7ee7a9b
EB
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
118popular library for creating and manipulating PNG files. With this library
119you can create PNG images on the fly or modify existing files.")
120 (license (package-license perl))))
d8ae0acc
EB
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")
e881752c 141 (synopsis "Security image generator")
d8ae0acc
EB
142 (description "This module provides a basic interface to create
143security (captcha) images. The final output is the actual graphic data, the
144mime type of the graphic, and the created random string. The module also has
145some \"styles\" that are used to create the background (or foreground) of the
146image.")
147 (license (package-license perl))))