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 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;; Copyright © 2018 Leo Famulari <leo@famulari.name>
7 ;;; Copyright © 2018 Thorsten Wilms <t_w_@freenet.de>
9 ;;; This file is part of GNU Guix.
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24 (define-module (gnu packages gimp)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix git-download)
28 #:use-module (guix utils)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix build-system gnu)
31 #:use-module (guix build-system glib-or-gtk)
32 #:use-module (gnu packages)
33 #:use-module (gnu packages algebra)
34 #:use-module (gnu packages autotools)
35 #:use-module (gnu packages pkg-config)
36 #:use-module (gnu packages glib)
37 #:use-module (gnu packages gtk)
38 #:use-module (gnu packages gnome)
39 #:use-module (gnu packages image)
40 #:use-module (gnu packages ghostscript)
41 #:use-module (gnu packages compression)
42 #:use-module (gnu packages xml)
43 #:use-module (gnu packages pdf)
44 #:use-module (gnu packages photo)
45 #:use-module (gnu packages python)
46 #:use-module (gnu packages web)
47 #:use-module (gnu packages xorg))
55 (uri (list (string-append "https://download.gimp.org/pub/babl/"
56 (version-major+minor version)
57 "/babl-" version ".tar.bz2")
58 (string-append "https://ftp.gtk.org/pub/babl/"
59 (version-major+minor version)
60 "/babl-" version ".tar.bz2")
61 (string-append "ftp://ftp.gtk.org/pub/babl/"
62 (version-major+minor version)
63 "/babl-" version ".tar.bz2")))
66 "1gsqs5spgla86y9g11riryvw7015asik7y22maainl83nhq4sxxv"))))
67 (build-system gnu-build-system)
68 (home-page "http://gegl.org/babl/")
69 (synopsis "Image pixel format conversion library")
71 "Babl is a dynamic, any-to-any pixel format translation library.
72 It allows converting between different methods of storing pixels, known as
73 @dfn{pixel formats}, that have different bit depths and other data
74 representations, color models, and component permutations.
76 A vocabulary to formulate new pixel formats from existing primitives is
77 provided, as well as a framework to add new color models and data types.")
78 (license license:lgpl3+)))
86 (uri (list (string-append "https://download.gimp.org/pub/gegl/"
87 (string-take version 3)
88 "/gegl-" version ".tar.bz2")))
91 "0njydcr6qdmfzh4fxx544681qxdpf7y6b2f47jcypn810dlxy4h1"))))
92 (build-system gnu-build-system)
94 '(#:configure-flags '("LDFLAGS=-lm")))
95 ;; These are propagated to satisfy 'gegl-0.4.pc'.
99 ("json-glib" ,json-glib)))
104 ("libjpeg" ,libjpeg)))
106 `(("pkg-config" ,pkg-config)
107 ("glib" ,glib "bin") ; for gtester
108 ("intltool" ,intltool)))
109 (home-page "http://gegl.org")
110 (synopsis "Graph based image processing framework")
111 (description "GEGL (Generic Graphics Library) provides infrastructure to
112 do demand based cached non destructive image editing on larger than RAM
114 ;; The library itself is licensed under LGPL while the sample commandline
115 ;; application and GUI binary gegl is licensed under GPL.
116 (license (list license:lgpl3+ license:gpl3+))))
124 (uri (string-append "https://download.gimp.org/pub/gimp/v"
125 (version-major+minor version)
126 "/gimp-" version ".tar.bz2"))
129 "0xwck5nbpb945s1cyij3kfqw1pchbhx8i5vf5hgywyjw4r1z5l8j"))))
130 (build-system gnu-build-system)
132 "doc")) ; 9 MiB of gtk-doc HTML
135 (list (string-append "--with-html-dir="
136 (assoc-ref %outputs "doc")
137 "/share/gtk-doc/html")
138 ;; ./configure requests not to annoy upstream with packaging bugs.
139 "--with-bug-report-url=https://bugs.gnu.org/guix")
141 (modify-phases %standard-phases
142 (add-after 'install 'install-sitecustomize.py
143 ;; Install 'sitecustomize.py' into gimp's python directory to
144 ;; add pygobject and pygtk to pygimp's search path.
145 (lambda* (#:key outputs #:allow-other-keys)
146 (let* ((pythonpath (getenv "PYTHONPATH"))
147 (out (assoc-ref outputs "out"))
150 out "/lib/gimp/2.0/python/sitecustomize.py")))
151 (call-with-output-file sitecustomize.py
153 (format port "import site~%")
154 (format port "for dir in '~a'.split(':'):~%" pythonpath)
155 (format port " site.addsitedir(dir)~%")))))))))
159 ("glib-networking" ,glib-networking)
165 ("libmypaint" ,libmypaint)
166 ("mypaint-brushes" ,mypaint-brushes)
167 ("exif" ,libexif) ; optional, EXIF + XMP support
168 ("lcms" ,lcms) ; optional, color management
169 ("librsvg" ,librsvg) ; optional, SVG support
170 ("poppler" ,poppler) ; optional, PDF support
171 ("poppler-data" ,poppler-data)
172 ("python" ,python-2) ; optional, Python support
173 ("python2-pygtk" ,python2-pygtk) ; optional, Python support
176 `(("glib:bin" ,glib "bin") ; for glib-compile-resources and gdbus-codegen
177 ("pkg-config" ,pkg-config)
178 ("intltool" ,intltool)))
179 (home-page "https://www.gimp.org")
180 (synopsis "GNU Image Manipulation Program")
182 "GIMP is an application for image manipulation tasks such as photo
183 retouching, composition and authoring. It supports all common image formats
184 as well as specialized ones. It features a highly customizable interface
185 that is extensible via a plugin system.")
186 (license license:gpl3+))) ; some files are lgplv3
188 (define-public gimp-fourier
190 (name "gimp-fourier")
194 (uri (string-append "http://registry.gimp.org/files/fourier-"
198 "1rpacyad678lqgxa3hh2n0zpg4azs8dpa8q079bqsl12812k9184"))))
199 (build-system gnu-build-system)
201 `(#:tests? #f ;no tests
203 (modify-phases %standard-phases
204 ;; FIXME: The gegl package only installs "gegl-0.4.pc", but
205 ;; "gimp-2.0.pc" requires "gegl-0.3.pc", so we just copy it.
207 (lambda* (#:key inputs #:allow-other-keys)
208 (mkdir-p "tmppkgconfig")
209 (copy-file (string-append (assoc-ref inputs "gegl")
210 "/lib/pkgconfig/gegl-0.4.pc")
211 "tmppkgconfig/gegl-0.3.pc")
212 (setenv "PKG_CONFIG_PATH"
213 (string-append "tmppkgconfig:"
214 (or (getenv "PKG_CONFIG_PATH") "")))
216 (add-after 'unpack 'set-prefix
217 (lambda* (#:key outputs #:allow-other-keys)
218 ;; gimptool-2.0 does not allow us to install to any target
220 (let ((target (string-append (assoc-ref outputs "out")
222 (car (string-split ,(package-version gimp) #\.))
224 (substitute* "Makefile"
225 (("\\$\\(PLUGIN_INSTALL\\) fourier")
226 (string-append "cp fourier " target)))
232 ;; needed by gimp-2.0.pc
233 ("gdk-pixbuf" ,gdk-pixbuf)
237 ;; needed by gimpui-2.0.pc
240 `(("pkg-config" ,pkg-config)))
241 (home-page "http://registry.gimp.org/node/19596")
242 (synopsis "GIMP plug-in to edit image in fourier space")
244 "This package provides a simple plug-in to apply the fourier transform on
245 an image, allowing you to work with the transformed image inside GIMP. You
246 can draw or apply filters in fourier space and get the modified image with an
247 inverse fourier transform.")
248 (license license:gpl3+)))
250 (define-public libmypaint
256 (uri (string-append "https://github.com/mypaint/libmypaint/"
257 "releases/download/v" version "/libmypaint-"
261 "0wd6jk69vmhsq1mdw96v0fh7b28n3glkr5ca466zcq7agzaxj1va"))))
262 (build-system gnu-build-system)
264 `(("intltool" ,intltool)
265 ("pkg-config" ,pkg-config)))
266 ;; As needed by 'libmypaint.pc'.
269 ("gobject-introspection" ,gobject-introspection)))
272 (synopsis "Artistic brushes library")
273 (description "Libmypaint, also called \"brushlib\", is a library for making
274 brushstrokes which is used by MyPaint and GIMP.")
275 (home-page "http://mypaint.org")
276 (license license:isc)))
278 (define-public mypaint-brushes
280 (name "mypaint-brushes")
285 (url "https://github.com/Jehan/mypaint-brushes.git")
286 (commit (string-append "v" version))))
287 (file-name (git-file-name name version))
290 "1iz89z6v2mp8j1lrf942k561s8311i3s34ap36wh4rybb2lq15m0"))))
291 (build-system gnu-build-system)
294 (modify-phases %standard-phases
295 (add-after 'unpack 'relax-dependency-version
297 (substitute* "autogen.sh"
298 (("automake-1.13") "automake")
299 (("aclocal-1.13") "aclocal"))
302 `(("autoconf" ,autoconf)
303 ("automake" ,automake)))
304 (synopsis "Default brushes for MyPaint")
305 (description "This package provides the default set of brushes for
307 (home-page "https://github.com/Jehan/mypaint-brushes")
308 (license license:cc0)))
310 (define-public gimp-resynthesizer
311 ;; GIMP does not respect any plugin search path environment variable, so after
312 ;; installation users have to edit their GIMP settings to include
313 ;; "$HOME/.guix-profile/lib/gimp/2.0/plug-ins/" in
314 ;; “Edit->Preferences->Folders->Plug Ins”.
316 (name "gimp-resynthesizer")
321 (uri (string-append "https://github.com/bootchk/resynthesizer/archive/v"
325 "0l3404w6rqny7h3djskxf149gzx6x4qhndgbh3403c9lbh4pi1kr"))
326 (file-name (string-append name "-" version ".tar.gz"))))
327 (build-system gnu-build-system)
329 `( ;; Turn off tests to avoid:
330 ;; make[1]: *** No rule to make target '../src/resynth-gui.c', needed by 'resynthesizer.pot'. Stop.
333 (modify-phases %standard-phases
334 (add-after 'unpack 'set-env
336 (setenv "CONFIG_SHELL" (which "sh"))
338 (add-after 'configure 'set-prefix
339 ;; Install plugin under $prefix, not under GIMP's libdir.
340 (lambda* (#:key outputs #:allow-other-keys)
341 (let ((target (string-append (assoc-ref outputs "out")
344 (package-version gimp))
346 (substitute* (list "src/resynthesizer/Makefile"
347 "src/resynthesizer-gui/Makefile")
348 (("GIMP_LIBDIR = .*")
349 (string-append "GIMP_LIBDIR = " target "\n")))
353 `(("autoconf" ,autoconf-wrapper)
354 ("automake" ,automake)
355 ("glib" ,glib "bin") ; glib-gettextize
356 ("intltool" ,intltool)
357 ("pkg-config" ,pkg-config)))
360 ("gdk-pixbuf" ,gdk-pixbuf) ; needed by gimp-2.0.pc
363 ("gtk+" ,gtk+-2) ; needed by gimpui-2.0.pc
365 (home-page "https://github.com/bootchk/resynthesizer")
366 (synopsis "GIMP plugins for texture synthesis")
368 "This package provides resynthesizer plugins for GIMP, which encompasses
369 tools for healing selections (content-aware fill), enlarging the canvas and
370 healing the border, increasing the resolution while adding detail, and
371 transferring the style of an image.")
372 (license license:gpl3+)))