gnu: gnutls: Update to 3.6.12.
[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, 2018 Ricardo Wurmus <rekado@elephly.net>
4 ;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2018, 2019, 202 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;; Copyright © 2018 Leo Famulari <leo@famulari.name>
7 ;;; Copyright © 2018 Thorsten Wilms <t_w_@freenet.de>
8 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
15 ;;;
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
20 ;;;
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24 (define-module (gnu packages gimp)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix git-download)
28 #:use-module (guix utils)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix build-system gnu)
31 #:use-module (guix build-system glib-or-gtk)
32 #:use-module (guix build-system meson)
33 #:use-module (gnu packages)
34 #:use-module (gnu packages algebra)
35 #:use-module (gnu packages autotools)
36 #:use-module (gnu packages pkg-config)
37 #:use-module (gnu packages glib)
38 #:use-module (gnu packages gtk)
39 #:use-module (gnu packages gnome)
40 #:use-module (gnu packages image)
41 #:use-module (gnu packages ghostscript)
42 #:use-module (gnu packages compression)
43 #:use-module (gnu packages xml)
44 #:use-module (gnu packages pdf)
45 #:use-module (gnu packages photo)
46 #:use-module (gnu packages python)
47 #:use-module (gnu packages web)
48 #:use-module (gnu packages xorg))
49
50 (define-public babl
51 (package
52 (name "babl")
53 (version "0.1.74")
54 (source (origin
55 (method url-fetch)
56 (uri (list (string-append "https://download.gimp.org/pub/babl/"
57 (version-major+minor version)
58 "/babl-" version ".tar.xz")
59 (string-append "https://ftp.gtk.org/pub/babl/"
60 (version-major+minor version)
61 "/babl-" version ".tar.xz")
62 (string-append "ftp://ftp.gtk.org/pub/babl/"
63 (version-major+minor version)
64 "/babl-" version ".tar.xz")))
65 (sha256
66 (base32
67 "03nfcvy3453xkfvsfcnsfcjf2vg2pin09qnr9jlssdysa1lhnwcs"))))
68 (build-system meson-build-system)
69 (arguments
70 `(#:configure-flags
71 (list "-Denable-gir=false")))
72 (native-inputs
73 `(("pkg-config" ,pkg-config)))
74 (propagated-inputs
75 ;; Propagated to satisfy ‘babl.pc’.
76 `(("lcms" ,lcms)))
77 (home-page "http://gegl.org/babl/")
78 (synopsis "Image pixel format conversion library")
79 (description
80 "Babl is a dynamic, any-to-any pixel format translation library.
81 It allows converting between different methods of storing pixels, known as
82 @dfn{pixel formats}, that have different bit depths and other data
83 representations, color models, and component permutations.
84
85 A vocabulary to formulate new pixel formats from existing primitives is
86 provided, as well as a framework to add new color models and data types.")
87 (license license:lgpl3+)))
88
89 (define-public gegl
90 (package
91 (name "gegl")
92 (version "0.4.20")
93 (source (origin
94 (method url-fetch)
95 (uri (list (string-append "https://download.gimp.org/pub/gegl/"
96 (string-take version 3)
97 "/gegl-" version ".tar.xz")
98 (string-append "https://ftp.gtk.org/pub/gegl/"
99 (version-major+minor version)
100 "/gegl-" version ".tar.xz")
101 (string-append "ftp://ftp.gtk.org/pub/gegl/"
102 (version-major+minor version)
103 "/gegl-" version ".tar.xz")))
104 (sha256
105 (base32
106 "1zrxnxlhn0jmshg4n2m2xlgi886w059ynkiiihm7rpi05fs8pg93"))))
107 (build-system meson-build-system)
108 (arguments
109 `(#:configure-flags
110 (list "-Dintrospection=false")))
111 ;; These are propagated to satisfy 'gegl-0.4.pc'.
112 (propagated-inputs
113 `(("babl" ,babl)
114 ("glib" ,glib)
115 ("json-glib" ,json-glib)))
116 (inputs
117 `(("cairo" ,cairo)
118 ("pango" ,pango)
119 ("libpng" ,libpng)
120 ("libjpeg" ,libjpeg-turbo)))
121 (native-inputs
122 `(("pkg-config" ,pkg-config)
123 ("glib" ,glib "bin") ; for gtester
124 ("intltool" ,intltool)))
125 (home-page "http://gegl.org")
126 (synopsis "Graph based image processing framework")
127 (description "GEGL (Generic Graphics Library) provides infrastructure to
128 do demand based cached non destructive image editing on larger than RAM
129 buffers.")
130 ;; The library itself is licensed under LGPL while the sample commandline
131 ;; application and GUI binary gegl is licensed under GPL.
132 (license (list license:lgpl3+ license:gpl3+))))
133
134 (define-public gimp
135 (package
136 (name "gimp")
137 (version "2.10.14")
138 (source (origin
139 (method url-fetch)
140 (uri (string-append "https://download.gimp.org/pub/gimp/v"
141 (version-major+minor version)
142 "/gimp-" version ".tar.bz2"))
143 (sha256
144 (base32
145 "0m6wdnfvsxyhimdd4v3351g4r1fklllnbipbwcfym3h7q88hz6yz"))))
146 (build-system gnu-build-system)
147 (outputs '("out"
148 "doc")) ; 9 MiB of gtk-doc HTML
149 (arguments
150 '(#:configure-flags
151 (list (string-append "--with-html-dir="
152 (assoc-ref %outputs "doc")
153 "/share/gtk-doc/html")
154 ;; ./configure requests not to annoy upstream with packaging bugs.
155 "--with-bug-report-url=https://bugs.gnu.org/guix")
156 #:phases
157 (modify-phases %standard-phases
158 (add-after 'install 'install-sitecustomize.py
159 ;; Install 'sitecustomize.py' into gimp's python directory to
160 ;; add pygobject and pygtk to pygimp's search path.
161 (lambda* (#:key outputs #:allow-other-keys)
162 (let* ((pythonpath (getenv "PYTHONPATH"))
163 (out (assoc-ref outputs "out"))
164 (sitecustomize.py
165 (string-append
166 out "/lib/gimp/2.0/python/sitecustomize.py")))
167 (call-with-output-file sitecustomize.py
168 (lambda (port)
169 (format port "import site~%")
170 (format port "for dir in '~a'.split(':'):~%" pythonpath)
171 (format port " site.addsitedir(dir)~%")))))))))
172 (inputs
173 `(("babl" ,babl)
174 ("glib" ,glib)
175 ("glib-networking" ,glib-networking)
176 ("libtiff" ,libtiff)
177 ("libjpeg" ,libjpeg-turbo)
178 ("atk" ,atk)
179 ("gexiv2" ,gexiv2)
180 ("gtk+" ,gtk+-2)
181 ("libmypaint" ,libmypaint)
182 ("mypaint-brushes" ,mypaint-brushes)
183 ("exif" ,libexif) ; optional, EXIF + XMP support
184 ("lcms" ,lcms) ; optional, color management
185 ("librsvg" ,librsvg) ; optional, SVG support
186 ("poppler" ,poppler) ; optional, PDF support
187 ("poppler-data" ,poppler-data)
188 ("python" ,python-2) ; optional, Python support
189 ("python2-pygtk" ,python2-pygtk) ; optional, Python support
190 ("gegl" ,gegl)))
191 (native-inputs
192 `(("glib:bin" ,glib "bin") ; for glib-compile-resources and gdbus-codegen
193 ("pkg-config" ,pkg-config)
194 ("intltool" ,intltool)))
195 (home-page "https://www.gimp.org")
196 (synopsis "GNU Image Manipulation Program")
197 (description
198 "GIMP is an application for image manipulation tasks such as photo
199 retouching, composition and authoring. It supports all common image formats
200 as well as specialized ones. It features a highly customizable interface
201 that is extensible via a plugin system.")
202 (license license:gpl3+))) ; some files are lgplv3
203
204 (define-public gimp-fourier
205 (package
206 (name "gimp-fourier")
207 (version "0.4.3-2")
208 (source (origin
209 (method url-fetch)
210 (uri (string-append "http://registry.gimp.org/files/fourier-"
211 version ".tar.gz"))
212 (sha256
213 (base32
214 "1rpacyad678lqgxa3hh2n0zpg4azs8dpa8q079bqsl12812k9184"))))
215 (build-system gnu-build-system)
216 (arguments
217 `(#:tests? #f ;no tests
218 #:phases
219 (modify-phases %standard-phases
220 ;; FIXME: The gegl package only installs "gegl-0.4.pc", but
221 ;; "gimp-2.0.pc" requires "gegl-0.3.pc", so we just copy it.
222 (replace 'configure
223 (lambda* (#:key inputs #:allow-other-keys)
224 (mkdir-p "tmppkgconfig")
225 (copy-file (string-append (assoc-ref inputs "gegl")
226 "/lib/pkgconfig/gegl-0.4.pc")
227 "tmppkgconfig/gegl-0.3.pc")
228 (setenv "PKG_CONFIG_PATH"
229 (string-append "tmppkgconfig:"
230 (or (getenv "PKG_CONFIG_PATH") "")))
231 #t))
232 (add-after 'unpack 'set-prefix
233 (lambda* (#:key outputs #:allow-other-keys)
234 ;; gimptool-2.0 does not allow us to install to any target
235 ;; directory.
236 (let ((target (string-append (assoc-ref outputs "out")
237 "/lib/gimp/"
238 (car (string-split ,(package-version gimp) #\.))
239 ".0/plug-ins")))
240 (substitute* "Makefile"
241 (("\\$\\(PLUGIN_INSTALL\\) fourier")
242 (string-append "cp fourier " target)))
243 (mkdir-p target))
244 #t)))))
245 (inputs
246 `(("fftw" ,fftw)
247 ("gimp" ,gimp)
248 ;; needed by gimp-2.0.pc
249 ("gdk-pixbuf" ,gdk-pixbuf)
250 ("gegl" ,gegl)
251 ("cairo" ,cairo)
252 ("glib" ,glib)
253 ;; needed by gimpui-2.0.pc
254 ("gtk+" ,gtk+-2)))
255 (native-inputs
256 `(("pkg-config" ,pkg-config)))
257 (home-page "http://registry.gimp.org/node/19596")
258 (synopsis "GIMP plug-in to edit image in fourier space")
259 (description
260 "This package provides a simple plug-in to apply the fourier transform on
261 an image, allowing you to work with the transformed image inside GIMP. You
262 can draw or apply filters in fourier space and get the modified image with an
263 inverse fourier transform.")
264 (license license:gpl3+)))
265
266 (define-public libmypaint
267 (package
268 (name "libmypaint")
269 (version "1.3.0")
270 (source (origin
271 (method url-fetch)
272 (uri (string-append "https://github.com/mypaint/libmypaint/"
273 "releases/download/v" version "/libmypaint-"
274 version ".tar.xz"))
275 (sha256
276 (base32
277 "0wd6jk69vmhsq1mdw96v0fh7b28n3glkr5ca466zcq7agzaxj1va"))))
278 (build-system gnu-build-system)
279 (native-inputs
280 `(("intltool" ,intltool)
281 ("pkg-config" ,pkg-config)))
282 ;; As needed by 'libmypaint.pc'.
283 (propagated-inputs
284 `(("json-c" ,json-c)
285 ("gobject-introspection" ,gobject-introspection)))
286 (inputs
287 `(("glib" ,glib)))
288 (synopsis "Artistic brushes library")
289 (description "Libmypaint, also called \"brushlib\", is a library for making
290 brushstrokes which is used by MyPaint and GIMP.")
291 (home-page "http://mypaint.org")
292 (license license:isc)))
293
294 (define-public mypaint-brushes
295 (package
296 (name "mypaint-brushes")
297 (version "1.3.0")
298 (source (origin
299 (method git-fetch)
300 (uri (git-reference
301 (url "https://github.com/Jehan/mypaint-brushes.git")
302 (commit (string-append "v" version))))
303 (file-name (git-file-name name version))
304 (sha256
305 (base32
306 "1iz89z6v2mp8j1lrf942k561s8311i3s34ap36wh4rybb2lq15m0"))))
307 (build-system gnu-build-system)
308 (arguments
309 `(#:phases
310 (modify-phases %standard-phases
311 (add-after 'unpack 'relax-dependency-version
312 (lambda _
313 (substitute* "autogen.sh"
314 (("automake-1.13") "automake")
315 (("aclocal-1.13") "aclocal"))
316 #t)))))
317 (native-inputs
318 `(("autoconf" ,autoconf)
319 ("automake" ,automake)))
320 (synopsis "Default brushes for MyPaint")
321 (description "This package provides the default set of brushes for
322 MyPaint.")
323 (home-page "https://github.com/Jehan/mypaint-brushes")
324 (license license:cc0)))
325
326 (define-public gimp-resynthesizer
327 ;; GIMP does not respect any plugin search path environment variable, so after
328 ;; installation users have to edit their GIMP settings to include
329 ;; "$HOME/.guix-profile/lib/gimp/2.0/plug-ins/" in
330 ;; “Edit->Preferences->Folders->Plug Ins”.
331 (package
332 (name "gimp-resynthesizer")
333 (version "2.0.3")
334 (source
335 (origin
336 (method url-fetch)
337 (uri (string-append "https://github.com/bootchk/resynthesizer/archive/v"
338 version ".tar.gz"))
339 (sha256
340 (base32
341 "0l3404w6rqny7h3djskxf149gzx6x4qhndgbh3403c9lbh4pi1kr"))
342 (file-name (string-append name "-" version ".tar.gz"))))
343 (build-system gnu-build-system)
344 (arguments
345 `( ;; Turn off tests to avoid:
346 ;; make[1]: *** No rule to make target '../src/resynth-gui.c', needed by 'resynthesizer.pot'. Stop.
347 #:tests? #f
348 #:phases
349 (modify-phases %standard-phases
350 (add-after 'unpack 'set-env
351 (lambda _
352 (setenv "CONFIG_SHELL" (which "sh"))
353 #t))
354 (add-after 'configure 'set-prefix
355 ;; Install plugin under $prefix, not under GIMP's libdir.
356 (lambda* (#:key outputs #:allow-other-keys)
357 (let ((target (string-append (assoc-ref outputs "out")
358 "/lib/gimp/"
359 ,(version-major
360 (package-version gimp))
361 ".0")))
362 (substitute* (list "src/resynthesizer/Makefile"
363 "src/resynthesizer-gui/Makefile")
364 (("GIMP_LIBDIR = .*")
365 (string-append "GIMP_LIBDIR = " target "\n")))
366 (mkdir-p target)
367 #t))))))
368 (native-inputs
369 `(("autoconf" ,autoconf-wrapper)
370 ("automake" ,automake)
371 ("glib" ,glib "bin") ; glib-gettextize
372 ("intltool" ,intltool)
373 ("pkg-config" ,pkg-config)))
374 (inputs
375 `(("gimp" ,gimp)
376 ("gdk-pixbuf" ,gdk-pixbuf) ; needed by gimp-2.0.pc
377 ("cairo" ,cairo)
378 ("gegl" ,gegl)
379 ("gtk+" ,gtk+-2) ; needed by gimpui-2.0.pc
380 ("glib" ,glib)))
381 (home-page "https://github.com/bootchk/resynthesizer")
382 (synopsis "GIMP plugins for texture synthesis")
383 (description
384 "This package provides resynthesizer plugins for GIMP, which encompasses
385 tools for healing selections (content-aware fill), enlarging the canvas and
386 healing the border, increasing the resolution while adding detail, and
387 transferring the style of an image.")
388 (license license:gpl3+)))