Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / photo.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014, 2015, 2017 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
4 ;;; Copyright © 2015, 2017 Andreas Enge <andreas@enge.fr>
5 ;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
7 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
8 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
15 ;;;
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
20 ;;;
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24 (define-module (gnu packages photo)
25 #:use-module (guix build-system cmake)
26 #:use-module (guix build-system gnu)
27 #:use-module (guix build-system perl)
28 #:use-module (guix download)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix packages)
31 #:use-module (guix utils)
32 #:use-module (gnu packages)
33 #:use-module (gnu packages algebra)
34 #:use-module (gnu packages autotools)
35 #:use-module (gnu packages base)
36 #:use-module (gnu packages boost)
37 #:use-module (gnu packages compression)
38 #:use-module (gnu packages curl)
39 #:use-module (gnu packages databases)
40 #:use-module (gnu packages gettext)
41 #:use-module (gnu packages ghostscript)
42 #:use-module (gnu packages gl)
43 #:use-module (gnu packages gnome)
44 #:use-module (gnu packages glib)
45 #:use-module (gnu packages graphics)
46 #:use-module (gnu packages gtk)
47 #:use-module (gnu packages image)
48 #:use-module (gnu packages imagemagick)
49 #:use-module (gnu packages libusb)
50 #:use-module (gnu packages llvm)
51 #:use-module (gnu packages man)
52 #:use-module (gnu packages maths)
53 #:use-module (gnu packages perl)
54 #:use-module (gnu packages pkg-config)
55 #:use-module (gnu packages popt)
56 #:use-module (gnu packages python)
57 #:use-module (gnu packages readline)
58 #:use-module (gnu packages tex)
59 #:use-module (gnu packages web)
60 #:use-module (gnu packages wxwidgets)
61 #:use-module (gnu packages xfig)
62 #:use-module (gnu packages xorg)
63 #:use-module (gnu packages xml)
64 #:use-module ((srfi srfi-1) #:hide (zip))
65 #:use-module (srfi srfi-26))
66
67 (define-public libraw
68 (package
69 (name "libraw")
70 (version "0.18.6")
71 (source (origin
72 (method url-fetch)
73 (uri (string-append "https://www.libraw.org/data/LibRaw-"
74 version ".tar.gz"))
75 (sha256
76 (base32
77 "0fx5mwkg0rx37qgxnajc8g8i0mhc6822100ljay5g94aap5arf75"))))
78 (build-system gnu-build-system)
79 (home-page "https://www.libraw.org")
80 (synopsis "Raw image decoder")
81 (description
82 "LibRaw is a library for reading RAW files obtained from digital photo
83 cameras (CRW/CR2, NEF, RAF, DNG, and others).")
84 (license license:lgpl2.1+)))
85
86 (define-public libexif
87 (package
88 (name "libexif")
89 (version "0.6.21")
90 (source (origin
91 (method url-fetch)
92 (uri (string-append "mirror://sourceforge/libexif/libexif/"
93 version "/libexif-" version ".tar.bz2"))
94 (patches (search-patches "libexif-CVE-2016-6328.patch"
95 "libexif-CVE-2017-7544.patch"))
96 (sha256
97 (base32
98 "06nlsibr3ylfwp28w8f5466l6drgrnydgxrm4jmxzrmk5svaxk8n"))))
99 (build-system gnu-build-system)
100 (home-page "http://libexif.sourceforge.net/")
101 (synopsis "Read and manipulate EXIF data in digital photographs")
102 (description
103 "The libexif C library allows applications to read, edit, and save EXIF
104 data as produced by digital cameras.")
105 (license license:lgpl2.1+)))
106
107 (define-public libgphoto2
108 (package
109 (name "libgphoto2")
110 (version "2.5.16")
111 (source (origin
112 (method url-fetch)
113 (uri (string-append "mirror://sourceforge/gphoto/libgphoto/"
114 version "/libgphoto2-" version ".tar.bz2"))
115 (sha256
116 (base32
117 "01i95av28d0szyvx6l2gjv039r3205wjwjr91nfimq132rnl2mz7"))))
118 (build-system gnu-build-system)
119 (native-inputs `(("pkg-config" ,pkg-config)))
120 (inputs
121 `(("libjpeg-turbo" ,libjpeg-turbo)
122 ("libltdl" ,libltdl)
123 ("libusb" ,libusb)
124 ("libxml2" ,libxml2)))
125 (propagated-inputs
126 `(;; The .pc refers to libexif.
127 ("libexif" ,libexif)))
128 (home-page "http://www.gphoto.org/proj/libgphoto2/")
129 (synopsis "Accessing digital cameras")
130 (description
131 "This is the library backend for gphoto2. It contains the code for PTP,
132 MTP, and other vendor specific protocols for controlling and transferring data
133 from digital cameras.")
134
135 ;; 'COPYING' says LGPLv2.1+, but in practices files are under LGPLv2+.
136 (license license:lgpl2.1+)))
137
138 (define-public gphoto2
139 (package
140 (name "gphoto2")
141 (version "2.5.15")
142 (source (origin
143 (method url-fetch)
144 (uri (string-append "mirror://sourceforge/gphoto/gphoto/" version
145 "/gphoto2-" version ".tar.bz2"))
146 (sha256
147 (base32
148 "0xsa12k5fz49v8y4h3zahzr427a3ylxaf0k7hybrkp43g4i1lmxf"))))
149 (build-system gnu-build-system)
150 (native-inputs
151 `(("pkg-config" ,pkg-config)))
152 (inputs
153 `(("readline" ,readline)
154 ("libjpeg-turbo" ,libjpeg-turbo)
155 ("popt" ,popt)
156 ("libexif" ,libexif)
157 ("libgphoto2" ,libgphoto2)))
158 (arguments
159 '(#:phases
160 (modify-phases %standard-phases
161 (add-before 'check 'pre-check
162 (lambda* (#:key inputs #:allow-other-keys)
163 (substitute* (find-files "tests/data" "\\.param$")
164 (("/usr/bin/env")
165 (which "env")))
166 #t)))
167
168 ;; FIXME: There is 1 test failure, most likely related to the build
169 ;; environment.
170 #:tests? #f))
171
172 (home-page "http://www.gphoto.org/")
173 (synopsis "Command-line tools to access digital cameras")
174 (description
175 "Gphoto2 is a set of command line utilities for manipulating a large
176 number of different digital cameras. Through libgphoto2, it supports PTP,
177 MTP, and much more.")
178
179 ;; Files are typically under LGPLv2+, but 'COPYING' says GPLv2+.
180 (license license:gpl2+)))
181
182 (define-public perl-image-exiftool
183 (package
184 (name "perl-image-exiftool")
185 (version "10.55")
186 (source (origin
187 (method url-fetch)
188 (uri (string-append
189 "mirror://cpan/authors/id/E/EX/EXIFTOOL/Image-ExifTool-"
190 version ".tar.gz"))
191 (sha256
192 (base32
193 "0z8zwjjfvyllnhsafhddbybywpgqv0pl1dbn1g034cs27yj836q2"))))
194 (build-system perl-build-system)
195 (arguments
196 '(#:phases
197 (modify-phases %standard-phases
198 (add-after 'install 'post-install
199 (lambda* (#:key outputs #:allow-other-keys)
200 ;; Make sure the 'exiftool' commands finds the library.
201 ;; XXX: Shouldn't it be handled by PERL-BUILD-SYSTEM?
202 (let* ((out (assoc-ref outputs "out"))
203 (pm (find-files out "^ExifTool\\.pm$"))
204 (lib (dirname (dirname (car pm)))))
205 (wrap-program (string-append out "/bin/exiftool")
206 `("PERL5LIB" prefix (,lib)))))))))
207 (home-page "http://search.cpan.org/dist/Image-ExifTool")
208 (synopsis "Program and Perl library to manipulate EXIF and other metadata")
209 (description "This package provides the @code{exiftool} command and the
210 @code{Image::ExifTool} Perl library to manipulate EXIF tags of digital images
211 and a wide variety of other metadata.")
212 (license license:perl-license)))
213
214 (define-public libpano13
215 (package
216 (name "libpano13")
217 (version "2.9.19")
218 (source (origin
219 (method url-fetch)
220 (uri (string-append "mirror://sourceforge/panotools/libpano13/"
221 "libpano13-" version "/"
222 "libpano13-" version ".tar.gz"))
223 (sha256
224 (base32
225 "1a4m3plmfcrrplqs9zfzhc5apibn10m5sajpizm1sd3q74w5fwq3"))))
226 (build-system cmake-build-system)
227 (inputs
228 `(("libjpeg" ,libjpeg)
229 ("libpng" ,libpng)
230 ("libtiff" ,libtiff)
231 ("zlib" ,zlib)))
232 (home-page "http://panotools.sourceforge.net/")
233 (synopsis "Library for panoramic images")
234 (description
235 "The libpano13 package contains the backend library written by the
236 Panorama Tools project for building panoramic images from a set of
237 overlapping images, as well as some command line tools.")
238 (license license:gpl2+)))
239
240 (define-public enblend-enfuse
241 (package
242 (name "enblend-enfuse")
243 (version "4.2")
244 (source (origin
245 (method url-fetch)
246 (uri (string-append "mirror://sourceforge/enblend/"
247 name "/"
248 name "-" (version-major+minor version) "/"
249 name "-" version ".tar.gz"))
250 (sha256
251 (base32
252 "0j5x011ilalb47ssah50ag0a4phgh1b0wdgxdbbp1gcyjcjf60w7"))))
253 (build-system gnu-build-system)
254 (native-inputs
255 `(("pkg-config" ,pkg-config)
256 ("perl" ,perl)
257 ("perl-timedate" ,perl-timedate)
258 ;; for building the documentation
259 ("gnuplot" ,gnuplot)
260 ("help2man" ,help2man)
261 ("imagemagick" ,imagemagick)
262 ("libxml2" ,libxml2)
263 ("texlive-minimal" ,texlive-tiny)
264 ("tidy" ,tidy)
265 ("transfig" ,transfig)))
266 (inputs
267 `(("boost" ,boost)
268 ("gsl" ,gsl)
269 ("lcms" ,lcms)
270 ("libjpeg" ,libjpeg)
271 ("libpng" ,libpng)
272 ("libtiff" ,libtiff)
273 ("openexr" ,openexr)
274 ("vigra" ,vigra)
275 ("zlib" ,zlib)))
276 (arguments
277 `(#:configure-flags `("--enable-openmp")))
278 (home-page "http://enblend.sourceforge.net/")
279 (synopsis "Tools for combining and blending images")
280 (description
281 "Enblend blends away the seams in a panoramic image mosaic using a
282 multi-resolution spline. Enfuse merges different exposures of the same
283 scene to produce an image that looks much like a tone-mapped image.")
284 (license license:gpl2+)))
285
286 (define-public lensfun
287 (package
288 (name "lensfun")
289 (version "0.3.2")
290 (source (origin
291 (method url-fetch)
292 (uri (string-append
293 "mirror://sourceforge/lensfun/"
294 version "/lensfun-" version ".tar.gz"))
295 (sha256
296 (base32
297 "0cfk8jjhs9nbfjfdy98plrj9ayi59aph0nx6ppslgjhlcvacm2xf"))))
298 (build-system cmake-build-system)
299 (arguments
300 `(,@(if (any (cute string-prefix? <> (or (%current-system)
301 (%current-target-system)))
302 '("x86_64" "i686"))
303 ;; SSE and SSE2 are supported only on Intel processors.
304 '()
305 '(#:configure-flags '("-DBUILD_FOR_SSE=OFF" "-DBUILD_FOR_SSE2=OFF")))
306 #:tests? #f)) ; There are no tests to run.
307 (native-inputs
308 `(("pkg-config" ,pkg-config)))
309 (inputs
310 `(("glib" ,glib)))
311 (home-page "https://sourceforge.net/projects/lensfun/")
312 (synopsis "Library to correct optical lens defects with a lens database")
313 (description "Digital photographs are not ideal. Of course, the better is
314 your camera, the better the results will be, but in any case if you look
315 carefully at shots taken even by the most expensive cameras equipped with the
316 most expensive lenses you will see various artifacts. It is very hard to make
317 ideal cameras, because there are a lot of factors that affect the final image
318 quality, and at some point camera and lens designers have to trade one factor
319 for another to achieve the optimal image quality, within the given design
320 restrictions and budget. But we all want ideal shots, don't we? So that's
321 what's Lensfun is all about: rectifying the defects introduced by your
322 photographic equipment.")
323 ;; The libraries are licensed under the LGPL3, the programs are
324 ;; licensed GPL3, and the database is license CC-BY-SA 3.0. See the
325 ;; README.md file for this clarification.
326 (license (list license:lgpl3 license:gpl3 license:cc-by-sa3.0))))
327
328 (define-public darktable
329 (package
330 (name "darktable")
331 (version "2.4.0")
332 (source (origin
333 (method url-fetch)
334 (uri (string-append
335 "https://github.com/darktable-org/darktable/releases/"
336 "download/release-"
337 version "/darktable-" version ".tar.xz"))
338 (sha256
339 (base32
340 "0y0q7a7k09sbg05k5xl1lz8n2ak1v8yarfv222ksvmbrxs53hdwx"))))
341 (build-system cmake-build-system)
342 (arguments
343 `(#:tests? #f ; There are no tests.
344 #:configure-flags '("-DBINARY_PACKAGE_BUILD=On")
345 #:make-flags
346 (list
347 (string-append "CPATH=" (assoc-ref %build-inputs "ilmbase")
348 "/include/OpenEXR:" (or (getenv "CPATH") "")))
349 #:phases
350 (modify-phases %standard-phases
351 (add-before 'configure 'set-ldflags
352 (lambda* (#:key outputs #:allow-other-keys)
353 (setenv "LDFLAGS"
354 (string-append
355 "-Wl,-rpath="
356 (assoc-ref outputs "out") "/lib/darktable"))
357 #t)))))
358 (native-inputs
359 `(("llvm" ,llvm-3.9.1)
360 ("clang" ,clang-3.9.1)))
361 (inputs
362 `(("libxslt" ,libxslt)
363 ("libxml2" ,libxml2)
364 ("pugixml" ,pugixml)
365 ("gtk+" ,gtk+)
366 ("sqlite" ,sqlite)
367 ("libjpeg" ,libjpeg)
368 ("libpng" ,libpng)
369 ("cairo" ,cairo)
370 ("lcms" ,lcms)
371 ("exiv2" ,exiv2)
372 ("libtiff" ,libtiff)
373 ("curl" ,curl)
374 ("libgphoto2" ,libgphoto2)
375 ("dbus-glib" ,dbus-glib)
376 ("openexr" ,openexr)
377 ("ilmbase" ,ilmbase)
378 ("libsoup" ,libsoup)
379 ("python-jsonschema" ,python-jsonschema)
380 ("intltool" ,intltool)
381 ("perl" ,perl)
382 ("pkg-config" ,pkg-config)
383 ("libwebp" ,libwebp)
384 ("lensfun" ,lensfun)
385 ("librsvg" ,librsvg)
386 ("json-glib" ,json-glib)
387 ("freeimage" ,freeimage)))
388 (home-page "https://www.darktable.org")
389 (synopsis "Virtual lighttable and darkroom for photographers")
390 (description "Darktable is a photography workflow application and RAW
391 developer. It manages your digital negatives in a database, lets you view
392 them through a zoomable lighttable and enables you to develop raw images
393 and enhance them.")
394 ;; see src/is_supported_platform.h for supported platforms
395 (supported-systems '("i686-linux" "x86_64-linux" "aarch64-linux"))
396 (license license:gpl3+)))
397
398 (define-public hugin
399 (package
400 (name "hugin")
401 (version "2016.2.0")
402 (source (origin
403 (method url-fetch)
404 (uri (string-append "mirror://sourceforge/hugin/hugin/hugin-"
405 (version-major+minor version)
406 "/hugin-" version ".tar.bz2"))
407 (sha256
408 (base32
409 "058zd63vx29yrx2pphbbll7kzcxkai22q26lpw13rn4lvp41pasl"))))
410 (build-system cmake-build-system)
411 (native-inputs
412 `(("gettext" ,gnu-gettext)
413 ("pkg-config" ,pkg-config)))
414 (inputs
415 `(("boost" ,boost)
416 ("enblend-enfuse" ,enblend-enfuse)
417 ("exiv2" ,exiv2)
418 ("fftw" ,fftw)
419 ("flann" ,flann)
420 ("freeglut" ,freeglut)
421 ("glew" ,glew)
422 ("lcms" ,lcms)
423 ("libjpeg" ,libjpeg)
424 ("libpano13" ,libpano13)
425 ("libpng" ,libpng)
426 ("libtiff" ,libtiff)
427 ("libxi" ,libxi)
428 ("libxmu" ,libxmu)
429 ("mesa" ,mesa)
430 ("openexr" ,openexr)
431 ("sqlite" ,sqlite)
432 ("vigra" ,vigra)
433 ("wxwidgets" ,wxwidgets)
434 ("zlib" ,zlib)))
435 (arguments
436 `(#:tests? #f ; no check target
437 #:configure-flags
438 (list
439 ;; The header files of ilmbase (propagated by openexr) are not found
440 ;; when included by the header files of openexr, and an explicit
441 ;; flag needs to be set.
442 (string-append "-DCMAKE_CXX_FLAGS=-I"
443 (assoc-ref %build-inputs "ilmbase")
444 "/include/OpenEXR")
445 ;; Disable installation of the Python scripting interface.
446 ;; It would require the additional inputs python and swig.
447 ;; Installation would need to be tweaked, as it tries to install
448 ;; into the python directory.
449 "-DBUILD_HSI=OFF")
450 #:phases
451 (modify-phases %standard-phases
452 (add-before 'configure 'substitute
453 (lambda _
454 (substitute* "src/hugin1/base_wx/StitchingExecutor.cpp"
455 (("wxT\\(\"enblend\"\\)")
456 (string-append "wxT(\"" (which "enblend") "\")"))
457 (("wxT\\(\"enfuse\"\\)")
458 (string-append "wxT(\"" (which "enfuse") "\")")))
459 #t)))))
460 (home-page "http://hugin.sourceforge.net/")
461 (synopsis "Panorama photo stitcher")
462 (description
463 "Hugin is an easy to use panoramic imaging toolchain with a graphical
464 user interface. It can be used to assemble a mosaic of photographs into
465 a complete panorama and stitch any series of overlapping pictures.")
466 (license license:gpl2+)))
467