Merge remote-tracking branch 'origin/staging-next' into staging
[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, 2020 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;; Copyright © 2018 Leo Famulari <leo@famulari.name>
7 ;;; Copyright © 2018 Thorsten Wilms <t_w_@freenet.de>
8 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
9 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
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 gimp)
27 #:use-module (guix packages)
28 #:use-module (guix download)
29 #:use-module (guix git-download)
30 #:use-module (guix utils)
31 #:use-module ((guix licenses) #:prefix license:)
32 #:use-module (guix build-system gnu)
33 #:use-module (guix build-system glib-or-gtk)
34 #:use-module (guix build-system meson)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages algebra)
37 #:use-module (gnu packages autotools)
38 #:use-module (gnu packages base)
39 #:use-module (gnu packages documentation)
40 #:use-module (gnu packages pkg-config)
41 #:use-module (gnu packages glib)
42 #:use-module (gnu packages gtk)
43 #:use-module (gnu packages gnome)
44 #:use-module (gnu packages graphics)
45 #:use-module (gnu packages image)
46 #:use-module (gnu packages ghostscript)
47 #:use-module (gnu packages compression)
48 #:use-module (gnu packages xml)
49 #:use-module (gnu packages linux)
50 #:use-module (gnu packages ncurses)
51 #:use-module (gnu packages patchutils)
52 #:use-module (gnu packages pdf)
53 #:use-module (gnu packages photo)
54 #:use-module (gnu packages python)
55 #:use-module (gnu packages web)
56 #:use-module (gnu packages xorg))
57
58 (define-public poly2tri-c
59 (package
60 (name "poly2tri-c")
61 (version "0.1.0")
62 (source
63 (origin
64 (method url-fetch)
65 (uri
66 (string-append "https://storage.googleapis.com/"
67 "google-code-archive-source/v2/code.google.com/"
68 "poly2tri-c/source-archive.zip"))
69 (file-name
70 (string-append name "-" version ".zip"))
71 (sha256
72 (base32 "17cw0zhbnf2gb59jm26z0wcarqgdwir9jr1fpi3v9lcvyb2s3mqj"))))
73 (build-system glib-or-gtk-build-system)
74 (outputs '("out" "doc"))
75 (arguments
76 `(#:configure-flags
77 (list
78 "--disable-static")
79 #:phases
80 (modify-phases %standard-phases
81 (add-after 'unpack 'disable-strict-rules
82 (lambda _
83 (substitute* "configure.ac"
84 (("\\$CFLAGS -Wall -ansi -pedantic")
85 "$CFLAGS")
86 (("\\$CFLAGS -Werror")
87 "$CFLAGS"))
88 #t))
89 (add-after 'disable-strict-rules 'fix-build-errors
90 (lambda _
91 (substitute* "poly2tri-c/refine/Makefile.am"
92 (("cdt.c")
93 "rcdt.c")
94 (("cdt.h")
95 "rcdt.h")
96 (("utils.c")
97 "rutils.c")
98 (("utils.h")
99 "rutils.h"))
100 #t))
101 (add-before 'bootstrap 'configure-later
102 (lambda _
103 (setenv "NOCONFIGURE" "set")
104 #t))
105 (add-after 'build 'generate-doc
106 (lambda _
107 (invoke "doxygen")
108 #t))
109 (add-after 'install 'install-doc
110 (lambda* (#:key outputs #:allow-other-keys)
111 (let* ((out (assoc-ref outputs "out"))
112 (doc (assoc-ref outputs "doc")))
113 (copy-recursively
114 "doc"
115 (string-append doc "/share/doc/poly2tri-c"))
116 #t))))))
117 (native-inputs
118 `(("autoconf" ,autoconf)
119 ("automake" ,automake)
120 ("doxygen" ,doxygen)
121 ("libtool" ,libtool)
122 ("pkg-config" ,pkg-config)
123 ("unzip" ,unzip)
124 ("which" ,which)))
125 (propagated-inputs
126 `(("glib" ,glib)))
127 (synopsis "2D constrained Delaunay triangulation library")
128 (description "Poly2Tri-C is a library for generating, refining and rendering
129 2-Dimensional Constrained Delaunay Triangulations.")
130 (home-page "https://code.google.com/archive/p/poly2tri-c/")
131 (license license:bsd-3)))
132
133 (define-public mrg
134 (package
135 (name "mrg")
136 (version "0.1.4")
137 (source
138 (origin
139 (method git-fetch)
140 (uri
141 (git-reference
142 (url "https://github.com/hodefoting/mrg.git")
143 (commit version)))
144 (file-name
145 (git-file-name name version))
146 (sha256
147 (base32 "106qhh0c11576cc5kh90ds0ram72d3r6n9sadw0y4krnhap6dvwk"))))
148 (build-system meson-build-system)
149 (arguments
150 `(#:glib-or-gtk? #t)) ; To wrap binaries and/or compile schemas
151 (native-inputs
152 `(("pkg-config" ,pkg-config)))
153 (propagated-inputs
154 `(("alsa" ,alsa-lib)
155 ("cairo" ,cairo)
156 ("gtk+" ,gtk+)
157 ("mmm" ,mmm)
158 ("x11" ,libx11)))
159 (synopsis "Microraptor GUI")
160 (description "MrG is is a C API for creating user interfaces. It can be
161 used as an application writing environment or as an interactive canvas for part
162 of a larger interface.")
163 (home-page "https://github.com/hodefoting/mrg")
164 (license license:lgpl2.0+)))
165
166 (define-public babl
167 (package
168 (name "babl")
169 (version "0.1.78")
170 (source (origin
171 (method url-fetch)
172 (uri (list (string-append "https://download.gimp.org/pub/babl/"
173 (version-major+minor version)
174 "/babl-" version ".tar.xz")
175 (string-append "https://ftp.gtk.org/pub/babl/"
176 (version-major+minor version)
177 "/babl-" version ".tar.xz")
178 (string-append "ftp://ftp.gtk.org/pub/babl/"
179 (version-major+minor version)
180 "/babl-" version ".tar.xz")))
181 (sha256
182 (base32
183 "0fjjfb0pbgimlqi7rk8cqz8pq595b7gw8nrpkxfmixdz6cv4km8p"))))
184 (build-system meson-build-system)
185 (arguments
186 `(#:configure-flags
187 (list "-Denable-gir=false")))
188 (native-inputs
189 `(("pkg-config" ,pkg-config)))
190 (propagated-inputs
191 ;; Propagated to satisfy ‘babl.pc’.
192 `(("lcms" ,lcms)))
193 (home-page "http://gegl.org/babl/")
194 (synopsis "Image pixel format conversion library")
195 (description
196 "Babl is a dynamic, any-to-any pixel format translation library.
197 It allows converting between different methods of storing pixels, known as
198 @dfn{pixel formats}, that have different bit depths and other data
199 representations, color models, and component permutations.
200
201 A vocabulary to formulate new pixel formats from existing primitives is
202 provided, as well as a framework to add new color models and data types.")
203 (license license:lgpl3+)))
204
205 (define-public gegl
206 (package
207 (name "gegl")
208 (version "0.4.26")
209 (source (origin
210 (method url-fetch)
211 (uri (list (string-append "https://download.gimp.org/pub/gegl/"
212 (string-take version 3)
213 "/gegl-" version ".tar.xz")
214 (string-append "https://ftp.gtk.org/pub/gegl/"
215 (version-major+minor version)
216 "/gegl-" version ".tar.xz")
217 (string-append "ftp://ftp.gtk.org/pub/gegl/"
218 (version-major+minor version)
219 "/gegl-" version ".tar.xz")))
220 (sha256
221 (base32
222 "097427icgpgvcx40019b3dm8m84cchz79pixzpz648drs8p1wdqg"))))
223 (build-system meson-build-system)
224 (arguments
225 `(#:configure-flags
226 (list "-Dintrospection=false")))
227 ;; These are propagated to satisfy 'gegl-0.4.pc'.
228 (propagated-inputs
229 `(("babl" ,babl)
230 ("glib" ,glib)
231 ("json-glib" ,json-glib)))
232 (inputs
233 `(("cairo" ,cairo)
234 ("pango" ,pango)
235 ("libpng" ,libpng)
236 ("libjpeg" ,libjpeg-turbo)))
237 (native-inputs
238 `(("pkg-config" ,pkg-config)
239 ("glib" ,glib "bin") ; for gtester
240 ("intltool" ,intltool)))
241 (home-page "http://gegl.org")
242 (synopsis "Graph based image processing framework")
243 (description "GEGL (Generic Graphics Library) provides infrastructure to
244 do demand based cached non destructive image editing on larger than RAM
245 buffers.")
246 ;; The library itself is licensed under LGPL while the sample commandline
247 ;; application and GUI binary gegl is licensed under GPL.
248 (license (list license:lgpl3+ license:gpl3+))))
249
250 (define-public gimp
251 (package
252 (name "gimp")
253 (version "2.10.22")
254 (source (origin
255 (method url-fetch)
256 (uri (string-append "https://download.gimp.org/pub/gimp/v"
257 (version-major+minor version)
258 "/gimp-" version ".tar.bz2"))
259 (sha256
260 (base32
261 "1fqqyshakvdarf1jipk2n33ibqr23ni22z3d8srq13bpydblpf1d"))))
262 (build-system gnu-build-system)
263 (outputs '("out"
264 "doc")) ; 9 MiB of gtk-doc HTML
265 (arguments
266 '(#:configure-flags
267 (list (string-append "--with-html-dir="
268 (assoc-ref %outputs "doc")
269 "/share/gtk-doc/html")
270
271 ;; Prevent the build system from running 'gtk-update-icon-cache'
272 ;; which is not needed during the build because Guix runs it at
273 ;; profile creation time.
274 "ac_cv_path_GTK_UPDATE_ICON_CACHE=true"
275
276 ;; Disable automatic network request on startup to check for
277 ;; version updates.
278 "--disable-check-update"
279
280 ;; ./configure requests not to annoy upstream with packaging bugs.
281 "--with-bug-report-url=https://bugs.gnu.org/guix")
282 #:phases
283 (modify-phases %standard-phases
284 (add-after 'install 'install-sitecustomize.py
285 ;; Install 'sitecustomize.py' into gimp's python directory to
286 ;; add pygobject and pygtk to pygimp's search path.
287 (lambda* (#:key outputs #:allow-other-keys)
288 (let* ((pythonpath (getenv "PYTHONPATH"))
289 (out (assoc-ref outputs "out"))
290 (sitecustomize.py
291 (string-append
292 out "/lib/gimp/2.0/python/sitecustomize.py")))
293 (call-with-output-file sitecustomize.py
294 (lambda (port)
295 (format port "import site~%")
296 (format port "for dir in '~a'.split(':'):~%" pythonpath)
297 (format port " site.addsitedir(dir)~%")))))))))
298 (inputs
299 `(("babl" ,babl)
300 ("glib" ,glib)
301 ("glib-networking" ,glib-networking)
302 ("libtiff" ,libtiff)
303 ("libwebp" ,libwebp)
304 ("libjpeg" ,libjpeg-turbo)
305 ("atk" ,atk)
306 ("gexiv2" ,gexiv2)
307 ("gtk+" ,gtk+-2)
308 ("libmypaint" ,libmypaint)
309 ("mypaint-brushes" ,mypaint-brushes-1.3)
310 ("exif" ,libexif) ; optional, EXIF + XMP support
311 ("lcms" ,lcms) ; optional, color management
312 ("librsvg" ,librsvg) ; optional, SVG support
313 ("libxcursor" ,libxcursor) ; optional, Mouse Cursor support
314 ("poppler" ,poppler) ; optional, PDF support
315 ("poppler-data" ,poppler-data)
316 ("python" ,python-2) ; optional, Python support
317 ("python2-pygtk" ,python2-pygtk) ; optional, Python support
318 ("gegl" ,gegl)))
319 (native-inputs
320 `(("glib:bin" ,glib "bin") ; for glib-compile-resources and gdbus-codegen
321 ("pkg-config" ,pkg-config)
322 ("intltool" ,intltool)))
323 (home-page "https://www.gimp.org")
324 (synopsis "GNU Image Manipulation Program")
325 (description
326 "GIMP is an application for image manipulation tasks such as photo
327 retouching, composition and authoring. It supports all common image formats
328 as well as specialized ones. It features a highly customizable interface
329 that is extensible via a plugin system.")
330 (license license:gpl3+))) ; some files are lgplv3
331
332 (define-public gimp-fourier
333 (package
334 (name "gimp-fourier")
335 (version "0.4.3-2")
336 (source (origin
337 (method url-fetch)
338 (uri (string-append "http://registry.gimp.org/files/fourier-"
339 version ".tar.gz"))
340 (sha256
341 (base32
342 "1rpacyad678lqgxa3hh2n0zpg4azs8dpa8q079bqsl12812k9184"))))
343 (build-system gnu-build-system)
344 (arguments
345 `(#:tests? #f ;no tests
346 #:phases
347 (modify-phases %standard-phases
348 ;; FIXME: The gegl package only installs "gegl-0.4.pc", but
349 ;; "gimp-2.0.pc" requires "gegl-0.3.pc", so we just copy it.
350 (replace 'configure
351 (lambda* (#:key inputs #:allow-other-keys)
352 (mkdir-p "tmppkgconfig")
353 (copy-file (string-append (assoc-ref inputs "gegl")
354 "/lib/pkgconfig/gegl-0.4.pc")
355 "tmppkgconfig/gegl-0.3.pc")
356 (setenv "PKG_CONFIG_PATH"
357 (string-append "tmppkgconfig:"
358 (or (getenv "PKG_CONFIG_PATH") "")))
359 #t))
360 (add-after 'unpack 'set-prefix
361 (lambda* (#:key outputs #:allow-other-keys)
362 ;; gimptool-2.0 does not allow us to install to any target
363 ;; directory.
364 (let ((target (string-append (assoc-ref outputs "out")
365 "/lib/gimp/"
366 (car (string-split ,(package-version gimp) #\.))
367 ".0/plug-ins")))
368 (substitute* "Makefile"
369 (("\\$\\(PLUGIN_INSTALL\\) fourier")
370 (string-append "cp fourier " target)))
371 (mkdir-p target))
372 #t)))))
373 (inputs
374 `(("fftw" ,fftw)
375 ("gimp" ,gimp)
376 ;; needed by gimp-2.0.pc
377 ("gdk-pixbuf" ,gdk-pixbuf)
378 ("gegl" ,gegl)
379 ("cairo" ,cairo)
380 ("glib" ,glib)
381 ;; needed by gimpui-2.0.pc
382 ("gtk+" ,gtk+-2)))
383 (native-inputs
384 `(("pkg-config" ,pkg-config)))
385 (home-page "https://www.lprp.fr/gimp_plugin_en/#fourier")
386 (synopsis "GIMP plug-in to edit image in fourier space")
387 (description
388 "This package provides a simple plug-in to apply the fourier transform on
389 an image, allowing you to work with the transformed image inside GIMP. You
390 can draw or apply filters in fourier space and get the modified image with an
391 inverse fourier transform.")
392 (license license:gpl3+)))
393
394 (define-public libmypaint
395 (package
396 (name "libmypaint")
397 (version "1.5.1")
398 (source (origin
399 (method url-fetch)
400 (uri (string-append "https://github.com/mypaint/libmypaint/"
401 "releases/download/v" version "/libmypaint-"
402 version ".tar.xz"))
403 (sha256
404 (base32
405 "0aqcv4fyscpfhknxgfpq0v84aj2nzigqvpi4zgv2zkl41h51by5f"))))
406 (build-system gnu-build-system)
407 (native-inputs
408 `(("intltool" ,intltool)
409 ("pkg-config" ,pkg-config)))
410 ;; As needed by 'libmypaint.pc'.
411 (propagated-inputs
412 `(("json-c" ,json-c)
413 ("gobject-introspection" ,gobject-introspection)))
414 (inputs
415 `(("glib" ,glib)))
416 (synopsis "Artistic brushes library")
417 (description "Libmypaint, also called \"brushlib\", is a library for making
418 brushstrokes which is used by MyPaint and GIMP.")
419 (home-page "http://mypaint.org")
420 (license license:isc)))
421
422 (define-public mypaint-brushes
423 (package
424 (name "mypaint-brushes")
425 (version "2.0.2")
426 (source
427 (origin
428 (method git-fetch)
429 (uri (git-reference
430 (url "https://github.com/mypaint/mypaint-brushes")
431 (commit (string-append "v" version))))
432 (file-name (git-file-name name version))
433 (sha256
434 (base32 "0kcqz13vzpy24dhmrx9hbs6s7hqb8y305vciznm15h277sabpmw9"))))
435 (build-system gnu-build-system)
436 (native-inputs
437 `(("autoconf" ,autoconf)
438 ("automake" ,automake)))
439 (synopsis "Default brushes for MyPaint")
440 (description "This package provides the default set of brushes for
441 MyPaint.")
442 (home-page "https://github.com/mypaint/mypaint-brushes/")
443 ;; Scripts are distributed under GPL2+ terms, brushes are provided as
444 ;; public domain or under CC0 terms.
445 (license (list license:gpl2+ license:cc0 license:public-domain))))
446
447 (define-public mypaint-brushes-1.3
448 (package
449 (inherit mypaint-brushes)
450 (name "mypaint-brushes")
451 (version "1.3.1")
452 (source
453 (origin
454 (method git-fetch)
455 (uri (git-reference
456 (url "https://github.com/mypaint/mypaint-brushes")
457 (commit (string-append "v" version))))
458 (file-name (git-file-name name version))
459 (sha256
460 (base32 "1c95l1vfz7sbrdlzrbz7h1p6s1k113kyjfd9wfnxlm0p6562cz3j"))))))
461
462 (define-public gimp-resynthesizer
463 ;; GIMP does not respect any plugin search path environment variable, so after
464 ;; installation users have to edit their GIMP settings to include
465 ;; "$HOME/.guix-profile/lib/gimp/2.0/plug-ins/" in
466 ;; “Edit->Preferences->Folders->Plug Ins”.
467 (package
468 (name "gimp-resynthesizer")
469 (version "2.0.3")
470 (source
471 (origin
472 (method git-fetch)
473 (uri (git-reference
474 (url "https://github.com/bootchk/resynthesizer")
475 (commit (string-append "v" version))))
476 (sha256
477 (base32
478 "1jwc8bhhm21xhrgw56nzbma6fwg59gc8anlmyns7jdiw83y0zx3j"))
479 (file-name (git-file-name name version))))
480 (build-system gnu-build-system)
481 (arguments
482 `( ;; Turn off tests to avoid:
483 ;; make[1]: *** No rule to make target '../src/resynth-gui.c', needed by 'resynthesizer.pot'. Stop.
484 #:tests? #f
485 #:phases
486 (modify-phases %standard-phases
487 (add-after 'unpack 'set-env
488 (lambda _
489 (setenv "CONFIG_SHELL" (which "sh"))
490 #t))
491 (add-after 'configure 'set-prefix
492 ;; Install plugin under $prefix, not under GIMP's libdir.
493 (lambda* (#:key outputs #:allow-other-keys)
494 (let ((target (string-append (assoc-ref outputs "out")
495 "/lib/gimp/"
496 ,(version-major
497 (package-version gimp))
498 ".0")))
499 (substitute* (list "src/resynthesizer/Makefile"
500 "src/resynthesizer-gui/Makefile")
501 (("GIMP_LIBDIR = .*")
502 (string-append "GIMP_LIBDIR = " target "\n")))
503 (mkdir-p target)
504 #t))))))
505 (native-inputs
506 `(("autoconf" ,autoconf-wrapper)
507 ("automake" ,automake)
508 ("glib" ,glib "bin") ; glib-gettextize
509 ("intltool" ,intltool)
510 ("pkg-config" ,pkg-config)))
511 (inputs
512 `(("gimp" ,gimp)
513 ("gdk-pixbuf" ,gdk-pixbuf) ; needed by gimp-2.0.pc
514 ("cairo" ,cairo)
515 ("gegl" ,gegl)
516 ("gtk+" ,gtk+-2) ; needed by gimpui-2.0.pc
517 ("glib" ,glib)))
518 (home-page "https://github.com/bootchk/resynthesizer")
519 (synopsis "GIMP plugins for texture synthesis")
520 (description
521 "This package provides resynthesizer plugins for GIMP, which encompasses
522 tools for healing selections (content-aware fill), enlarging the canvas and
523 healing the border, increasing the resolution while adding detail, and
524 transferring the style of an image.")
525 (license license:gpl3+)))