projects/guix·blob java-team · refs

171 lines · 7.1 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2016, 2023-2024 Ludovic Courtès <[email protected]>
3;;; Copyright © 2015, 2016 Mark H Weaver <[email protected]>
4;;; Copyright © 2015 Eric Bavier <[email protected]>
5;;; Copyright © 2016, 2017 Leo Famulari <[email protected]>
6;;; Copyright © 2017, 2021 Efraim Flashner <[email protected]>
7;;; Copyright © 2017 Marius Bakke <[email protected]>
8;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <[email protected]>
9;;; Copyright © 2024 Maxim Cournoyer <[email protected]>
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
26(define-module (gnu packages gd)
27 #:use-module (guix gexp)
28 #:use-module (guix packages)
29 #:use-module (guix utils)
30 #:use-module (guix build-system gnu)
31 #:use-module (guix build-system perl)
32 #:use-module (guix download)
33 #:use-module (gnu packages)
34 #:use-module (gnu packages perl)
35 #:use-module (gnu packages perl-check)
36 #:use-module (gnu packages image)
37 #:use-module (gnu packages imagemagick)
38 #:use-module (gnu packages fontutils)
39 #:use-module (gnu packages compression)
40 #:use-module (gnu packages pkg-config)
41 #:use-module ((guix licenses) #:select (non-copyleft perl-license)))
42
43(define-public gd
44 (package
45 (name "gd")
46 ;; Note: With libgd.org now pointing to github.com, genuine old
47 ;; tarballs are no longer available. Notably, versions 2.0.x are
48 ;; missing.
49 (version "2.3.3")
50 (source (origin
51 (method url-fetch)
52 (uri (string-append
53 "https://github.com/libgd/libgd/releases/download/gd-"
54 version "/libgd-" version ".tar.xz"))
55 (sha256
56 (base32
57 "0qas3q9xz3wgw06dm2fj0i189rain6n60z1vyq50d5h7wbn25s1z"))
58 (patches
59 (search-patches "gd-fix-tests-on-i686.patch"
60 "gd-brect-bounds.patch"))))
61 (build-system gnu-build-system)
62 (arguments
63 ;; As recommended by github.com/libgd/libgd/issues/278 to fix rounding
64 ;; issues on aarch64 and other architectures.
65 (list #:make-flags #~(list "CFLAGS=-ffp-contract=off"
66
67 ;; XXX: This test fails on i686-linux.
68 ;; See <https://issues.guix.gnu.org/71996>.
69 #$@(if (and (not (%current-target-system))
70 (target-x86-32?))
71 #~("XFAIL_TESTS=gdimagegrayscale/basic")
72 #~()))
73 #:configure-flags #~(list "--disable-static")
74 #:phases
75 #~(modify-phases %standard-phases
76 (add-after 'install 'remove-libtool-archives
77 ;; Libtool archives lists the whole transitive dependencies,
78 ;; which is unnecessary unless producing static archives and
79 ;; leads to overlinking, e.g. causing the configure script of
80 ;; texlive-bin to fail due to looking for a transitive jpeg
81 ;; library.
82 (lambda _
83 (for-each delete-file
84 (find-files (string-append #$output "/lib")
85 "\\.la$")))))))
86 (native-inputs
87 (list pkg-config))
88 (inputs
89 (list fontconfig
90 freetype
91 libjpeg-turbo
92 libpng
93 zlib))
94 (home-page "https://www.libgd.org/")
95 (synopsis "Library for the dynamic creation of images by programmers")
96 (description
97 "GD is a library for the dynamic creation of images by programmers. GD
98is written in C, and \"wrappers\" are available for Perl, PHP and other
99languages. GD creates PNG, JPEG, GIF, WebP, XPM, BMP images, among other
100formats. GD is commonly used to generate charts, graphics, thumbnails, and
101most anything else, on the fly. While not restricted to use on the web, the
102most common applications of GD involve website development.")
103 (license (non-copyleft "file://COPYING"
104 "See COPYING file in the distribution."))
105 (properties '((cpe-name . "libgd")
106 (upstream-name . "libgd")
107 (release-monitoring-url
108 . "https://github.com/libgd/libgd/releases")))))
109
110(define-public perl-gd
111 (package
112 (name "perl-gd")
113 (version "2.78")
114 (source
115 (origin
116 (method url-fetch)
117 (uri (string-append "mirror://cpan/authors/id/R/RU/RURBAN/"
118 "GD-" version ".tar.gz"))
119 (sha256
120 (base32 "1r3fpr8jhpwi48i66rickiphyj442hypsqnk4df4yjs2ym5hacb8"))))
121 (build-system perl-build-system)
122 (inputs
123 (list fontconfig
124 freetype
125 gd
126 libpng
127 libjpeg-turbo
128 zlib))
129 (native-inputs
130 (list perl-extutils-pkgconfig
131 perl-test-nowarnings))
132 (arguments
133 (list #:make-maker-flags
134 #~(list (string-append "--lib_jpeg_path="
135 #$(this-package-input "libjpeg-turbo")))))
136 (home-page "https://metacpan.org/release/GD")
137 (synopsis "Perl interface to the GD graphics library")
138 (description "GD.pm is an autoloadable interface module for libgd, a
139popular library for creating and manipulating PNG files. With this library
140you can create PNG images on the fly or modify existing files.")
141 (license perl-license)))
142
143(define-public perl-gd-securityimage
144 (package
145 (name "perl-gd-securityimage")
146 (version "1.75")
147 (source
148 (origin
149 (method url-fetch)
150 (uri (string-append "mirror://cpan/authors/id/B/BU/BURAK/"
151 "GD-SecurityImage-" version ".tar.gz"))
152 (sha256
153 (base32 "19lf1kzdavrkkx3f900jnpynr55d5kjd2sdmwpfir5dsmkcj9pix"))))
154 (build-system perl-build-system)
155 (arguments
156 '(#:phases
157 (modify-phases %standard-phases
158 (add-after 'unpack 'set-env
159 (lambda _ (setenv "PERL_USE_UNSAFE_INC" "1") #t)))))
160 (native-inputs
161 (list perl-module-build))
162 (propagated-inputs
163 (list perl-gd perl-image-magick))
164 (home-page "https://metacpan.org/release/GD-SecurityImage")
165 (synopsis "Security image generator")
166 (description "This module provides a basic interface to create
167security (captcha) images. The final output is the actual graphic data, the
168mime type of the graphic, and the created random string. The module also has
169some \"styles\" that are used to create the background (or foreground) of the
170image.")
171 (license perl-license)))