gnu: igt-gpu-tools: Don't use NAME in source URI.
[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 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 (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))
48
49 (define-public babl
50 (package
51 (name "babl")
52 (version "0.1.56")
53 (source (origin
54 (method url-fetch)
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")))
64 (sha256
65 (base32
66 "0a2dvihah1j7qi5dp1qzzlwklcqnndmxsm7lc7i78g7c2yknrlla"))))
67 (build-system gnu-build-system)
68 (home-page "http://gegl.org/babl/")
69 (synopsis "Image pixel format conversion library")
70 (description
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.
75
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+)))
79
80 (define-public gegl
81 (package
82 (name "gegl")
83 (version "0.4.8")
84 (source (origin
85 (method url-fetch)
86 (uri (list (string-append "https://download.gimp.org/pub/gegl/"
87 (string-take version 3)
88 "/" name "-" version ".tar.bz2")))
89 (sha256
90 (base32
91 "0jdfhf8wikba4h68k505x0br3gisiwivc33aca8v3ibaqpp6i53i"))))
92 (build-system gnu-build-system)
93 (arguments
94 '(#:configure-flags '("LDFLAGS=-lm")))
95 ;; These are propagated to satisfy 'gegl-0.4.pc'.
96 (propagated-inputs
97 `(("babl" ,babl)
98 ("glib" ,glib)
99 ("json-glib" ,json-glib)))
100 (inputs
101 `(("cairo" ,cairo)
102 ("pango" ,pango)
103 ("libpng" ,libpng)
104 ("libjpeg" ,libjpeg)))
105 (native-inputs
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
113 buffers.")
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+))))
117
118 (define-public gimp
119 (package
120 (name "gimp")
121 (version "2.10.6")
122 (source (origin
123 (method url-fetch)
124 (uri (string-append "https://download.gimp.org/pub/gimp/v"
125 (version-major+minor version)
126 "/gimp-" version ".tar.bz2"))
127 (sha256
128 (base32
129 "07qh2ljbza2mph1gh8sicn27qihhj8hx3ivvry2874cfh8ghgj2f"))))
130 (build-system gnu-build-system)
131 (outputs '("out"
132 "doc")) ; 9 MiB of gtk-doc HTML
133 (arguments
134 '(#:configure-flags
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")
140 #:phases
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"))
148 (sitecustomize.py
149 (string-append
150 out "/lib/gimp/2.0/python/sitecustomize.py")))
151 (call-with-output-file sitecustomize.py
152 (lambda (port)
153 (format port "import site~%")
154 (format port "for dir in '~a'.split(':'):~%" pythonpath)
155 (format port " site.addsitedir(dir)~%")))))))))
156 (inputs
157 `(("babl" ,babl)
158 ("glib" ,glib)
159 ("glib-networking" ,glib-networking)
160 ("libtiff" ,libtiff)
161 ("libjpeg" ,libjpeg)
162 ("atk" ,atk)
163 ("gexiv2" ,gexiv2)
164 ("gtk+" ,gtk+-2)
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
174 ("gegl" ,gegl)))
175 (native-inputs
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")
181 (description
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
187
188 (define-public gimp-fourier
189 (package
190 (name "gimp-fourier")
191 (version "0.4.3-2")
192 (source (origin
193 (method url-fetch)
194 (uri (string-append "http://registry.gimp.org/files/fourier-"
195 version ".tar.gz"))
196 (sha256
197 (base32
198 "1rpacyad678lqgxa3hh2n0zpg4azs8dpa8q079bqsl12812k9184"))))
199 (build-system gnu-build-system)
200 (arguments
201 `(#:tests? #f ;no tests
202 #:phases
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.
206 (replace 'configure
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") "")))
215 #t))
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
219 ;; directory.
220 (let ((target (string-append (assoc-ref outputs "out")
221 "/lib/gimp/"
222 (car (string-split ,(package-version gimp) #\.))
223 ".0/plug-ins")))
224 (substitute* "Makefile"
225 (("\\$\\(PLUGIN_INSTALL\\) fourier")
226 (string-append "cp fourier " target)))
227 (mkdir-p target))
228 #t)))))
229 (inputs
230 `(("fftw" ,fftw)
231 ("gimp" ,gimp)
232 ;; needed by gimp-2.0.pc
233 ("gdk-pixbuf" ,gdk-pixbuf)
234 ("gegl" ,gegl)
235 ("cairo" ,cairo)
236 ("glib" ,glib)
237 ;; needed by gimpui-2.0.pc
238 ("gtk+" ,gtk+-2)))
239 (native-inputs
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")
243 (description
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+)))
249
250 (define-public libmypaint
251 (package
252 (name "libmypaint")
253 (version "1.3.0")
254 (source (origin
255 (method url-fetch)
256 (uri (string-append "https://github.com/mypaint/libmypaint/"
257 "releases/download/v" version "/libmypaint-"
258 version ".tar.xz"))
259 (sha256
260 (base32
261 "0wd6jk69vmhsq1mdw96v0fh7b28n3glkr5ca466zcq7agzaxj1va"))))
262 (build-system gnu-build-system)
263 (native-inputs
264 `(("intltool" ,intltool)
265 ("pkg-config" ,pkg-config)))
266 ;; As needed by 'libmypaint.pc'.
267 (propagated-inputs
268 `(("json-c" ,json-c)
269 ("gobject-introspection" ,gobject-introspection)))
270 (inputs
271 `(("glib" ,glib)))
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)))
277
278 (define-public mypaint-brushes
279 (package
280 (name "mypaint-brushes")
281 (version "1.3.0")
282 (source (origin
283 (method git-fetch)
284 (uri (git-reference
285 (url "https://github.com/Jehan/mypaint-brushes.git")
286 (commit (string-append "v" version))))
287 (file-name (git-file-name name version))
288 (sha256
289 (base32
290 "1iz89z6v2mp8j1lrf942k561s8311i3s34ap36wh4rybb2lq15m0"))))
291 (build-system gnu-build-system)
292 (arguments
293 `(#:phases
294 (modify-phases %standard-phases
295 (add-after 'unpack 'relax-dependency-version
296 (lambda _
297 (substitute* "autogen.sh"
298 (("automake-1.13") "automake")
299 (("aclocal-1.13") "aclocal"))
300 #t)))))
301 (native-inputs
302 `(("autoconf" ,autoconf)
303 ("automake" ,automake)))
304 (synopsis "Default brushes for MyPaint")
305 (description "This package provides the default set of brushes for
306 MyPaint.")
307 (home-page "https://github.com/Jehan/mypaint-brushes")
308 (license license:cc0)))
309
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”.
315 (package
316 (name "gimp-resynthesizer")
317 (version "2.0.3")
318 (source
319 (origin
320 (method url-fetch)
321 (uri (string-append "https://github.com/bootchk/resynthesizer/archive/v"
322 version ".tar.gz"))
323 (sha256
324 (base32
325 "0l3404w6rqny7h3djskxf149gzx6x4qhndgbh3403c9lbh4pi1kr"))
326 (file-name (string-append name "-" version ".tar.gz"))))
327 (build-system gnu-build-system)
328 (arguments
329 `( ;; Turn off tests to avoid:
330 ;; make[1]: *** No rule to make target '../src/resynth-gui.c', needed by 'resynthesizer.pot'. Stop.
331 #:tests? #f
332 #:phases
333 (modify-phases %standard-phases
334 (add-after 'unpack 'set-env
335 (lambda _
336 (setenv "CONFIG_SHELL" (which "sh"))
337 #t))
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")
342 "/lib/gimp/"
343 ,(version-major
344 (package-version gimp))
345 ".0")))
346 (substitute* (list "src/resynthesizer/Makefile"
347 "src/resynthesizer-gui/Makefile")
348 (("GIMP_LIBDIR = .*")
349 (string-append "GIMP_LIBDIR = " target "\n")))
350 (mkdir-p target)
351 #t))))))
352 (native-inputs
353 `(("autoconf" ,autoconf-wrapper)
354 ("automake" ,automake)
355 ("glib" ,glib "bin") ; glib-gettextize
356 ("intltool" ,intltool)
357 ("pkg-config" ,pkg-config)))
358 (inputs
359 `(("gimp" ,gimp)
360 ("gdk-pixbuf" ,gdk-pixbuf) ; needed by gimp-2.0.pc
361 ("cairo" ,cairo)
362 ("gegl" ,gegl)
363 ("gtk+" ,gtk+-2) ; needed by gimpui-2.0.pc
364 ("glib" ,glib)))
365 (home-page "https://github.com/bootchk/resynthesizer")
366 (synopsis "GIMP plugins for texture synthesis")
367 (description
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 transfering the style of an image.")
372 (license license:gpl3+)))