gnu: Add rust-nalgebra-0.18.
[jackhill/guix/guix.git] / gnu / packages / gimp.scm
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, 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 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
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.
15 ;;;
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.
20 ;;;
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/>.
23
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 (guix build-system meson)
33 #:use-module (gnu packages)
34 #:use-module (gnu packages algebra)
35 #:use-module (gnu packages autotools)
36 #:use-module (gnu packages pkg-config)
37 #:use-module (gnu packages glib)
38 #:use-module (gnu packages gtk)
39 #:use-module (gnu packages gnome)
40 #:use-module (gnu packages image)
41 #:use-module (gnu packages ghostscript)
42 #:use-module (gnu packages compression)
43 #:use-module (gnu packages xml)
44 #:use-module (gnu packages pdf)
45 #:use-module (gnu packages photo)
46 #:use-module (gnu packages python)
47 #:use-module (gnu packages web)
48 #:use-module (gnu packages xorg))
49
50 (define-public babl
51 (package
52 (name "babl")
53 (version "0.1.74")
54 (source (origin
55 (method url-fetch)
56 (uri (list (string-append "https://download.gimp.org/pub/babl/"
57 (version-major+minor version)
58 "/babl-" version ".tar.xz")
59 (string-append "https://ftp.gtk.org/pub/babl/"
60 (version-major+minor version)
61 "/babl-" version ".tar.xz")
62 (string-append "ftp://ftp.gtk.org/pub/babl/"
63 (version-major+minor version)
64 "/babl-" version ".tar.xz")))
65 (sha256
66 (base32
67 "03nfcvy3453xkfvsfcnsfcjf2vg2pin09qnr9jlssdysa1lhnwcs"))))
68 (build-system meson-build-system)
69 (arguments
70 `(#:configure-flags
71 (list "-Denable-gir=false")))
72 (native-inputs
73 `(("pkg-config" ,pkg-config)))
74 (propagated-inputs
75 ;; Propagated to satisfy ‘babl.pc’.
76 `(("lcms" ,lcms)))
77 (home-page "http://gegl.org/babl/")
78 (synopsis "Image pixel format conversion library")
79 (description
80 "Babl is a dynamic, any-to-any pixel format translation library.
81 It allows converting between different methods of storing pixels, known as
82 @dfn{pixel formats}, that have different bit depths and other data
83 representations, color models, and component permutations.
84
85 A vocabulary to formulate new pixel formats from existing primitives is
86 provided, as well as a framework to add new color models and data types.")
87 (license license:lgpl3+)))
88
89 (define-public gegl
90 (package
91 (name "gegl")
92 (version "0.4.22")
93 (source (origin
94 (method url-fetch)
95 (uri (list (string-append "https://download.gimp.org/pub/gegl/"
96 (string-take version 3)
97 "/gegl-" version ".tar.xz")
98 (string-append "https://ftp.gtk.org/pub/gegl/"
99 (version-major+minor version)
100 "/gegl-" version ".tar.xz")
101 (string-append "ftp://ftp.gtk.org/pub/gegl/"
102 (version-major+minor version)
103 "/gegl-" version ".tar.xz")))
104 (sha256
105 (base32
106 "0q9cckf90fb82qc5d496fjz459f1xw4j4p3rff1f57yivx0yr20q"))))
107 (build-system meson-build-system)
108 (arguments
109 `(#:configure-flags
110 (list "-Dintrospection=false")))
111 ;; These are propagated to satisfy 'gegl-0.4.pc'.
112 (propagated-inputs
113 `(("babl" ,babl)
114 ("glib" ,glib)
115 ("json-glib" ,json-glib)))
116 (inputs
117 `(("cairo" ,cairo)
118 ("pango" ,pango)
119 ("libpng" ,libpng)
120 ("libjpeg" ,libjpeg)))
121 (native-inputs
122 `(("pkg-config" ,pkg-config)
123 ("glib" ,glib "bin") ; for gtester
124 ("intltool" ,intltool)))
125 (home-page "http://gegl.org")
126 (synopsis "Graph based image processing framework")
127 (description "GEGL (Generic Graphics Library) provides infrastructure to
128 do demand based cached non destructive image editing on larger than RAM
129 buffers.")
130 ;; The library itself is licensed under LGPL while the sample commandline
131 ;; application and GUI binary gegl is licensed under GPL.
132 (license (list license:lgpl3+ license:gpl3+))))
133
134 (define-public gimp
135 (package
136 (name "gimp")
137 (version "2.10.18")
138 (source (origin
139 (method url-fetch)
140 (uri (string-append "https://download.gimp.org/pub/gimp/v"
141 (version-major+minor version)
142 "/gimp-" version ".tar.bz2"))
143 (sha256
144 (base32
145 "05np26g61fyr72s7qjfrcck8v57r0yswq5ihvqyzvgzfx08y3gv5"))))
146 (build-system gnu-build-system)
147 (outputs '("out"
148 "doc")) ; 9 MiB of gtk-doc HTML
149 (arguments
150 '(#:configure-flags
151 (list (string-append "--with-html-dir="
152 (assoc-ref %outputs "doc")
153 "/share/gtk-doc/html")
154 ;; ./configure requests not to annoy upstream with packaging bugs.
155 "--with-bug-report-url=https://bugs.gnu.org/guix")
156 #:phases
157 (modify-phases %standard-phases
158 (add-after 'install 'install-sitecustomize.py
159 ;; Install 'sitecustomize.py' into gimp's python directory to
160 ;; add pygobject and pygtk to pygimp's search path.
161 (lambda* (#:key outputs #:allow-other-keys)
162 (let* ((pythonpath (getenv "PYTHONPATH"))
163 (out (assoc-ref outputs "out"))
164 (sitecustomize.py
165 (string-append
166 out "/lib/gimp/2.0/python/sitecustomize.py")))
167 (call-with-output-file sitecustomize.py
168 (lambda (port)
169 (format port "import site~%")
170 (format port "for dir in '~a'.split(':'):~%" pythonpath)
171 (format port " site.addsitedir(dir)~%")))))))))
172 (inputs
173 `(("babl" ,babl)
174 ("glib" ,glib)
175 ("glib-networking" ,glib-networking)
176 ("libtiff" ,libtiff)
177 ("libwebp" ,libwebp)
178 ("libjpeg" ,libjpeg)
179 ("atk" ,atk)
180 ("gexiv2" ,gexiv2)
181 ("gtk+" ,gtk+-2)
182 ("libmypaint" ,libmypaint)
183 ("mypaint-brushes" ,mypaint-brushes)
184 ("exif" ,libexif) ; optional, EXIF + XMP support
185 ("lcms" ,lcms) ; optional, color management
186 ("librsvg" ,librsvg) ; optional, SVG support
187 ("poppler" ,poppler) ; optional, PDF support
188 ("poppler-data" ,poppler-data)
189 ("python" ,python-2) ; optional, Python support
190 ("python2-pygtk" ,python2-pygtk) ; optional, Python support
191 ("gegl" ,gegl)))
192 (native-inputs
193 `(("glib:bin" ,glib "bin") ; for glib-compile-resources and gdbus-codegen
194 ("pkg-config" ,pkg-config)
195 ("intltool" ,intltool)))
196 (home-page "https://www.gimp.org")
197 (synopsis "GNU Image Manipulation Program")
198 (description
199 "GIMP is an application for image manipulation tasks such as photo
200 retouching, composition and authoring. It supports all common image formats
201 as well as specialized ones. It features a highly customizable interface
202 that is extensible via a plugin system.")
203 (license license:gpl3+))) ; some files are lgplv3
204
205 (define-public gimp-fourier
206 (package
207 (name "gimp-fourier")
208 (version "0.4.3-2")
209 (source (origin
210 (method url-fetch)
211 (uri (string-append "http://registry.gimp.org/files/fourier-"
212 version ".tar.gz"))
213 (sha256
214 (base32
215 "1rpacyad678lqgxa3hh2n0zpg4azs8dpa8q079bqsl12812k9184"))))
216 (build-system gnu-build-system)
217 (arguments
218 `(#:tests? #f ;no tests
219 #:phases
220 (modify-phases %standard-phases
221 ;; FIXME: The gegl package only installs "gegl-0.4.pc", but
222 ;; "gimp-2.0.pc" requires "gegl-0.3.pc", so we just copy it.
223 (replace 'configure
224 (lambda* (#:key inputs #:allow-other-keys)
225 (mkdir-p "tmppkgconfig")
226 (copy-file (string-append (assoc-ref inputs "gegl")
227 "/lib/pkgconfig/gegl-0.4.pc")
228 "tmppkgconfig/gegl-0.3.pc")
229 (setenv "PKG_CONFIG_PATH"
230 (string-append "tmppkgconfig:"
231 (or (getenv "PKG_CONFIG_PATH") "")))
232 #t))
233 (add-after 'unpack 'set-prefix
234 (lambda* (#:key outputs #:allow-other-keys)
235 ;; gimptool-2.0 does not allow us to install to any target
236 ;; directory.
237 (let ((target (string-append (assoc-ref outputs "out")
238 "/lib/gimp/"
239 (car (string-split ,(package-version gimp) #\.))
240 ".0/plug-ins")))
241 (substitute* "Makefile"
242 (("\\$\\(PLUGIN_INSTALL\\) fourier")
243 (string-append "cp fourier " target)))
244 (mkdir-p target))
245 #t)))))
246 (inputs
247 `(("fftw" ,fftw)
248 ("gimp" ,gimp)
249 ;; needed by gimp-2.0.pc
250 ("gdk-pixbuf" ,gdk-pixbuf)
251 ("gegl" ,gegl)
252 ("cairo" ,cairo)
253 ("glib" ,glib)
254 ;; needed by gimpui-2.0.pc
255 ("gtk+" ,gtk+-2)))
256 (native-inputs
257 `(("pkg-config" ,pkg-config)))
258 (home-page "https://www.lprp.fr/gimp_plugin_en/#fourier")
259 (synopsis "GIMP plug-in to edit image in fourier space")
260 (description
261 "This package provides a simple plug-in to apply the fourier transform on
262 an image, allowing you to work with the transformed image inside GIMP. You
263 can draw or apply filters in fourier space and get the modified image with an
264 inverse fourier transform.")
265 (license license:gpl3+)))
266
267 (define-public libmypaint
268 (package
269 (name "libmypaint")
270 (version "1.3.0")
271 (source (origin
272 (method url-fetch)
273 (uri (string-append "https://github.com/mypaint/libmypaint/"
274 "releases/download/v" version "/libmypaint-"
275 version ".tar.xz"))
276 (sha256
277 (base32
278 "0wd6jk69vmhsq1mdw96v0fh7b28n3glkr5ca466zcq7agzaxj1va"))))
279 (build-system gnu-build-system)
280 (native-inputs
281 `(("intltool" ,intltool)
282 ("pkg-config" ,pkg-config)))
283 ;; As needed by 'libmypaint.pc'.
284 (propagated-inputs
285 `(("json-c" ,json-c)
286 ("gobject-introspection" ,gobject-introspection)))
287 (inputs
288 `(("glib" ,glib)))
289 (synopsis "Artistic brushes library")
290 (description "Libmypaint, also called \"brushlib\", is a library for making
291 brushstrokes which is used by MyPaint and GIMP.")
292 (home-page "http://mypaint.org")
293 (license license:isc)))
294
295 (define-public mypaint-brushes
296 (package
297 (name "mypaint-brushes")
298 (version "1.3.0")
299 (source (origin
300 (method git-fetch)
301 (uri (git-reference
302 (url "https://github.com/Jehan/mypaint-brushes.git")
303 (commit (string-append "v" version))))
304 (file-name (git-file-name name version))
305 (sha256
306 (base32
307 "1iz89z6v2mp8j1lrf942k561s8311i3s34ap36wh4rybb2lq15m0"))))
308 (build-system gnu-build-system)
309 (arguments
310 `(#:phases
311 (modify-phases %standard-phases
312 (add-after 'unpack 'relax-dependency-version
313 (lambda _
314 (substitute* "autogen.sh"
315 (("automake-1.13") "automake")
316 (("aclocal-1.13") "aclocal"))
317 #t)))))
318 (native-inputs
319 `(("autoconf" ,autoconf)
320 ("automake" ,automake)))
321 (synopsis "Default brushes for MyPaint")
322 (description "This package provides the default set of brushes for
323 MyPaint.")
324 (home-page "https://github.com/Jehan/mypaint-brushes")
325 (license license:cc0)))
326
327 (define-public gimp-resynthesizer
328 ;; GIMP does not respect any plugin search path environment variable, so after
329 ;; installation users have to edit their GIMP settings to include
330 ;; "$HOME/.guix-profile/lib/gimp/2.0/plug-ins/" in
331 ;; “Edit->Preferences->Folders->Plug Ins”.
332 (package
333 (name "gimp-resynthesizer")
334 (version "2.0.3")
335 (source
336 (origin
337 (method url-fetch)
338 (uri (string-append "https://github.com/bootchk/resynthesizer/archive/v"
339 version ".tar.gz"))
340 (sha256
341 (base32
342 "0l3404w6rqny7h3djskxf149gzx6x4qhndgbh3403c9lbh4pi1kr"))
343 (file-name (string-append name "-" version ".tar.gz"))))
344 (build-system gnu-build-system)
345 (arguments
346 `( ;; Turn off tests to avoid:
347 ;; make[1]: *** No rule to make target '../src/resynth-gui.c', needed by 'resynthesizer.pot'. Stop.
348 #:tests? #f
349 #:phases
350 (modify-phases %standard-phases
351 (add-after 'unpack 'set-env
352 (lambda _
353 (setenv "CONFIG_SHELL" (which "sh"))
354 #t))
355 (add-after 'configure 'set-prefix
356 ;; Install plugin under $prefix, not under GIMP's libdir.
357 (lambda* (#:key outputs #:allow-other-keys)
358 (let ((target (string-append (assoc-ref outputs "out")
359 "/lib/gimp/"
360 ,(version-major
361 (package-version gimp))
362 ".0")))
363 (substitute* (list "src/resynthesizer/Makefile"
364 "src/resynthesizer-gui/Makefile")
365 (("GIMP_LIBDIR = .*")
366 (string-append "GIMP_LIBDIR = " target "\n")))
367 (mkdir-p target)
368 #t))))))
369 (native-inputs
370 `(("autoconf" ,autoconf-wrapper)
371 ("automake" ,automake)
372 ("glib" ,glib "bin") ; glib-gettextize
373 ("intltool" ,intltool)
374 ("pkg-config" ,pkg-config)))
375 (inputs
376 `(("gimp" ,gimp)
377 ("gdk-pixbuf" ,gdk-pixbuf) ; needed by gimp-2.0.pc
378 ("cairo" ,cairo)
379 ("gegl" ,gegl)
380 ("gtk+" ,gtk+-2) ; needed by gimpui-2.0.pc
381 ("glib" ,glib)))
382 (home-page "https://github.com/bootchk/resynthesizer")
383 (synopsis "GIMP plugins for texture synthesis")
384 (description
385 "This package provides resynthesizer plugins for GIMP, which encompasses
386 tools for healing selections (content-aware fill), enlarging the canvas and
387 healing the border, increasing the resolution while adding detail, and
388 transferring the style of an image.")
389 (license license:gpl3+)))