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, 2020 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>
11 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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 build-tools)
40 #:use-module (gnu packages documentation)
41 #:use-module (gnu packages graphviz)
42 #:use-module (gnu packages pkg-config)
43 #:use-module (gnu packages glib)
44 #:use-module (gnu packages gtk)
45 #:use-module (gnu packages gnome)
46 #:use-module (gnu packages graphics)
47 #:use-module (gnu packages image)
48 #:use-module (gnu packages ghostscript)
49 #:use-module (gnu packages compression)
50 #:use-module (gnu packages xml)
51 #:use-module (gnu packages linux)
52 #:use-module (gnu packages ncurses)
53 #:use-module (gnu packages patchutils)
54 #:use-module (gnu packages pdf)
55 #:use-module (gnu packages photo)
56 #:use-module (gnu packages python)
57 #:use-module (gnu packages web)
58 #:use-module (gnu packages xorg))
60 (define-public poly2tri-c
68 (string-append "https://storage.googleapis.com/"
69 "google-code-archive-source/v2/code.google.com/"
70 "poly2tri-c/source-archive.zip"))
72 (string-append name "-" version ".zip"))
74 (base32 "17cw0zhbnf2gb59jm26z0wcarqgdwir9jr1fpi3v9lcvyb2s3mqj"))))
75 (build-system glib-or-gtk-build-system)
76 (outputs '("out" "doc"))
82 (modify-phases %standard-phases
83 (add-after 'unpack 'disable-strict-rules
85 (substitute* "configure.ac"
86 (("\\$CFLAGS -Wall -ansi -pedantic")
88 (("\\$CFLAGS -Werror")
91 (add-after 'disable-strict-rules 'fix-build-errors
93 (substitute* "poly2tri-c/refine/Makefile.am"
103 (add-before 'bootstrap 'configure-later
105 (setenv "NOCONFIGURE" "set")
107 (add-after 'build 'generate-doc
111 (add-after 'install 'install-doc
112 (lambda* (#:key outputs #:allow-other-keys)
113 (let* ((out (assoc-ref outputs "out"))
114 (doc (assoc-ref outputs "doc")))
117 (string-append doc "/share/doc/poly2tri-c"))
120 `(("autoconf" ,autoconf)
121 ("automake" ,automake)
124 ("pkg-config" ,pkg-config)
129 (synopsis "2D constrained Delaunay triangulation library")
130 (description "Poly2Tri-C is a library for generating, refining and rendering
131 2-Dimensional Constrained Delaunay Triangulations.")
132 (home-page "https://code.google.com/archive/p/poly2tri-c/")
133 (license license:bsd-3)))
144 (url "https://github.com/hodefoting/mrg")
147 (git-file-name name version))
149 (base32 "106qhh0c11576cc5kh90ds0ram72d3r6n9sadw0y4krnhap6dvwk"))))
150 (build-system meson-build-system)
152 `(#:glib-or-gtk? #t)) ; To wrap binaries and/or compile schemas
154 `(("pkg-config" ,pkg-config)))
161 (synopsis "Microraptor GUI")
162 (description "MrG is is a C API for creating user interfaces. It can be
163 used as an application writing environment or as an interactive canvas for part
164 of a larger interface.")
165 (home-page "https://github.com/hodefoting/mrg")
166 (license license:lgpl2.0+)))
174 (uri (list (string-append "https://download.gimp.org/pub/babl/"
175 (version-major+minor version)
176 "/babl-" version ".tar.xz")
177 (string-append "https://ftp.gtk.org/pub/babl/"
178 (version-major+minor version)
179 "/babl-" version ".tar.xz")
180 (string-append "ftp://ftp.gtk.org/pub/babl/"
181 (version-major+minor version)
182 "/babl-" version ".tar.xz")))
185 "1w68h81kqkqnziixrx21qs0gfv2z79651h19sxn226xdb58mjgqb"))))
186 (build-system meson-build-system)
188 `(#:meson ,meson-0.55
190 (list "-Denable-gir=false")))
192 `(("pkg-config" ,pkg-config)))
194 ;; Propagated to satisfy ‘babl.pc’.
196 (home-page "https://gegl.org/babl/")
197 (synopsis "Image pixel format conversion library")
199 "Babl is a dynamic, any-to-any pixel format translation library.
200 It allows converting between different methods of storing pixels, known as
201 @dfn{pixel formats}, that have different bit depths and other data
202 representations, color models, and component permutations.
204 A vocabulary to formulate new pixel formats from existing primitives is
205 provided, as well as a framework to add new color models and data types.")
206 (license license:lgpl3+)))
214 (uri (list (string-append "https://download.gimp.org/pub/gegl/"
215 (string-take version 3)
216 "/gegl-" version ".tar.xz")
217 (string-append "https://ftp.gtk.org/pub/gegl/"
218 (version-major+minor version)
219 "/gegl-" version ".tar.xz")
220 (string-append "ftp://ftp.gtk.org/pub/gegl/"
221 (version-major+minor version)
222 "/gegl-" version ".tar.xz")))
225 "1pd8xkx70k0fsi1hrzrmaify7112wjmxzk0p6bi6js89yhn7h4n1"))))
226 (build-system meson-build-system)
228 `(#:meson ,meson-0.55
230 (list "-Dintrospection=false")
232 (modify-phases %standard-phases
233 (add-after 'unpack 'extend-test-time-outs
235 ;; Multiply some poorly-chosen time-outs for busy build machines.
236 (substitute* "tests/simple/test-node-exponential.c"
237 (("G_TIME_SPAN_SECOND" match)
238 (string-append "10 * " match)))
239 (substitute* "tests/simple/test-buffer-sharing.c"
240 (("g_timeout_add_seconds\\([0-9]+" match)
241 (string-append match "0")))
242 (substitute* (find-files "tests" "^meson\\.build$")
243 (("timeout ?: [0-9]+" match)
244 (string-append match "0")))
246 ;; These are propagated to satisfy 'gegl-0.4.pc'.
250 ("json-glib" ,json-glib)))
255 ("libjpeg" ,libjpeg-turbo)))
257 `(("pkg-config" ,pkg-config)
258 ("glib" ,glib "bin") ; for gtester
259 ("intltool" ,intltool)))
260 (home-page "https://gegl.org")
261 (synopsis "Graph based image processing framework")
262 (description "GEGL (Generic Graphics Library) provides infrastructure to
263 do demand based cached non destructive image editing on larger than RAM
265 ;; The library itself is licensed under LGPL while the sample commandline
266 ;; application and GUI binary gegl is licensed under GPL.
267 (license (list license:lgpl3+ license:gpl3+))))
276 (uri (string-append "https://download.gimp.org/pub/gimp/v"
277 (version-major+minor version)
278 "/gimp-" version ".tar.bz2"))
280 (base32 "17lq6ns5qhspd171zqh76yf98xnn5n0hcl7hbhbx63cc6ribf6xx"))))
281 (build-system gnu-build-system)
283 "doc")) ; 9 MiB of gtk-doc HTML
286 (list (string-append "--with-html-dir="
287 (assoc-ref %outputs "doc")
288 "/share/gtk-doc/html")
290 ;; Prevent the build system from running 'gtk-update-icon-cache'
291 ;; which is not needed during the build because Guix runs it at
292 ;; profile creation time.
293 "ac_cv_path_GTK_UPDATE_ICON_CACHE=true"
295 ;; Disable automatic network request on startup to check for
297 "--disable-check-update"
299 ;; ./configure requests not to annoy upstream with packaging bugs.
300 "--with-bug-report-url=https://bugs.gnu.org/guix")
302 (modify-phases %standard-phases
303 (add-after 'install 'install-sitecustomize.py
304 ;; Install 'sitecustomize.py' into gimp's python directory to
305 ;; add pygobject and pygtk to pygimp's search path.
306 (lambda* (#:key outputs #:allow-other-keys)
307 (let* ((pythonpath (getenv "PYTHONPATH"))
308 (out (assoc-ref outputs "out"))
311 out "/lib/gimp/2.0/python/sitecustomize.py")))
312 (call-with-output-file sitecustomize.py
314 (format port "import site~%")
315 (format port "for dir in '~a'.split(':'):~%" pythonpath)
316 (format port " site.addsitedir(dir)~%")))))))))
320 ("glib-networking" ,glib-networking)
323 ("libjpeg" ,libjpeg-turbo)
327 ("libmypaint" ,libmypaint)
328 ("mypaint-brushes" ,mypaint-brushes-1.3)
329 ("exif" ,libexif) ; optional, EXIF + XMP support
330 ("lcms" ,lcms) ; optional, color management
331 ("librsvg" ,librsvg) ; optional, SVG support
332 ("libxcursor" ,libxcursor) ; optional, Mouse Cursor support
333 ("poppler" ,poppler) ; optional, PDF support
334 ("poppler-data" ,poppler-data)
335 ("python" ,python-2) ; optional, Python support
336 ("python2-pygtk" ,python2-pygtk) ; optional, Python support
339 `(("glib:bin" ,glib "bin") ; for glib-compile-resources and gdbus-codegen
340 ("pkg-config" ,pkg-config)
341 ("intltool" ,intltool)))
342 (home-page "https://www.gimp.org")
343 (synopsis "GNU Image Manipulation Program")
345 "GIMP is an application for image manipulation tasks such as photo
346 retouching, composition and authoring. It supports all common image formats
347 as well as specialized ones. It features a highly customizable interface
348 that is extensible via a plugin system.")
349 (license license:gpl3+))) ; some files are lgplv3
351 (define-public gimp-fourier
353 (name "gimp-fourier")
357 (uri (string-append "http://registry.gimp.org/files/fourier-"
361 "1rpacyad678lqgxa3hh2n0zpg4azs8dpa8q079bqsl12812k9184"))))
362 (build-system gnu-build-system)
364 `(#:tests? #f ;no tests
366 (modify-phases %standard-phases
367 ;; FIXME: The gegl package only installs "gegl-0.4.pc", but
368 ;; "gimp-2.0.pc" requires "gegl-0.3.pc", so we just copy it.
370 (lambda* (#:key inputs #:allow-other-keys)
371 (mkdir-p "tmppkgconfig")
372 (copy-file (string-append (assoc-ref inputs "gegl")
373 "/lib/pkgconfig/gegl-0.4.pc")
374 "tmppkgconfig/gegl-0.3.pc")
375 (setenv "PKG_CONFIG_PATH"
376 (string-append "tmppkgconfig:"
377 (or (getenv "PKG_CONFIG_PATH") "")))
379 (add-after 'unpack 'set-prefix
380 (lambda* (#:key outputs #:allow-other-keys)
381 ;; gimptool-2.0 does not allow us to install to any target
383 (let ((target (string-append (assoc-ref outputs "out")
385 (car (string-split ,(package-version gimp) #\.))
387 (substitute* "Makefile"
388 (("\\$\\(PLUGIN_INSTALL\\) fourier")
389 (string-append "cp fourier " target)))
395 ;; needed by gimp-2.0.pc
396 ("gdk-pixbuf" ,gdk-pixbuf)
400 ;; needed by gimpui-2.0.pc
403 `(("pkg-config" ,pkg-config)))
404 (home-page "https://www.lprp.fr/gimp_plugin_en/#fourier")
405 (synopsis "GIMP plug-in to edit image in fourier space")
407 "This package provides a simple plug-in to apply the fourier transform on
408 an image, allowing you to work with the transformed image inside GIMP. You
409 can draw or apply filters in fourier space and get the modified image with an
410 inverse fourier transform.")
411 (license license:gpl3+)))
413 (define-public libmypaint
419 (uri (string-append "https://github.com/mypaint/libmypaint/"
420 "releases/download/v" version "/libmypaint-"
424 "0priwpmc7dizccqvn21ig6d649bprl3xl1hmjj7nddznjgr585vl"))))
425 (build-system gnu-build-system)
427 `(("intltool" ,intltool)
428 ("pkg-config" ,pkg-config)))
429 ;; As needed by 'libmypaint.pc'.
432 ("gobject-introspection" ,gobject-introspection)))
435 (synopsis "Artistic brushes library")
436 (description "Libmypaint, also called \"brushlib\", is a library for making
437 brushstrokes which is used by MyPaint and GIMP.")
438 (home-page "http://mypaint.org")
439 (license license:isc)))
441 (define-public mypaint-brushes
443 (name "mypaint-brushes")
449 (url "https://github.com/mypaint/mypaint-brushes")
450 (commit (string-append "v" version))))
451 (file-name (git-file-name name version))
453 (base32 "0kcqz13vzpy24dhmrx9hbs6s7hqb8y305vciznm15h277sabpmw9"))))
454 (build-system gnu-build-system)
456 `(("autoconf" ,autoconf)
457 ("automake" ,automake)))
458 (synopsis "Default brushes for MyPaint")
459 (description "This package provides the default set of brushes for
461 (home-page "https://github.com/mypaint/mypaint-brushes/")
462 ;; Scripts are distributed under GPL2+ terms, brushes are provided as
463 ;; public domain or under CC0 terms.
464 (license (list license:gpl2+ license:cc0 license:public-domain))))
466 (define-public mypaint-brushes-1.3
468 (inherit mypaint-brushes)
469 (name "mypaint-brushes")
475 (url "https://github.com/mypaint/mypaint-brushes")
476 (commit (string-append "v" version))))
477 (file-name (git-file-name name version))
479 (base32 "1c95l1vfz7sbrdlzrbz7h1p6s1k113kyjfd9wfnxlm0p6562cz3j"))))))
481 (define-public gimp-resynthesizer
482 ;; GIMP does not respect any plugin search path environment variable, so after
483 ;; installation users have to edit their GIMP settings to include
484 ;; "$HOME/.guix-profile/lib/gimp/2.0/plug-ins/" in
485 ;; “Edit->Preferences->Folders->Plug Ins”.
487 (name "gimp-resynthesizer")
493 (url "https://github.com/bootchk/resynthesizer")
494 (commit (string-append "v" version))))
497 "1jwc8bhhm21xhrgw56nzbma6fwg59gc8anlmyns7jdiw83y0zx3j"))
498 (file-name (git-file-name name version))))
499 (build-system gnu-build-system)
501 `( ;; Turn off tests to avoid:
502 ;; make[1]: *** No rule to make target '../src/resynth-gui.c', needed by 'resynthesizer.pot'. Stop.
505 (modify-phases %standard-phases
506 (add-after 'unpack 'set-env
508 (setenv "CONFIG_SHELL" (which "sh"))
510 (add-after 'configure 'set-prefix
511 ;; Install plugin under $prefix, not under GIMP's libdir.
512 (lambda* (#:key outputs #:allow-other-keys)
513 (let ((target (string-append (assoc-ref outputs "out")
516 (package-version gimp))
518 (substitute* (list "src/resynthesizer/Makefile"
519 "src/resynthesizer-gui/Makefile")
520 (("GIMP_LIBDIR = .*")
521 (string-append "GIMP_LIBDIR = " target "\n")))
525 ;; avoid ./autogen.sh: ./configure: /bin/sh: bad interpreter:
526 ;; No such file or directory
527 `(("autoconf" ,autoconf-wrapper)
528 ("automake" ,automake)
529 ("glib" ,glib "bin") ; glib-gettextize
530 ("intltool" ,intltool)
531 ("pkg-config" ,pkg-config)))
534 ("gdk-pixbuf" ,gdk-pixbuf) ; needed by gimp-2.0.pc
537 ("gtk+" ,gtk+-2) ; needed by gimpui-2.0.pc
539 (home-page "https://github.com/bootchk/resynthesizer")
540 (synopsis "GIMP plugins for texture synthesis")
542 "This package provides resynthesizer plugins for GIMP, which encompasses
543 tools for healing selections (content-aware fill), enlarging the canvas and
544 healing the border, increasing the resolution while adding detail, and
545 transferring the style of an image.")
546 (license license:gpl3+)))
548 (define gegl-for-glimpse
549 ;; Remove this when GIMP commit 2cae9b9acf9da98c4c9990819ffbd5aabe23017e
550 ;; makes it into Glimpse.
554 (substitute-keyword-arguments (package-arguments gegl)
556 `(modify-phases ,phases
557 (add-after 'unpack 'refer-to-dot
558 ;; XXX Without ‘dot’ in $PATH, Glimpse would fail to start with an
559 ;; extremely obtuse ‘GEGL operation missing!’ error.
561 (substitute* "gegl/gegl-dot.c"
563 (format #f "\"~a " (which "dot"))))
564 (substitute* "operations/common/introspect.c"
565 (("g_find_program_in_path \\(\"dot\"\\)")
566 (format #f "g_strdup (\"~a\")" (which "dot"))))))))))
568 `(,@(package-inputs gegl)
569 ("graphviz" ,graphviz)))))
571 (define-public glimpse
578 (url "https://github.com/glimpse-editor/Glimpse")
579 (commit (string-append "v" version))))
580 (file-name (git-file-name name version))
583 "0drngj2xqzxfaag6pc4xjffiw003n4y43x5rb5bf4ziv1ac51dm9"))))
584 (build-system gnu-build-system)
586 "doc")) ; 9 MiB of gtk-doc HTML
589 (list (string-append "--with-html-dir="
590 (assoc-ref %outputs "doc")
591 "/share/gtk-doc/html")
594 ;; Prevent the build system from running 'gtk-update-icon-cache'
595 ;; which is not needed during the build because Guix runs it at
596 ;; profile creation time.
597 "ac_cv_path_GTK_UPDATE_ICON_CACHE=true"
599 ;; Disable automatic network request on startup to check for
601 "--disable-check-update"
603 ;; ./configure requests not to annoy upstream with packaging bugs.
604 "--with-bug-report-url=https://bugs.gnu.org/guix")
606 (modify-phases %standard-phases
607 (add-after 'install 'install-sitecustomize.py
608 ;; Install 'sitecustomize.py' into glimpse's python directory to
609 ;; add pygobject and pygtk to pygimp's search path.
610 (lambda* (#:key outputs #:allow-other-keys)
611 (let* ((pythonpath (getenv "PYTHONPATH"))
612 (out (assoc-ref outputs "out"))
615 out "/lib/glimpse/2.0/python/sitecustomize.py")))
616 (call-with-output-file sitecustomize.py
618 (format port "import site~%")
619 (format port "for dir in '~a'.split(':'):~%" pythonpath)
620 (format port " site.addsitedir(dir)~%")))))))))
622 `(("autoconf" ,autoconf)
623 ("automake" ,automake)
625 ("intltool" ,intltool)
627 ("libxslt" ,libxslt) ; for xsltproc
628 ("pkg-config" ,pkg-config)
629 ("glib:bin" ,glib "bin"))) ; for gdbus-codegen
633 ("glib-networking" ,glib-networking)
636 ("libjpeg" ,libjpeg-turbo)
640 ("libmypaint" ,libmypaint)
641 ("mypaint-brushes" ,mypaint-brushes-1.3)
642 ("exif" ,libexif) ; optional, EXIF + XMP support
643 ("lcms" ,lcms) ; optional, color management
644 ("librsvg" ,librsvg) ; optional, SVG support
645 ("libxcursor" ,libxcursor) ; optional, Mouse Cursor support
646 ("poppler" ,poppler) ; optional, PDF support
647 ("poppler-data" ,poppler-data)
648 ("python" ,python-2) ; optional, Python support
649 ("python2-pygtk" ,python2-pygtk) ; optional, Python support
650 ("gegl" ,gegl-for-glimpse))) ; XXX see comment in gegl-for-glimpse
651 (home-page "https://glimpse-editor.github.io/")
652 (synopsis "Glimpse Image Editor")
653 (description "The Glimpse Image Editor is an application for image
654 manipulation tasks such as photo retouching, composition and authoring.
655 It supports all common image formats as well as specialized ones. It
656 features a highly customizable interface that is extensible via a plugin
657 system. It was forked from the GNU Image Manipulation Program.")
658 (license license:gpl3+)))