| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 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 | |
| 47 | |
| 48 | |
| 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 | |
| 64 | |
| 65 | (list #:make-flags #~(list "CFLAGS=-ffp-contract=off"
|
| 66 |
|
| 67 | |
| 68 | |
| 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 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 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
|
| 98 | is written in C, and \"wrappers\" are available for Perl, PHP and other
|
| 99 | languages. GD creates PNG, JPEG, GIF, WebP, XPM, BMP images, among other
|
| 100 | formats. GD is commonly used to generate charts, graphics, thumbnails, and
|
| 101 | most anything else, on the fly. While not restricted to use on the web, the
|
| 102 | most 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
|
| 139 | popular library for creating and manipulating PNG files. With this library
|
| 140 | you 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
|
| 167 | security (captcha) images. The final output is the actual graphic data, the
|
| 168 | mime type of the graphic, and the created random string. The module also has
|
| 169 | some \"styles\" that are used to create the background (or foreground) of the
|
| 170 | image.")
|
| 171 | (license perl-license)))
|