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>
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.git")
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 "http://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")))
227 ;; These are propagated to satisfy 'gegl-0.4.pc'.
231 ("json-glib" ,json-glib)))
236 ("libjpeg" ,libjpeg-turbo)))
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
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+))))
256 (uri (string-append "https://download.gimp.org/pub/gimp/v"
257 (version-major+minor version)
258 "/gimp-" version ".tar.bz2"))
261 "1fqqyshakvdarf1jipk2n33ibqr23ni22z3d8srq13bpydblpf1d"))))
262 (build-system gnu-build-system)
264 "doc")) ; 9 MiB of gtk-doc HTML
267 (list (string-append "--with-html-dir="
268 (assoc-ref %outputs "doc")
269 "/share/gtk-doc/html")
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"
276 ;; Disable automatic network request on startup to check for
278 "--disable-check-update"
280 ;; ./configure requests not to annoy upstream with packaging bugs.
281 "--with-bug-report-url=https://bugs.gnu.org/guix")
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"))
292 out "/lib/gimp/2.0/python/sitecustomize.py")))
293 (call-with-output-file sitecustomize.py
295 (format port "import site~%")
296 (format port "for dir in '~a'.split(':'):~%" pythonpath)
297 (format port " site.addsitedir(dir)~%")))))))))
301 ("glib-networking" ,glib-networking)
304 ("libjpeg" ,libjpeg-turbo)
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
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")
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
332 (define-public gimp-fourier
334 (name "gimp-fourier")
338 (uri (string-append "http://registry.gimp.org/files/fourier-"
342 "1rpacyad678lqgxa3hh2n0zpg4azs8dpa8q079bqsl12812k9184"))))
343 (build-system gnu-build-system)
345 `(#:tests? #f ;no tests
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.
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") "")))
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
364 (let ((target (string-append (assoc-ref outputs "out")
366 (car (string-split ,(package-version gimp) #\.))
368 (substitute* "Makefile"
369 (("\\$\\(PLUGIN_INSTALL\\) fourier")
370 (string-append "cp fourier " target)))
376 ;; needed by gimp-2.0.pc
377 ("gdk-pixbuf" ,gdk-pixbuf)
381 ;; needed by gimpui-2.0.pc
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")
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+)))
394 (define-public libmypaint
400 (uri (string-append "https://github.com/mypaint/libmypaint/"
401 "releases/download/v" version "/libmypaint-"
405 "0aqcv4fyscpfhknxgfpq0v84aj2nzigqvpi4zgv2zkl41h51by5f"))))
406 (build-system gnu-build-system)
408 `(("intltool" ,intltool)
409 ("pkg-config" ,pkg-config)))
410 ;; As needed by 'libmypaint.pc'.
413 ("gobject-introspection" ,gobject-introspection)))
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)))
422 (define-public mypaint-brushes
424 (name "mypaint-brushes")
430 (url "https://github.com/mypaint/mypaint-brushes")
431 (commit (string-append "v" version))))
432 (file-name (git-file-name name version))
434 (base32 "0kcqz13vzpy24dhmrx9hbs6s7hqb8y305vciznm15h277sabpmw9"))))
435 (build-system gnu-build-system)
437 `(("autoconf" ,autoconf)
438 ("automake" ,automake)))
439 (synopsis "Default brushes for MyPaint")
440 (description "This package provides the default set of brushes for
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))))
447 (define-public mypaint-brushes-1.3
449 (inherit mypaint-brushes)
450 (name "mypaint-brushes")
456 (url "https://github.com/mypaint/mypaint-brushes")
457 (commit (string-append "v" version))))
458 (file-name (git-file-name name version))
460 (base32 "1c95l1vfz7sbrdlzrbz7h1p6s1k113kyjfd9wfnxlm0p6562cz3j"))))))
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”.
468 (name "gimp-resynthesizer")
474 (url "https://github.com/bootchk/resynthesizer")
475 (commit (string-append "v" version))))
478 "1jwc8bhhm21xhrgw56nzbma6fwg59gc8anlmyns7jdiw83y0zx3j"))
479 (file-name (git-file-name name version))))
480 (build-system gnu-build-system)
482 `( ;; Turn off tests to avoid:
483 ;; make[1]: *** No rule to make target '../src/resynth-gui.c', needed by 'resynthesizer.pot'. Stop.
486 (modify-phases %standard-phases
487 (add-after 'unpack 'set-env
489 (setenv "CONFIG_SHELL" (which "sh"))
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")
497 (package-version gimp))
499 (substitute* (list "src/resynthesizer/Makefile"
500 "src/resynthesizer-gui/Makefile")
501 (("GIMP_LIBDIR = .*")
502 (string-append "GIMP_LIBDIR = " target "\n")))
506 `(("autoconf" ,autoconf-wrapper)
507 ("automake" ,automake)
508 ("glib" ,glib "bin") ; glib-gettextize
509 ("intltool" ,intltool)
510 ("pkg-config" ,pkg-config)))
513 ("gdk-pixbuf" ,gdk-pixbuf) ; needed by gimp-2.0.pc
516 ("gtk+" ,gtk+-2) ; needed by gimpui-2.0.pc
518 (home-page "https://github.com/bootchk/resynthesizer")
519 (synopsis "GIMP plugins for texture synthesis")
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+)))