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>
10 ;;; This file is part of GNU Guix.
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25 (define-module (gnu packages gimp)
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module (guix git-download)
29 #:use-module (guix utils)
30 #:use-module ((guix licenses) #:prefix license:)
31 #:use-module (guix build-system gnu)
32 #:use-module (guix build-system glib-or-gtk)
33 #:use-module (guix build-system meson)
34 #:use-module (gnu packages)
35 #:use-module (gnu packages algebra)
36 #:use-module (gnu packages autotools)
37 #:use-module (gnu packages base)
38 #:use-module (gnu packages documentation)
39 #:use-module (gnu packages pkg-config)
40 #:use-module (gnu packages glib)
41 #:use-module (gnu packages gtk)
42 #:use-module (gnu packages gnome)
43 #:use-module (gnu packages graphics)
44 #:use-module (gnu packages image)
45 #:use-module (gnu packages ghostscript)
46 #:use-module (gnu packages compression)
47 #:use-module (gnu packages xml)
48 #:use-module (gnu packages linux)
49 #:use-module (gnu packages ncurses)
50 #:use-module (gnu packages patchutils)
51 #:use-module (gnu packages pdf)
52 #:use-module (gnu packages photo)
53 #:use-module (gnu packages python)
54 #:use-module (gnu packages web)
55 #:use-module (gnu packages xorg))
57 (define-public poly2tri-c
65 (string-append "https://storage.googleapis.com/"
66 "google-code-archive-source/v2/code.google.com/"
67 "poly2tri-c/source-archive.zip"))
69 (string-append name "-" version ".zip"))
71 (base32 "17cw0zhbnf2gb59jm26z0wcarqgdwir9jr1fpi3v9lcvyb2s3mqj"))))
72 (build-system glib-or-gtk-build-system)
73 (outputs '("out" "doc"))
79 (modify-phases %standard-phases
80 (add-after 'unpack 'disable-strict-rules
82 (substitute* "configure.ac"
83 (("\\$CFLAGS -Wall -ansi -pedantic")
85 (("\\$CFLAGS -Werror")
88 (add-after 'disable-strict-rules 'fix-build-errors
90 (substitute* "poly2tri-c/refine/Makefile.am"
100 (add-before 'bootstrap 'configure-later
102 (setenv "NOCONFIGURE" "set")
104 (add-after 'build 'generate-doc
108 (add-after 'install 'install-doc
109 (lambda* (#:key outputs #:allow-other-keys)
110 (let* ((out (assoc-ref outputs "out"))
111 (doc (assoc-ref outputs "doc")))
114 (string-append doc "/share/doc/poly2tri-c"))
117 `(("autoconf" ,autoconf)
118 ("automake" ,automake)
121 ("pkg-config" ,pkg-config)
126 (synopsis "2D constrained Delaunay triangulation library")
127 (description "Poly2Tri-C is a library for generating, refining and rendering
128 2-Dimensional Constrained Delaunay Triangulations.")
129 (home-page "https://code.google.com/archive/p/poly2tri-c/")
130 (license license:bsd-3)))
141 (url "https://github.com/hodefoting/mrg.git")
144 (git-file-name name version))
146 (base32 "106qhh0c11576cc5kh90ds0ram72d3r6n9sadw0y4krnhap6dvwk"))))
147 (build-system meson-build-system)
149 `(#:glib-or-gtk? #t)) ; To wrap binaries and/or compile schemas
151 `(("pkg-config" ,pkg-config)))
158 (synopsis "Microraptor GUI")
159 (description "MrG is is a C API for creating user interfaces. It can be
160 used as an application writing environment or as an interactive canvas for part
161 of a larger interface.")
162 (home-page "https://github.com/hodefoting/mrg")
163 (license license:lgpl2.0+)))
171 (uri (list (string-append "https://download.gimp.org/pub/babl/"
172 (version-major+minor version)
173 "/babl-" version ".tar.xz")
174 (string-append "https://ftp.gtk.org/pub/babl/"
175 (version-major+minor version)
176 "/babl-" version ".tar.xz")
177 (string-append "ftp://ftp.gtk.org/pub/babl/"
178 (version-major+minor version)
179 "/babl-" version ".tar.xz")))
182 "0fjjfb0pbgimlqi7rk8cqz8pq595b7gw8nrpkxfmixdz6cv4km8p"))))
183 (build-system meson-build-system)
186 (list "-Denable-gir=false")))
188 `(("pkg-config" ,pkg-config)))
190 ;; Propagated to satisfy ‘babl.pc’.
192 (home-page "http://gegl.org/babl/")
193 (synopsis "Image pixel format conversion library")
195 "Babl is a dynamic, any-to-any pixel format translation library.
196 It allows converting between different methods of storing pixels, known as
197 @dfn{pixel formats}, that have different bit depths and other data
198 representations, color models, and component permutations.
200 A vocabulary to formulate new pixel formats from existing primitives is
201 provided, as well as a framework to add new color models and data types.")
202 (license license:lgpl3+)))
210 (uri (list (string-append "https://download.gimp.org/pub/gegl/"
211 (string-take version 3)
212 "/gegl-" version ".tar.xz")
213 (string-append "https://ftp.gtk.org/pub/gegl/"
214 (version-major+minor version)
215 "/gegl-" version ".tar.xz")
216 (string-append "ftp://ftp.gtk.org/pub/gegl/"
217 (version-major+minor version)
218 "/gegl-" version ".tar.xz")))
221 "0ji57s7cba94vzy49agn7x47ca61rccm6rif0cb0s6rl4ygljrbp"))))
222 (build-system meson-build-system)
225 (list "-Dintrospection=false")))
226 ;; These are propagated to satisfy 'gegl-0.4.pc'.
230 ("json-glib" ,json-glib)))
235 ("libjpeg" ,libjpeg-turbo)))
237 `(("pkg-config" ,pkg-config)
238 ("glib" ,glib "bin") ; for gtester
239 ("intltool" ,intltool)))
240 (home-page "http://gegl.org")
241 (synopsis "Graph based image processing framework")
242 (description "GEGL (Generic Graphics Library) provides infrastructure to
243 do demand based cached non destructive image editing on larger than RAM
245 ;; The library itself is licensed under LGPL while the sample commandline
246 ;; application and GUI binary gegl is licensed under GPL.
247 (license (list license:lgpl3+ license:gpl3+))))
255 (uri (string-append "https://download.gimp.org/pub/gimp/v"
256 (version-major+minor version)
257 "/gimp-" version ".tar.bz2"))
260 "0g3vzh1bjffqx94mfghmwvkhncv71cgah2mnfx17q00s9f3rybz1"))))
261 (build-system gnu-build-system)
263 "doc")) ; 9 MiB of gtk-doc HTML
266 (list (string-append "--with-html-dir="
267 (assoc-ref %outputs "doc")
268 "/share/gtk-doc/html")
270 ;; Prevent the build system from running 'gtk-update-icon-cache'
271 ;; which is not needed during the build because Guix runs it at
272 ;; profile creation time.
273 "ac_cv_path_GTK_UPDATE_ICON_CACHE=true"
275 ;; Disable automatic network request on startup to check for
277 "--disable-check-update"
279 ;; ./configure requests not to annoy upstream with packaging bugs.
280 "--with-bug-report-url=https://bugs.gnu.org/guix")
282 (modify-phases %standard-phases
283 (add-after 'install 'install-sitecustomize.py
284 ;; Install 'sitecustomize.py' into gimp's python directory to
285 ;; add pygobject and pygtk to pygimp's search path.
286 (lambda* (#:key outputs #:allow-other-keys)
287 (let* ((pythonpath (getenv "PYTHONPATH"))
288 (out (assoc-ref outputs "out"))
291 out "/lib/gimp/2.0/python/sitecustomize.py")))
292 (call-with-output-file sitecustomize.py
294 (format port "import site~%")
295 (format port "for dir in '~a'.split(':'):~%" pythonpath)
296 (format port " site.addsitedir(dir)~%")))))))))
300 ("glib-networking" ,glib-networking)
303 ("libjpeg" ,libjpeg-turbo)
307 ("libmypaint" ,libmypaint)
308 ("mypaint-brushes" ,mypaint-brushes-1.3)
309 ("exif" ,libexif) ; optional, EXIF + XMP support
310 ("lcms" ,lcms) ; optional, color management
311 ("librsvg" ,librsvg) ; optional, SVG support
312 ("poppler" ,poppler) ; optional, PDF support
313 ("poppler-data" ,poppler-data)
314 ("python" ,python-2) ; optional, Python support
315 ("python2-pygtk" ,python2-pygtk) ; optional, Python support
318 `(("glib:bin" ,glib "bin") ; for glib-compile-resources and gdbus-codegen
319 ("pkg-config" ,pkg-config)
320 ("intltool" ,intltool)))
321 (home-page "https://www.gimp.org")
322 (synopsis "GNU Image Manipulation Program")
324 "GIMP is an application for image manipulation tasks such as photo
325 retouching, composition and authoring. It supports all common image formats
326 as well as specialized ones. It features a highly customizable interface
327 that is extensible via a plugin system.")
328 (license license:gpl3+))) ; some files are lgplv3
330 (define-public gimp-fourier
332 (name "gimp-fourier")
336 (uri (string-append "http://registry.gimp.org/files/fourier-"
340 "1rpacyad678lqgxa3hh2n0zpg4azs8dpa8q079bqsl12812k9184"))))
341 (build-system gnu-build-system)
343 `(#:tests? #f ;no tests
345 (modify-phases %standard-phases
346 ;; FIXME: The gegl package only installs "gegl-0.4.pc", but
347 ;; "gimp-2.0.pc" requires "gegl-0.3.pc", so we just copy it.
349 (lambda* (#:key inputs #:allow-other-keys)
350 (mkdir-p "tmppkgconfig")
351 (copy-file (string-append (assoc-ref inputs "gegl")
352 "/lib/pkgconfig/gegl-0.4.pc")
353 "tmppkgconfig/gegl-0.3.pc")
354 (setenv "PKG_CONFIG_PATH"
355 (string-append "tmppkgconfig:"
356 (or (getenv "PKG_CONFIG_PATH") "")))
358 (add-after 'unpack 'set-prefix
359 (lambda* (#:key outputs #:allow-other-keys)
360 ;; gimptool-2.0 does not allow us to install to any target
362 (let ((target (string-append (assoc-ref outputs "out")
364 (car (string-split ,(package-version gimp) #\.))
366 (substitute* "Makefile"
367 (("\\$\\(PLUGIN_INSTALL\\) fourier")
368 (string-append "cp fourier " target)))
374 ;; needed by gimp-2.0.pc
375 ("gdk-pixbuf" ,gdk-pixbuf)
379 ;; needed by gimpui-2.0.pc
382 `(("pkg-config" ,pkg-config)))
383 (home-page "https://www.lprp.fr/gimp_plugin_en/#fourier")
384 (synopsis "GIMP plug-in to edit image in fourier space")
386 "This package provides a simple plug-in to apply the fourier transform on
387 an image, allowing you to work with the transformed image inside GIMP. You
388 can draw or apply filters in fourier space and get the modified image with an
389 inverse fourier transform.")
390 (license license:gpl3+)))
392 (define-public libmypaint
398 (uri (string-append "https://github.com/mypaint/libmypaint/"
399 "releases/download/v" version "/libmypaint-"
403 "0aqcv4fyscpfhknxgfpq0v84aj2nzigqvpi4zgv2zkl41h51by5f"))))
404 (build-system gnu-build-system)
406 `(("intltool" ,intltool)
407 ("pkg-config" ,pkg-config)))
408 ;; As needed by 'libmypaint.pc'.
411 ("gobject-introspection" ,gobject-introspection)))
414 (synopsis "Artistic brushes library")
415 (description "Libmypaint, also called \"brushlib\", is a library for making
416 brushstrokes which is used by MyPaint and GIMP.")
417 (home-page "http://mypaint.org")
418 (license license:isc)))
420 (define-public mypaint-brushes
422 (name "mypaint-brushes")
428 (url "https://github.com/mypaint/mypaint-brushes")
429 (commit (string-append "v" version))))
430 (file-name (git-file-name name version))
432 (base32 "0kcqz13vzpy24dhmrx9hbs6s7hqb8y305vciznm15h277sabpmw9"))))
433 (build-system gnu-build-system)
435 `(("autoconf" ,autoconf)
436 ("automake" ,automake)))
437 (synopsis "Default brushes for MyPaint")
438 (description "This package provides the default set of brushes for
440 (home-page "https://github.com/mypaint/mypaint-brushes/")
441 ;; Scripts are distributed under GPL2+ terms, brushes are provided as
442 ;; public domain or under CC0 terms.
443 (license (list license:gpl2+ license:cc0 license:public-domain))))
445 (define-public mypaint-brushes-1.3
447 (inherit mypaint-brushes)
448 (name "mypaint-brushes")
454 (url "https://github.com/mypaint/mypaint-brushes")
455 (commit (string-append "v" version))))
456 (file-name (git-file-name name version))
458 (base32 "1c95l1vfz7sbrdlzrbz7h1p6s1k113kyjfd9wfnxlm0p6562cz3j"))))))
460 (define-public gimp-resynthesizer
461 ;; GIMP does not respect any plugin search path environment variable, so after
462 ;; installation users have to edit their GIMP settings to include
463 ;; "$HOME/.guix-profile/lib/gimp/2.0/plug-ins/" in
464 ;; “Edit->Preferences->Folders->Plug Ins”.
466 (name "gimp-resynthesizer")
472 (url "https://github.com/bootchk/resynthesizer")
473 (commit (string-append "v" version))))
476 "1jwc8bhhm21xhrgw56nzbma6fwg59gc8anlmyns7jdiw83y0zx3j"))
477 (file-name (git-file-name name version))))
478 (build-system gnu-build-system)
480 `( ;; Turn off tests to avoid:
481 ;; make[1]: *** No rule to make target '../src/resynth-gui.c', needed by 'resynthesizer.pot'. Stop.
484 (modify-phases %standard-phases
485 (add-after 'unpack 'set-env
487 (setenv "CONFIG_SHELL" (which "sh"))
489 (add-after 'configure 'set-prefix
490 ;; Install plugin under $prefix, not under GIMP's libdir.
491 (lambda* (#:key outputs #:allow-other-keys)
492 (let ((target (string-append (assoc-ref outputs "out")
495 (package-version gimp))
497 (substitute* (list "src/resynthesizer/Makefile"
498 "src/resynthesizer-gui/Makefile")
499 (("GIMP_LIBDIR = .*")
500 (string-append "GIMP_LIBDIR = " target "\n")))
504 `(("autoconf" ,autoconf-wrapper)
505 ("automake" ,automake)
506 ("glib" ,glib "bin") ; glib-gettextize
507 ("intltool" ,intltool)
508 ("pkg-config" ,pkg-config)))
511 ("gdk-pixbuf" ,gdk-pixbuf) ; needed by gimp-2.0.pc
514 ("gtk+" ,gtk+-2) ; needed by gimpui-2.0.pc
516 (home-page "https://github.com/bootchk/resynthesizer")
517 (synopsis "GIMP plugins for texture synthesis")
519 "This package provides resynthesizer plugins for GIMP, which encompasses
520 tools for healing selections (content-aware fill), enlarging the canvas and
521 healing the border, increasing the resolution while adding detail, and
522 transferring the style of an image.")
523 (license license:gpl3+)))