gnu: python-html5lib: Add dependency on python-webencodings.
[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>
1d6c6af0 3;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
5f1ba089 4;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
a37b8077
LC
5;;;
6;;; This file is part of GNU Guix.
7;;;
8;;; GNU Guix is free software; you can redistribute it and/or modify it
9;;; under the terms of the GNU General Public License as published by
10;;; the Free Software Foundation; either version 3 of the License, or (at
11;;; your option) any later version.
12;;;
13;;; GNU Guix is distributed in the hope that it will be useful, but
14;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;;; GNU General Public License for more details.
17;;;
18;;; You should have received a copy of the GNU General Public License
19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21(define-module (gnu packages gimp)
22 #:use-module (guix packages)
23 #:use-module (guix download)
1d6c6af0 24 #:use-module (guix utils)
b5b73a82 25 #:use-module ((guix licenses) #:prefix license:)
a37b8077 26 #:use-module (guix build-system gnu)
30347040 27 #:use-module (guix build-system glib-or-gtk)
5f1ba089 28 #:use-module (gnu packages)
1d6c6af0 29 #:use-module (gnu packages algebra)
a37b8077
LC
30 #:use-module (gnu packages pkg-config)
31 #:use-module (gnu packages glib)
32 #:use-module (gnu packages gtk)
33 #:use-module (gnu packages gnome)
e55354b8 34 #:use-module (gnu packages image)
793bcc19 35 #:use-module (gnu packages ghostscript)
a37b8077
LC
36 #:use-module (gnu packages compression)
37 #:use-module (gnu packages xml)
38 #:use-module (gnu packages photo)
9c8bd626 39 #:use-module (gnu packages python)
a37b8077
LC
40 #:use-module (gnu packages xorg)
41 #:use-module (gnu packages imagemagick))
42
43(define-public babl
44 (package
45 (name "babl")
e70dc63a 46 (version "0.1.18")
a37b8077
LC
47 (source (origin
48 (method url-fetch)
e70dc63a
SB
49 (uri (list (string-append "https://download.gimp.org/pub/babl/"
50 "0.1/babl-" version ".tar.bz2")
51 (string-append "http://ftp.gtk.org/pub/babl/0.1/babl-"
a37b8077
LC
52 version ".tar.bz2")
53 (string-append "ftp://ftp.gtk.org/pub/babl/0.1/babl-"
54 version ".tar.bz2")))
55 (sha256
56 (base32
e70dc63a 57 "1ygvnq22pf0zvf3bj7h67vvbpz7b8hhjvrr79ribws7sr5dljfj8"))))
a37b8077
LC
58 (build-system gnu-build-system)
59 (home-page "http://gegl.org/babl/")
60 (synopsis "Image pixel format conversion library")
61 (description
35b9e423 62 "Babl is a dynamic, any to any, pixel format translation library.
a37b8077
LC
63It allows converting between different methods of storing pixels known as
64pixel formats that have with different bitdepths and other data
65representations, color models and component permutations.
66
67A vocabulary to formulate new pixel formats from existing primitives is
68provided as well as the framework to add new color models and data types.")
69 (license license:lgpl3+)))
12c0f32a
JD
70
71(define-public gegl
72 (package
73 (name "gegl")
74 (version "0.2.0")
75 (source (origin
76 (method url-fetch)
a124bbd2 77 (uri (list (string-append "http://download.gimp.org/pub/gegl/"
12c0f32a
JD
78 (string-take version 3)
79 "/" name "-" version ".tar.bz2")))
80 (sha256
81 (base32
5f1ba089
EF
82 "09nlv06li9nrn74ifpm7223mxpg0s7cii702z72cpbwrjh6nlbnz"))
83 (patches (search-patches "gegl-CVE-2012-4433.patch"))))
12c0f32a
JD
84 (build-system gnu-build-system)
85 (arguments
bc9812f1
AE
86 `(;; More than just the one test disabled below now fails; disable them
87 ;; all according to the rationale given below.
88 #:tests? #f
89 #:phases
12c0f32a
JD
90 (alist-cons-before
91 'build 'pre-build
92 (lambda _
93 ;; This test program seems to crash on exit. Specifically, whilst
94 ;; g_object_unreffing bufferA and bufferB - This seems to be a bug
95 ;; in the destructor. This is just a test program so will not have
96 ;; any wider effect, although might be hiding another problem.
97 ;; According to advice received on irc.gimp.org#gegl although 0.2.0
98 ;; is the latest released version, any bug reports against it will
99 ;; be ignored. So we are on our own.
100 (substitute* "tools/img_cmp.c"
101 (("g_object_unref \\(buffer.\\);") ""))
102
103 (substitute* "tests/compositions/Makefile"
104 (("/bin/sh") (which "bash"))))
105 %standard-phases)))
106 (inputs
107 `(("babl" ,babl)
108 ("glib" ,glib)
109 ("cairo" ,cairo)
110 ("pango" ,pango)
111 ("libpng" ,libpng)
112 ("libjpeg" ,libjpeg-8)))
113 (native-inputs
114 `(("pkg-config" ,pkg-config)
9fd571a2 115 ("glib" ,glib "bin") ; for gtester
12c0f32a
JD
116 ("intltool" ,intltool)))
117 (home-page "http://gegl.org")
118 (synopsis "Graph based image processing framework")
119 (description "GEGL (Generic Graphics Library) provides infrastructure to
120do demand based cached non destructive image editing on larger than RAM
121buffers.")
122 ;; The library itself is licensed under LGPL while the sample commandline
123 ;; application and GUI binary gegl is licensed under GPL.
124 (license (list license:lgpl3+ license:gpl3+))))
125
126(define-public gimp
127 (package
128 (name "gimp")
a7f05b41 129 (version "2.8.18")
12c0f32a
JD
130 (source (origin
131 (method url-fetch)
a5dd8db4
EF
132 (uri (string-append "http://download.gimp.org/pub/gimp/v"
133 (version-major+minor version)
134 "/gimp-" version ".tar.bz2"))
12c0f32a
JD
135 (sha256
136 (base32
a7f05b41 137 "0halh6sl3d2j9gahyabj6h6r3yyldcy7sfb4qrfazpkqqr3j5p9r"))))
12c0f32a 138 (build-system gnu-build-system)
be4fbbe0
LC
139 (outputs '("out"
140 "doc")) ;8 MiB of gtk-doc HTML
141 (arguments
142 '(#:configure-flags (list (string-append "--with-html-dir="
143 (assoc-ref %outputs "doc")
580dfc33
SB
144 "/share/gtk-doc/html"))
145 #:phases
146 (modify-phases %standard-phases
147 (add-after 'install 'install-sitecustomize.py
148 ;; Install 'sitecustomize.py' into gimp's python directory to
149 ;; add pygobject and pygtk to pygimp's search path.
150 (lambda* (#:key outputs #:allow-other-keys)
151 (let* ((pythonpath (getenv "PYTHONPATH"))
152 (out (assoc-ref outputs "out"))
153 (sitecustomize.py
154 (string-append
155 out "/lib/gimp/2.0/python/sitecustomize.py")))
156 (call-with-output-file sitecustomize.py
157 (lambda (port)
158 (format port "import site~%")
159 (format port "for dir in '~a'.split(':'):~%" pythonpath)
160 (format port " site.addsitedir(dir)~%")))))))))
12c0f32a
JD
161 (inputs
162 `(("babl" ,babl)
163 ("glib" ,glib)
164 ("libtiff" ,libtiff)
165 ("libjpeg" ,libjpeg-8)
166 ("atk" ,atk)
167 ("gtk+" ,gtk+-2)
4320c094
LC
168 ("exif" ,libexif) ;optional, EXIF + XMP support
169 ("lcms" ,lcms) ;optional, color management
170 ("librsvg" ,librsvg) ;optional, SVG support
9c8bd626
RW
171 ("python" ,python-2) ;optional, Python support
172 ("python2-pygtk" ,python2-pygtk) ;optional, Python support
12c0f32a
JD
173 ("gegl" ,gegl)))
174 (native-inputs
175 `(("pkg-config" ,pkg-config)
176 ("intltool" ,intltool)))
177 (home-page "http://gimp.org")
66672a45
LC
178 (synopsis "GNU Image Manipulation Program")
179 (description
180 "GIMP is an application for image manipulation tasks such as photo
181retouching, composition and authoring. It supports all common image formats
182as well as specialized ones. It features a highly customizable interface
183that is extensible via a plugin system.")
12c0f32a 184 (license license:gpl3+))) ; some files are lgplv3
1d6c6af0
RW
185
186(define-public gimp-fourier
187 (package
188 (name "gimp-fourier")
189 (version "0.4.3-2")
190 (source (origin
191 (method url-fetch)
192 (uri (string-append "http://registry.gimp.org/files/fourier-"
193 version ".tar.gz"))
194 (sha256
195 (base32
196 "1rpacyad678lqgxa3hh2n0zpg4azs8dpa8q079bqsl12812k9184"))))
197 (build-system gnu-build-system)
198 (arguments
199 `(#:tests? #f ;no tests
200 #:phases
201 (modify-phases %standard-phases
202 (delete 'configure)
203 (add-after 'unpack 'set-prefix
204 (lambda* (#:key outputs #:allow-other-keys)
205 ;; gimptool-2.0 does not allow us to install to any target
206 ;; directory.
207 (let ((target (string-append (assoc-ref outputs "out")
208 "/lib/gimp/"
209 (car (string-split ,(package-version gimp) #\.))
210 ".0/plug-ins")))
211 (substitute* "Makefile"
212 (("\\$\\(PLUGIN_INSTALL\\) fourier")
213 (string-append "cp fourier " target)))
214 (mkdir-p target))
215 #t)))))
216 (inputs
217 `(("fftw" ,fftw)
218 ("gimp" ,gimp)
219 ;; needed by gimp-2.0.pc
220 ("gdk-pixbuf" ,gdk-pixbuf)
221 ("cairo" ,cairo)
222 ("glib" ,glib)
223 ;; needed by gimpui-2.0.pc
224 ("gtk+" ,gtk+-2)))
225 (native-inputs
226 `(("pkg-config" ,pkg-config)))
227 (home-page "http://registry.gimp.org/node/19596")
228 (synopsis "GIMP plug-in to edit image in fourier space")
229 (description
230 "This package provides a simple plug-in to apply the fourier transform on
231an image, allowing you to work with the transformed image inside GIMP. You
232can draw or apply filters in fourier space and get the modified image with an
233inverse fourier transform.")
234 (license license:gpl3+)))