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 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))
58 (define-public poly2tri-c
66 (string-append "https://storage.googleapis.com/"
67 "google-code-archive-source/v2/code.google.com/"
68 "poly2tri-c/source-archive.zip"))
70 (string-append name "-" version ".zip"))
72 (base32 "17cw0zhbnf2gb59jm26z0wcarqgdwir9jr1fpi3v9lcvyb2s3mqj"))))
73 (build-system glib-or-gtk-build-system)
74 (outputs '("out" "doc"))
80 (modify-phases %standard-phases
81 (add-after 'unpack 'disable-strict-rules
83 (substitute* "configure.ac"
84 (("\\$CFLAGS -Wall -ansi -pedantic")
86 (("\\$CFLAGS -Werror")
89 (add-after 'disable-strict-rules 'fix-build-errors
91 (substitute* "poly2tri-c/refine/Makefile.am"
101 (add-before 'bootstrap 'configure-later
103 (setenv "NOCONFIGURE" "set")
105 (add-after 'build 'generate-doc
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")))
115 (string-append doc "/share/doc/poly2tri-c"))
118 `(("autoconf" ,autoconf)
119 ("automake" ,automake)
122 ("pkg-config" ,pkg-config)
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)))
142 (url "https://github.com/hodefoting/mrg")
145 (git-file-name name version))
147 (base32 "106qhh0c11576cc5kh90ds0ram72d3r6n9sadw0y4krnhap6dvwk"))))
148 (build-system meson-build-system)
150 `(#:glib-or-gtk? #t)) ; To wrap binaries and/or compile schemas
152 `(("pkg-config" ,pkg-config)))
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+)))
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")))
183 "0fjjfb0pbgimlqi7rk8cqz8pq595b7gw8nrpkxfmixdz6cv4km8p"))))
184 (build-system meson-build-system)
187 (list "-Denable-gir=false")))
189 `(("pkg-config" ,pkg-config)))
191 ;; Propagated to satisfy ‘babl.pc’.
193 (home-page "https://gegl.org/babl/")
194 (synopsis "Image pixel format conversion library")
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.
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+)))
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")))
222 "097427icgpgvcx40019b3dm8m84cchz79pixzpz648drs8p1wdqg"))))
223 (build-system meson-build-system)
226 (list "-Dintrospection=false")
228 (modify-phases %standard-phases
229 (add-after 'unpack 'extend-test-time-outs
231 ;; Multiply some poorly-chosen time-outs for busy build machines.
232 (substitute* "tests/simple/test-node-exponential.c"
233 (("G_TIME_SPAN_SECOND" match)
234 (string-append "10 * " match)))
235 (substitute* "tests/simple/test-buffer-sharing.c"
236 (("g_timeout_add_seconds\\([0-9]+" match)
237 (string-append match "0")))
238 (substitute* (find-files "tests" "^meson\\.build$")
239 (("timeout ?: [0-9]+" match)
240 (string-append match "0")))
242 ;; These are propagated to satisfy 'gegl-0.4.pc'.
246 ("json-glib" ,json-glib)))
251 ("libjpeg" ,libjpeg-turbo)))
253 `(("pkg-config" ,pkg-config)
254 ("glib" ,glib "bin") ; for gtester
255 ("intltool" ,intltool)))
256 (home-page "https://gegl.org")
257 (synopsis "Graph based image processing framework")
258 (description "GEGL (Generic Graphics Library) provides infrastructure to
259 do demand based cached non destructive image editing on larger than RAM
261 ;; The library itself is licensed under LGPL while the sample commandline
262 ;; application and GUI binary gegl is licensed under GPL.
263 (license (list license:lgpl3+ license:gpl3+))))
271 (uri (string-append "https://download.gimp.org/pub/gimp/v"
272 (version-major+minor version)
273 "/gimp-" version ".tar.bz2"))
276 "1fqqyshakvdarf1jipk2n33ibqr23ni22z3d8srq13bpydblpf1d"))))
277 (build-system gnu-build-system)
279 "doc")) ; 9 MiB of gtk-doc HTML
282 (list (string-append "--with-html-dir="
283 (assoc-ref %outputs "doc")
284 "/share/gtk-doc/html")
286 ;; Prevent the build system from running 'gtk-update-icon-cache'
287 ;; which is not needed during the build because Guix runs it at
288 ;; profile creation time.
289 "ac_cv_path_GTK_UPDATE_ICON_CACHE=true"
291 ;; Disable automatic network request on startup to check for
293 "--disable-check-update"
295 ;; ./configure requests not to annoy upstream with packaging bugs.
296 "--with-bug-report-url=https://bugs.gnu.org/guix")
298 (modify-phases %standard-phases
299 (add-after 'install 'install-sitecustomize.py
300 ;; Install 'sitecustomize.py' into gimp's python directory to
301 ;; add pygobject and pygtk to pygimp's search path.
302 (lambda* (#:key outputs #:allow-other-keys)
303 (let* ((pythonpath (getenv "PYTHONPATH"))
304 (out (assoc-ref outputs "out"))
307 out "/lib/gimp/2.0/python/sitecustomize.py")))
308 (call-with-output-file sitecustomize.py
310 (format port "import site~%")
311 (format port "for dir in '~a'.split(':'):~%" pythonpath)
312 (format port " site.addsitedir(dir)~%")))))))))
316 ("glib-networking" ,glib-networking)
319 ("libjpeg" ,libjpeg-turbo)
323 ("libmypaint" ,libmypaint)
324 ("mypaint-brushes" ,mypaint-brushes-1.3)
325 ("exif" ,libexif) ; optional, EXIF + XMP support
326 ("lcms" ,lcms) ; optional, color management
327 ("librsvg" ,librsvg) ; optional, SVG support
328 ("libxcursor" ,libxcursor) ; optional, Mouse Cursor support
329 ("poppler" ,poppler) ; optional, PDF support
330 ("poppler-data" ,poppler-data)
331 ("python" ,python-2) ; optional, Python support
332 ("python2-pygtk" ,python2-pygtk) ; optional, Python support
335 `(("glib:bin" ,glib "bin") ; for glib-compile-resources and gdbus-codegen
336 ("pkg-config" ,pkg-config)
337 ("intltool" ,intltool)))
338 (home-page "https://www.gimp.org")
339 (synopsis "GNU Image Manipulation Program")
341 "GIMP is an application for image manipulation tasks such as photo
342 retouching, composition and authoring. It supports all common image formats
343 as well as specialized ones. It features a highly customizable interface
344 that is extensible via a plugin system.")
345 (license license:gpl3+))) ; some files are lgplv3
347 (define-public gimp-fourier
349 (name "gimp-fourier")
353 (uri (string-append "http://registry.gimp.org/files/fourier-"
357 "1rpacyad678lqgxa3hh2n0zpg4azs8dpa8q079bqsl12812k9184"))))
358 (build-system gnu-build-system)
360 `(#:tests? #f ;no tests
362 (modify-phases %standard-phases
363 ;; FIXME: The gegl package only installs "gegl-0.4.pc", but
364 ;; "gimp-2.0.pc" requires "gegl-0.3.pc", so we just copy it.
366 (lambda* (#:key inputs #:allow-other-keys)
367 (mkdir-p "tmppkgconfig")
368 (copy-file (string-append (assoc-ref inputs "gegl")
369 "/lib/pkgconfig/gegl-0.4.pc")
370 "tmppkgconfig/gegl-0.3.pc")
371 (setenv "PKG_CONFIG_PATH"
372 (string-append "tmppkgconfig:"
373 (or (getenv "PKG_CONFIG_PATH") "")))
375 (add-after 'unpack 'set-prefix
376 (lambda* (#:key outputs #:allow-other-keys)
377 ;; gimptool-2.0 does not allow us to install to any target
379 (let ((target (string-append (assoc-ref outputs "out")
381 (car (string-split ,(package-version gimp) #\.))
383 (substitute* "Makefile"
384 (("\\$\\(PLUGIN_INSTALL\\) fourier")
385 (string-append "cp fourier " target)))
391 ;; needed by gimp-2.0.pc
392 ("gdk-pixbuf" ,gdk-pixbuf)
396 ;; needed by gimpui-2.0.pc
399 `(("pkg-config" ,pkg-config)))
400 (home-page "https://www.lprp.fr/gimp_plugin_en/#fourier")
401 (synopsis "GIMP plug-in to edit image in fourier space")
403 "This package provides a simple plug-in to apply the fourier transform on
404 an image, allowing you to work with the transformed image inside GIMP. You
405 can draw or apply filters in fourier space and get the modified image with an
406 inverse fourier transform.")
407 (license license:gpl3+)))
409 (define-public libmypaint
415 (uri (string-append "https://github.com/mypaint/libmypaint/"
416 "releases/download/v" version "/libmypaint-"
420 "0priwpmc7dizccqvn21ig6d649bprl3xl1hmjj7nddznjgr585vl"))))
421 (build-system gnu-build-system)
423 `(("intltool" ,intltool)
424 ("pkg-config" ,pkg-config)))
425 ;; As needed by 'libmypaint.pc'.
428 ("gobject-introspection" ,gobject-introspection)))
431 (synopsis "Artistic brushes library")
432 (description "Libmypaint, also called \"brushlib\", is a library for making
433 brushstrokes which is used by MyPaint and GIMP.")
434 (home-page "http://mypaint.org")
435 (license license:isc)))
437 (define-public mypaint-brushes
439 (name "mypaint-brushes")
445 (url "https://github.com/mypaint/mypaint-brushes")
446 (commit (string-append "v" version))))
447 (file-name (git-file-name name version))
449 (base32 "0kcqz13vzpy24dhmrx9hbs6s7hqb8y305vciznm15h277sabpmw9"))))
450 (build-system gnu-build-system)
452 `(("autoconf" ,autoconf)
453 ("automake" ,automake)))
454 (synopsis "Default brushes for MyPaint")
455 (description "This package provides the default set of brushes for
457 (home-page "https://github.com/mypaint/mypaint-brushes/")
458 ;; Scripts are distributed under GPL2+ terms, brushes are provided as
459 ;; public domain or under CC0 terms.
460 (license (list license:gpl2+ license:cc0 license:public-domain))))
462 (define-public mypaint-brushes-1.3
464 (inherit mypaint-brushes)
465 (name "mypaint-brushes")
471 (url "https://github.com/mypaint/mypaint-brushes")
472 (commit (string-append "v" version))))
473 (file-name (git-file-name name version))
475 (base32 "1c95l1vfz7sbrdlzrbz7h1p6s1k113kyjfd9wfnxlm0p6562cz3j"))))))
477 (define-public gimp-resynthesizer
478 ;; GIMP does not respect any plugin search path environment variable, so after
479 ;; installation users have to edit their GIMP settings to include
480 ;; "$HOME/.guix-profile/lib/gimp/2.0/plug-ins/" in
481 ;; “Edit->Preferences->Folders->Plug Ins”.
483 (name "gimp-resynthesizer")
489 (url "https://github.com/bootchk/resynthesizer")
490 (commit (string-append "v" version))))
493 "1jwc8bhhm21xhrgw56nzbma6fwg59gc8anlmyns7jdiw83y0zx3j"))
494 (file-name (git-file-name name version))))
495 (build-system gnu-build-system)
497 `( ;; Turn off tests to avoid:
498 ;; make[1]: *** No rule to make target '../src/resynth-gui.c', needed by 'resynthesizer.pot'. Stop.
501 (modify-phases %standard-phases
502 (add-after 'unpack 'set-env
504 (setenv "CONFIG_SHELL" (which "sh"))
506 (add-after 'configure 'set-prefix
507 ;; Install plugin under $prefix, not under GIMP's libdir.
508 (lambda* (#:key outputs #:allow-other-keys)
509 (let ((target (string-append (assoc-ref outputs "out")
512 (package-version gimp))
514 (substitute* (list "src/resynthesizer/Makefile"
515 "src/resynthesizer-gui/Makefile")
516 (("GIMP_LIBDIR = .*")
517 (string-append "GIMP_LIBDIR = " target "\n")))
521 ;; avoid ./autogen.sh: ./configure: /bin/sh: bad interpreter:
522 ;; No such file or directory
523 `(("autoconf" ,autoconf-wrapper)
524 ("automake" ,automake)
525 ("glib" ,glib "bin") ; glib-gettextize
526 ("intltool" ,intltool)
527 ("pkg-config" ,pkg-config)))
530 ("gdk-pixbuf" ,gdk-pixbuf) ; needed by gimp-2.0.pc
533 ("gtk+" ,gtk+-2) ; needed by gimpui-2.0.pc
535 (home-page "https://github.com/bootchk/resynthesizer")
536 (synopsis "GIMP plugins for texture synthesis")
538 "This package provides resynthesizer plugins for GIMP, which encompasses
539 tools for healing selections (content-aware fill), enlarging the canvas and
540 healing the border, increasing the resolution while adding detail, and
541 transferring the style of an image.")
542 (license license:gpl3+)))
544 (define-public glimpse
551 (url "https://github.com/glimpse-editor/Glimpse")
552 (commit (string-append "v" version))))
553 (file-name (git-file-name name version))
556 "0drngj2xqzxfaag6pc4xjffiw003n4y43x5rb5bf4ziv1ac51dm9"))))
557 (build-system gnu-build-system)
559 "doc")) ; 9 MiB of gtk-doc HTML
562 (list (string-append "--with-html-dir="
563 (assoc-ref %outputs "doc")
564 "/share/gtk-doc/html")
567 ;; Prevent the build system from running 'gtk-update-icon-cache'
568 ;; which is not needed during the build because Guix runs it at
569 ;; profile creation time.
570 "ac_cv_path_GTK_UPDATE_ICON_CACHE=true"
572 ;; Disable automatic network request on startup to check for
574 "--disable-check-update"
576 ;; ./configure requests not to annoy upstream with packaging bugs.
577 "--with-bug-report-url=https://bugs.gnu.org/guix")
579 (modify-phases %standard-phases
580 (add-after 'install 'install-sitecustomize.py
581 ;; Install 'sitecustomize.py' into glimpse's python directory to
582 ;; add pygobject and pygtk to pygimp's search path.
583 (lambda* (#:key outputs #:allow-other-keys)
584 (let* ((pythonpath (getenv "PYTHONPATH"))
585 (out (assoc-ref outputs "out"))
588 out "/lib/glimpse/2.0/python/sitecustomize.py")))
589 (call-with-output-file sitecustomize.py
591 (format port "import site~%")
592 (format port "for dir in '~a'.split(':'):~%" pythonpath)
593 (format port " site.addsitedir(dir)~%")))))))))
595 `(("autoconf" ,autoconf)
596 ("automake" ,automake)
598 ("intltool" ,intltool)
600 ("libxslt" ,libxslt) ; for xsltproc
601 ("pkg-config" ,pkg-config)
602 ("glib:bin" ,glib "bin"))) ; for gdbus-codegen
606 ("glib-networking" ,glib-networking)
609 ("libjpeg" ,libjpeg-turbo)
613 ("libmypaint" ,libmypaint)
614 ("mypaint-brushes" ,mypaint-brushes-1.3)
615 ("exif" ,libexif) ; optional, EXIF + XMP support
616 ("lcms" ,lcms) ; optional, color management
617 ("librsvg" ,librsvg) ; optional, SVG support
618 ("libxcursor" ,libxcursor) ; optional, Mouse Cursor support
619 ("poppler" ,poppler) ; optional, PDF support
620 ("poppler-data" ,poppler-data)
621 ("python" ,python-2) ; optional, Python support
622 ("python2-pygtk" ,python2-pygtk) ; optional, Python support
624 (home-page "https://glimpse-editor.github.io/")
625 (synopsis "Glimpse Image Editor")
626 (description "The Glimpse Image Editor is an application for image
627 manipulation tasks such as photo retouching, composition and authoring.
628 It supports all common image formats as well as specialized ones. It
629 features a highly customizable interface that is extensible via a plugin
630 system. It was forked from the GNU Image Manipulation Program.")
631 (license license:gpl3+)))