gnu: Fix common unquote typos.
[jackhill/guix/guix.git] / gnu / packages / gimp.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
4 ;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
13 ;;;
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
18 ;;;
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22 (define-module (gnu packages gimp)
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix utils)
26 #:use-module ((guix licenses) #:prefix license:)
27 #:use-module (guix build-system gnu)
28 #:use-module (guix build-system glib-or-gtk)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages algebra)
31 #:use-module (gnu packages pkg-config)
32 #:use-module (gnu packages glib)
33 #:use-module (gnu packages gtk)
34 #:use-module (gnu packages gnome)
35 #:use-module (gnu packages image)
36 #:use-module (gnu packages ghostscript)
37 #:use-module (gnu packages compression)
38 #:use-module (gnu packages xml)
39 #:use-module (gnu packages pdf)
40 #:use-module (gnu packages photo)
41 #:use-module (gnu packages python)
42 #:use-module (gnu packages xorg))
43
44 (define-public babl
45 (package
46 (name "babl")
47 (version "0.1.40")
48 (source (origin
49 (method url-fetch)
50 (uri (list (string-append "https://download.gimp.org/pub/babl/"
51 (version-major+minor version)
52 "/babl-" version ".tar.bz2")
53 (string-append "http://ftp.gtk.org/pub/babl/"
54 (version-major+minor version)
55 "/babl-" version ".tar.bz2")
56 (string-append "ftp://ftp.gtk.org/pub/babl/"
57 (version-major+minor version)
58 "/babl-" version ".tar.bz2")))
59 (sha256
60 (base32
61 "08cdl6rcfvkhqsnhb214xzr0wbrv0956xzlrzqxcb1k1madgjanh"))))
62 (build-system gnu-build-system)
63 (home-page "http://gegl.org/babl/")
64 (synopsis "Image pixel format conversion library")
65 (description
66 "Babl is a dynamic, any-to-any pixel format translation library.
67 It allows converting between different methods of storing pixels, known as
68 @dfn{pixel formats}, that have different bit depths and other data
69 representations, color models, and component permutations.
70
71 A vocabulary to formulate new pixel formats from existing primitives is
72 provided, as well as a framework to add new color models and data types.")
73 (license license:lgpl3+)))
74
75 (define-public gegl
76 (package
77 (name "gegl")
78 (version "0.2.0")
79 (source (origin
80 (method url-fetch)
81 (uri (list (string-append "http://download.gimp.org/pub/gegl/"
82 (string-take version 3)
83 "/" name "-" version ".tar.bz2")))
84 (sha256
85 (base32
86 "09nlv06li9nrn74ifpm7223mxpg0s7cii702z72cpbwrjh6nlbnz"))
87 (patches (search-patches "gegl-CVE-2012-4433.patch"))))
88 (build-system gnu-build-system)
89 (arguments
90 '(;; More than just the one test disabled below now fails; disable them
91 ;; all according to the rationale given below.
92 #:tests? #f
93 #:configure-flags '("LDFLAGS=-lm")
94 #:phases
95 (modify-phases %standard-phases
96 (add-before 'build 'pre-build
97 (lambda _
98 ;; This test program seems to crash on exit. Specifically, whilst
99 ;; g_object_unreffing bufferA and bufferB - This seems to be a bug
100 ;; in the destructor. This is just a test program so will not have
101 ;; any wider effect, although might be hiding another problem.
102 ;; According to advice received on irc.gimp.org#gegl although 0.2.0
103 ;; is the latest released version, any bug reports against it will
104 ;; be ignored. So we are on our own.
105 (substitute* "tools/img_cmp.c"
106 (("g_object_unref \\(buffer.\\);") ""))
107
108 (substitute* "tests/compositions/Makefile"
109 (("/bin/sh") (which "sh")))
110 #t)))))
111 (inputs
112 `(("babl" ,babl)
113 ("glib" ,glib)
114 ("cairo" ,cairo)
115 ("pango" ,pango)
116 ("libpng" ,libpng)
117 ("libjpeg" ,libjpeg-8)))
118 (native-inputs
119 `(("pkg-config" ,pkg-config)
120 ("glib" ,glib "bin") ; for gtester
121 ("intltool" ,intltool)))
122 (home-page "http://gegl.org")
123 (synopsis "Graph based image processing framework")
124 (description "GEGL (Generic Graphics Library) provides infrastructure to
125 do demand based cached non destructive image editing on larger than RAM
126 buffers.")
127 ;; The library itself is licensed under LGPL while the sample commandline
128 ;; application and GUI binary gegl is licensed under GPL.
129 (license (list license:lgpl3+ license:gpl3+))))
130
131 (define-public gimp
132 (package
133 (name "gimp")
134 (version "2.8.22")
135 (source (origin
136 (method url-fetch)
137 (uri (string-append "http://download.gimp.org/pub/gimp/v"
138 (version-major+minor version)
139 "/gimp-" version ".tar.bz2"))
140 (patches (search-patches "gimp-CVE-2017-17784.patch"
141 "gimp-CVE-2017-17785.patch"
142 "gimp-CVE-2017-17786.patch"
143 "gimp-CVE-2017-17787.patch"
144 "gimp-CVE-2017-17789.patch"))
145 (sha256
146 (base32
147 "12k3lp938qdc9cqj29scg55f3bb8iav2fysd29w0s49bqmfa71wi"))))
148 (build-system gnu-build-system)
149 (outputs '("out"
150 "doc")) ;5 MiB of gtk-doc HTML
151 (arguments
152 '(#:configure-flags (list (string-append "--with-html-dir="
153 (assoc-ref %outputs "doc")
154 "/share/gtk-doc/html"))
155 #:phases
156 (modify-phases %standard-phases
157 (add-after 'install 'install-sitecustomize.py
158 ;; Install 'sitecustomize.py' into gimp's python directory to
159 ;; add pygobject and pygtk to pygimp's search path.
160 (lambda* (#:key outputs #:allow-other-keys)
161 (let* ((pythonpath (getenv "PYTHONPATH"))
162 (out (assoc-ref outputs "out"))
163 (sitecustomize.py
164 (string-append
165 out "/lib/gimp/2.0/python/sitecustomize.py")))
166 (call-with-output-file sitecustomize.py
167 (lambda (port)
168 (format port "import site~%")
169 (format port "for dir in '~a'.split(':'):~%" pythonpath)
170 (format port " site.addsitedir(dir)~%")))))))))
171 (inputs
172 `(("babl" ,babl)
173 ("glib" ,glib)
174 ("libtiff" ,libtiff)
175 ("libjpeg" ,libjpeg-8)
176 ("atk" ,atk)
177 ("gtk+" ,gtk+-2)
178 ("exif" ,libexif) ; optional, EXIF + XMP support
179 ("lcms" ,lcms) ; optional, color management
180 ("librsvg" ,librsvg) ; optional, SVG support
181 ("poppler" ,poppler) ; optional, PDF support
182 ("python" ,python-2) ; optional, Python support
183 ("python2-pygtk" ,python2-pygtk) ; optional, Python support
184 ("gegl" ,gegl)))
185 (native-inputs
186 `(("pkg-config" ,pkg-config)
187 ("intltool" ,intltool)))
188 (home-page "http://gimp.org")
189 (synopsis "GNU Image Manipulation Program")
190 (description
191 "GIMP is an application for image manipulation tasks such as photo
192 retouching, composition and authoring. It supports all common image formats
193 as well as specialized ones. It features a highly customizable interface
194 that is extensible via a plugin system.")
195 (license license:gpl3+))) ; some files are lgplv3
196
197 (define-public gimp-fourier
198 (package
199 (name "gimp-fourier")
200 (version "0.4.3-2")
201 (source (origin
202 (method url-fetch)
203 (uri (string-append "http://registry.gimp.org/files/fourier-"
204 version ".tar.gz"))
205 (sha256
206 (base32
207 "1rpacyad678lqgxa3hh2n0zpg4azs8dpa8q079bqsl12812k9184"))))
208 (build-system gnu-build-system)
209 (arguments
210 `(#:tests? #f ;no tests
211 #:phases
212 (modify-phases %standard-phases
213 (delete 'configure)
214 (add-after 'unpack 'set-prefix
215 (lambda* (#:key outputs #:allow-other-keys)
216 ;; gimptool-2.0 does not allow us to install to any target
217 ;; directory.
218 (let ((target (string-append (assoc-ref outputs "out")
219 "/lib/gimp/"
220 (car (string-split ,(package-version gimp) #\.))
221 ".0/plug-ins")))
222 (substitute* "Makefile"
223 (("\\$\\(PLUGIN_INSTALL\\) fourier")
224 (string-append "cp fourier " target)))
225 (mkdir-p target))
226 #t)))))
227 (inputs
228 `(("fftw" ,fftw)
229 ("gimp" ,gimp)
230 ;; needed by gimp-2.0.pc
231 ("gdk-pixbuf" ,gdk-pixbuf)
232 ("cairo" ,cairo)
233 ("glib" ,glib)
234 ;; needed by gimpui-2.0.pc
235 ("gtk+" ,gtk+-2)))
236 (native-inputs
237 `(("pkg-config" ,pkg-config)))
238 (home-page "http://registry.gimp.org/node/19596")
239 (synopsis "GIMP plug-in to edit image in fourier space")
240 (description
241 "This package provides a simple plug-in to apply the fourier transform on
242 an image, allowing you to work with the transformed image inside GIMP. You
243 can draw or apply filters in fourier space and get the modified image with an
244 inverse fourier transform.")
245 (license license:gpl3+)))