gnu: Add mmm.
[jackhill/guix/guix.git] / gnu / packages / gimp.scm
... / ...
CommitLineData
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;;;
10;;; This file is part of GNU Guix.
11;;;
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.
16;;;
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.
21;;;
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/>.
24
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 image)
44 #:use-module (gnu packages ghostscript)
45 #:use-module (gnu packages compression)
46 #:use-module (gnu packages xml)
47 #:use-module (gnu packages pdf)
48 #:use-module (gnu packages photo)
49 #:use-module (gnu packages python)
50 #:use-module (gnu packages web)
51 #:use-module (gnu packages xorg))
52
53(define-public poly2tri-c
54 (package
55 (name "poly2tri-c")
56 (version "0.1.0")
57 (source
58 (origin
59 (method url-fetch)
60 (uri
61 (string-append "https://storage.googleapis.com/"
62 "google-code-archive-source/v2/code.google.com/"
63 "poly2tri-c/source-archive.zip"))
64 (file-name
65 (string-append name "-" version ".zip"))
66 (sha256
67 (base32 "17cw0zhbnf2gb59jm26z0wcarqgdwir9jr1fpi3v9lcvyb2s3mqj"))))
68 (build-system glib-or-gtk-build-system)
69 (outputs '("out" "doc"))
70 (arguments
71 `(#:configure-flags
72 (list
73 "--disable-static")
74 #:phases
75 (modify-phases %standard-phases
76 (add-after 'unpack 'disable-strict-rules
77 (lambda _
78 (substitute* "configure.ac"
79 (("\\$CFLAGS -Wall -ansi -pedantic")
80 "$CFLAGS")
81 (("\\$CFLAGS -Werror")
82 "$CFLAGS"))
83 #t))
84 (add-after 'disable-strict-rules 'fix-build-errors
85 (lambda _
86 (substitute* "poly2tri-c/refine/Makefile.am"
87 (("cdt.c")
88 "rcdt.c")
89 (("cdt.h")
90 "rcdt.h")
91 (("utils.c")
92 "rutils.c")
93 (("utils.h")
94 "rutils.h"))
95 #t))
96 (add-before 'bootstrap 'configure-later
97 (lambda _
98 (setenv "NOCONFIGURE" "set")
99 #t))
100 (add-after 'build 'generate-doc
101 (lambda _
102 (invoke "doxygen")
103 #t))
104 (add-after 'install 'install-doc
105 (lambda* (#:key outputs #:allow-other-keys)
106 (let* ((out (assoc-ref outputs "out"))
107 (doc (assoc-ref outputs "doc")))
108 (copy-recursively
109 "doc"
110 (string-append doc "/share/doc/poly2tri-c"))
111 #t))))))
112 (native-inputs
113 `(("autoconf" ,autoconf)
114 ("automake" ,automake)
115 ("doxygen" ,doxygen)
116 ("libtool" ,libtool)
117 ("pkg-config" ,pkg-config)
118 ("unzip" ,unzip)
119 ("which" ,which)))
120 (propagated-inputs
121 `(("glib" ,glib)))
122 (synopsis "2D constrained Delaunay triangulation library")
123 (description "Poly2Tri-C is a library for generating, refining and rendering
1242-Dimensional Constrained Delaunay Triangulations.")
125 (home-page "https://code.google.com/archive/p/poly2tri-c/")
126 (license license:bsd-3)))
127
128(define-public babl
129 (package
130 (name "babl")
131 (version "0.1.78")
132 (source (origin
133 (method url-fetch)
134 (uri (list (string-append "https://download.gimp.org/pub/babl/"
135 (version-major+minor version)
136 "/babl-" version ".tar.xz")
137 (string-append "https://ftp.gtk.org/pub/babl/"
138 (version-major+minor version)
139 "/babl-" version ".tar.xz")
140 (string-append "ftp://ftp.gtk.org/pub/babl/"
141 (version-major+minor version)
142 "/babl-" version ".tar.xz")))
143 (sha256
144 (base32
145 "0fjjfb0pbgimlqi7rk8cqz8pq595b7gw8nrpkxfmixdz6cv4km8p"))))
146 (build-system meson-build-system)
147 (arguments
148 `(#:configure-flags
149 (list "-Denable-gir=false")))
150 (native-inputs
151 `(("pkg-config" ,pkg-config)))
152 (propagated-inputs
153 ;; Propagated to satisfy ‘babl.pc’.
154 `(("lcms" ,lcms)))
155 (home-page "http://gegl.org/babl/")
156 (synopsis "Image pixel format conversion library")
157 (description
158 "Babl is a dynamic, any-to-any pixel format translation library.
159It allows converting between different methods of storing pixels, known as
160@dfn{pixel formats}, that have different bit depths and other data
161representations, color models, and component permutations.
162
163A vocabulary to formulate new pixel formats from existing primitives is
164provided, as well as a framework to add new color models and data types.")
165 (license license:lgpl3+)))
166
167(define-public gegl
168 (package
169 (name "gegl")
170 (version "0.4.24")
171 (source (origin
172 (method url-fetch)
173 (uri (list (string-append "https://download.gimp.org/pub/gegl/"
174 (string-take version 3)
175 "/gegl-" version ".tar.xz")
176 (string-append "https://ftp.gtk.org/pub/gegl/"
177 (version-major+minor version)
178 "/gegl-" version ".tar.xz")
179 (string-append "ftp://ftp.gtk.org/pub/gegl/"
180 (version-major+minor version)
181 "/gegl-" version ".tar.xz")))
182 (sha256
183 (base32
184 "0ji57s7cba94vzy49agn7x47ca61rccm6rif0cb0s6rl4ygljrbp"))))
185 (build-system meson-build-system)
186 (arguments
187 `(#:configure-flags
188 (list "-Dintrospection=false")))
189 ;; These are propagated to satisfy 'gegl-0.4.pc'.
190 (propagated-inputs
191 `(("babl" ,babl)
192 ("glib" ,glib)
193 ("json-glib" ,json-glib)))
194 (inputs
195 `(("cairo" ,cairo)
196 ("pango" ,pango)
197 ("libpng" ,libpng)
198 ("libjpeg" ,libjpeg-turbo)))
199 (native-inputs
200 `(("pkg-config" ,pkg-config)
201 ("glib" ,glib "bin") ; for gtester
202 ("intltool" ,intltool)))
203 (home-page "http://gegl.org")
204 (synopsis "Graph based image processing framework")
205 (description "GEGL (Generic Graphics Library) provides infrastructure to
206do demand based cached non destructive image editing on larger than RAM
207buffers.")
208 ;; The library itself is licensed under LGPL while the sample commandline
209 ;; application and GUI binary gegl is licensed under GPL.
210 (license (list license:lgpl3+ license:gpl3+))))
211
212(define-public gimp
213 (package
214 (name "gimp")
215 (version "2.10.20")
216 (source (origin
217 (method url-fetch)
218 (uri (string-append "https://download.gimp.org/pub/gimp/v"
219 (version-major+minor version)
220 "/gimp-" version ".tar.bz2"))
221 (sha256
222 (base32
223 "0g3vzh1bjffqx94mfghmwvkhncv71cgah2mnfx17q00s9f3rybz1"))))
224 (build-system gnu-build-system)
225 (outputs '("out"
226 "doc")) ; 9 MiB of gtk-doc HTML
227 (arguments
228 '(#:configure-flags
229 (list (string-append "--with-html-dir="
230 (assoc-ref %outputs "doc")
231 "/share/gtk-doc/html")
232
233 ;; Prevent the build system from running 'gtk-update-icon-cache'
234 ;; which is not needed during the build because Guix runs it at
235 ;; profile creation time.
236 "ac_cv_path_GTK_UPDATE_ICON_CACHE=true"
237
238 ;; Disable automatic network request on startup to check for
239 ;; version updates.
240 "--disable-check-update"
241
242 ;; ./configure requests not to annoy upstream with packaging bugs.
243 "--with-bug-report-url=https://bugs.gnu.org/guix")
244 #:phases
245 (modify-phases %standard-phases
246 (add-after 'install 'install-sitecustomize.py
247 ;; Install 'sitecustomize.py' into gimp's python directory to
248 ;; add pygobject and pygtk to pygimp's search path.
249 (lambda* (#:key outputs #:allow-other-keys)
250 (let* ((pythonpath (getenv "PYTHONPATH"))
251 (out (assoc-ref outputs "out"))
252 (sitecustomize.py
253 (string-append
254 out "/lib/gimp/2.0/python/sitecustomize.py")))
255 (call-with-output-file sitecustomize.py
256 (lambda (port)
257 (format port "import site~%")
258 (format port "for dir in '~a'.split(':'):~%" pythonpath)
259 (format port " site.addsitedir(dir)~%")))))))))
260 (inputs
261 `(("babl" ,babl)
262 ("glib" ,glib)
263 ("glib-networking" ,glib-networking)
264 ("libtiff" ,libtiff)
265 ("libwebp" ,libwebp)
266 ("libjpeg" ,libjpeg-turbo)
267 ("atk" ,atk)
268 ("gexiv2" ,gexiv2)
269 ("gtk+" ,gtk+-2)
270 ("libmypaint" ,libmypaint)
271 ("mypaint-brushes" ,mypaint-brushes-1.3)
272 ("exif" ,libexif) ; optional, EXIF + XMP support
273 ("lcms" ,lcms) ; optional, color management
274 ("librsvg" ,librsvg) ; optional, SVG support
275 ("poppler" ,poppler) ; optional, PDF support
276 ("poppler-data" ,poppler-data)
277 ("python" ,python-2) ; optional, Python support
278 ("python2-pygtk" ,python2-pygtk) ; optional, Python support
279 ("gegl" ,gegl)))
280 (native-inputs
281 `(("glib:bin" ,glib "bin") ; for glib-compile-resources and gdbus-codegen
282 ("pkg-config" ,pkg-config)
283 ("intltool" ,intltool)))
284 (home-page "https://www.gimp.org")
285 (synopsis "GNU Image Manipulation Program")
286 (description
287 "GIMP is an application for image manipulation tasks such as photo
288retouching, composition and authoring. It supports all common image formats
289as well as specialized ones. It features a highly customizable interface
290that is extensible via a plugin system.")
291 (license license:gpl3+))) ; some files are lgplv3
292
293(define-public gimp-fourier
294 (package
295 (name "gimp-fourier")
296 (version "0.4.3-2")
297 (source (origin
298 (method url-fetch)
299 (uri (string-append "http://registry.gimp.org/files/fourier-"
300 version ".tar.gz"))
301 (sha256
302 (base32
303 "1rpacyad678lqgxa3hh2n0zpg4azs8dpa8q079bqsl12812k9184"))))
304 (build-system gnu-build-system)
305 (arguments
306 `(#:tests? #f ;no tests
307 #:phases
308 (modify-phases %standard-phases
309 ;; FIXME: The gegl package only installs "gegl-0.4.pc", but
310 ;; "gimp-2.0.pc" requires "gegl-0.3.pc", so we just copy it.
311 (replace 'configure
312 (lambda* (#:key inputs #:allow-other-keys)
313 (mkdir-p "tmppkgconfig")
314 (copy-file (string-append (assoc-ref inputs "gegl")
315 "/lib/pkgconfig/gegl-0.4.pc")
316 "tmppkgconfig/gegl-0.3.pc")
317 (setenv "PKG_CONFIG_PATH"
318 (string-append "tmppkgconfig:"
319 (or (getenv "PKG_CONFIG_PATH") "")))
320 #t))
321 (add-after 'unpack 'set-prefix
322 (lambda* (#:key outputs #:allow-other-keys)
323 ;; gimptool-2.0 does not allow us to install to any target
324 ;; directory.
325 (let ((target (string-append (assoc-ref outputs "out")
326 "/lib/gimp/"
327 (car (string-split ,(package-version gimp) #\.))
328 ".0/plug-ins")))
329 (substitute* "Makefile"
330 (("\\$\\(PLUGIN_INSTALL\\) fourier")
331 (string-append "cp fourier " target)))
332 (mkdir-p target))
333 #t)))))
334 (inputs
335 `(("fftw" ,fftw)
336 ("gimp" ,gimp)
337 ;; needed by gimp-2.0.pc
338 ("gdk-pixbuf" ,gdk-pixbuf)
339 ("gegl" ,gegl)
340 ("cairo" ,cairo)
341 ("glib" ,glib)
342 ;; needed by gimpui-2.0.pc
343 ("gtk+" ,gtk+-2)))
344 (native-inputs
345 `(("pkg-config" ,pkg-config)))
346 (home-page "https://www.lprp.fr/gimp_plugin_en/#fourier")
347 (synopsis "GIMP plug-in to edit image in fourier space")
348 (description
349 "This package provides a simple plug-in to apply the fourier transform on
350an image, allowing you to work with the transformed image inside GIMP. You
351can draw or apply filters in fourier space and get the modified image with an
352inverse fourier transform.")
353 (license license:gpl3+)))
354
355(define-public libmypaint
356 (package
357 (name "libmypaint")
358 (version "1.5.1")
359 (source (origin
360 (method url-fetch)
361 (uri (string-append "https://github.com/mypaint/libmypaint/"
362 "releases/download/v" version "/libmypaint-"
363 version ".tar.xz"))
364 (sha256
365 (base32
366 "0aqcv4fyscpfhknxgfpq0v84aj2nzigqvpi4zgv2zkl41h51by5f"))))
367 (build-system gnu-build-system)
368 (native-inputs
369 `(("intltool" ,intltool)
370 ("pkg-config" ,pkg-config)))
371 ;; As needed by 'libmypaint.pc'.
372 (propagated-inputs
373 `(("json-c" ,json-c)
374 ("gobject-introspection" ,gobject-introspection)))
375 (inputs
376 `(("glib" ,glib)))
377 (synopsis "Artistic brushes library")
378 (description "Libmypaint, also called \"brushlib\", is a library for making
379brushstrokes which is used by MyPaint and GIMP.")
380 (home-page "http://mypaint.org")
381 (license license:isc)))
382
383(define-public mypaint-brushes
384 (package
385 (name "mypaint-brushes")
386 (version "2.0.2")
387 (source
388 (origin
389 (method git-fetch)
390 (uri (git-reference
391 (url "https://github.com/mypaint/mypaint-brushes")
392 (commit (string-append "v" version))))
393 (file-name (git-file-name name version))
394 (sha256
395 (base32 "0kcqz13vzpy24dhmrx9hbs6s7hqb8y305vciznm15h277sabpmw9"))))
396 (build-system gnu-build-system)
397 (native-inputs
398 `(("autoconf" ,autoconf)
399 ("automake" ,automake)))
400 (synopsis "Default brushes for MyPaint")
401 (description "This package provides the default set of brushes for
402MyPaint.")
403 (home-page "https://github.com/mypaint/mypaint-brushes/")
404 ;; Scripts are distributed under GPL2+ terms, brushes are provided as
405 ;; public domain or under CC0 terms.
406 (license (list license:gpl2+ license:cc0 license:public-domain))))
407
408(define-public mypaint-brushes-1.3
409 (package
410 (inherit mypaint-brushes)
411 (name "mypaint-brushes")
412 (version "1.3.1")
413 (source
414 (origin
415 (method git-fetch)
416 (uri (git-reference
417 (url "https://github.com/mypaint/mypaint-brushes")
418 (commit (string-append "v" version))))
419 (file-name (git-file-name name version))
420 (sha256
421 (base32 "1c95l1vfz7sbrdlzrbz7h1p6s1k113kyjfd9wfnxlm0p6562cz3j"))))))
422
423(define-public gimp-resynthesizer
424 ;; GIMP does not respect any plugin search path environment variable, so after
425 ;; installation users have to edit their GIMP settings to include
426 ;; "$HOME/.guix-profile/lib/gimp/2.0/plug-ins/" in
427 ;; “Edit->Preferences->Folders->Plug Ins”.
428 (package
429 (name "gimp-resynthesizer")
430 (version "2.0.3")
431 (source
432 (origin
433 (method git-fetch)
434 (uri (git-reference
435 (url "https://github.com/bootchk/resynthesizer")
436 (commit (string-append "v" version))))
437 (sha256
438 (base32
439 "1jwc8bhhm21xhrgw56nzbma6fwg59gc8anlmyns7jdiw83y0zx3j"))
440 (file-name (git-file-name name version))))
441 (build-system gnu-build-system)
442 (arguments
443 `( ;; Turn off tests to avoid:
444 ;; make[1]: *** No rule to make target '../src/resynth-gui.c', needed by 'resynthesizer.pot'. Stop.
445 #:tests? #f
446 #:phases
447 (modify-phases %standard-phases
448 (add-after 'unpack 'set-env
449 (lambda _
450 (setenv "CONFIG_SHELL" (which "sh"))
451 #t))
452 (add-after 'configure 'set-prefix
453 ;; Install plugin under $prefix, not under GIMP's libdir.
454 (lambda* (#:key outputs #:allow-other-keys)
455 (let ((target (string-append (assoc-ref outputs "out")
456 "/lib/gimp/"
457 ,(version-major
458 (package-version gimp))
459 ".0")))
460 (substitute* (list "src/resynthesizer/Makefile"
461 "src/resynthesizer-gui/Makefile")
462 (("GIMP_LIBDIR = .*")
463 (string-append "GIMP_LIBDIR = " target "\n")))
464 (mkdir-p target)
465 #t))))))
466 (native-inputs
467 `(("autoconf" ,autoconf-wrapper)
468 ("automake" ,automake)
469 ("glib" ,glib "bin") ; glib-gettextize
470 ("intltool" ,intltool)
471 ("pkg-config" ,pkg-config)))
472 (inputs
473 `(("gimp" ,gimp)
474 ("gdk-pixbuf" ,gdk-pixbuf) ; needed by gimp-2.0.pc
475 ("cairo" ,cairo)
476 ("gegl" ,gegl)
477 ("gtk+" ,gtk+-2) ; needed by gimpui-2.0.pc
478 ("glib" ,glib)))
479 (home-page "https://github.com/bootchk/resynthesizer")
480 (synopsis "GIMP plugins for texture synthesis")
481 (description
482 "This package provides resynthesizer plugins for GIMP, which encompasses
483tools for healing selections (content-aware fill), enlarging the canvas and
484healing the border, increasing the resolution while adding detail, and
485transferring the style of an image.")
486 (license license:gpl3+)))