gnu: lvm2: Fix static build after 62ec02bf21.
[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 pdf)
39 #:use-module (gnu packages photo)
40 #:use-module (gnu packages python)
41 #:use-module (gnu packages xorg))
42
43 (define-public babl
44 (package
45 (name "babl")
46 (version "0.1.18")
47 (source (origin
48 (method url-fetch)
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-"
52 version ".tar.bz2")
53 (string-append "ftp://ftp.gtk.org/pub/babl/0.1/babl-"
54 version ".tar.bz2")))
55 (sha256
56 (base32
57 "1ygvnq22pf0zvf3bj7h67vvbpz7b8hhjvrr79ribws7sr5dljfj8"))))
58 (build-system gnu-build-system)
59 (home-page "http://gegl.org/babl/")
60 (synopsis "Image pixel format conversion library")
61 (description
62 "Babl is a dynamic, any to any, pixel format translation library.
63 It allows converting between different methods of storing pixels known as
64 pixel formats that have with different bitdepths and other data
65 representations, color models and component permutations.
66
67 A vocabulary to formulate new pixel formats from existing primitives is
68 provided as well as the framework to add new color models and data types.")
69 (license license:lgpl3+)))
70
71 (define-public gegl
72 (package
73 (name "gegl")
74 (version "0.2.0")
75 (source (origin
76 (method url-fetch)
77 (uri (list (string-append "http://download.gimp.org/pub/gegl/"
78 (string-take version 3)
79 "/" name "-" version ".tar.bz2")))
80 (sha256
81 (base32
82 "09nlv06li9nrn74ifpm7223mxpg0s7cii702z72cpbwrjh6nlbnz"))
83 (patches (search-patches "gegl-CVE-2012-4433.patch"))))
84 (build-system gnu-build-system)
85 (arguments
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
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 "sh"))))
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)
115 ("glib" ,glib "bin") ; for gtester
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
120 do demand based cached non destructive image editing on larger than RAM
121 buffers.")
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")
129 (version "2.8.18")
130 (source (origin
131 (method url-fetch)
132 (uri (string-append "http://download.gimp.org/pub/gimp/v"
133 (version-major+minor version)
134 "/gimp-" version ".tar.bz2"))
135 (sha256
136 (base32
137 "0halh6sl3d2j9gahyabj6h6r3yyldcy7sfb4qrfazpkqqr3j5p9r"))))
138 (build-system gnu-build-system)
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")
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)~%")))))))))
161 (inputs
162 `(("babl" ,babl)
163 ("glib" ,glib)
164 ("libtiff" ,libtiff)
165 ("libjpeg" ,libjpeg-8)
166 ("atk" ,atk)
167 ("gtk+" ,gtk+-2)
168 ("exif" ,libexif) ;optional, EXIF + XMP support
169 ("lcms" ,lcms) ;optional, color management
170 ("librsvg" ,librsvg) ;optional, SVG support
171 ("poppler", poppler) ; optional, PDF support
172 ("python" ,python-2) ;optional, Python support
173 ("python2-pygtk" ,python2-pygtk) ;optional, Python support
174 ("gegl" ,gegl)))
175 (native-inputs
176 `(("pkg-config" ,pkg-config)
177 ("intltool" ,intltool)))
178 (home-page "http://gimp.org")
179 (synopsis "GNU Image Manipulation Program")
180 (description
181 "GIMP is an application for image manipulation tasks such as photo
182 retouching, composition and authoring. It supports all common image formats
183 as well as specialized ones. It features a highly customizable interface
184 that is extensible via a plugin system.")
185 (license license:gpl3+))) ; some files are lgplv3
186
187 (define-public gimp-fourier
188 (package
189 (name "gimp-fourier")
190 (version "0.4.3-2")
191 (source (origin
192 (method url-fetch)
193 (uri (string-append "http://registry.gimp.org/files/fourier-"
194 version ".tar.gz"))
195 (sha256
196 (base32
197 "1rpacyad678lqgxa3hh2n0zpg4azs8dpa8q079bqsl12812k9184"))))
198 (build-system gnu-build-system)
199 (arguments
200 `(#:tests? #f ;no tests
201 #:phases
202 (modify-phases %standard-phases
203 (delete 'configure)
204 (add-after 'unpack 'set-prefix
205 (lambda* (#:key outputs #:allow-other-keys)
206 ;; gimptool-2.0 does not allow us to install to any target
207 ;; directory.
208 (let ((target (string-append (assoc-ref outputs "out")
209 "/lib/gimp/"
210 (car (string-split ,(package-version gimp) #\.))
211 ".0/plug-ins")))
212 (substitute* "Makefile"
213 (("\\$\\(PLUGIN_INSTALL\\) fourier")
214 (string-append "cp fourier " target)))
215 (mkdir-p target))
216 #t)))))
217 (inputs
218 `(("fftw" ,fftw)
219 ("gimp" ,gimp)
220 ;; needed by gimp-2.0.pc
221 ("gdk-pixbuf" ,gdk-pixbuf)
222 ("cairo" ,cairo)
223 ("glib" ,glib)
224 ;; needed by gimpui-2.0.pc
225 ("gtk+" ,gtk+-2)))
226 (native-inputs
227 `(("pkg-config" ,pkg-config)))
228 (home-page "http://registry.gimp.org/node/19596")
229 (synopsis "GIMP plug-in to edit image in fourier space")
230 (description
231 "This package provides a simple plug-in to apply the fourier transform on
232 an image, allowing you to work with the transformed image inside GIMP. You
233 can draw or apply filters in fourier space and get the modified image with an
234 inverse fourier transform.")
235 (license license:gpl3+)))