gnu: r-maldiquant: Move to (gnu packages cran).
[jackhill/guix/guix.git] / gnu / packages / gimp.scm
CommitLineData
a37b8077 1;;; GNU Guix --- Functional package management for GNU
30347040 2;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org>
b2086776 3;;; Copyright © 2016, 2018 Ricardo Wurmus <rekado@elephly.net>
ec37ff19 4;;; Copyright © 2016, 2017, 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
e60969d5 5;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
9eecf9bc 6;;; Copyright © 2018 Leo Famulari <leo@famulari.name>
65b8d610 7;;; Copyright © 2018 Thorsten Wilms <t_w_@freenet.de>
ef4c5a41 8;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
a37b8077
LC
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)
e5bbfc7d 28 #:use-module (guix git-download)
1d6c6af0 29 #:use-module (guix utils)
b5b73a82 30 #:use-module ((guix licenses) #:prefix license:)
a37b8077 31 #:use-module (guix build-system gnu)
30347040 32 #:use-module (guix build-system glib-or-gtk)
54a114db 33 #:use-module (guix build-system meson)
5f1ba089 34 #:use-module (gnu packages)
1d6c6af0 35 #:use-module (gnu packages algebra)
4b5c056a 36 #:use-module (gnu packages autotools)
64976b9b
RG
37 #:use-module (gnu packages base)
38 #:use-module (gnu packages documentation)
a37b8077
LC
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)
d4cb5347 43 #:use-module (gnu packages graphics)
e55354b8 44 #:use-module (gnu packages image)
793bcc19 45 #:use-module (gnu packages ghostscript)
a37b8077
LC
46 #:use-module (gnu packages compression)
47 #:use-module (gnu packages xml)
d4cb5347
RG
48 #:use-module (gnu packages linux)
49 #:use-module (gnu packages ncurses)
50 #:use-module (gnu packages patchutils)
61551868 51 #:use-module (gnu packages pdf)
a37b8077 52 #:use-module (gnu packages photo)
9c8bd626 53 #:use-module (gnu packages python)
657687d3 54 #:use-module (gnu packages web)
7988af99 55 #:use-module (gnu packages xorg))
a37b8077 56
64976b9b
RG
57(define-public poly2tri-c
58 (package
59 (name "poly2tri-c")
60 (version "0.1.0")
61 (source
62 (origin
63 (method url-fetch)
64 (uri
65 (string-append "https://storage.googleapis.com/"
66 "google-code-archive-source/v2/code.google.com/"
67 "poly2tri-c/source-archive.zip"))
68 (file-name
69 (string-append name "-" version ".zip"))
70 (sha256
71 (base32 "17cw0zhbnf2gb59jm26z0wcarqgdwir9jr1fpi3v9lcvyb2s3mqj"))))
72 (build-system glib-or-gtk-build-system)
73 (outputs '("out" "doc"))
74 (arguments
75 `(#:configure-flags
76 (list
77 "--disable-static")
78 #:phases
79 (modify-phases %standard-phases
80 (add-after 'unpack 'disable-strict-rules
81 (lambda _
82 (substitute* "configure.ac"
83 (("\\$CFLAGS -Wall -ansi -pedantic")
84 "$CFLAGS")
85 (("\\$CFLAGS -Werror")
86 "$CFLAGS"))
87 #t))
88 (add-after 'disable-strict-rules 'fix-build-errors
89 (lambda _
90 (substitute* "poly2tri-c/refine/Makefile.am"
91 (("cdt.c")
92 "rcdt.c")
93 (("cdt.h")
94 "rcdt.h")
95 (("utils.c")
96 "rutils.c")
97 (("utils.h")
98 "rutils.h"))
99 #t))
100 (add-before 'bootstrap 'configure-later
101 (lambda _
102 (setenv "NOCONFIGURE" "set")
103 #t))
104 (add-after 'build 'generate-doc
105 (lambda _
106 (invoke "doxygen")
107 #t))
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")))
112 (copy-recursively
113 "doc"
114 (string-append doc "/share/doc/poly2tri-c"))
115 #t))))))
116 (native-inputs
117 `(("autoconf" ,autoconf)
118 ("automake" ,automake)
119 ("doxygen" ,doxygen)
120 ("libtool" ,libtool)
121 ("pkg-config" ,pkg-config)
122 ("unzip" ,unzip)
123 ("which" ,which)))
124 (propagated-inputs
125 `(("glib" ,glib)))
126 (synopsis "2D constrained Delaunay triangulation library")
127 (description "Poly2Tri-C is a library for generating, refining and rendering
1282-Dimensional Constrained Delaunay Triangulations.")
129 (home-page "https://code.google.com/archive/p/poly2tri-c/")
130 (license license:bsd-3)))
131
d4cb5347
RG
132(define-public mrg
133 (package
134 (name "mrg")
135 (version "0.1.4")
136 (source
137 (origin
138 (method git-fetch)
139 (uri
140 (git-reference
141 (url "https://github.com/hodefoting/mrg.git")
142 (commit version)))
143 (file-name
144 (git-file-name name version))
145 (sha256
146 (base32 "106qhh0c11576cc5kh90ds0ram72d3r6n9sadw0y4krnhap6dvwk"))))
147 (build-system meson-build-system)
148 (arguments
149 `(#:glib-or-gtk? #t)) ; To wrap binaries and/or compile schemas
150 (native-inputs
151 `(("pkg-config" ,pkg-config)))
152 (propagated-inputs
153 `(("alsa" ,alsa-lib)
154 ("cairo" ,cairo)
155 ("gtk+" ,gtk+)
156 ("mmm" ,mmm)
157 ("x11" ,libx11)))
158 (synopsis "Microraptor GUI")
159 (description "MrG is is a C API for creating user interfaces. It can be
160used as an application writing environment or as an interactive canvas for part
161of a larger interface.")
162 (home-page "https://github.com/hodefoting/mrg")
163 (license license:lgpl2.0+)))
164
a37b8077
LC
165(define-public babl
166 (package
167 (name "babl")
ee385c58 168 (version "0.1.78")
a37b8077
LC
169 (source (origin
170 (method url-fetch)
e70dc63a 171 (uri (list (string-append "https://download.gimp.org/pub/babl/"
9d2e56d0 172 (version-major+minor version)
54a114db 173 "/babl-" version ".tar.xz")
24d6cc1d 174 (string-append "https://ftp.gtk.org/pub/babl/"
9d2e56d0 175 (version-major+minor version)
54a114db 176 "/babl-" version ".tar.xz")
9d2e56d0
TGR
177 (string-append "ftp://ftp.gtk.org/pub/babl/"
178 (version-major+minor version)
54a114db 179 "/babl-" version ".tar.xz")))
a37b8077
LC
180 (sha256
181 (base32
ee385c58 182 "0fjjfb0pbgimlqi7rk8cqz8pq595b7gw8nrpkxfmixdz6cv4km8p"))))
54a114db
TGR
183 (build-system meson-build-system)
184 (arguments
185 `(#:configure-flags
186 (list "-Denable-gir=false")))
187 (native-inputs
188 `(("pkg-config" ,pkg-config)))
189 (propagated-inputs
190 ;; Propagated to satisfy ‘babl.pc’.
191 `(("lcms" ,lcms)))
a37b8077
LC
192 (home-page "http://gegl.org/babl/")
193 (synopsis "Image pixel format conversion library")
194 (description
0c8ac76c
TGR
195 "Babl is a dynamic, any-to-any pixel format translation library.
196It allows converting between different methods of storing pixels, known as
197@dfn{pixel formats}, that have different bit depths and other data
198representations, color models, and component permutations.
a37b8077
LC
199
200A vocabulary to formulate new pixel formats from existing primitives is
0c8ac76c 201provided, as well as a framework to add new color models and data types.")
a37b8077 202 (license license:lgpl3+)))
12c0f32a
JD
203
204(define-public gegl
205 (package
206 (name "gegl")
e76d1907 207 (version "0.4.24")
12c0f32a
JD
208 (source (origin
209 (method url-fetch)
f62633ca 210 (uri (list (string-append "https://download.gimp.org/pub/gegl/"
12c0f32a 211 (string-take version 3)
bd70db6e
TGR
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")))
12c0f32a
JD
219 (sha256
220 (base32
e76d1907 221 "0ji57s7cba94vzy49agn7x47ca61rccm6rif0cb0s6rl4ygljrbp"))))
51282524 222 (build-system meson-build-system)
12c0f32a 223 (arguments
51282524
TGR
224 `(#:configure-flags
225 (list "-Dintrospection=false")))
f62633ca
LF
226 ;; These are propagated to satisfy 'gegl-0.4.pc'.
227 (propagated-inputs
12c0f32a
JD
228 `(("babl" ,babl)
229 ("glib" ,glib)
f62633ca
LF
230 ("json-glib" ,json-glib)))
231 (inputs
232 `(("cairo" ,cairo)
12c0f32a
JD
233 ("pango" ,pango)
234 ("libpng" ,libpng)
4bd428a7 235 ("libjpeg" ,libjpeg-turbo)))
12c0f32a
JD
236 (native-inputs
237 `(("pkg-config" ,pkg-config)
9fd571a2 238 ("glib" ,glib "bin") ; for gtester
12c0f32a
JD
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
243do demand based cached non destructive image editing on larger than RAM
244buffers.")
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+))))
248
249(define-public gimp
250 (package
251 (name "gimp")
483ce0d3 252 (version "2.10.20")
12c0f32a
JD
253 (source (origin
254 (method url-fetch)
9eecf9bc 255 (uri (string-append "https://download.gimp.org/pub/gimp/v"
a5dd8db4
EF
256 (version-major+minor version)
257 "/gimp-" version ".tar.bz2"))
12c0f32a
JD
258 (sha256
259 (base32
483ce0d3 260 "0g3vzh1bjffqx94mfghmwvkhncv71cgah2mnfx17q00s9f3rybz1"))))
12c0f32a 261 (build-system gnu-build-system)
be4fbbe0 262 (outputs '("out"
b3450251 263 "doc")) ; 9 MiB of gtk-doc HTML
be4fbbe0 264 (arguments
cb4baa4d
TGR
265 '(#:configure-flags
266 (list (string-append "--with-html-dir="
267 (assoc-ref %outputs "doc")
268 "/share/gtk-doc/html")
27783023 269
ef4c5a41
MB
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"
27783023 274
a7cc13ed
JH
275 ;; Disable automatic network request on startup to check for
276 ;; version updates.
277 "--disable-check-update"
27783023 278
cb4baa4d
TGR
279 ;; ./configure requests not to annoy upstream with packaging bugs.
280 "--with-bug-report-url=https://bugs.gnu.org/guix")
580dfc33
SB
281 #:phases
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"))
289 (sitecustomize.py
290 (string-append
291 out "/lib/gimp/2.0/python/sitecustomize.py")))
292 (call-with-output-file sitecustomize.py
293 (lambda (port)
294 (format port "import site~%")
295 (format port "for dir in '~a'.split(':'):~%" pythonpath)
296 (format port " site.addsitedir(dir)~%")))))))))
12c0f32a
JD
297 (inputs
298 `(("babl" ,babl)
299 ("glib" ,glib)
9eecf9bc 300 ("glib-networking" ,glib-networking)
12c0f32a 301 ("libtiff" ,libtiff)
5a8adc6d 302 ("libwebp" ,libwebp)
4bd428a7 303 ("libjpeg" ,libjpeg-turbo)
12c0f32a 304 ("atk" ,atk)
9eecf9bc 305 ("gexiv2" ,gexiv2)
12c0f32a 306 ("gtk+" ,gtk+-2)
9eecf9bc 307 ("libmypaint" ,libmypaint)
db79c150 308 ("mypaint-brushes" ,mypaint-brushes-1.3)
c695fb76
TGR
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
9eecf9bc 313 ("poppler-data" ,poppler-data)
c695fb76
TGR
314 ("python" ,python-2) ; optional, Python support
315 ("python2-pygtk" ,python2-pygtk) ; optional, Python support
12c0f32a
JD
316 ("gegl" ,gegl)))
317 (native-inputs
9eecf9bc
LF
318 `(("glib:bin" ,glib "bin") ; for glib-compile-resources and gdbus-codegen
319 ("pkg-config" ,pkg-config)
12c0f32a 320 ("intltool" ,intltool)))
9eecf9bc 321 (home-page "https://www.gimp.org")
66672a45
LC
322 (synopsis "GNU Image Manipulation Program")
323 (description
324 "GIMP is an application for image manipulation tasks such as photo
325retouching, composition and authoring. It supports all common image formats
326as well as specialized ones. It features a highly customizable interface
327that is extensible via a plugin system.")
12c0f32a 328 (license license:gpl3+))) ; some files are lgplv3
1d6c6af0
RW
329
330(define-public gimp-fourier
331 (package
332 (name "gimp-fourier")
333 (version "0.4.3-2")
334 (source (origin
335 (method url-fetch)
336 (uri (string-append "http://registry.gimp.org/files/fourier-"
337 version ".tar.gz"))
338 (sha256
339 (base32
340 "1rpacyad678lqgxa3hh2n0zpg4azs8dpa8q079bqsl12812k9184"))))
341 (build-system gnu-build-system)
342 (arguments
343 `(#:tests? #f ;no tests
344 #:phases
345 (modify-phases %standard-phases
b2086776
RW
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.
348 (replace 'configure
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") "")))
357 #t))
1d6c6af0
RW
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
361 ;; directory.
362 (let ((target (string-append (assoc-ref outputs "out")
363 "/lib/gimp/"
364 (car (string-split ,(package-version gimp) #\.))
365 ".0/plug-ins")))
366 (substitute* "Makefile"
367 (("\\$\\(PLUGIN_INSTALL\\) fourier")
368 (string-append "cp fourier " target)))
369 (mkdir-p target))
370 #t)))))
371 (inputs
372 `(("fftw" ,fftw)
373 ("gimp" ,gimp)
374 ;; needed by gimp-2.0.pc
375 ("gdk-pixbuf" ,gdk-pixbuf)
b2086776 376 ("gegl" ,gegl)
1d6c6af0
RW
377 ("cairo" ,cairo)
378 ("glib" ,glib)
379 ;; needed by gimpui-2.0.pc
380 ("gtk+" ,gtk+-2)))
381 (native-inputs
382 `(("pkg-config" ,pkg-config)))
84877c8a 383 (home-page "https://www.lprp.fr/gimp_plugin_en/#fourier")
1d6c6af0
RW
384 (synopsis "GIMP plug-in to edit image in fourier space")
385 (description
386 "This package provides a simple plug-in to apply the fourier transform on
387an image, allowing you to work with the transformed image inside GIMP. You
388can draw or apply filters in fourier space and get the modified image with an
389inverse fourier transform.")
390 (license license:gpl3+)))
657687d3
LF
391
392(define-public libmypaint
393 (package
394 (name "libmypaint")
ec37ff19 395 (version "1.5.1")
657687d3
LF
396 (source (origin
397 (method url-fetch)
398 (uri (string-append "https://github.com/mypaint/libmypaint/"
399 "releases/download/v" version "/libmypaint-"
400 version ".tar.xz"))
401 (sha256
402 (base32
ec37ff19 403 "0aqcv4fyscpfhknxgfpq0v84aj2nzigqvpi4zgv2zkl41h51by5f"))))
657687d3
LF
404 (build-system gnu-build-system)
405 (native-inputs
406 `(("intltool" ,intltool)
407 ("pkg-config" ,pkg-config)))
408 ;; As needed by 'libmypaint.pc'.
409 (propagated-inputs
410 `(("json-c" ,json-c)
411 ("gobject-introspection" ,gobject-introspection)))
412 (inputs
413 `(("glib" ,glib)))
414 (synopsis "Artistic brushes library")
415 (description "Libmypaint, also called \"brushlib\", is a library for making
416brushstrokes which is used by MyPaint and GIMP.")
417 (home-page "http://mypaint.org")
418 (license license:isc)))
4b5c056a
LF
419
420(define-public mypaint-brushes
421 (package
422 (name "mypaint-brushes")
db79c150
NG
423 (version "2.0.2")
424 (source
425 (origin
426 (method git-fetch)
427 (uri (git-reference
b0e7b699 428 (url "https://github.com/mypaint/mypaint-brushes")
db79c150
NG
429 (commit (string-append "v" version))))
430 (file-name (git-file-name name version))
431 (sha256
432 (base32 "0kcqz13vzpy24dhmrx9hbs6s7hqb8y305vciznm15h277sabpmw9"))))
4b5c056a 433 (build-system gnu-build-system)
4b5c056a
LF
434 (native-inputs
435 `(("autoconf" ,autoconf)
436 ("automake" ,automake)))
437 (synopsis "Default brushes for MyPaint")
438 (description "This package provides the default set of brushes for
439MyPaint.")
db79c150
NG
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))))
444
445(define-public mypaint-brushes-1.3
446 (package
447 (inherit mypaint-brushes)
448 (name "mypaint-brushes")
449 (version "1.3.1")
450 (source
451 (origin
452 (method git-fetch)
453 (uri (git-reference
b0e7b699 454 (url "https://github.com/mypaint/mypaint-brushes")
db79c150
NG
455 (commit (string-append "v" version))))
456 (file-name (git-file-name name version))
457 (sha256
458 (base32 "1c95l1vfz7sbrdlzrbz7h1p6s1k113kyjfd9wfnxlm0p6562cz3j"))))))
65b8d610
TW
459
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”.
465 (package
466 (name "gimp-resynthesizer")
467 (version "2.0.3")
468 (source
469 (origin
48e961a5
EF
470 (method git-fetch)
471 (uri (git-reference
472 (url "https://github.com/bootchk/resynthesizer")
473 (commit (string-append "v" version))))
65b8d610
TW
474 (sha256
475 (base32
48e961a5
EF
476 "1jwc8bhhm21xhrgw56nzbma6fwg59gc8anlmyns7jdiw83y0zx3j"))
477 (file-name (git-file-name name version))))
65b8d610
TW
478 (build-system gnu-build-system)
479 (arguments
480 `( ;; Turn off tests to avoid:
481 ;; make[1]: *** No rule to make target '../src/resynth-gui.c', needed by 'resynthesizer.pot'. Stop.
482 #:tests? #f
483 #:phases
484 (modify-phases %standard-phases
48e961a5
EF
485 (add-after 'unpack 'set-env
486 (lambda _
487 (setenv "CONFIG_SHELL" (which "sh"))
488 #t))
489 (add-after 'configure 'set-prefix
65b8d610
TW
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")
493 "/lib/gimp/"
494 ,(version-major
495 (package-version gimp))
496 ".0")))
497 (substitute* (list "src/resynthesizer/Makefile"
48e961a5
EF
498 "src/resynthesizer-gui/Makefile")
499 (("GIMP_LIBDIR = .*")
65b8d610
TW
500 (string-append "GIMP_LIBDIR = " target "\n")))
501 (mkdir-p target)
502 #t))))))
503 (native-inputs
504 `(("autoconf" ,autoconf-wrapper)
505 ("automake" ,automake)
506 ("glib" ,glib "bin") ; glib-gettextize
507 ("intltool" ,intltool)
508 ("pkg-config" ,pkg-config)))
509 (inputs
510 `(("gimp" ,gimp)
511 ("gdk-pixbuf" ,gdk-pixbuf) ; needed by gimp-2.0.pc
512 ("cairo" ,cairo)
513 ("gegl" ,gegl)
514 ("gtk+" ,gtk+-2) ; needed by gimpui-2.0.pc
515 ("glib" ,glib)))
516 (home-page "https://github.com/bootchk/resynthesizer")
517 (synopsis "GIMP plugins for texture synthesis")
518 (description
519 "This package provides resynthesizer plugins for GIMP, which encompasses
520tools for healing selections (content-aware fill), enlarging the canvas and
521healing the border, increasing the resolution while adding detail, and
f714bb3d 522transferring the style of an image.")
65b8d610 523 (license license:gpl3+)))