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