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