gnu: Add external-program.
[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>
cb570156 4;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
fb2d54ec 5;;; Copyright © 2018, 2019 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>
a37b8077
LC
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)
e5bbfc7d 27 #:use-module (guix git-download)
1d6c6af0 28 #:use-module (guix utils)
b5b73a82 29 #:use-module ((guix licenses) #:prefix license:)
a37b8077 30 #:use-module (guix build-system gnu)
30347040 31 #:use-module (guix build-system glib-or-gtk)
54a114db 32 #:use-module (guix build-system meson)
5f1ba089 33 #:use-module (gnu packages)
1d6c6af0 34 #:use-module (gnu packages algebra)
4b5c056a 35 #:use-module (gnu packages autotools)
a37b8077
LC
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)
e55354b8 40 #:use-module (gnu packages image)
793bcc19 41 #:use-module (gnu packages ghostscript)
a37b8077
LC
42 #:use-module (gnu packages compression)
43 #:use-module (gnu packages xml)
61551868 44 #:use-module (gnu packages pdf)
a37b8077 45 #:use-module (gnu packages photo)
9c8bd626 46 #:use-module (gnu packages python)
657687d3 47 #:use-module (gnu packages web)
7988af99 48 #:use-module (gnu packages xorg))
a37b8077
LC
49
50(define-public babl
51 (package
52 (name "babl")
54a114db 53 (version "0.1.72")
a37b8077
LC
54 (source (origin
55 (method url-fetch)
e70dc63a 56 (uri (list (string-append "https://download.gimp.org/pub/babl/"
9d2e56d0 57 (version-major+minor version)
54a114db 58 "/babl-" version ".tar.xz")
24d6cc1d 59 (string-append "https://ftp.gtk.org/pub/babl/"
9d2e56d0 60 (version-major+minor version)
54a114db 61 "/babl-" version ".tar.xz")
9d2e56d0
TGR
62 (string-append "ftp://ftp.gtk.org/pub/babl/"
63 (version-major+minor version)
54a114db 64 "/babl-" version ".tar.xz")))
a37b8077
LC
65 (sha256
66 (base32
54a114db
TGR
67 "0hkagjrnza77aasa1kss5hvy37ndm50y6i7hkdn2z8hzgc4i3qb4"))))
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)))
a37b8077
LC
77 (home-page "http://gegl.org/babl/")
78 (synopsis "Image pixel format conversion library")
79 (description
0c8ac76c
TGR
80 "Babl is a dynamic, any-to-any pixel format translation library.
81It allows converting between different methods of storing pixels, known as
82@dfn{pixel formats}, that have different bit depths and other data
83representations, color models, and component permutations.
a37b8077
LC
84
85A vocabulary to formulate new pixel formats from existing primitives is
0c8ac76c 86provided, as well as a framework to add new color models and data types.")
a37b8077 87 (license license:lgpl3+)))
12c0f32a
JD
88
89(define-public gegl
90 (package
91 (name "gegl")
51282524 92 (version "0.4.18")
12c0f32a
JD
93 (source (origin
94 (method url-fetch)
f62633ca 95 (uri (list (string-append "https://download.gimp.org/pub/gegl/"
12c0f32a 96 (string-take version 3)
bd70db6e
TGR
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")))
12c0f32a
JD
104 (sha256
105 (base32
51282524
TGR
106 "0r6akqnrkvxizyhyi8sv40mxm7j4bcwjb6mqjpxy0zzbbfsdyin9"))))
107 (build-system meson-build-system)
12c0f32a 108 (arguments
51282524
TGR
109 `(#:configure-flags
110 (list "-Dintrospection=false")))
f62633ca
LF
111 ;; These are propagated to satisfy 'gegl-0.4.pc'.
112 (propagated-inputs
12c0f32a
JD
113 `(("babl" ,babl)
114 ("glib" ,glib)
f62633ca
LF
115 ("json-glib" ,json-glib)))
116 (inputs
117 `(("cairo" ,cairo)
12c0f32a
JD
118 ("pango" ,pango)
119 ("libpng" ,libpng)
cb570156 120 ("libjpeg" ,libjpeg)))
12c0f32a
JD
121 (native-inputs
122 `(("pkg-config" ,pkg-config)
9fd571a2 123 ("glib" ,glib "bin") ; for gtester
12c0f32a
JD
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
128do demand based cached non destructive image editing on larger than RAM
129buffers.")
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")
4c003c5f 137 (version "2.10.14")
12c0f32a
JD
138 (source (origin
139 (method url-fetch)
9eecf9bc 140 (uri (string-append "https://download.gimp.org/pub/gimp/v"
a5dd8db4
EF
141 (version-major+minor version)
142 "/gimp-" version ".tar.bz2"))
12c0f32a
JD
143 (sha256
144 (base32
4c003c5f 145 "0m6wdnfvsxyhimdd4v3351g4r1fklllnbipbwcfym3h7q88hz6yz"))))
12c0f32a 146 (build-system gnu-build-system)
be4fbbe0 147 (outputs '("out"
b3450251 148 "doc")) ; 9 MiB of gtk-doc HTML
be4fbbe0 149 (arguments
cb4baa4d
TGR
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")
580dfc33
SB
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)~%")))))))))
12c0f32a
JD
172 (inputs
173 `(("babl" ,babl)
174 ("glib" ,glib)
9eecf9bc 175 ("glib-networking" ,glib-networking)
12c0f32a 176 ("libtiff" ,libtiff)
74f99ee4 177 ("libjpeg" ,libjpeg)
12c0f32a 178 ("atk" ,atk)
9eecf9bc 179 ("gexiv2" ,gexiv2)
12c0f32a 180 ("gtk+" ,gtk+-2)
9eecf9bc
LF
181 ("libmypaint" ,libmypaint)
182 ("mypaint-brushes" ,mypaint-brushes)
c695fb76
TGR
183 ("exif" ,libexif) ; optional, EXIF + XMP support
184 ("lcms" ,lcms) ; optional, color management
185 ("librsvg" ,librsvg) ; optional, SVG support
186 ("poppler" ,poppler) ; optional, PDF support
9eecf9bc 187 ("poppler-data" ,poppler-data)
c695fb76
TGR
188 ("python" ,python-2) ; optional, Python support
189 ("python2-pygtk" ,python2-pygtk) ; optional, Python support
12c0f32a
JD
190 ("gegl" ,gegl)))
191 (native-inputs
9eecf9bc
LF
192 `(("glib:bin" ,glib "bin") ; for glib-compile-resources and gdbus-codegen
193 ("pkg-config" ,pkg-config)
12c0f32a 194 ("intltool" ,intltool)))
9eecf9bc 195 (home-page "https://www.gimp.org")
66672a45
LC
196 (synopsis "GNU Image Manipulation Program")
197 (description
198 "GIMP is an application for image manipulation tasks such as photo
199retouching, composition and authoring. It supports all common image formats
200as well as specialized ones. It features a highly customizable interface
201that is extensible via a plugin system.")
12c0f32a 202 (license license:gpl3+))) ; some files are lgplv3
1d6c6af0
RW
203
204(define-public gimp-fourier
205 (package
206 (name "gimp-fourier")
207 (version "0.4.3-2")
208 (source (origin
209 (method url-fetch)
210 (uri (string-append "http://registry.gimp.org/files/fourier-"
211 version ".tar.gz"))
212 (sha256
213 (base32
214 "1rpacyad678lqgxa3hh2n0zpg4azs8dpa8q079bqsl12812k9184"))))
215 (build-system gnu-build-system)
216 (arguments
217 `(#:tests? #f ;no tests
218 #:phases
219 (modify-phases %standard-phases
b2086776
RW
220 ;; FIXME: The gegl package only installs "gegl-0.4.pc", but
221 ;; "gimp-2.0.pc" requires "gegl-0.3.pc", so we just copy it.
222 (replace 'configure
223 (lambda* (#:key inputs #:allow-other-keys)
224 (mkdir-p "tmppkgconfig")
225 (copy-file (string-append (assoc-ref inputs "gegl")
226 "/lib/pkgconfig/gegl-0.4.pc")
227 "tmppkgconfig/gegl-0.3.pc")
228 (setenv "PKG_CONFIG_PATH"
229 (string-append "tmppkgconfig:"
230 (or (getenv "PKG_CONFIG_PATH") "")))
231 #t))
1d6c6af0
RW
232 (add-after 'unpack 'set-prefix
233 (lambda* (#:key outputs #:allow-other-keys)
234 ;; gimptool-2.0 does not allow us to install to any target
235 ;; directory.
236 (let ((target (string-append (assoc-ref outputs "out")
237 "/lib/gimp/"
238 (car (string-split ,(package-version gimp) #\.))
239 ".0/plug-ins")))
240 (substitute* "Makefile"
241 (("\\$\\(PLUGIN_INSTALL\\) fourier")
242 (string-append "cp fourier " target)))
243 (mkdir-p target))
244 #t)))))
245 (inputs
246 `(("fftw" ,fftw)
247 ("gimp" ,gimp)
248 ;; needed by gimp-2.0.pc
249 ("gdk-pixbuf" ,gdk-pixbuf)
b2086776 250 ("gegl" ,gegl)
1d6c6af0
RW
251 ("cairo" ,cairo)
252 ("glib" ,glib)
253 ;; needed by gimpui-2.0.pc
254 ("gtk+" ,gtk+-2)))
255 (native-inputs
256 `(("pkg-config" ,pkg-config)))
257 (home-page "http://registry.gimp.org/node/19596")
258 (synopsis "GIMP plug-in to edit image in fourier space")
259 (description
260 "This package provides a simple plug-in to apply the fourier transform on
261an image, allowing you to work with the transformed image inside GIMP. You
262can draw or apply filters in fourier space and get the modified image with an
263inverse fourier transform.")
264 (license license:gpl3+)))
657687d3
LF
265
266(define-public libmypaint
267 (package
268 (name "libmypaint")
269 (version "1.3.0")
270 (source (origin
271 (method url-fetch)
272 (uri (string-append "https://github.com/mypaint/libmypaint/"
273 "releases/download/v" version "/libmypaint-"
274 version ".tar.xz"))
275 (sha256
276 (base32
277 "0wd6jk69vmhsq1mdw96v0fh7b28n3glkr5ca466zcq7agzaxj1va"))))
278 (build-system gnu-build-system)
279 (native-inputs
280 `(("intltool" ,intltool)
281 ("pkg-config" ,pkg-config)))
282 ;; As needed by 'libmypaint.pc'.
283 (propagated-inputs
284 `(("json-c" ,json-c)
285 ("gobject-introspection" ,gobject-introspection)))
286 (inputs
287 `(("glib" ,glib)))
288 (synopsis "Artistic brushes library")
289 (description "Libmypaint, also called \"brushlib\", is a library for making
290brushstrokes which is used by MyPaint and GIMP.")
291 (home-page "http://mypaint.org")
292 (license license:isc)))
4b5c056a
LF
293
294(define-public mypaint-brushes
295 (package
296 (name "mypaint-brushes")
297 (version "1.3.0")
298 (source (origin
e5bbfc7d
RW
299 (method git-fetch)
300 (uri (git-reference
301 (url "https://github.com/Jehan/mypaint-brushes.git")
302 (commit (string-append "v" version))))
303 (file-name (git-file-name name version))
4b5c056a
LF
304 (sha256
305 (base32
e5bbfc7d 306 "1iz89z6v2mp8j1lrf942k561s8311i3s34ap36wh4rybb2lq15m0"))))
4b5c056a
LF
307 (build-system gnu-build-system)
308 (arguments
5686be39 309 `(#:phases
4b5c056a 310 (modify-phases %standard-phases
5686be39
RW
311 (add-after 'unpack 'relax-dependency-version
312 (lambda _
313 (substitute* "autogen.sh"
314 (("automake-1.13") "automake")
315 (("aclocal-1.13") "aclocal"))
316 #t)))))
4b5c056a
LF
317 (native-inputs
318 `(("autoconf" ,autoconf)
319 ("automake" ,automake)))
320 (synopsis "Default brushes for MyPaint")
321 (description "This package provides the default set of brushes for
322MyPaint.")
323 (home-page "https://github.com/Jehan/mypaint-brushes")
324 (license license:cc0)))
65b8d610
TW
325
326(define-public gimp-resynthesizer
327 ;; GIMP does not respect any plugin search path environment variable, so after
328 ;; installation users have to edit their GIMP settings to include
329 ;; "$HOME/.guix-profile/lib/gimp/2.0/plug-ins/" in
330 ;; “Edit->Preferences->Folders->Plug Ins”.
331 (package
332 (name "gimp-resynthesizer")
333 (version "2.0.3")
334 (source
335 (origin
336 (method url-fetch)
337 (uri (string-append "https://github.com/bootchk/resynthesizer/archive/v"
338 version ".tar.gz"))
339 (sha256
340 (base32
341 "0l3404w6rqny7h3djskxf149gzx6x4qhndgbh3403c9lbh4pi1kr"))
342 (file-name (string-append name "-" version ".tar.gz"))))
343 (build-system gnu-build-system)
344 (arguments
345 `( ;; Turn off tests to avoid:
346 ;; make[1]: *** No rule to make target '../src/resynth-gui.c', needed by 'resynthesizer.pot'. Stop.
347 #:tests? #f
348 #:phases
349 (modify-phases %standard-phases
350 (add-after 'unpack 'set-env
351 (lambda _
352 (setenv "CONFIG_SHELL" (which "sh"))
353 #t))
354 (add-after 'configure 'set-prefix
355 ;; Install plugin under $prefix, not under GIMP's libdir.
356 (lambda* (#:key outputs #:allow-other-keys)
357 (let ((target (string-append (assoc-ref outputs "out")
358 "/lib/gimp/"
359 ,(version-major
360 (package-version gimp))
361 ".0")))
362 (substitute* (list "src/resynthesizer/Makefile"
363 "src/resynthesizer-gui/Makefile")
364 (("GIMP_LIBDIR = .*")
365 (string-append "GIMP_LIBDIR = " target "\n")))
366 (mkdir-p target)
367 #t))))))
368 (native-inputs
369 `(("autoconf" ,autoconf-wrapper)
370 ("automake" ,automake)
371 ("glib" ,glib "bin") ; glib-gettextize
372 ("intltool" ,intltool)
373 ("pkg-config" ,pkg-config)))
374 (inputs
375 `(("gimp" ,gimp)
376 ("gdk-pixbuf" ,gdk-pixbuf) ; needed by gimp-2.0.pc
377 ("cairo" ,cairo)
378 ("gegl" ,gegl)
379 ("gtk+" ,gtk+-2) ; needed by gimpui-2.0.pc
380 ("glib" ,glib)))
381 (home-page "https://github.com/bootchk/resynthesizer")
382 (synopsis "GIMP plugins for texture synthesis")
383 (description
384 "This package provides resynthesizer plugins for GIMP, which encompasses
385tools for healing selections (content-aware fill), enlarging the canvas and
386healing the border, increasing the resolution while adding detail, and
f714bb3d 387transferring the style of an image.")
65b8d610 388 (license license:gpl3+)))