Merge branch 'master' into core-updates
[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 Ricardo Wurmus <rekado@elephly.net>
4 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
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)
24 #:use-module (guix utils)
25 #:use-module ((guix licenses) #:prefix license:)
26 #:use-module (guix build-system gnu)
27 #:use-module (guix build-system glib-or-gtk)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages algebra)
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)
34 #:use-module (gnu packages image)
35 #:use-module (gnu packages ghostscript)
36 #:use-module (gnu packages compression)
37 #:use-module (gnu packages xml)
38 #:use-module (gnu packages photo)
39 #:use-module (gnu packages python)
40 #:use-module (gnu packages xorg)
41 #:use-module (gnu packages imagemagick))
42
43 (define-public babl
44 (package
45 (name "babl")
46 (version "0.1.10")
47 (source (origin
48 (method url-fetch)
49 (uri (list (string-append "http://ftp.gtk.org/pub/babl/0.1/babl-"
50 version ".tar.bz2")
51 (string-append "ftp://ftp.gtk.org/pub/babl/0.1/babl-"
52 version ".tar.bz2")))
53 (sha256
54 (base32
55 "1x2mb7zfbvk9d0a7h5cpdff9hhjsadxvqml2jay2bpf7x9nc6gwl"))))
56 (build-system gnu-build-system)
57 (home-page "http://gegl.org/babl/")
58 (synopsis "Image pixel format conversion library")
59 (description
60 "Babl is a dynamic, any to any, pixel format translation library.
61 It allows converting between different methods of storing pixels known as
62 pixel formats that have with different bitdepths and other data
63 representations, color models and component permutations.
64
65 A vocabulary to formulate new pixel formats from existing primitives is
66 provided as well as the framework to add new color models and data types.")
67 (license license:lgpl3+)))
68
69 (define-public gegl
70 (package
71 (name "gegl")
72 (version "0.2.0")
73 (source (origin
74 (method url-fetch)
75 (uri (list (string-append "http://download.gimp.org/pub/gegl/"
76 (string-take version 3)
77 "/" name "-" version ".tar.bz2")))
78 (sha256
79 (base32
80 "09nlv06li9nrn74ifpm7223mxpg0s7cii702z72cpbwrjh6nlbnz"))
81 (patches (search-patches "gegl-CVE-2012-4433.patch"))))
82 (build-system gnu-build-system)
83 (arguments
84 `(;; More than just the one test disabled below now fails; disable them
85 ;; all according to the rationale given below.
86 #:tests? #f
87 #:phases
88 (alist-cons-before
89 'build 'pre-build
90 (lambda _
91 ;; This test program seems to crash on exit. Specifically, whilst
92 ;; g_object_unreffing bufferA and bufferB - This seems to be a bug
93 ;; in the destructor. This is just a test program so will not have
94 ;; any wider effect, although might be hiding another problem.
95 ;; According to advice received on irc.gimp.org#gegl although 0.2.0
96 ;; is the latest released version, any bug reports against it will
97 ;; be ignored. So we are on our own.
98 (substitute* "tools/img_cmp.c"
99 (("g_object_unref \\(buffer.\\);") ""))
100
101 (substitute* "tests/compositions/Makefile"
102 (("/bin/sh") (which "bash"))))
103 %standard-phases)))
104 (inputs
105 `(("babl" ,babl)
106 ("glib" ,glib)
107 ("cairo" ,cairo)
108 ("pango" ,pango)
109 ("libpng" ,libpng)
110 ("libjpeg" ,libjpeg-8)))
111 (native-inputs
112 `(("pkg-config" ,pkg-config)
113 ("glib" ,glib "bin") ; for gtester
114 ("intltool" ,intltool)))
115 (home-page "http://gegl.org")
116 (synopsis "Graph based image processing framework")
117 (description "GEGL (Generic Graphics Library) provides infrastructure to
118 do demand based cached non destructive image editing on larger than RAM
119 buffers.")
120 ;; The library itself is licensed under LGPL while the sample commandline
121 ;; application and GUI binary gegl is licensed under GPL.
122 (license (list license:lgpl3+ license:gpl3+))))
123
124 (define-public gimp
125 (package
126 (name "gimp")
127 (version "2.8.16")
128 (source (origin
129 (method url-fetch)
130 (uri (string-append "http://download.gimp.org/pub/gimp/v"
131 (version-major+minor version)
132 "/gimp-" version ".tar.bz2"))
133 (patches (search-patches "gimp-CVE-2016-4994.patch"))
134 (sha256
135 (base32
136 "1dsgazia9hmab8cw3iis7s69dvqyfj5wga7ds7w2q5mms1xqbqwm"))))
137 (build-system gnu-build-system)
138 (outputs '("out"
139 "doc")) ;8 MiB of gtk-doc HTML
140 (arguments
141 '(#:configure-flags (list (string-append "--with-html-dir="
142 (assoc-ref %outputs "doc")
143 "/share/gtk-doc/html"))))
144 (inputs
145 `(("babl" ,babl)
146 ("glib" ,glib)
147 ("libtiff" ,libtiff)
148 ("libjpeg" ,libjpeg-8)
149 ("atk" ,atk)
150 ("gtk+" ,gtk+-2)
151 ("exif" ,libexif) ;optional, EXIF + XMP support
152 ("lcms" ,lcms) ;optional, color management
153 ("librsvg" ,librsvg) ;optional, SVG support
154 ("python" ,python-2) ;optional, Python support
155 ("python2-pygtk" ,python2-pygtk) ;optional, Python support
156 ("gegl" ,gegl)))
157 (native-inputs
158 `(("pkg-config" ,pkg-config)
159 ("intltool" ,intltool)))
160 (home-page "http://gimp.org")
161 (synopsis "GNU Image Manipulation Program")
162 (description
163 "GIMP is an application for image manipulation tasks such as photo
164 retouching, composition and authoring. It supports all common image formats
165 as well as specialized ones. It features a highly customizable interface
166 that is extensible via a plugin system.")
167 (license license:gpl3+))) ; some files are lgplv3
168
169 (define-public gimp-fourier
170 (package
171 (name "gimp-fourier")
172 (version "0.4.3-2")
173 (source (origin
174 (method url-fetch)
175 (uri (string-append "http://registry.gimp.org/files/fourier-"
176 version ".tar.gz"))
177 (sha256
178 (base32
179 "1rpacyad678lqgxa3hh2n0zpg4azs8dpa8q079bqsl12812k9184"))))
180 (build-system gnu-build-system)
181 (arguments
182 `(#:tests? #f ;no tests
183 #:phases
184 (modify-phases %standard-phases
185 (delete 'configure)
186 (add-after 'unpack 'set-prefix
187 (lambda* (#:key outputs #:allow-other-keys)
188 ;; gimptool-2.0 does not allow us to install to any target
189 ;; directory.
190 (let ((target (string-append (assoc-ref outputs "out")
191 "/lib/gimp/"
192 (car (string-split ,(package-version gimp) #\.))
193 ".0/plug-ins")))
194 (substitute* "Makefile"
195 (("\\$\\(PLUGIN_INSTALL\\) fourier")
196 (string-append "cp fourier " target)))
197 (mkdir-p target))
198 #t)))))
199 (inputs
200 `(("fftw" ,fftw)
201 ("gimp" ,gimp)
202 ;; needed by gimp-2.0.pc
203 ("gdk-pixbuf" ,gdk-pixbuf)
204 ("cairo" ,cairo)
205 ("glib" ,glib)
206 ;; needed by gimpui-2.0.pc
207 ("gtk+" ,gtk+-2)))
208 (native-inputs
209 `(("pkg-config" ,pkg-config)))
210 (home-page "http://registry.gimp.org/node/19596")
211 (synopsis "GIMP plug-in to edit image in fourier space")
212 (description
213 "This package provides a simple plug-in to apply the fourier transform on
214 an image, allowing you to work with the transformed image inside GIMP. You
215 can draw or apply filters in fourier space and get the modified image with an
216 inverse fourier transform.")
217 (license license:gpl3+)))