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 pkg-config)
38 #:use-module (gnu packages glib)
39 #:use-module (gnu packages gtk)
40 #:use-module (gnu packages gnome)
41 #:use-module (gnu packages image)
42 #:use-module (gnu packages ghostscript)
43 #:use-module (gnu packages compression)
44 #:use-module (gnu packages xml)
45 #:use-module (gnu packages pdf)
46 #:use-module (gnu packages photo)
47 #:use-module (gnu packages python)
48 #:use-module (gnu packages web)
49 #:use-module (gnu packages xorg))
57 (uri (list (string-append "https://download.gimp.org/pub/babl/"
58 (version-major+minor version)
59 "/babl-" version ".tar.xz")
60 (string-append "https://ftp.gtk.org/pub/babl/"
61 (version-major+minor version)
62 "/babl-" version ".tar.xz")
63 (string-append "ftp://ftp.gtk.org/pub/babl/"
64 (version-major+minor version)
65 "/babl-" version ".tar.xz")))
68 "0fjjfb0pbgimlqi7rk8cqz8pq595b7gw8nrpkxfmixdz6cv4km8p"))))
69 (build-system meson-build-system)
72 (list "-Denable-gir=false")))
74 `(("pkg-config" ,pkg-config)))
76 ;; Propagated to satisfy ‘babl.pc’.
78 (home-page "http://gegl.org/babl/")
79 (synopsis "Image pixel format conversion library")
81 "Babl is a dynamic, any-to-any pixel format translation library.
82 It allows converting between different methods of storing pixels, known as
83 @dfn{pixel formats}, that have different bit depths and other data
84 representations, color models, and component permutations.
86 A vocabulary to formulate new pixel formats from existing primitives is
87 provided, as well as a framework to add new color models and data types.")
88 (license license:lgpl3+)))
96 (uri (list (string-append "https://download.gimp.org/pub/gegl/"
97 (string-take version 3)
98 "/gegl-" version ".tar.xz")
99 (string-append "https://ftp.gtk.org/pub/gegl/"
100 (version-major+minor version)
101 "/gegl-" version ".tar.xz")
102 (string-append "ftp://ftp.gtk.org/pub/gegl/"
103 (version-major+minor version)
104 "/gegl-" version ".tar.xz")))
107 "0ji57s7cba94vzy49agn7x47ca61rccm6rif0cb0s6rl4ygljrbp"))))
108 (build-system meson-build-system)
111 (list "-Dintrospection=false")))
112 ;; These are propagated to satisfy 'gegl-0.4.pc'.
116 ("json-glib" ,json-glib)))
121 ("libjpeg" ,libjpeg-turbo)))
123 `(("pkg-config" ,pkg-config)
124 ("glib" ,glib "bin") ; for gtester
125 ("intltool" ,intltool)))
126 (home-page "http://gegl.org")
127 (synopsis "Graph based image processing framework")
128 (description "GEGL (Generic Graphics Library) provides infrastructure to
129 do demand based cached non destructive image editing on larger than RAM
131 ;; The library itself is licensed under LGPL while the sample commandline
132 ;; application and GUI binary gegl is licensed under GPL.
133 (license (list license:lgpl3+ license:gpl3+))))
141 (uri (string-append "https://download.gimp.org/pub/gimp/v"
142 (version-major+minor version)
143 "/gimp-" version ".tar.bz2"))
146 "0g3vzh1bjffqx94mfghmwvkhncv71cgah2mnfx17q00s9f3rybz1"))))
147 (build-system gnu-build-system)
149 "doc")) ; 9 MiB of gtk-doc HTML
152 (list (string-append "--with-html-dir="
153 (assoc-ref %outputs "doc")
154 "/share/gtk-doc/html")
156 ;; Prevent the build system from running 'gtk-update-icon-cache'
157 ;; which is not needed during the build because Guix runs it at
158 ;; profile creation time.
159 "ac_cv_path_GTK_UPDATE_ICON_CACHE=true"
161 ;; Disable automatic network request on startup to check for
163 "--disable-check-update"
165 ;; ./configure requests not to annoy upstream with packaging bugs.
166 "--with-bug-report-url=https://bugs.gnu.org/guix")
168 (modify-phases %standard-phases
169 (add-after 'install 'install-sitecustomize.py
170 ;; Install 'sitecustomize.py' into gimp's python directory to
171 ;; add pygobject and pygtk to pygimp's search path.
172 (lambda* (#:key outputs #:allow-other-keys)
173 (let* ((pythonpath (getenv "PYTHONPATH"))
174 (out (assoc-ref outputs "out"))
177 out "/lib/gimp/2.0/python/sitecustomize.py")))
178 (call-with-output-file sitecustomize.py
180 (format port "import site~%")
181 (format port "for dir in '~a'.split(':'):~%" pythonpath)
182 (format port " site.addsitedir(dir)~%")))))))))
186 ("glib-networking" ,glib-networking)
189 ("libjpeg" ,libjpeg-turbo)
193 ("libmypaint" ,libmypaint)
194 ("mypaint-brushes" ,mypaint-brushes-1.3)
195 ("exif" ,libexif) ; optional, EXIF + XMP support
196 ("lcms" ,lcms) ; optional, color management
197 ("librsvg" ,librsvg) ; optional, SVG support
198 ("poppler" ,poppler) ; optional, PDF support
199 ("poppler-data" ,poppler-data)
200 ("python" ,python-2) ; optional, Python support
201 ("python2-pygtk" ,python2-pygtk) ; optional, Python support
204 `(("glib:bin" ,glib "bin") ; for glib-compile-resources and gdbus-codegen
205 ("pkg-config" ,pkg-config)
206 ("intltool" ,intltool)))
207 (home-page "https://www.gimp.org")
208 (synopsis "GNU Image Manipulation Program")
210 "GIMP is an application for image manipulation tasks such as photo
211 retouching, composition and authoring. It supports all common image formats
212 as well as specialized ones. It features a highly customizable interface
213 that is extensible via a plugin system.")
214 (license license:gpl3+))) ; some files are lgplv3
216 (define-public gimp-fourier
218 (name "gimp-fourier")
222 (uri (string-append "http://registry.gimp.org/files/fourier-"
226 "1rpacyad678lqgxa3hh2n0zpg4azs8dpa8q079bqsl12812k9184"))))
227 (build-system gnu-build-system)
229 `(#:tests? #f ;no tests
231 (modify-phases %standard-phases
232 ;; FIXME: The gegl package only installs "gegl-0.4.pc", but
233 ;; "gimp-2.0.pc" requires "gegl-0.3.pc", so we just copy it.
235 (lambda* (#:key inputs #:allow-other-keys)
236 (mkdir-p "tmppkgconfig")
237 (copy-file (string-append (assoc-ref inputs "gegl")
238 "/lib/pkgconfig/gegl-0.4.pc")
239 "tmppkgconfig/gegl-0.3.pc")
240 (setenv "PKG_CONFIG_PATH"
241 (string-append "tmppkgconfig:"
242 (or (getenv "PKG_CONFIG_PATH") "")))
244 (add-after 'unpack 'set-prefix
245 (lambda* (#:key outputs #:allow-other-keys)
246 ;; gimptool-2.0 does not allow us to install to any target
248 (let ((target (string-append (assoc-ref outputs "out")
250 (car (string-split ,(package-version gimp) #\.))
252 (substitute* "Makefile"
253 (("\\$\\(PLUGIN_INSTALL\\) fourier")
254 (string-append "cp fourier " target)))
260 ;; needed by gimp-2.0.pc
261 ("gdk-pixbuf" ,gdk-pixbuf)
265 ;; needed by gimpui-2.0.pc
268 `(("pkg-config" ,pkg-config)))
269 (home-page "https://www.lprp.fr/gimp_plugin_en/#fourier")
270 (synopsis "GIMP plug-in to edit image in fourier space")
272 "This package provides a simple plug-in to apply the fourier transform on
273 an image, allowing you to work with the transformed image inside GIMP. You
274 can draw or apply filters in fourier space and get the modified image with an
275 inverse fourier transform.")
276 (license license:gpl3+)))
278 (define-public libmypaint
284 (uri (string-append "https://github.com/mypaint/libmypaint/"
285 "releases/download/v" version "/libmypaint-"
289 "0aqcv4fyscpfhknxgfpq0v84aj2nzigqvpi4zgv2zkl41h51by5f"))))
290 (build-system gnu-build-system)
292 `(("intltool" ,intltool)
293 ("pkg-config" ,pkg-config)))
294 ;; As needed by 'libmypaint.pc'.
297 ("gobject-introspection" ,gobject-introspection)))
300 (synopsis "Artistic brushes library")
301 (description "Libmypaint, also called \"brushlib\", is a library for making
302 brushstrokes which is used by MyPaint and GIMP.")
303 (home-page "http://mypaint.org")
304 (license license:isc)))
306 (define-public mypaint-brushes
308 (name "mypaint-brushes")
314 (url "https://github.com/mypaint/mypaint-brushes")
315 (commit (string-append "v" version))))
316 (file-name (git-file-name name version))
318 (base32 "0kcqz13vzpy24dhmrx9hbs6s7hqb8y305vciznm15h277sabpmw9"))))
319 (build-system gnu-build-system)
321 `(("autoconf" ,autoconf)
322 ("automake" ,automake)))
323 (synopsis "Default brushes for MyPaint")
324 (description "This package provides the default set of brushes for
326 (home-page "https://github.com/mypaint/mypaint-brushes/")
327 ;; Scripts are distributed under GPL2+ terms, brushes are provided as
328 ;; public domain or under CC0 terms.
329 (license (list license:gpl2+ license:cc0 license:public-domain))))
331 (define-public mypaint-brushes-1.3
333 (inherit mypaint-brushes)
334 (name "mypaint-brushes")
340 (url "https://github.com/mypaint/mypaint-brushes")
341 (commit (string-append "v" version))))
342 (file-name (git-file-name name version))
344 (base32 "1c95l1vfz7sbrdlzrbz7h1p6s1k113kyjfd9wfnxlm0p6562cz3j"))))))
346 (define-public gimp-resynthesizer
347 ;; GIMP does not respect any plugin search path environment variable, so after
348 ;; installation users have to edit their GIMP settings to include
349 ;; "$HOME/.guix-profile/lib/gimp/2.0/plug-ins/" in
350 ;; “Edit->Preferences->Folders->Plug Ins”.
352 (name "gimp-resynthesizer")
358 (url "https://github.com/bootchk/resynthesizer")
359 (commit (string-append "v" version))))
362 "1jwc8bhhm21xhrgw56nzbma6fwg59gc8anlmyns7jdiw83y0zx3j"))
363 (file-name (git-file-name name version))))
364 (build-system gnu-build-system)
366 `( ;; Turn off tests to avoid:
367 ;; make[1]: *** No rule to make target '../src/resynth-gui.c', needed by 'resynthesizer.pot'. Stop.
370 (modify-phases %standard-phases
371 (add-after 'unpack 'set-env
373 (setenv "CONFIG_SHELL" (which "sh"))
375 (add-after 'configure 'set-prefix
376 ;; Install plugin under $prefix, not under GIMP's libdir.
377 (lambda* (#:key outputs #:allow-other-keys)
378 (let ((target (string-append (assoc-ref outputs "out")
381 (package-version gimp))
383 (substitute* (list "src/resynthesizer/Makefile"
384 "src/resynthesizer-gui/Makefile")
385 (("GIMP_LIBDIR = .*")
386 (string-append "GIMP_LIBDIR = " target "\n")))
390 `(("autoconf" ,autoconf-wrapper)
391 ("automake" ,automake)
392 ("glib" ,glib "bin") ; glib-gettextize
393 ("intltool" ,intltool)
394 ("pkg-config" ,pkg-config)))
397 ("gdk-pixbuf" ,gdk-pixbuf) ; needed by gimp-2.0.pc
400 ("gtk+" ,gtk+-2) ; needed by gimpui-2.0.pc
402 (home-page "https://github.com/bootchk/resynthesizer")
403 (synopsis "GIMP plugins for texture synthesis")
405 "This package provides resynthesizer plugins for GIMP, which encompasses
406 tools for healing selections (content-aware fill), enlarging the canvas and
407 healing the border, increasing the resolution while adding detail, and
408 transferring the style of an image.")
409 (license license:gpl3+)))